WORST_CASE(Omega(n^1),O(n^2)) proof of input_zSOMMWB3If.trs # AProVE Commit ID: 5b976082cb74a395683ed8cc7acf94bd611ab29f fuhs 20230524 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxRelTRS (9) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxWeightedTrs (11) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedTrs (13) CompletionProof [UPPER BOUND(ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) CompleteCoflocoProof [FINISHED, 298 ms] (18) BOUNDS(1, n^2) (19) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (20) CdtProblem (21) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (22) CpxRelTRS (23) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (24) CpxRelTRS (25) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (26) typed CpxTrs (27) OrderProof [LOWER BOUND(ID), 11 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 457 ms] (30) BEST (31) proven lower bound (32) LowerBoundPropagationProof [FINISHED, 0 ms] (33) BOUNDS(n^1, INF) (34) typed CpxTrs (35) RewriteLemmaProof [LOWER BOUND(ID), 81 ms] (36) typed CpxTrs (37) RewriteLemmaProof [LOWER BOUND(ID), 621 ms] (38) typed CpxTrs (39) RewriteLemmaProof [LOWER BOUND(ID), 96 ms] (40) 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) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (2) 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 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 6 trailing nodes: SUB(0, 0) -> c ZERO2(s(z0), nil) -> c9(ZERO(nil)) ZERO(nil) -> c4(ZERO2(0, nil)) SUB(0, s(z0)) -> c2 SUB(s(z0), 0) -> c1 ZERO2(0, nil) -> c6 ---------------------------------------- (4) 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(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) S tuples: SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) 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: c3_1, c5_2, c7_1, c8_1, c10_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: 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)) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: sub(0, 0) -> 0 sub(s(z0), s(z1)) -> sub(z0, z1) sub(s(z0), 0) -> s(z0) sub(0, s(z0)) -> 0 Tuples: SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) S tuples: SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) K tuples:none Defined Rule Symbols: sub_2 Defined Pair Symbols: SUB_2, ZERO_1, ZERO2_2 Compound Symbols: c3_1, c5_2, c7_1, c8_1, c10_1 ---------------------------------------- (7) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (8) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) 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), s(z1)) -> sub(z0, z1) sub(s(z0), 0) -> s(z0) sub(0, s(z0)) -> 0 Rewrite Strategy: INNERMOST ---------------------------------------- (9) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (10) 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(s(z0), s(z1)) -> c3(SUB(z0, z1)) [1] ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) [1] ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) [1] sub(0, 0) -> 0 [0] sub(s(z0), s(z1)) -> sub(z0, z1) [0] sub(s(z0), 0) -> s(z0) [0] sub(0, s(z0)) -> 0 [0] Rewrite Strategy: INNERMOST ---------------------------------------- (11) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (12) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) [1] ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) [1] ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) [1] sub(0, 0) -> 0 [0] sub(s(z0), s(z1)) -> sub(z0, z1) [0] sub(s(z0), 0) -> s(z0) [0] sub(0, s(z0)) -> 0 [0] The TRS has the following type information: SUB :: s:0 -> s:0 -> c3 s :: s:0 -> s:0 c3 :: c3 -> c3 ZERO :: cons -> c5 cons :: s:0 -> cons -> cons c5 :: c7:c8:c10 -> c3 -> c5 ZERO2 :: s:0 -> cons -> c7:c8:c10 sub :: s:0 -> s:0 -> s:0 0 :: s:0 c7 :: c3 -> c7:c8:c10 c8 :: c5 -> c7:c8:c10 c10 :: c5 -> c7:c8:c10 Rewrite Strategy: INNERMOST ---------------------------------------- (13) 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: sub(v0, v1) -> null_sub [0] SUB(v0, v1) -> null_SUB [0] ZERO(v0) -> null_ZERO [0] ZERO2(v0, v1) -> null_ZERO2 [0] And the following fresh constants: null_sub, null_SUB, null_ZERO, null_ZERO2, const ---------------------------------------- (14) 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(s(z0), s(z1)) -> c3(SUB(z0, z1)) [1] ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) [1] ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) [1] sub(0, 0) -> 0 [0] sub(s(z0), s(z1)) -> sub(z0, z1) [0] sub(s(z0), 0) -> s(z0) [0] sub(0, s(z0)) -> 0 [0] sub(v0, v1) -> null_sub [0] SUB(v0, v1) -> null_SUB [0] ZERO(v0) -> null_ZERO [0] ZERO2(v0, v1) -> null_ZERO2 [0] The TRS has the following type information: SUB :: s:0:null_sub -> s:0:null_sub -> c3:null_SUB s :: s:0:null_sub -> s:0:null_sub c3 :: c3:null_SUB -> c3:null_SUB ZERO :: cons -> c5:null_ZERO cons :: s:0:null_sub -> cons -> cons c5 :: c7:c8:c10:null_ZERO2 -> c3:null_SUB -> c5:null_ZERO ZERO2 :: s:0:null_sub -> cons -> c7:c8:c10:null_ZERO2 sub :: s:0:null_sub -> s:0:null_sub -> s:0:null_sub 0 :: s:0:null_sub c7 :: c3:null_SUB -> c7:c8:c10:null_ZERO2 c8 :: c5:null_ZERO -> c7:c8:c10:null_ZERO2 c10 :: c5:null_ZERO -> c7:c8:c10:null_ZERO2 null_sub :: s:0:null_sub null_SUB :: c3:null_SUB null_ZERO :: c5:null_ZERO null_ZERO2 :: c7:c8:c10:null_ZERO2 const :: cons Rewrite Strategy: INNERMOST ---------------------------------------- (15) 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 null_sub => 0 null_SUB => 0 null_ZERO => 0 null_ZERO2 => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: SUB(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 SUB(z, z') -{ 1 }-> 1 + SUB(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 ZERO(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 ZERO(z) -{ 1 }-> 1 + ZERO2(sub(z0, z0), 1 + z0 + z1) + SUB(z0, z0) :|: z1 >= 0, z0 >= 0, z = 1 + z0 + z1 ZERO2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 ZERO2(z, z') -{ 1 }-> 1 + ZERO(z1) :|: z' = 1 + z0 + z1, z1 >= 0, z0 >= 0, z = 0 ZERO2(z, z') -{ 1 }-> 1 + ZERO(1 + z1 + z2) :|: z1 >= 0, z' = 1 + z1 + z2, z = 1 + z0, z0 >= 0, z2 >= 0 ZERO2(z, z') -{ 1 }-> 1 + SUB(z0, z0) :|: z' = 1 + z0 + z1, z1 >= 0, z0 >= 0, z = 0 sub(z, z') -{ 0 }-> sub(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 sub(z, z') -{ 0 }-> 0 :|: z = 0, z' = 0 sub(z, z') -{ 0 }-> 0 :|: z0 >= 0, z' = 1 + z0, z = 0 sub(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 sub(z, z') -{ 0 }-> 1 + z0 :|: z = 1 + z0, z0 >= 0, z' = 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (17) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun1(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[sub(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[fun(V3, V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V1 = 1 + V3,V3 >= 0,V = 1 + V2]). eq(fun1(V1, Out),1,[sub(V5, V5, Ret010),fun2(Ret010, 1 + V5 + V4, Ret01),fun(V5, V5, Ret11)],[Out = 1 + Ret01 + Ret11,V4 >= 0,V5 >= 0,V1 = 1 + V4 + V5]). eq(fun2(V1, V, Out),1,[fun(V7, V7, Ret12)],[Out = 1 + Ret12,V = 1 + V6 + V7,V6 >= 0,V7 >= 0,V1 = 0]). eq(fun2(V1, V, Out),1,[fun1(V9, Ret13)],[Out = 1 + Ret13,V = 1 + V8 + V9,V9 >= 0,V8 >= 0,V1 = 0]). eq(fun2(V1, V, Out),1,[fun1(1 + V10 + V12, Ret14)],[Out = 1 + Ret14,V10 >= 0,V = 1 + V10 + V12,V1 = 1 + V11,V11 >= 0,V12 >= 0]). eq(sub(V1, V, Out),0,[],[Out = 0,V1 = 0,V = 0]). eq(sub(V1, V, Out),0,[sub(V14, V13, Ret)],[Out = Ret,V13 >= 0,V1 = 1 + V14,V14 >= 0,V = 1 + V13]). eq(sub(V1, V, Out),0,[],[Out = 1 + V15,V1 = 1 + V15,V15 >= 0,V = 0]). eq(sub(V1, V, Out),0,[],[Out = 0,V16 >= 0,V = 1 + V16,V1 = 0]). eq(sub(V1, V, Out),0,[],[Out = 0,V18 >= 0,V17 >= 0,V1 = V18,V = V17]). eq(fun(V1, V, Out),0,[],[Out = 0,V20 >= 0,V19 >= 0,V1 = V20,V = V19]). eq(fun1(V1, Out),0,[],[Out = 0,V21 >= 0,V1 = V21]). eq(fun2(V1, V, Out),0,[],[Out = 0,V22 >= 0,V23 >= 0,V1 = V22,V = V23]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,Out),[V1],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(sub(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive : [sub/3] 2. recursive [non_tail] : [fun1/2,fun2/3] 3. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into sub/3 2. SCC is partially evaluated into fun1/2 3. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 14 is refined into CE [19] * CE 13 is refined into CE [20] ### Cost equations --> "Loop" of fun/3 * CEs [20] --> Loop 11 * CEs [19] --> Loop 12 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [11]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [11]: - RF of loop [11:1]: V V1 ### Specialization of cost equations sub/3 * CE 17 is refined into CE [21] * CE 15 is refined into CE [22] * CE 18 is refined into CE [23] * CE 16 is refined into CE [24] ### Cost equations --> "Loop" of sub/3 * CEs [24] --> Loop 13 * CEs [21] --> Loop 14 * CEs [22,23] --> Loop 15 ### Ranking functions of CR sub(V1,V,Out) * RF of phase [13]: [V,V1] #### Partial ranking functions of CR sub(V1,V,Out) * Partial RF of phase [13]: - RF of loop [13:1]: V V1 ### Specialization of cost equations fun1/2 * CE 8 is refined into CE [25,26] * CE 11 is refined into CE [27,28,29,30] * CE 12 is refined into CE [31] * CE 10 is refined into CE [32,33] * CE 9 is discarded (unfeasible) ### Cost equations --> "Loop" of fun1/2 * CEs [33] --> Loop 16 * CEs [32] --> Loop 17 * CEs [30] --> Loop 18 * CEs [28,29] --> Loop 19 * CEs [26] --> Loop 20 * CEs [27] --> Loop 21 * CEs [25] --> Loop 22 * CEs [31] --> Loop 23 ### Ranking functions of CR fun1(V1,Out) * RF of phase [16,17]: [V1] #### Partial ranking functions of CR fun1(V1,Out) * Partial RF of phase [16,17]: - RF of loop [16:1]: V1-1 - RF of loop [17:1]: V1 ### Specialization of cost equations start/2 * CE 1 is refined into CE [34] * CE 2 is refined into CE [35,36,37] * CE 3 is refined into CE [38,39,40] * CE 4 is refined into CE [41,42] * CE 5 is refined into CE [43,44] * CE 6 is refined into CE [45,46,47] * CE 7 is refined into CE [48,49,50] ### Cost equations --> "Loop" of start/2 * CEs [48] --> Loop 24 * CEs [34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,50] --> Loop 25 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of fun(V1,V,Out): * Chain [[11],12]: 1*it(11)+0 Such that:it(11) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [12]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of sub(V1,V,Out): * Chain [[13],15]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [[13],14]: 0 with precondition: [V1=Out+V,V>=1,V1>=V+1] * Chain [15]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [14]: 0 with precondition: [V=0,V1=Out,V1>=1] #### Cost of chains of fun1(V1,Out): * Chain [[16,17],23]: 4*it(16)+1*s(3)+0 Such that:aux(4) =< V1 it(16) =< aux(4) s(3) =< it(16)*aux(4) with precondition: [V1>=1,Out>=2] * Chain [[16,17],22]: 4*it(16)+1*s(3)+1 Such that:aux(5) =< V1 it(16) =< aux(5) s(3) =< it(16)*aux(5) with precondition: [V1>=2,Out>=3] * Chain [[16,17],21]: 4*it(16)+1*s(3)+2 Such that:aux(6) =< V1 it(16) =< aux(6) s(3) =< it(16)*aux(6) with precondition: [V1>=2,Out>=4] * Chain [[16,17],20]: 5*it(16)+1*s(3)+1 Such that:aux(7) =< V1 it(16) =< aux(7) s(3) =< it(16)*aux(7) with precondition: [V1>=3,Out>=4] * Chain [[16,17],19]: 6*it(16)+1*s(3)+2 Such that:aux(9) =< V1 it(16) =< aux(9) s(3) =< it(16)*aux(9) with precondition: [V1>=3,Out>=5] * Chain [[16,17],18]: 6*it(16)+1*s(3)+2 Such that:aux(11) =< V1 it(16) =< aux(11) s(3) =< it(16)*aux(11) with precondition: [V1>=3,Out>=6] * Chain [23]: 0 with precondition: [Out=0,V1>=0] * Chain [22]: 1 with precondition: [Out=1,V1>=1] * Chain [21]: 2 with precondition: [Out=2,V1>=1] * Chain [20]: 1*s(4)+1 Such that:s(4) =< V1 with precondition: [Out>=2,V1>=Out] * Chain [19]: 2*s(5)+2 Such that:aux(8) =< V1 s(5) =< aux(8) with precondition: [Out>=3,V1+1>=Out] * Chain [18]: 2*s(7)+2 Such that:aux(10) =< V1 s(7) =< aux(10) with precondition: [Out>=4,2*V1>=Out] #### Cost of chains of start(V1,V): * Chain [25]: 70*s(33)+12*s(34)+34*s(41)+6*s(42)+3 Such that:s(40) =< V1 aux(13) =< V s(33) =< aux(13) s(41) =< s(40) s(42) =< s(41)*s(40) s(34) =< s(33)*aux(13) with precondition: [V1>=0] * Chain [24]: 0 with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [25] with precondition: [V1>=0] - Upper bound: 34*V1+3+6*V1*V1+nat(V)*70+nat(V)*12*nat(V) - Complexity: n^2 * Chain [24] with precondition: [V=0,V1>=1] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V): 34*V1+3+6*V1*V1+nat(V)*70+nat(V)*12*nat(V) Asymptotic class: n^2 * Total analysis performed in 261 ms. ---------------------------------------- (18) BOUNDS(1, n^2) ---------------------------------------- (19) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (20) 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 ---------------------------------------- (21) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (22) 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 ---------------------------------------- (23) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (24) 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 ---------------------------------------- (25) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (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 ---------------------------------------- (27) 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 ---------------------------------------- (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 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 ---------------------------------------- (29) 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). ---------------------------------------- (30) Complex Obligation (BEST) ---------------------------------------- (31) 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 ---------------------------------------- (32) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (33) BOUNDS(n^1, INF) ---------------------------------------- (34) 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 ---------------------------------------- (35) 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). ---------------------------------------- (36) 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 ---------------------------------------- (37) 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). ---------------------------------------- (38) 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 ---------------------------------------- (39) 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). ---------------------------------------- (40) BOUNDS(1, INF)