WORST_CASE(Omega(n^1),O(n^2)) proof of input_jpwfsULal9.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxTRS (1) RelTrsToWeightedTrsProof [UPPER BOUND(ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 216 ms] (10) BOUNDS(1, n^2) (11) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CdtProblem (13) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRelTRS (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxRelTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 0 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 387 ms] (22) BEST (23) proven lower bound (24) LowerBoundPropagationProof [FINISHED, 0 ms] (25) BOUNDS(n^1, INF) (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 119 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 583 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 100 ms] (32) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: sub(0, 0) -> 0 sub(s(x), 0) -> s(x) sub(0, s(x)) -> 0 sub(s(x), s(y)) -> sub(x, y) zero(nil) -> zero2(0, nil) zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) zero2(0, nil) -> nil zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) zero2(s(y), nil) -> zero(nil) zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (UPPER BOUND(ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: sub(0, 0) -> 0 [1] sub(s(x), 0) -> s(x) [1] sub(0, s(x)) -> 0 [1] sub(s(x), s(y)) -> sub(x, y) [1] zero(nil) -> zero2(0, nil) [1] zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) [1] zero2(0, nil) -> nil [1] zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) [1] zero2(s(y), nil) -> zero(nil) [1] zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: sub(0, 0) -> 0 [1] sub(s(x), 0) -> s(x) [1] sub(0, s(x)) -> 0 [1] sub(s(x), s(y)) -> sub(x, y) [1] zero(nil) -> zero2(0, nil) [1] zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) [1] zero2(0, nil) -> nil [1] zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) [1] zero2(s(y), nil) -> zero(nil) [1] zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) [1] The TRS has the following type information: sub :: 0:s -> 0:s -> 0:s 0 :: 0:s s :: 0:s -> 0:s zero :: nil:cons -> nil:cons nil :: nil:cons zero2 :: 0:s -> nil:cons -> nil:cons cons :: 0:s -> nil:cons -> nil:cons Rewrite Strategy: INNERMOST ---------------------------------------- (5) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: none And the following fresh constants: none ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: sub(0, 0) -> 0 [1] sub(s(x), 0) -> s(x) [1] sub(0, s(x)) -> 0 [1] sub(s(x), s(y)) -> sub(x, y) [1] zero(nil) -> zero2(0, nil) [1] zero(cons(x, xs)) -> zero2(sub(x, x), cons(x, xs)) [1] zero2(0, nil) -> nil [1] zero2(0, cons(x, xs)) -> cons(sub(x, x), zero(xs)) [1] zero2(s(y), nil) -> zero(nil) [1] zero2(s(y), cons(x, xs)) -> zero(cons(x, xs)) [1] The TRS has the following type information: sub :: 0:s -> 0:s -> 0:s 0 :: 0:s s :: 0:s -> 0:s zero :: nil:cons -> nil:cons nil :: nil:cons zero2 :: 0:s -> nil:cons -> nil:cons cons :: 0:s -> nil:cons -> nil:cons Rewrite Strategy: INNERMOST ---------------------------------------- (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: 0 => 0 nil => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: sub(z, z') -{ 1 }-> sub(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x sub(z, z') -{ 1 }-> 0 :|: z = 0, z' = 0 sub(z, z') -{ 1 }-> 0 :|: z' = 1 + x, x >= 0, z = 0 sub(z, z') -{ 1 }-> 1 + x :|: x >= 0, z = 1 + x, z' = 0 zero(z) -{ 1 }-> zero2(sub(x, x), 1 + x + xs) :|: z = 1 + x + xs, xs >= 0, x >= 0 zero(z) -{ 1 }-> zero2(0, 0) :|: z = 0 zero2(z, z') -{ 1 }-> zero(0) :|: y >= 0, z = 1 + y, z' = 0 zero2(z, z') -{ 1 }-> zero(1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, y >= 0, x >= 0, z = 1 + y zero2(z, z') -{ 1 }-> 0 :|: z = 0, z' = 0 zero2(z, z') -{ 1 }-> 1 + sub(x, x) + zero(xs) :|: xs >= 0, z' = 1 + x + xs, x >= 0, z = 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V),0,[sub(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[zero(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[zero2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(sub(V1, V, Out),1,[],[Out = 0,V1 = 0,V = 0]). eq(sub(V1, V, Out),1,[],[Out = 1 + V2,V2 >= 0,V1 = 1 + V2,V = 0]). eq(sub(V1, V, Out),1,[],[Out = 0,V = 1 + V3,V3 >= 0,V1 = 0]). eq(sub(V1, V, Out),1,[sub(V4, V5, Ret)],[Out = Ret,V = 1 + V5,V4 >= 0,V5 >= 0,V1 = 1 + V4]). eq(zero(V1, Out),1,[zero2(0, 0, Ret1)],[Out = Ret1,V1 = 0]). 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]). eq(zero2(V1, V, Out),1,[],[Out = 0,V1 = 0,V = 0]). 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]). eq(zero2(V1, V, Out),1,[zero(0, Ret3)],[Out = Ret3,V10 >= 0,V1 = 1 + V10,V = 0]). 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]). input_output_vars(sub(V1,V,Out),[V1,V],[Out]). input_output_vars(zero(V1,Out),[V1],[Out]). input_output_vars(zero2(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [sub/3] 1. recursive : [zero/2,zero2/3] 2. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into sub/3 1. SCC is partially evaluated into zero/2 2. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations sub/3 * CE 13 is refined into CE [14] * CE 11 is refined into CE [15] * CE 12 is refined into CE [16] * CE 10 is refined into CE [17] ### Cost equations --> "Loop" of sub/3 * CEs [15] --> Loop 11 * CEs [16] --> Loop 12 * CEs [17] --> Loop 13 * CEs [14] --> Loop 14 ### Ranking functions of CR sub(V1,V,Out) * RF of phase [14]: [V,V1] #### Partial ranking functions of CR sub(V1,V,Out) * Partial RF of phase [14]: - RF of loop [14:1]: V V1 ### Specialization of cost equations zero/2 * CE 9 is refined into CE [18] * CE 8 is refined into CE [19,20,21,22] * CE 7 is discarded (unfeasible) ### Cost equations --> "Loop" of zero/2 * CEs [20,22] --> Loop 15 * CEs [19,21] --> Loop 16 * CEs [18] --> Loop 17 ### Ranking functions of CR zero(V1,Out) * RF of phase [15,16]: [V1] #### Partial ranking functions of CR zero(V1,Out) * Partial RF of phase [15,16]: - RF of loop [15:1]: V1-1 - RF of loop [16:1]: V1 ### Specialization of cost equations start/2 * CE 2 is refined into CE [23] * CE 3 is refined into CE [24,25,26,27] * CE 1 is refined into CE [28] * CE 4 is refined into CE [29] * CE 5 is refined into CE [30,31,32,33,34,35] * CE 6 is refined into CE [36,37] ### Cost equations --> "Loop" of start/2 * CEs [33] --> Loop 18 * CEs [23,28,32,34,35,37] --> Loop 19 * CEs [24,25,26,27,29,30,31,36] --> Loop 20 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of sub(V1,V,Out): * Chain [[14],13]: 1*it(14)+1 Such that:it(14) =< V1 with precondition: [Out=0,V1=V,V1>=1] * Chain [[14],12]: 1*it(14)+1 Such that:it(14) =< V1 with precondition: [Out=0,V1>=1,V>=V1+1] * Chain [[14],11]: 1*it(14)+1 Such that:it(14) =< V with precondition: [V1=Out+V,V>=1,V1>=V+1] * Chain [13]: 1 with precondition: [V1=0,V=0,Out=0] * Chain [12]: 1 with precondition: [V1=0,Out=0,V>=1] * Chain [11]: 1 with precondition: [V=0,V1=Out,V1>=1] #### Cost of chains of zero(V1,Out): * Chain [[15,16],17]: 10*it(15)+1*s(10)+1*s(12)+2 Such that:aux(6) =< V1 it(15) =< aux(6) aux(3) =< aux(6)-1 s(10) =< it(15)*aux(6) s(12) =< it(15)*aux(3) with precondition: [Out>=1,V1>=Out] * Chain [17]: 2 with precondition: [V1=0,Out=0] #### Cost of chains of start(V1,V): * Chain [20]: 22*s(14)+2*s(16)+2*s(17)+4 Such that:aux(8) =< V s(14) =< aux(8) s(15) =< aux(8)-1 s(16) =< s(14)*aux(8) s(17) =< s(14)*s(15) with precondition: [V1=0] * Chain [19]: 11*s(26)+1*s(28)+1*s(29)+11*s(30)+1*s(35)+1*s(36)+3 Such that:aux(9) =< V1 aux(10) =< V s(30) =< aux(9) s(26) =< aux(10) s(34) =< aux(9)-1 s(35) =< s(30)*aux(9) s(36) =< s(30)*s(34) s(27) =< aux(10)-1 s(28) =< s(26)*aux(10) s(29) =< s(26)*s(27) with precondition: [V1>=1] * Chain [18]: 1*s(37)+1 Such that:s(37) =< V with precondition: [V1=V,V1>=1] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [20] with precondition: [V1=0] - Upper bound: nat(V)*22+4+nat(V)*2*nat(V)+nat(V)*2*nat(nat(V)+ -1) - Complexity: n^2 * Chain [19] with precondition: [V1>=1] - Upper bound: 11*V1+3+V1*V1+(V1-1)*V1+nat(V)*11+nat(V)*nat(V)+nat(nat(V)+ -1)*nat(V) - Complexity: n^2 * Chain [18] with precondition: [V1=V,V1>=1] - Upper bound: V+1 - Complexity: n ### 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) Asymptotic class: n^2 * Total analysis performed in 192 ms. ---------------------------------------- (10) BOUNDS(1, n^2) ---------------------------------------- (11) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (12) Obligation: Complexity Dependency Tuples Problem Rules: sub(0, 0) -> 0 sub(s(z0), 0) -> s(z0) sub(0, s(z0)) -> 0 sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0, nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0, nil) -> nil zero2(0, cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Tuples: SUB(0, 0) -> c SUB(s(z0), 0) -> c1 SUB(0, s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0, nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, nil) -> c6 ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) S tuples: SUB(0, 0) -> c SUB(s(z0), 0) -> c1 SUB(0, s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0, nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, nil) -> c6 ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) K tuples:none Defined Rule Symbols: sub_2, zero_1, zero2_2 Defined Pair Symbols: SUB_2, ZERO_1, ZERO2_2 Compound Symbols: c, c1, c2, c3_1, c4_1, c5_2, c6, c7_1, c8_1, c9_1, c10_1 ---------------------------------------- (13) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (14) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: SUB(0, 0) -> c SUB(s(z0), 0) -> c1 SUB(0, s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0, nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, nil) -> c6 ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) The (relative) TRS S consists of the following rules: sub(0, 0) -> 0 sub(s(z0), 0) -> s(z0) sub(0, s(z0)) -> 0 sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0, nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0, nil) -> nil zero2(0, cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Rewrite Strategy: INNERMOST ---------------------------------------- (15) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (16) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) The (relative) TRS S consists of the following rules: sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Types: SUB :: 0':s -> 0':s -> c:c1:c2:c3 0' :: 0':s c :: c:c1:c2:c3 s :: 0':s -> 0':s c1 :: c:c1:c2:c3 c2 :: c:c1:c2:c3 c3 :: c:c1:c2:c3 -> c:c1:c2:c3 ZERO :: nil:cons -> c4:c5 nil :: nil:cons c4 :: c6:c7:c8:c9:c10 -> c4:c5 ZERO2 :: 0':s -> nil:cons -> c6:c7:c8:c9:c10 cons :: 0':s -> nil:cons -> nil:cons c5 :: c6:c7:c8:c9:c10 -> c:c1:c2:c3 -> c4:c5 sub :: 0':s -> 0':s -> 0':s c6 :: c6:c7:c8:c9:c10 c7 :: c:c1:c2:c3 -> c6:c7:c8:c9:c10 c8 :: c4:c5 -> c6:c7:c8:c9:c10 c9 :: c4:c5 -> c6:c7:c8:c9:c10 c10 :: c4:c5 -> c6:c7:c8:c9:c10 zero :: nil:cons -> nil:cons zero2 :: 0':s -> nil:cons -> nil:cons hole_c:c1:c2:c31_11 :: c:c1:c2:c3 hole_0':s2_11 :: 0':s hole_c4:c53_11 :: c4:c5 hole_nil:cons4_11 :: nil:cons hole_c6:c7:c8:c9:c105_11 :: c6:c7:c8:c9:c10 gen_c:c1:c2:c36_11 :: Nat -> c:c1:c2:c3 gen_0':s7_11 :: Nat -> 0':s gen_nil:cons8_11 :: Nat -> nil:cons ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: SUB, ZERO, sub, zero They will be analysed ascendingly in the following order: SUB < ZERO sub < ZERO sub < zero ---------------------------------------- (20) Obligation: Innermost TRS: Rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Types: SUB :: 0':s -> 0':s -> c:c1:c2:c3 0' :: 0':s c :: c:c1:c2:c3 s :: 0':s -> 0':s c1 :: c:c1:c2:c3 c2 :: c:c1:c2:c3 c3 :: c:c1:c2:c3 -> c:c1:c2:c3 ZERO :: nil:cons -> c4:c5 nil :: nil:cons c4 :: c6:c7:c8:c9:c10 -> c4:c5 ZERO2 :: 0':s -> nil:cons -> c6:c7:c8:c9:c10 cons :: 0':s -> nil:cons -> nil:cons c5 :: c6:c7:c8:c9:c10 -> c:c1:c2:c3 -> c4:c5 sub :: 0':s -> 0':s -> 0':s c6 :: c6:c7:c8:c9:c10 c7 :: c:c1:c2:c3 -> c6:c7:c8:c9:c10 c8 :: c4:c5 -> c6:c7:c8:c9:c10 c9 :: c4:c5 -> c6:c7:c8:c9:c10 c10 :: c4:c5 -> c6:c7:c8:c9:c10 zero :: nil:cons -> nil:cons zero2 :: 0':s -> nil:cons -> nil:cons hole_c:c1:c2:c31_11 :: c:c1:c2:c3 hole_0':s2_11 :: 0':s hole_c4:c53_11 :: c4:c5 hole_nil:cons4_11 :: nil:cons hole_c6:c7:c8:c9:c105_11 :: c6:c7:c8:c9:c10 gen_c:c1:c2:c36_11 :: Nat -> c:c1:c2:c3 gen_0':s7_11 :: Nat -> 0':s gen_nil:cons8_11 :: Nat -> nil:cons Generator Equations: gen_c:c1:c2:c36_11(0) <=> c gen_c:c1:c2:c36_11(+(x, 1)) <=> c3(gen_c:c1:c2:c36_11(x)) gen_0':s7_11(0) <=> 0' gen_0':s7_11(+(x, 1)) <=> s(gen_0':s7_11(x)) gen_nil:cons8_11(0) <=> nil gen_nil:cons8_11(+(x, 1)) <=> cons(0', gen_nil:cons8_11(x)) The following defined symbols remain to be analysed: SUB, ZERO, sub, zero They will be analysed ascendingly in the following order: SUB < ZERO sub < ZERO sub < zero ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: SUB(gen_0':s7_11(n10_11), gen_0':s7_11(n10_11)) -> gen_c:c1:c2:c36_11(n10_11), rt in Omega(1 + n10_11) Induction Base: SUB(gen_0':s7_11(0), gen_0':s7_11(0)) ->_R^Omega(1) c Induction Step: SUB(gen_0':s7_11(+(n10_11, 1)), gen_0':s7_11(+(n10_11, 1))) ->_R^Omega(1) c3(SUB(gen_0':s7_11(n10_11), gen_0':s7_11(n10_11))) ->_IH c3(gen_c:c1:c2:c36_11(c11_11)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (22) Complex Obligation (BEST) ---------------------------------------- (23) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Types: SUB :: 0':s -> 0':s -> c:c1:c2:c3 0' :: 0':s c :: c:c1:c2:c3 s :: 0':s -> 0':s c1 :: c:c1:c2:c3 c2 :: c:c1:c2:c3 c3 :: c:c1:c2:c3 -> c:c1:c2:c3 ZERO :: nil:cons -> c4:c5 nil :: nil:cons c4 :: c6:c7:c8:c9:c10 -> c4:c5 ZERO2 :: 0':s -> nil:cons -> c6:c7:c8:c9:c10 cons :: 0':s -> nil:cons -> nil:cons c5 :: c6:c7:c8:c9:c10 -> c:c1:c2:c3 -> c4:c5 sub :: 0':s -> 0':s -> 0':s c6 :: c6:c7:c8:c9:c10 c7 :: c:c1:c2:c3 -> c6:c7:c8:c9:c10 c8 :: c4:c5 -> c6:c7:c8:c9:c10 c9 :: c4:c5 -> c6:c7:c8:c9:c10 c10 :: c4:c5 -> c6:c7:c8:c9:c10 zero :: nil:cons -> nil:cons zero2 :: 0':s -> nil:cons -> nil:cons hole_c:c1:c2:c31_11 :: c:c1:c2:c3 hole_0':s2_11 :: 0':s hole_c4:c53_11 :: c4:c5 hole_nil:cons4_11 :: nil:cons hole_c6:c7:c8:c9:c105_11 :: c6:c7:c8:c9:c10 gen_c:c1:c2:c36_11 :: Nat -> c:c1:c2:c3 gen_0':s7_11 :: Nat -> 0':s gen_nil:cons8_11 :: Nat -> nil:cons Generator Equations: gen_c:c1:c2:c36_11(0) <=> c gen_c:c1:c2:c36_11(+(x, 1)) <=> c3(gen_c:c1:c2:c36_11(x)) gen_0':s7_11(0) <=> 0' gen_0':s7_11(+(x, 1)) <=> s(gen_0':s7_11(x)) gen_nil:cons8_11(0) <=> nil gen_nil:cons8_11(+(x, 1)) <=> cons(0', gen_nil:cons8_11(x)) The following defined symbols remain to be analysed: SUB, ZERO, sub, zero They will be analysed ascendingly in the following order: SUB < ZERO sub < ZERO sub < zero ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: Innermost TRS: Rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Types: SUB :: 0':s -> 0':s -> c:c1:c2:c3 0' :: 0':s c :: c:c1:c2:c3 s :: 0':s -> 0':s c1 :: c:c1:c2:c3 c2 :: c:c1:c2:c3 c3 :: c:c1:c2:c3 -> c:c1:c2:c3 ZERO :: nil:cons -> c4:c5 nil :: nil:cons c4 :: c6:c7:c8:c9:c10 -> c4:c5 ZERO2 :: 0':s -> nil:cons -> c6:c7:c8:c9:c10 cons :: 0':s -> nil:cons -> nil:cons c5 :: c6:c7:c8:c9:c10 -> c:c1:c2:c3 -> c4:c5 sub :: 0':s -> 0':s -> 0':s c6 :: c6:c7:c8:c9:c10 c7 :: c:c1:c2:c3 -> c6:c7:c8:c9:c10 c8 :: c4:c5 -> c6:c7:c8:c9:c10 c9 :: c4:c5 -> c6:c7:c8:c9:c10 c10 :: c4:c5 -> c6:c7:c8:c9:c10 zero :: nil:cons -> nil:cons zero2 :: 0':s -> nil:cons -> nil:cons hole_c:c1:c2:c31_11 :: c:c1:c2:c3 hole_0':s2_11 :: 0':s hole_c4:c53_11 :: c4:c5 hole_nil:cons4_11 :: nil:cons hole_c6:c7:c8:c9:c105_11 :: c6:c7:c8:c9:c10 gen_c:c1:c2:c36_11 :: Nat -> c:c1:c2:c3 gen_0':s7_11 :: Nat -> 0':s gen_nil:cons8_11 :: Nat -> nil:cons Lemmas: SUB(gen_0':s7_11(n10_11), gen_0':s7_11(n10_11)) -> gen_c:c1:c2:c36_11(n10_11), rt in Omega(1 + n10_11) Generator Equations: gen_c:c1:c2:c36_11(0) <=> c gen_c:c1:c2:c36_11(+(x, 1)) <=> c3(gen_c:c1:c2:c36_11(x)) gen_0':s7_11(0) <=> 0' gen_0':s7_11(+(x, 1)) <=> s(gen_0':s7_11(x)) gen_nil:cons8_11(0) <=> nil gen_nil:cons8_11(+(x, 1)) <=> cons(0', gen_nil:cons8_11(x)) The following defined symbols remain to be analysed: sub, ZERO, zero They will be analysed ascendingly in the following order: sub < ZERO sub < zero ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: sub(gen_0':s7_11(n878_11), gen_0':s7_11(n878_11)) -> gen_0':s7_11(0), rt in Omega(0) Induction Base: sub(gen_0':s7_11(0), gen_0':s7_11(0)) ->_R^Omega(0) 0' Induction Step: sub(gen_0':s7_11(+(n878_11, 1)), gen_0':s7_11(+(n878_11, 1))) ->_R^Omega(0) sub(gen_0':s7_11(n878_11), gen_0':s7_11(n878_11)) ->_IH gen_0':s7_11(0) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (28) Obligation: Innermost TRS: Rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Types: SUB :: 0':s -> 0':s -> c:c1:c2:c3 0' :: 0':s c :: c:c1:c2:c3 s :: 0':s -> 0':s c1 :: c:c1:c2:c3 c2 :: c:c1:c2:c3 c3 :: c:c1:c2:c3 -> c:c1:c2:c3 ZERO :: nil:cons -> c4:c5 nil :: nil:cons c4 :: c6:c7:c8:c9:c10 -> c4:c5 ZERO2 :: 0':s -> nil:cons -> c6:c7:c8:c9:c10 cons :: 0':s -> nil:cons -> nil:cons c5 :: c6:c7:c8:c9:c10 -> c:c1:c2:c3 -> c4:c5 sub :: 0':s -> 0':s -> 0':s c6 :: c6:c7:c8:c9:c10 c7 :: c:c1:c2:c3 -> c6:c7:c8:c9:c10 c8 :: c4:c5 -> c6:c7:c8:c9:c10 c9 :: c4:c5 -> c6:c7:c8:c9:c10 c10 :: c4:c5 -> c6:c7:c8:c9:c10 zero :: nil:cons -> nil:cons zero2 :: 0':s -> nil:cons -> nil:cons hole_c:c1:c2:c31_11 :: c:c1:c2:c3 hole_0':s2_11 :: 0':s hole_c4:c53_11 :: c4:c5 hole_nil:cons4_11 :: nil:cons hole_c6:c7:c8:c9:c105_11 :: c6:c7:c8:c9:c10 gen_c:c1:c2:c36_11 :: Nat -> c:c1:c2:c3 gen_0':s7_11 :: Nat -> 0':s gen_nil:cons8_11 :: Nat -> nil:cons Lemmas: SUB(gen_0':s7_11(n10_11), gen_0':s7_11(n10_11)) -> gen_c:c1:c2:c36_11(n10_11), rt in Omega(1 + n10_11) sub(gen_0':s7_11(n878_11), gen_0':s7_11(n878_11)) -> gen_0':s7_11(0), rt in Omega(0) Generator Equations: gen_c:c1:c2:c36_11(0) <=> c gen_c:c1:c2:c36_11(+(x, 1)) <=> c3(gen_c:c1:c2:c36_11(x)) gen_0':s7_11(0) <=> 0' gen_0':s7_11(+(x, 1)) <=> s(gen_0':s7_11(x)) gen_nil:cons8_11(0) <=> nil gen_nil:cons8_11(+(x, 1)) <=> cons(0', gen_nil:cons8_11(x)) The following defined symbols remain to be analysed: ZERO, zero ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ZERO(gen_nil:cons8_11(n1828_11)) -> *9_11, rt in Omega(n1828_11) Induction Base: ZERO(gen_nil:cons8_11(0)) Induction Step: ZERO(gen_nil:cons8_11(+(n1828_11, 1))) ->_R^Omega(1) c5(ZERO2(sub(0', 0'), cons(0', gen_nil:cons8_11(n1828_11))), SUB(0', 0')) ->_L^Omega(0) c5(ZERO2(gen_0':s7_11(0), cons(0', gen_nil:cons8_11(n1828_11))), SUB(0', 0')) ->_R^Omega(1) c5(c8(ZERO(gen_nil:cons8_11(n1828_11))), SUB(0', 0')) ->_IH c5(c8(*9_11), SUB(0', 0')) ->_L^Omega(1) c5(c8(*9_11), gen_c:c1:c2:c36_11(0)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (30) Obligation: Innermost TRS: Rules: SUB(0', 0') -> c SUB(s(z0), 0') -> c1 SUB(0', s(z0)) -> c2 SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(nil) -> c4(ZERO2(0', nil)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0', nil) -> c6 ZERO2(0', cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0', cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) sub(0', 0') -> 0' sub(s(z0), 0') -> s(z0) sub(0', s(z0)) -> 0' sub(s(z0), s(z1)) -> sub(z0, z1) zero(nil) -> zero2(0', nil) zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) zero2(0', nil) -> nil zero2(0', cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) zero2(s(z0), nil) -> zero(nil) zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) Types: SUB :: 0':s -> 0':s -> c:c1:c2:c3 0' :: 0':s c :: c:c1:c2:c3 s :: 0':s -> 0':s c1 :: c:c1:c2:c3 c2 :: c:c1:c2:c3 c3 :: c:c1:c2:c3 -> c:c1:c2:c3 ZERO :: nil:cons -> c4:c5 nil :: nil:cons c4 :: c6:c7:c8:c9:c10 -> c4:c5 ZERO2 :: 0':s -> nil:cons -> c6:c7:c8:c9:c10 cons :: 0':s -> nil:cons -> nil:cons c5 :: c6:c7:c8:c9:c10 -> c:c1:c2:c3 -> c4:c5 sub :: 0':s -> 0':s -> 0':s c6 :: c6:c7:c8:c9:c10 c7 :: c:c1:c2:c3 -> c6:c7:c8:c9:c10 c8 :: c4:c5 -> c6:c7:c8:c9:c10 c9 :: c4:c5 -> c6:c7:c8:c9:c10 c10 :: c4:c5 -> c6:c7:c8:c9:c10 zero :: nil:cons -> nil:cons zero2 :: 0':s -> nil:cons -> nil:cons hole_c:c1:c2:c31_11 :: c:c1:c2:c3 hole_0':s2_11 :: 0':s hole_c4:c53_11 :: c4:c5 hole_nil:cons4_11 :: nil:cons hole_c6:c7:c8:c9:c105_11 :: c6:c7:c8:c9:c10 gen_c:c1:c2:c36_11 :: Nat -> c:c1:c2:c3 gen_0':s7_11 :: Nat -> 0':s gen_nil:cons8_11 :: Nat -> nil:cons Lemmas: SUB(gen_0':s7_11(n10_11), gen_0':s7_11(n10_11)) -> gen_c:c1:c2:c36_11(n10_11), rt in Omega(1 + n10_11) sub(gen_0':s7_11(n878_11), gen_0':s7_11(n878_11)) -> gen_0':s7_11(0), rt in Omega(0) ZERO(gen_nil:cons8_11(n1828_11)) -> *9_11, rt in Omega(n1828_11) Generator Equations: gen_c:c1:c2:c36_11(0) <=> c gen_c:c1:c2:c36_11(+(x, 1)) <=> c3(gen_c:c1:c2:c36_11(x)) gen_0':s7_11(0) <=> 0' gen_0':s7_11(+(x, 1)) <=> s(gen_0':s7_11(x)) gen_nil:cons8_11(0) <=> nil gen_nil:cons8_11(+(x, 1)) <=> cons(0', gen_nil:cons8_11(x)) The following defined symbols remain to be analysed: zero ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: zero(gen_nil:cons8_11(n7888_11)) -> gen_nil:cons8_11(n7888_11), rt in Omega(0) Induction Base: zero(gen_nil:cons8_11(0)) ->_R^Omega(0) zero2(0', nil) ->_R^Omega(0) nil Induction Step: zero(gen_nil:cons8_11(+(n7888_11, 1))) ->_R^Omega(0) zero2(sub(0', 0'), cons(0', gen_nil:cons8_11(n7888_11))) ->_L^Omega(0) zero2(gen_0':s7_11(0), cons(0', gen_nil:cons8_11(n7888_11))) ->_R^Omega(0) cons(sub(0', 0'), zero(gen_nil:cons8_11(n7888_11))) ->_L^Omega(0) cons(gen_0':s7_11(0), zero(gen_nil:cons8_11(n7888_11))) ->_IH cons(gen_0':s7_11(0), gen_nil:cons8_11(c7889_11)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (32) BOUNDS(1, INF)