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