911.90/291.59 WORST_CASE(Omega(n^1), O(n^2)) 911.90/291.61 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 911.90/291.61 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 911.90/291.61 911.90/291.61 911.90/291.61 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 911.90/291.61 911.90/291.61 (0) CpxTRS 911.90/291.61 (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] 911.90/291.61 (2) CpxTRS 911.90/291.61 (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 911.90/291.61 (4) CpxWeightedTrs 911.90/291.61 (5) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 911.90/291.61 (6) CpxTypedWeightedTrs 911.90/291.61 (7) CompletionProof [UPPER BOUND(ID), 0 ms] 911.90/291.61 (8) CpxTypedWeightedCompleteTrs 911.90/291.61 (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 911.90/291.61 (10) CpxRNTS 911.90/291.61 (11) CompleteCoflocoProof [FINISHED, 282 ms] 911.90/291.61 (12) BOUNDS(1, n^2) 911.90/291.61 (13) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] 911.90/291.61 (14) CpxTRS 911.90/291.61 (15) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 911.90/291.61 (16) typed CpxTrs 911.90/291.61 (17) OrderProof [LOWER BOUND(ID), 0 ms] 911.90/291.61 (18) typed CpxTrs 911.90/291.61 (19) RewriteLemmaProof [LOWER BOUND(ID), 333 ms] 911.90/291.61 (20) BEST 911.90/291.61 (21) proven lower bound 911.90/291.61 (22) LowerBoundPropagationProof [FINISHED, 0 ms] 911.90/291.61 (23) BOUNDS(n^1, INF) 911.90/291.61 (24) typed CpxTrs 911.90/291.61 (25) RewriteLemmaProof [LOWER BOUND(ID), 65 ms] 911.90/291.61 (26) BOUNDS(1, INF) 911.90/291.61 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (0) 911.90/291.61 Obligation: 911.90/291.61 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 911.90/291.61 911.90/291.61 911.90/291.61 The TRS R consists of the following rules: 911.90/291.61 911.90/291.61 sub(0, 0) -> 0 911.90/291.61 sub(s(x), 0) -> s(x) 911.90/291.61 sub(0, s(x)) -> 0 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0, nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0, nil) -> nil 911.90/291.61 zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 S is empty. 911.90/291.61 Rewrite Strategy: FULL 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) 911.90/291.61 Converted rc-obligation to irc-obligation. 911.90/291.61 911.90/291.61 The duplicating contexts are: 911.90/291.61 zero(cons([], xs)) 911.90/291.61 zero2(0, cons([], xs)) 911.90/291.61 911.90/291.61 911.90/291.61 The defined contexts are: 911.90/291.61 zero2([], cons(x1, x2)) 911.90/291.61 911.90/291.61 911.90/291.61 [] just represents basic- or constructor-terms in the following defined contexts: 911.90/291.61 zero2([], cons(x1, x2)) 911.90/291.61 911.90/291.61 911.90/291.61 As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (2) 911.90/291.61 Obligation: 911.90/291.61 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2). 911.90/291.61 911.90/291.61 911.90/291.61 The TRS R consists of the following rules: 911.90/291.61 911.90/291.61 sub(0, 0) -> 0 911.90/291.61 sub(s(x), 0) -> s(x) 911.90/291.61 sub(0, s(x)) -> 0 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0, nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0, nil) -> nil 911.90/291.61 zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 S is empty. 911.90/291.61 Rewrite Strategy: INNERMOST 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 911.90/291.61 Transformed relative TRS to weighted TRS 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (4) 911.90/291.61 Obligation: 911.90/291.61 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). 911.90/291.61 911.90/291.61 911.90/291.61 The TRS R consists of the following rules: 911.90/291.61 911.90/291.61 sub(0, 0) -> 0 [1] 911.90/291.61 sub(s(x), 0) -> s(x) [1] 911.90/291.61 sub(0, s(x)) -> 0 [1] 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) [1] 911.90/291.61 zero(nil) -> zero2(0, nil) [1] 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) [1] 911.90/291.61 zero2(0, nil) -> nil [1] 911.90/291.61 zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) [1] 911.90/291.61 zero2(s(y), nil) -> zero(nil) [1] 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) [1] 911.90/291.61 911.90/291.61 Rewrite Strategy: INNERMOST 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (5) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 911.90/291.61 Infered types. 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (6) 911.90/291.61 Obligation: 911.90/291.61 Runtime Complexity Weighted TRS with Types. 911.90/291.61 The TRS R consists of the following rules: 911.90/291.61 911.90/291.61 sub(0, 0) -> 0 [1] 911.90/291.61 sub(s(x), 0) -> s(x) [1] 911.90/291.61 sub(0, s(x)) -> 0 [1] 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) [1] 911.90/291.61 zero(nil) -> zero2(0, nil) [1] 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) [1] 911.90/291.61 zero2(0, nil) -> nil [1] 911.90/291.61 zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) [1] 911.90/291.61 zero2(s(y), nil) -> zero(nil) [1] 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) [1] 911.90/291.61 911.90/291.61 The TRS has the following type information: 911.90/291.61 sub :: 0:s -> 0:s -> 0:s 911.90/291.61 0 :: 0:s 911.90/291.61 s :: 0:s -> 0:s 911.90/291.61 zero :: nil:cons -> nil:cons 911.90/291.61 nil :: nil:cons 911.90/291.61 zero2 :: 0:s -> nil:cons -> nil:cons 911.90/291.61 cons :: 0:s -> nil:cons -> nil:cons 911.90/291.61 911.90/291.61 Rewrite Strategy: INNERMOST 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (7) CompletionProof (UPPER BOUND(ID)) 911.90/291.61 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 911.90/291.61 none 911.90/291.61 911.90/291.61 And the following fresh constants: none 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (8) 911.90/291.61 Obligation: 911.90/291.61 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 911.90/291.61 911.90/291.61 Runtime Complexity Weighted TRS with Types. 911.90/291.61 The TRS R consists of the following rules: 911.90/291.61 911.90/291.61 sub(0, 0) -> 0 [1] 911.90/291.61 sub(s(x), 0) -> s(x) [1] 911.90/291.61 sub(0, s(x)) -> 0 [1] 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) [1] 911.90/291.61 zero(nil) -> zero2(0, nil) [1] 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) [1] 911.90/291.61 zero2(0, nil) -> nil [1] 911.90/291.61 zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) [1] 911.90/291.61 zero2(s(y), nil) -> zero(nil) [1] 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) [1] 911.90/291.61 911.90/291.61 The TRS has the following type information: 911.90/291.61 sub :: 0:s -> 0:s -> 0:s 911.90/291.61 0 :: 0:s 911.90/291.61 s :: 0:s -> 0:s 911.90/291.61 zero :: nil:cons -> nil:cons 911.90/291.61 nil :: nil:cons 911.90/291.61 zero2 :: 0:s -> nil:cons -> nil:cons 911.90/291.61 cons :: 0:s -> nil:cons -> nil:cons 911.90/291.61 911.90/291.61 Rewrite Strategy: INNERMOST 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 911.90/291.61 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 911.90/291.61 The constant constructors are abstracted as follows: 911.90/291.61 911.90/291.61 0 => 0 911.90/291.61 nil => 0 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (10) 911.90/291.61 Obligation: 911.90/291.61 Complexity RNTS consisting of the following rules: 911.90/291.61 911.90/291.61 sub(z, z') -{ 1 }-> sub(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x 911.90/291.61 sub(z, z') -{ 1 }-> 0 :|: z = 0, z' = 0 911.90/291.61 sub(z, z') -{ 1 }-> 0 :|: z' = 1 + x, x >= 0, z = 0 911.90/291.61 sub(z, z') -{ 1 }-> 1 + x :|: x >= 0, z = 1 + x, z' = 0 911.90/291.61 zero(z) -{ 1 }-> zero2(sub(x, x), 1 + x + xs) :|: z = 1 + x + xs, xs >= 0, x >= 0 911.90/291.61 zero(z) -{ 1 }-> zero2(0, 0) :|: z = 0 911.90/291.61 zero2(z, z') -{ 1 }-> zero(0) :|: y >= 0, z = 1 + y, z' = 0 911.90/291.61 zero2(z, z') -{ 1 }-> zero(1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, y >= 0, x >= 0, z = 1 + y 911.90/291.61 zero2(z, z') -{ 1 }-> 0 :|: z = 0, z' = 0 911.90/291.61 zero2(z, z') -{ 1 }-> 1 + sub(x, x) + zero(xs) :|: xs >= 0, z' = 1 + x + xs, x >= 0, z = 0 911.90/291.61 911.90/291.61 Only complete derivations are relevant for the runtime complexity. 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (11) CompleteCoflocoProof (FINISHED) 911.90/291.61 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 911.90/291.61 911.90/291.61 eq(start(V1, V),0,[sub(V1, V, Out)],[V1 >= 0,V >= 0]). 911.90/291.61 eq(start(V1, V),0,[zero(V1, Out)],[V1 >= 0]). 911.90/291.61 eq(start(V1, V),0,[zero2(V1, V, Out)],[V1 >= 0,V >= 0]). 911.90/291.61 eq(sub(V1, V, Out),1,[],[Out = 0,V1 = 0,V = 0]). 911.90/291.61 eq(sub(V1, V, Out),1,[],[Out = 1 + V2,V2 >= 0,V1 = 1 + V2,V = 0]). 911.90/291.61 eq(sub(V1, V, Out),1,[],[Out = 0,V = 1 + V3,V3 >= 0,V1 = 0]). 911.90/291.61 eq(sub(V1, V, Out),1,[sub(V4, V5, Ret)],[Out = Ret,V = 1 + V5,V4 >= 0,V5 >= 0,V1 = 1 + V4]). 911.90/291.61 eq(zero(V1, Out),1,[zero2(0, 0, Ret1)],[Out = Ret1,V1 = 0]). 911.90/291.61 eq(zero(V1, Out),1,[sub(V6, V6, Ret0),zero2(Ret0, 1 + V6 + V7, Ret2)],[Out = Ret2,V1 = 1 + V6 + V7,V7 >= 0,V6 >= 0]). 911.90/291.61 eq(zero2(V1, V, Out),1,[],[Out = 0,V1 = 0,V = 0]). 911.90/291.61 eq(zero2(V1, V, Out),1,[sub(V8, V8, Ret01),zero(V9, Ret11)],[Out = 1 + Ret01 + Ret11,V9 >= 0,V = 1 + V8 + V9,V8 >= 0,V1 = 0]). 911.90/291.61 eq(zero2(V1, V, Out),1,[zero(0, Ret3)],[Out = Ret3,V10 >= 0,V1 = 1 + V10,V = 0]). 911.90/291.61 eq(zero2(V1, V, Out),1,[zero(1 + V12 + V13, Ret4)],[Out = Ret4,V13 >= 0,V = 1 + V12 + V13,V11 >= 0,V12 >= 0,V1 = 1 + V11]). 911.90/291.61 input_output_vars(sub(V1,V,Out),[V1,V],[Out]). 911.90/291.61 input_output_vars(zero(V1,Out),[V1],[Out]). 911.90/291.61 input_output_vars(zero2(V1,V,Out),[V1,V],[Out]). 911.90/291.61 911.90/291.61 911.90/291.61 CoFloCo proof output: 911.90/291.61 Preprocessing Cost Relations 911.90/291.61 ===================================== 911.90/291.61 911.90/291.61 #### Computed strongly connected components 911.90/291.61 0. recursive : [sub/3] 911.90/291.61 1. recursive : [zero/2,zero2/3] 911.90/291.61 2. non_recursive : [start/2] 911.90/291.61 911.90/291.61 #### Obtained direct recursion through partial evaluation 911.90/291.61 0. SCC is partially evaluated into sub/3 911.90/291.61 1. SCC is partially evaluated into zero/2 911.90/291.61 2. SCC is partially evaluated into start/2 911.90/291.61 911.90/291.61 Control-Flow Refinement of Cost Relations 911.90/291.61 ===================================== 911.90/291.61 911.90/291.61 ### Specialization of cost equations sub/3 911.90/291.61 * CE 13 is refined into CE [14] 911.90/291.61 * CE 11 is refined into CE [15] 911.90/291.61 * CE 12 is refined into CE [16] 911.90/291.61 * CE 10 is refined into CE [17] 911.90/291.61 911.90/291.61 911.90/291.61 ### Cost equations --> "Loop" of sub/3 911.90/291.61 * CEs [15] --> Loop 11 911.90/291.61 * CEs [16] --> Loop 12 911.90/291.61 * CEs [17] --> Loop 13 911.90/291.61 * CEs [14] --> Loop 14 911.90/291.61 911.90/291.61 ### Ranking functions of CR sub(V1,V,Out) 911.90/291.61 * RF of phase [14]: [V,V1] 911.90/291.61 911.90/291.61 #### Partial ranking functions of CR sub(V1,V,Out) 911.90/291.61 * Partial RF of phase [14]: 911.90/291.61 - RF of loop [14:1]: 911.90/291.61 V 911.90/291.61 V1 911.90/291.61 911.90/291.61 911.90/291.61 ### Specialization of cost equations zero/2 911.90/291.61 * CE 9 is refined into CE [18] 911.90/291.61 * CE 8 is refined into CE [19,20,21,22] 911.90/291.61 * CE 7 is discarded (unfeasible) 911.90/291.61 911.90/291.61 911.90/291.61 ### Cost equations --> "Loop" of zero/2 911.90/291.61 * CEs [20,22] --> Loop 15 911.90/291.61 * CEs [19,21] --> Loop 16 911.90/291.61 * CEs [18] --> Loop 17 911.90/291.61 911.90/291.61 ### Ranking functions of CR zero(V1,Out) 911.90/291.61 * RF of phase [15,16]: [V1] 911.90/291.61 911.90/291.61 #### Partial ranking functions of CR zero(V1,Out) 911.90/291.61 * Partial RF of phase [15,16]: 911.90/291.61 - RF of loop [15:1]: 911.90/291.61 V1-1 911.90/291.61 - RF of loop [16:1]: 911.90/291.61 V1 911.90/291.61 911.90/291.61 911.90/291.61 ### Specialization of cost equations start/2 911.90/291.61 * CE 2 is refined into CE [23] 911.90/291.61 * CE 3 is refined into CE [24,25,26,27] 911.90/291.61 * CE 1 is refined into CE [28] 911.90/291.61 * CE 4 is refined into CE [29] 911.90/291.61 * CE 5 is refined into CE [30,31,32,33,34,35] 911.90/291.61 * CE 6 is refined into CE [36,37] 911.90/291.61 911.90/291.61 911.90/291.61 ### Cost equations --> "Loop" of start/2 911.90/291.61 * CEs [33] --> Loop 18 911.90/291.61 * CEs [23,28,32,34,35,37] --> Loop 19 911.90/291.61 * CEs [24,25,26,27,29,30,31,36] --> Loop 20 911.90/291.61 911.90/291.61 ### Ranking functions of CR start(V1,V) 911.90/291.61 911.90/291.61 #### Partial ranking functions of CR start(V1,V) 911.90/291.61 911.90/291.61 911.90/291.61 Computing Bounds 911.90/291.61 ===================================== 911.90/291.61 911.90/291.61 #### Cost of chains of sub(V1,V,Out): 911.90/291.61 * Chain [[14],13]: 1*it(14)+1 911.90/291.61 Such that:it(14) =< V1 911.90/291.61 911.90/291.61 with precondition: [Out=0,V1=V,V1>=1] 911.90/291.61 911.90/291.61 * Chain [[14],12]: 1*it(14)+1 911.90/291.61 Such that:it(14) =< V1 911.90/291.61 911.90/291.61 with precondition: [Out=0,V1>=1,V>=V1+1] 911.90/291.61 911.90/291.61 * Chain [[14],11]: 1*it(14)+1 911.90/291.61 Such that:it(14) =< V 911.90/291.61 911.90/291.61 with precondition: [V1=Out+V,V>=1,V1>=V+1] 911.90/291.61 911.90/291.61 * Chain [13]: 1 911.90/291.61 with precondition: [V1=0,V=0,Out=0] 911.90/291.61 911.90/291.61 * Chain [12]: 1 911.90/291.61 with precondition: [V1=0,Out=0,V>=1] 911.90/291.61 911.90/291.61 * Chain [11]: 1 911.90/291.61 with precondition: [V=0,V1=Out,V1>=1] 911.90/291.61 911.90/291.61 911.90/291.61 #### Cost of chains of zero(V1,Out): 911.90/291.61 * Chain [[15,16],17]: 10*it(15)+1*s(10)+1*s(12)+2 911.90/291.61 Such that:aux(6) =< V1 911.90/291.61 it(15) =< aux(6) 911.90/291.61 aux(3) =< aux(6)-1 911.90/291.61 s(10) =< it(15)*aux(6) 911.90/291.61 s(12) =< it(15)*aux(3) 911.90/291.61 911.90/291.61 with precondition: [Out>=1,V1>=Out] 911.90/291.61 911.90/291.61 * Chain [17]: 2 911.90/291.61 with precondition: [V1=0,Out=0] 911.90/291.61 911.90/291.61 911.90/291.61 #### Cost of chains of start(V1,V): 911.90/291.61 * Chain [20]: 22*s(14)+2*s(16)+2*s(17)+4 911.90/291.61 Such that:aux(8) =< V 911.90/291.61 s(14) =< aux(8) 911.90/291.61 s(15) =< aux(8)-1 911.90/291.61 s(16) =< s(14)*aux(8) 911.90/291.61 s(17) =< s(14)*s(15) 911.90/291.61 911.90/291.61 with precondition: [V1=0] 911.90/291.61 911.90/291.61 * Chain [19]: 11*s(26)+1*s(28)+1*s(29)+11*s(30)+1*s(35)+1*s(36)+3 911.90/291.61 Such that:aux(9) =< V1 911.90/291.61 aux(10) =< V 911.90/291.61 s(30) =< aux(9) 911.90/291.61 s(26) =< aux(10) 911.90/291.61 s(34) =< aux(9)-1 911.90/291.61 s(35) =< s(30)*aux(9) 911.90/291.61 s(36) =< s(30)*s(34) 911.90/291.61 s(27) =< aux(10)-1 911.90/291.61 s(28) =< s(26)*aux(10) 911.90/291.61 s(29) =< s(26)*s(27) 911.90/291.61 911.90/291.61 with precondition: [V1>=1] 911.90/291.61 911.90/291.61 * Chain [18]: 1*s(37)+1 911.90/291.61 Such that:s(37) =< V 911.90/291.61 911.90/291.61 with precondition: [V1=V,V1>=1] 911.90/291.61 911.90/291.61 911.90/291.61 Closed-form bounds of start(V1,V): 911.90/291.61 ------------------------------------- 911.90/291.61 * Chain [20] with precondition: [V1=0] 911.90/291.61 - Upper bound: nat(V)*22+4+nat(V)*2*nat(V)+nat(V)*2*nat(nat(V)+ -1) 911.90/291.61 - Complexity: n^2 911.90/291.61 * Chain [19] with precondition: [V1>=1] 911.90/291.61 - Upper bound: 11*V1+3+V1*V1+(V1-1)*V1+nat(V)*11+nat(V)*nat(V)+nat(nat(V)+ -1)*nat(V) 911.90/291.61 - Complexity: n^2 911.90/291.61 * Chain [18] with precondition: [V1=V,V1>=1] 911.90/291.61 - Upper bound: V+1 911.90/291.61 - Complexity: n 911.90/291.61 911.90/291.61 ### Maximum cost of start(V1,V): nat(V)*10+2+nat(V)*nat(V)+nat(nat(V)+ -1)*nat(V)+max([11*V1+V1*V1+nat(V1-1)*V1,nat(V)*11+1+nat(V)*nat(V)+nat(nat(V)+ -1)*nat(V)])+(nat(V)+1) 911.90/291.61 Asymptotic class: n^2 911.90/291.61 * Total analysis performed in 196 ms. 911.90/291.61 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (12) 911.90/291.61 BOUNDS(1, n^2) 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (13) RenamingProof (BOTH BOUNDS(ID, ID)) 911.90/291.61 Renamed function symbols to avoid clashes with predefined symbol. 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (14) 911.90/291.61 Obligation: 911.90/291.61 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 911.90/291.61 911.90/291.61 911.90/291.61 The TRS R consists of the following rules: 911.90/291.61 911.90/291.61 sub(0', 0') -> 0' 911.90/291.61 sub(s(x), 0') -> s(x) 911.90/291.61 sub(0', s(x)) -> 0' 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0', nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0', nil) -> nil 911.90/291.61 zero2(0', cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 S is empty. 911.90/291.61 Rewrite Strategy: FULL 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 911.90/291.61 Infered types. 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (16) 911.90/291.61 Obligation: 911.90/291.61 TRS: 911.90/291.61 Rules: 911.90/291.61 sub(0', 0') -> 0' 911.90/291.61 sub(s(x), 0') -> s(x) 911.90/291.61 sub(0', s(x)) -> 0' 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0', nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0', nil) -> nil 911.90/291.61 zero2(0', cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 Types: 911.90/291.61 sub :: 0':s -> 0':s -> 0':s 911.90/291.61 0' :: 0':s 911.90/291.61 s :: 0':s -> 0':s 911.90/291.61 zero :: nil:cons -> nil:cons 911.90/291.61 nil :: nil:cons 911.90/291.61 zero2 :: 0':s -> nil:cons -> nil:cons 911.90/291.61 cons :: 0':s -> nil:cons -> nil:cons 911.90/291.61 hole_0':s1_0 :: 0':s 911.90/291.61 hole_nil:cons2_0 :: nil:cons 911.90/291.61 gen_0':s3_0 :: Nat -> 0':s 911.90/291.61 gen_nil:cons4_0 :: Nat -> nil:cons 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (17) OrderProof (LOWER BOUND(ID)) 911.90/291.61 Heuristically decided to analyse the following defined symbols: 911.90/291.61 sub, zero 911.90/291.61 911.90/291.61 They will be analysed ascendingly in the following order: 911.90/291.61 sub < zero 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (18) 911.90/291.61 Obligation: 911.90/291.61 TRS: 911.90/291.61 Rules: 911.90/291.61 sub(0', 0') -> 0' 911.90/291.61 sub(s(x), 0') -> s(x) 911.90/291.61 sub(0', s(x)) -> 0' 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0', nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0', nil) -> nil 911.90/291.61 zero2(0', cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 Types: 911.90/291.61 sub :: 0':s -> 0':s -> 0':s 911.90/291.61 0' :: 0':s 911.90/291.61 s :: 0':s -> 0':s 911.90/291.61 zero :: nil:cons -> nil:cons 911.90/291.61 nil :: nil:cons 911.90/291.61 zero2 :: 0':s -> nil:cons -> nil:cons 911.90/291.61 cons :: 0':s -> nil:cons -> nil:cons 911.90/291.61 hole_0':s1_0 :: 0':s 911.90/291.61 hole_nil:cons2_0 :: nil:cons 911.90/291.61 gen_0':s3_0 :: Nat -> 0':s 911.90/291.61 gen_nil:cons4_0 :: Nat -> nil:cons 911.90/291.61 911.90/291.61 911.90/291.61 Generator Equations: 911.90/291.61 gen_0':s3_0(0) <=> 0' 911.90/291.61 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 911.90/291.61 gen_nil:cons4_0(0) <=> nil 911.90/291.61 gen_nil:cons4_0(+(x, 1)) <=> cons(0', gen_nil:cons4_0(x)) 911.90/291.61 911.90/291.61 911.90/291.61 The following defined symbols remain to be analysed: 911.90/291.61 sub, zero 911.90/291.61 911.90/291.61 They will be analysed ascendingly in the following order: 911.90/291.61 sub < zero 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (19) RewriteLemmaProof (LOWER BOUND(ID)) 911.90/291.61 Proved the following rewrite lemma: 911.90/291.61 sub(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) -> gen_0':s3_0(0), rt in Omega(1 + n6_0) 911.90/291.61 911.90/291.61 Induction Base: 911.90/291.61 sub(gen_0':s3_0(0), gen_0':s3_0(0)) ->_R^Omega(1) 911.90/291.61 0' 911.90/291.61 911.90/291.61 Induction Step: 911.90/291.61 sub(gen_0':s3_0(+(n6_0, 1)), gen_0':s3_0(+(n6_0, 1))) ->_R^Omega(1) 911.90/291.61 sub(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) ->_IH 911.90/291.61 gen_0':s3_0(0) 911.90/291.61 911.90/291.61 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (20) 911.90/291.61 Complex Obligation (BEST) 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (21) 911.90/291.61 Obligation: 911.90/291.61 Proved the lower bound n^1 for the following obligation: 911.90/291.61 911.90/291.61 TRS: 911.90/291.61 Rules: 911.90/291.61 sub(0', 0') -> 0' 911.90/291.61 sub(s(x), 0') -> s(x) 911.90/291.61 sub(0', s(x)) -> 0' 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0', nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0', nil) -> nil 911.90/291.61 zero2(0', cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 Types: 911.90/291.61 sub :: 0':s -> 0':s -> 0':s 911.90/291.61 0' :: 0':s 911.90/291.61 s :: 0':s -> 0':s 911.90/291.61 zero :: nil:cons -> nil:cons 911.90/291.61 nil :: nil:cons 911.90/291.61 zero2 :: 0':s -> nil:cons -> nil:cons 911.90/291.61 cons :: 0':s -> nil:cons -> nil:cons 911.90/291.61 hole_0':s1_0 :: 0':s 911.90/291.61 hole_nil:cons2_0 :: nil:cons 911.90/291.61 gen_0':s3_0 :: Nat -> 0':s 911.90/291.61 gen_nil:cons4_0 :: Nat -> nil:cons 911.90/291.61 911.90/291.61 911.90/291.61 Generator Equations: 911.90/291.61 gen_0':s3_0(0) <=> 0' 911.90/291.61 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 911.90/291.61 gen_nil:cons4_0(0) <=> nil 911.90/291.61 gen_nil:cons4_0(+(x, 1)) <=> cons(0', gen_nil:cons4_0(x)) 911.90/291.61 911.90/291.61 911.90/291.61 The following defined symbols remain to be analysed: 911.90/291.61 sub, zero 911.90/291.61 911.90/291.61 They will be analysed ascendingly in the following order: 911.90/291.61 sub < zero 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (22) LowerBoundPropagationProof (FINISHED) 911.90/291.61 Propagated lower bound. 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (23) 911.90/291.61 BOUNDS(n^1, INF) 911.90/291.61 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (24) 911.90/291.61 Obligation: 911.90/291.61 TRS: 911.90/291.61 Rules: 911.90/291.61 sub(0', 0') -> 0' 911.90/291.61 sub(s(x), 0') -> s(x) 911.90/291.61 sub(0', s(x)) -> 0' 911.90/291.61 sub(s(x), s(y)) -> sub(x, y) 911.90/291.61 zero(nil) -> zero2(0', nil) 911.90/291.61 zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) 911.90/291.61 zero2(0', nil) -> nil 911.90/291.61 zero2(0', cons(x, xs)) -> cons(sub(x, x), zero(xs)) 911.90/291.61 zero2(s(y), nil) -> zero(nil) 911.90/291.61 zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) 911.90/291.61 911.90/291.61 Types: 911.90/291.61 sub :: 0':s -> 0':s -> 0':s 911.90/291.61 0' :: 0':s 911.90/291.61 s :: 0':s -> 0':s 911.90/291.61 zero :: nil:cons -> nil:cons 911.90/291.61 nil :: nil:cons 911.90/291.61 zero2 :: 0':s -> nil:cons -> nil:cons 911.90/291.61 cons :: 0':s -> nil:cons -> nil:cons 911.90/291.61 hole_0':s1_0 :: 0':s 911.90/291.61 hole_nil:cons2_0 :: nil:cons 911.90/291.61 gen_0':s3_0 :: Nat -> 0':s 911.90/291.61 gen_nil:cons4_0 :: Nat -> nil:cons 911.90/291.61 911.90/291.61 911.90/291.61 Lemmas: 911.90/291.61 sub(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) -> gen_0':s3_0(0), rt in Omega(1 + n6_0) 911.90/291.61 911.90/291.61 911.90/291.61 Generator Equations: 911.90/291.61 gen_0':s3_0(0) <=> 0' 911.90/291.61 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 911.90/291.61 gen_nil:cons4_0(0) <=> nil 911.90/291.61 gen_nil:cons4_0(+(x, 1)) <=> cons(0', gen_nil:cons4_0(x)) 911.90/291.61 911.90/291.61 911.90/291.61 The following defined symbols remain to be analysed: 911.90/291.61 zero 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (25) RewriteLemmaProof (LOWER BOUND(ID)) 911.90/291.61 Proved the following rewrite lemma: 911.90/291.61 zero(gen_nil:cons4_0(n704_0)) -> gen_nil:cons4_0(n704_0), rt in Omega(1 + n704_0) 911.90/291.61 911.90/291.61 Induction Base: 911.90/291.61 zero(gen_nil:cons4_0(0)) ->_R^Omega(1) 911.90/291.61 zero2(0', nil) ->_R^Omega(1) 911.90/291.61 nil 911.90/291.61 911.90/291.61 Induction Step: 911.90/291.61 zero(gen_nil:cons4_0(+(n704_0, 1))) ->_R^Omega(1) 911.90/291.61 zero2(sub(0', 0'), cons(0', gen_nil:cons4_0(n704_0))) ->_L^Omega(1) 911.90/291.61 zero2(gen_0':s3_0(0), cons(0', gen_nil:cons4_0(n704_0))) ->_R^Omega(1) 911.90/291.61 cons(sub(0', 0'), zero(gen_nil:cons4_0(n704_0))) ->_L^Omega(1) 911.90/291.61 cons(gen_0':s3_0(0), zero(gen_nil:cons4_0(n704_0))) ->_IH 911.90/291.61 cons(gen_0':s3_0(0), gen_nil:cons4_0(c705_0)) 911.90/291.61 911.90/291.61 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 911.90/291.61 ---------------------------------------- 911.90/291.61 911.90/291.61 (26) 911.90/291.61 BOUNDS(1, INF) 912.18/291.68 EOF