17.29/5.19 WORST_CASE(Omega(n^1), O(n^1)) 17.41/5.20 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 17.41/5.20 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 17.41/5.20 17.41/5.20 17.41/5.20 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 17.41/5.20 17.41/5.20 (0) CpxTRS 17.41/5.20 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 17.41/5.20 (2) CpxWeightedTrs 17.41/5.20 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 17.41/5.20 (4) CpxTypedWeightedTrs 17.41/5.20 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 17.41/5.20 (6) CpxTypedWeightedCompleteTrs 17.41/5.20 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 17.41/5.20 (8) CpxRNTS 17.41/5.20 (9) CompleteCoflocoProof [FINISHED, 43 ms] 17.41/5.20 (10) BOUNDS(1, n^1) 17.41/5.20 (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 17.41/5.20 (12) TRS for Loop Detection 17.41/5.20 (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 17.41/5.20 (14) BEST 17.41/5.20 (15) proven lower bound 17.41/5.20 (16) LowerBoundPropagationProof [FINISHED, 0 ms] 17.41/5.20 (17) BOUNDS(n^1, INF) 17.41/5.20 (18) TRS for Loop Detection 17.41/5.20 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (0) 17.41/5.20 Obligation: 17.41/5.20 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 17.41/5.20 17.41/5.20 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) 17.41/5.20 cond(true, y) -> y 17.41/5.20 17.41/5.20 S is empty. 17.41/5.20 Rewrite Strategy: INNERMOST 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 17.41/5.20 Transformed relative TRS to weighted TRS 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (2) 17.41/5.20 Obligation: 17.41/5.20 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). 17.41/5.20 17.41/5.20 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil [1] 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) [1] 17.41/5.20 cond(true, y) -> y [1] 17.41/5.20 17.41/5.20 Rewrite Strategy: INNERMOST 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 17.41/5.20 Infered types. 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (4) 17.41/5.20 Obligation: 17.41/5.20 Runtime Complexity Weighted TRS with Types. 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil [1] 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) [1] 17.41/5.20 cond(true, y) -> y [1] 17.41/5.20 17.41/5.20 The TRS has the following type information: 17.41/5.20 admit :: carry -> nil:. -> nil:. 17.41/5.20 nil :: nil:. 17.41/5.20 . :: w -> nil:. -> nil:. 17.41/5.20 w :: w 17.41/5.20 cond :: =:true -> nil:. -> nil:. 17.41/5.20 = :: sum -> w -> =:true 17.41/5.20 sum :: carry -> w -> w -> sum 17.41/5.20 carry :: carry -> w -> w -> carry 17.41/5.20 true :: =:true 17.41/5.20 17.41/5.20 Rewrite Strategy: INNERMOST 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (5) CompletionProof (UPPER BOUND(ID)) 17.41/5.20 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 17.41/5.20 17.41/5.20 admit(v0, v1) -> null_admit [0] 17.41/5.20 cond(v0, v1) -> null_cond [0] 17.41/5.20 17.41/5.20 And the following fresh constants: null_admit, null_cond, const, const1 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (6) 17.41/5.20 Obligation: 17.41/5.20 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 17.41/5.20 17.41/5.20 Runtime Complexity Weighted TRS with Types. 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil [1] 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) [1] 17.41/5.20 cond(true, y) -> y [1] 17.41/5.20 admit(v0, v1) -> null_admit [0] 17.41/5.20 cond(v0, v1) -> null_cond [0] 17.41/5.20 17.41/5.20 The TRS has the following type information: 17.41/5.20 admit :: carry -> nil:.:null_admit:null_cond -> nil:.:null_admit:null_cond 17.41/5.20 nil :: nil:.:null_admit:null_cond 17.41/5.20 . :: w -> nil:.:null_admit:null_cond -> nil:.:null_admit:null_cond 17.41/5.20 w :: w 17.41/5.20 cond :: =:true -> nil:.:null_admit:null_cond -> nil:.:null_admit:null_cond 17.41/5.20 = :: sum -> w -> =:true 17.41/5.20 sum :: carry -> w -> w -> sum 17.41/5.20 carry :: carry -> w -> w -> carry 17.41/5.20 true :: =:true 17.41/5.20 null_admit :: nil:.:null_admit:null_cond 17.41/5.20 null_cond :: nil:.:null_admit:null_cond 17.41/5.20 const :: carry 17.41/5.20 const1 :: sum 17.41/5.20 17.41/5.20 Rewrite Strategy: INNERMOST 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 17.41/5.20 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 17.41/5.20 The constant constructors are abstracted as follows: 17.41/5.20 17.41/5.20 nil => 0 17.41/5.20 w => 0 17.41/5.20 true => 0 17.41/5.20 null_admit => 0 17.41/5.20 null_cond => 0 17.41/5.20 const => 0 17.41/5.20 const1 => 0 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (8) 17.41/5.20 Obligation: 17.41/5.20 Complexity RNTS consisting of the following rules: 17.41/5.20 17.41/5.20 admit(z', z'') -{ 1 }-> cond(1 + (1 + x + u + v) + 0, 1 + u + (1 + v + (1 + 0 + admit(1 + x + u + v, z)))) :|: v >= 0, z >= 0, z' = x, x >= 0, z'' = 1 + u + (1 + v + (1 + 0 + z)), u >= 0 17.41/5.20 admit(z', z'') -{ 1 }-> 0 :|: z'' = 0, z' = x, x >= 0 17.41/5.20 admit(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 17.41/5.20 cond(z', z'') -{ 1 }-> y :|: z'' = y, y >= 0, z' = 0 17.41/5.20 cond(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 17.41/5.20 17.41/5.20 Only complete derivations are relevant for the runtime complexity. 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (9) CompleteCoflocoProof (FINISHED) 17.41/5.20 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 17.41/5.20 17.41/5.20 eq(start(V, V1),0,[admit(V, V1, Out)],[V >= 0,V1 >= 0]). 17.41/5.20 eq(start(V, V1),0,[cond(V, V1, Out)],[V >= 0,V1 >= 0]). 17.41/5.20 eq(admit(V, V1, Out),1,[],[Out = 0,V1 = 0,V = V2,V2 >= 0]). 17.41/5.20 eq(admit(V, V1, Out),1,[admit(1 + V5 + V3 + V4, V6, Ret1111),cond(1 + (1 + V5 + V3 + V4) + 0, 1 + V3 + (1 + V4 + (1 + 0 + Ret1111)), Ret)],[Out = Ret,V4 >= 0,V6 >= 0,V = V5,V5 >= 0,V1 = 3 + V3 + V4 + V6,V3 >= 0]). 17.41/5.20 eq(cond(V, V1, Out),1,[],[Out = V7,V1 = V7,V7 >= 0,V = 0]). 17.41/5.20 eq(admit(V, V1, Out),0,[],[Out = 0,V9 >= 0,V8 >= 0,V1 = V8,V = V9]). 17.41/5.20 eq(cond(V, V1, Out),0,[],[Out = 0,V11 >= 0,V10 >= 0,V1 = V10,V = V11]). 17.41/5.20 input_output_vars(admit(V,V1,Out),[V,V1],[Out]). 17.41/5.20 input_output_vars(cond(V,V1,Out),[V,V1],[Out]). 17.41/5.20 17.41/5.20 17.41/5.20 CoFloCo proof output: 17.41/5.20 Preprocessing Cost Relations 17.41/5.20 ===================================== 17.41/5.20 17.41/5.20 #### Computed strongly connected components 17.41/5.20 0. non_recursive : [cond/3] 17.41/5.20 1. recursive [non_tail] : [admit/3] 17.41/5.20 2. non_recursive : [start/2] 17.41/5.20 17.41/5.20 #### Obtained direct recursion through partial evaluation 17.41/5.20 0. SCC is partially evaluated into cond/3 17.41/5.20 1. SCC is partially evaluated into admit/3 17.41/5.20 2. SCC is partially evaluated into start/2 17.41/5.20 17.41/5.20 Control-Flow Refinement of Cost Relations 17.41/5.20 ===================================== 17.41/5.20 17.41/5.20 ### Specialization of cost equations cond/3 17.41/5.20 * CE 7 is refined into CE [8] 17.41/5.20 * CE 6 is refined into CE [9] 17.41/5.20 17.41/5.20 17.41/5.20 ### Cost equations --> "Loop" of cond/3 17.41/5.20 * CEs [8] --> Loop 6 17.41/5.20 * CEs [9] --> Loop 7 17.41/5.20 17.41/5.20 ### Ranking functions of CR cond(V,V1,Out) 17.41/5.20 17.41/5.20 #### Partial ranking functions of CR cond(V,V1,Out) 17.41/5.20 17.41/5.20 17.41/5.20 ### Specialization of cost equations admit/3 17.41/5.20 * CE 3 is refined into CE [10] 17.41/5.20 * CE 5 is refined into CE [11] 17.41/5.20 * CE 4 is refined into CE [12] 17.41/5.20 17.41/5.20 17.41/5.20 ### Cost equations --> "Loop" of admit/3 17.41/5.20 * CEs [12] --> Loop 8 17.41/5.20 * CEs [10,11] --> Loop 9 17.41/5.20 17.41/5.20 ### Ranking functions of CR admit(V,V1,Out) 17.41/5.20 * RF of phase [8]: [V/2+V1/2-1,V1/3-2/3] 17.41/5.20 17.41/5.20 #### Partial ranking functions of CR admit(V,V1,Out) 17.41/5.20 * Partial RF of phase [8]: 17.41/5.20 - RF of loop [8:1]: 17.41/5.20 V/2+V1/2-1 17.41/5.20 V1/3-2/3 17.41/5.20 17.41/5.20 17.41/5.20 ### Specialization of cost equations start/2 17.41/5.20 * CE 1 is refined into CE [13] 17.41/5.20 * CE 2 is refined into CE [14,15] 17.41/5.20 17.41/5.20 17.41/5.20 ### Cost equations --> "Loop" of start/2 17.41/5.20 * CEs [13,14,15] --> Loop 10 17.41/5.20 17.41/5.20 ### Ranking functions of CR start(V,V1) 17.41/5.20 17.41/5.20 #### Partial ranking functions of CR start(V,V1) 17.41/5.20 17.41/5.20 17.41/5.20 Computing Bounds 17.41/5.20 ===================================== 17.41/5.20 17.41/5.20 #### Cost of chains of cond(V,V1,Out): 17.41/5.20 * Chain [7]: 1 17.41/5.20 with precondition: [V=0,V1=Out,V1>=0] 17.41/5.20 17.41/5.20 * Chain [6]: 0 17.41/5.20 with precondition: [Out=0,V>=0,V1>=0] 17.41/5.20 17.41/5.20 17.41/5.20 #### Cost of chains of admit(V,V1,Out): 17.41/5.20 * Chain [[8],9]: 1*it(8)+1 17.41/5.20 Such that:it(8) =< V1/3 17.41/5.20 17.41/5.20 with precondition: [Out=0,V>=0,V1>=3] 17.41/5.20 17.41/5.20 * Chain [9]: 1 17.41/5.20 with precondition: [Out=0,V>=0,V1>=0] 17.41/5.20 17.41/5.20 17.41/5.20 #### Cost of chains of start(V,V1): 17.41/5.20 * Chain [10]: 1*s(2)+1 17.41/5.20 Such that:s(2) =< V1/3 17.41/5.20 17.41/5.20 with precondition: [V>=0,V1>=0] 17.41/5.20 17.41/5.20 17.41/5.20 Closed-form bounds of start(V,V1): 17.41/5.20 ------------------------------------- 17.41/5.20 * Chain [10] with precondition: [V>=0,V1>=0] 17.41/5.20 - Upper bound: V1/3+1 17.41/5.20 - Complexity: n 17.41/5.20 17.41/5.20 ### Maximum cost of start(V,V1): V1/3+1 17.41/5.20 Asymptotic class: n 17.41/5.20 * Total analysis performed in 65 ms. 17.41/5.20 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (10) 17.41/5.20 BOUNDS(1, n^1) 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 17.41/5.20 Transformed a relative TRS into a decreasing-loop problem. 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (12) 17.41/5.20 Obligation: 17.41/5.20 Analyzing the following TRS for decreasing loops: 17.41/5.20 17.41/5.20 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 17.41/5.20 17.41/5.20 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) 17.41/5.20 cond(true, y) -> y 17.41/5.20 17.41/5.20 S is empty. 17.41/5.20 Rewrite Strategy: INNERMOST 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (13) DecreasingLoopProof (LOWER BOUND(ID)) 17.41/5.20 The following loop(s) give(s) rise to the lower bound Omega(n^1): 17.41/5.20 17.41/5.20 The rewrite sequence 17.41/5.20 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) ->^+ cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) 17.41/5.20 17.41/5.20 gives rise to a decreasing loop by considering the right hand sides subterm at position [1,1,1,1]. 17.41/5.20 17.41/5.20 The pumping substitution is [z / .(u, .(v, .(w, z)))]. 17.41/5.20 17.41/5.20 The result substitution is [x / carry(x, u, v)]. 17.41/5.20 17.41/5.20 17.41/5.20 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (14) 17.41/5.20 Complex Obligation (BEST) 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (15) 17.41/5.20 Obligation: 17.41/5.20 Proved the lower bound n^1 for the following obligation: 17.41/5.20 17.41/5.20 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 17.41/5.20 17.41/5.20 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) 17.41/5.20 cond(true, y) -> y 17.41/5.20 17.41/5.20 S is empty. 17.41/5.20 Rewrite Strategy: INNERMOST 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (16) LowerBoundPropagationProof (FINISHED) 17.41/5.20 Propagated lower bound. 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (17) 17.41/5.20 BOUNDS(n^1, INF) 17.41/5.20 17.41/5.20 ---------------------------------------- 17.41/5.20 17.41/5.20 (18) 17.41/5.20 Obligation: 17.41/5.20 Analyzing the following TRS for decreasing loops: 17.41/5.20 17.41/5.20 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 17.41/5.20 17.41/5.20 17.41/5.20 The TRS R consists of the following rules: 17.41/5.20 17.41/5.20 admit(x, nil) -> nil 17.41/5.20 admit(x, .(u, .(v, .(w, z)))) -> cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) 17.41/5.20 cond(true, y) -> y 17.41/5.20 17.41/5.20 S is empty. 17.41/5.20 Rewrite Strategy: INNERMOST 17.47/5.25 EOF