WORST_CASE(Omega(n^1),O(n^2)) proof of input_3Z43mOEiP6.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) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CdtProblem (9) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxRelTRS (11) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxWeightedTrs (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxTypedWeightedTrs (15) CompletionProof [UPPER BOUND(ID), 0 ms] (16) CpxTypedWeightedCompleteTrs (17) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (18) CpxRNTS (19) CompleteCoflocoProof [FINISHED, 847 ms] (20) BOUNDS(1, n^2) (21) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (22) CdtProblem (23) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (24) CpxRelTRS (25) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (26) CpxRelTRS (27) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (28) typed CpxTrs (29) OrderProof [LOWER BOUND(ID), 11 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 313 ms] (32) typed CpxTrs (33) RewriteLemmaProof [LOWER BOUND(ID), 68 ms] (34) typed CpxTrs (35) RewriteLemmaProof [LOWER BOUND(ID), 114 ms] (36) BEST (37) proven lower bound (38) LowerBoundPropagationProof [FINISHED, 0 ms] (39) BOUNDS(n^1, INF) (40) typed CpxTrs (41) RewriteLemmaProof [LOWER BOUND(ID), 23 ms] (42) typed CpxTrs ---------------------------------------- (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: nthtail(n, l) -> cond(ge(n, length(l)), n, l) cond(true, n, l) -> l cond(false, n, l) -> tail(nthtail(s(n), l)) tail(nil) -> nil tail(cons(x, l)) -> l length(nil) -> 0 length(cons(x, l)) -> s(length(l)) ge(u, 0) -> true ge(0, s(v)) -> false ge(s(u), s(v)) -> ge(u, v) 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: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0) -> c7 GE(0, s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) S tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0) -> c7 GE(0, s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) K tuples:none Defined Rule Symbols: nthtail_2, cond_3, tail_1, length_1, ge_2 Defined Pair Symbols: NTHTAIL_2, COND_3, TAIL_1, LENGTH_1, GE_2 Compound Symbols: c_3, c1, c2_2, c3, c4, c5, c6_1, c7, c8, c9_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 6 trailing nodes: GE(0, s(z0)) -> c8 TAIL(cons(z0, z1)) -> c4 GE(z0, 0) -> c7 TAIL(nil) -> c3 LENGTH(nil) -> c5 COND(true, z0, z1) -> c1 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) S tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) K tuples:none Defined Rule Symbols: nthtail_2, cond_3, tail_1, length_1, ge_2 Defined Pair Symbols: NTHTAIL_2, COND_3, LENGTH_1, GE_2 Compound Symbols: c_3, c2_2, c6_1, c9_1 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) S tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) K tuples:none Defined Rule Symbols: nthtail_2, cond_3, tail_1, length_1, ge_2 Defined Pair Symbols: NTHTAIL_2, LENGTH_1, GE_2, COND_3 Compound Symbols: c_3, c6_1, c9_1, c2_1 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) Tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) S tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) K tuples:none Defined Rule Symbols: ge_2, length_1 Defined Pair Symbols: NTHTAIL_2, LENGTH_1, GE_2, COND_3 Compound Symbols: c_3, c6_1, c9_1, c2_1 ---------------------------------------- (9) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (10) 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: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(s(z0), s(z1)) -> c9(GE(z0, z1)) COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) The (relative) TRS S consists of the following rules: ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) Rewrite Strategy: INNERMOST ---------------------------------------- (11) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (12) 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: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) [1] LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) [1] GE(s(z0), s(z1)) -> c9(GE(z0, z1)) [1] COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) [1] ge(z0, 0) -> true [0] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] length(nil) -> 0 [0] length(cons(z0, z1)) -> s(length(z1)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) [1] LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) [1] GE(s(z0), s(z1)) -> c9(GE(z0, z1)) [1] COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) [1] ge(z0, 0) -> true [0] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] length(nil) -> 0 [0] length(cons(z0, z1)) -> s(length(z1)) [0] The TRS has the following type information: NTHTAIL :: s:0 -> cons:nil -> c c :: c2 -> c9 -> c6 -> c COND :: false:true -> s:0 -> cons:nil -> c2 ge :: s:0 -> s:0 -> false:true length :: cons:nil -> s:0 GE :: s:0 -> s:0 -> c9 LENGTH :: cons:nil -> c6 cons :: a -> cons:nil -> cons:nil c6 :: c6 -> c6 s :: s:0 -> s:0 c9 :: c9 -> c9 false :: false:true c2 :: c -> c2 0 :: s:0 true :: false:true nil :: cons:nil Rewrite Strategy: INNERMOST ---------------------------------------- (15) 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: ge(v0, v1) -> null_ge [0] length(v0) -> null_length [0] LENGTH(v0) -> null_LENGTH [0] GE(v0, v1) -> null_GE [0] COND(v0, v1, v2) -> null_COND [0] And the following fresh constants: null_ge, null_length, null_LENGTH, null_GE, null_COND, const, const1 ---------------------------------------- (16) 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: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) [1] LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) [1] GE(s(z0), s(z1)) -> c9(GE(z0, z1)) [1] COND(false, z0, z1) -> c2(NTHTAIL(s(z0), z1)) [1] ge(z0, 0) -> true [0] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] length(nil) -> 0 [0] length(cons(z0, z1)) -> s(length(z1)) [0] ge(v0, v1) -> null_ge [0] length(v0) -> null_length [0] LENGTH(v0) -> null_LENGTH [0] GE(v0, v1) -> null_GE [0] COND(v0, v1, v2) -> null_COND [0] The TRS has the following type information: NTHTAIL :: s:0:null_length -> cons:nil -> c c :: c2:null_COND -> c9:null_GE -> c6:null_LENGTH -> c COND :: false:true:null_ge -> s:0:null_length -> cons:nil -> c2:null_COND ge :: s:0:null_length -> s:0:null_length -> false:true:null_ge length :: cons:nil -> s:0:null_length GE :: s:0:null_length -> s:0:null_length -> c9:null_GE LENGTH :: cons:nil -> c6:null_LENGTH cons :: a -> cons:nil -> cons:nil c6 :: c6:null_LENGTH -> c6:null_LENGTH s :: s:0:null_length -> s:0:null_length c9 :: c9:null_GE -> c9:null_GE false :: false:true:null_ge c2 :: c -> c2:null_COND 0 :: s:0:null_length true :: false:true:null_ge nil :: cons:nil null_ge :: false:true:null_ge null_length :: s:0:null_length null_LENGTH :: c6:null_LENGTH null_GE :: c9:null_GE null_COND :: c2:null_COND const :: c const1 :: a Rewrite Strategy: INNERMOST ---------------------------------------- (17) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: false => 1 0 => 0 true => 2 nil => 0 null_ge => 0 null_length => 0 null_LENGTH => 0 null_GE => 0 null_COND => 0 const => 0 const1 => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: COND(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 COND(z, z', z'') -{ 1 }-> 1 + NTHTAIL(1 + z0, z1) :|: z1 >= 0, z = 1, z0 >= 0, z' = z0, z'' = z1 GE(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 GE(z, z') -{ 1 }-> 1 + GE(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 LENGTH(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 LENGTH(z) -{ 1 }-> 1 + LENGTH(z1) :|: z1 >= 0, z0 >= 0, z = 1 + z0 + z1 NTHTAIL(z, z') -{ 1 }-> 1 + COND(ge(z0, length(z1)), z0, z1) + GE(z0, length(z1)) + LENGTH(z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 ge(z, z') -{ 0 }-> ge(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 ge(z, z') -{ 0 }-> 2 :|: z = z0, z0 >= 0, z' = 0 ge(z, z') -{ 0 }-> 1 :|: z0 >= 0, z' = 1 + z0, z = 0 ge(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 length(z) -{ 0 }-> 0 :|: z = 0 length(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 length(z) -{ 0 }-> 1 + length(z1) :|: z1 >= 0, z0 >= 0, z = 1 + z0 + z1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (19) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V, V9),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V9),0,[fun3(V1, Out)],[V1 >= 0]). eq(start(V1, V, V9),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V9),0,[fun1(V1, V, V9, Out)],[V1 >= 0,V >= 0,V9 >= 0]). eq(start(V1, V, V9),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V9),0,[length(V1, Out)],[V1 >= 0]). eq(fun(V1, V, Out),1,[length(V2, Ret00101),ge(V3, Ret00101, Ret0010),fun1(Ret0010, V3, V2, Ret001),length(V2, Ret011),fun2(V3, Ret011, Ret01),fun3(V2, Ret1)],[Out = 1 + Ret001 + Ret01 + Ret1,V1 = V3,V2 >= 0,V = V2,V3 >= 0]). eq(fun3(V1, Out),1,[fun3(V4, Ret11)],[Out = 1 + Ret11,V4 >= 0,V5 >= 0,V1 = 1 + V4 + V5]). eq(fun2(V1, V, Out),1,[fun2(V7, V6, Ret12)],[Out = 1 + Ret12,V6 >= 0,V1 = 1 + V7,V7 >= 0,V = 1 + V6]). eq(fun1(V1, V, V9, Out),1,[fun(1 + V8, V10, Ret13)],[Out = 1 + Ret13,V10 >= 0,V1 = 1,V8 >= 0,V = V8,V9 = V10]). eq(ge(V1, V, Out),0,[],[Out = 2,V1 = V11,V11 >= 0,V = 0]). eq(ge(V1, V, Out),0,[],[Out = 1,V12 >= 0,V = 1 + V12,V1 = 0]). eq(ge(V1, V, Out),0,[ge(V14, V13, Ret)],[Out = Ret,V13 >= 0,V1 = 1 + V14,V14 >= 0,V = 1 + V13]). eq(length(V1, Out),0,[],[Out = 0,V1 = 0]). eq(length(V1, Out),0,[length(V15, Ret14)],[Out = 1 + Ret14,V15 >= 0,V16 >= 0,V1 = 1 + V15 + V16]). eq(ge(V1, V, Out),0,[],[Out = 0,V18 >= 0,V17 >= 0,V1 = V18,V = V17]). eq(length(V1, Out),0,[],[Out = 0,V19 >= 0,V1 = V19]). eq(fun3(V1, Out),0,[],[Out = 0,V20 >= 0,V1 = V20]). eq(fun2(V1, V, Out),0,[],[Out = 0,V21 >= 0,V22 >= 0,V1 = V21,V = V22]). eq(fun1(V1, V, V9, Out),0,[],[Out = 0,V23 >= 0,V9 = V25,V24 >= 0,V1 = V23,V = V24,V25 >= 0]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun3(V1,Out),[V1],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,V9,Out),[V1,V,V9],[Out]). input_output_vars(ge(V1,V,Out),[V1,V],[Out]). input_output_vars(length(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun2/3] 1. recursive : [fun3/2] 2. recursive : [ge/3] 3. recursive : [length/2] 4. recursive [non_tail] : [fun/3,fun1/4] 5. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun2/3 1. SCC is partially evaluated into fun3/2 2. SCC is partially evaluated into ge/3 3. SCC is partially evaluated into length/2 4. SCC is partially evaluated into fun/3 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun2/3 * CE 13 is refined into CE [20] * CE 12 is refined into CE [21] ### Cost equations --> "Loop" of fun2/3 * CEs [21] --> Loop 14 * CEs [20] --> Loop 15 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [14]: [V,V1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [14]: - RF of loop [14:1]: V V1 ### Specialization of cost equations fun3/2 * CE 11 is refined into CE [22] * CE 10 is refined into CE [23] ### Cost equations --> "Loop" of fun3/2 * CEs [23] --> Loop 16 * CEs [22] --> Loop 17 ### Ranking functions of CR fun3(V1,Out) * RF of phase [16]: [V1] #### Partial ranking functions of CR fun3(V1,Out) * Partial RF of phase [16]: - RF of loop [16:1]: V1 ### Specialization of cost equations ge/3 * CE 17 is refined into CE [24] * CE 14 is refined into CE [25] * CE 15 is refined into CE [26] * CE 16 is refined into CE [27] ### Cost equations --> "Loop" of ge/3 * CEs [27] --> Loop 18 * CEs [24] --> Loop 19 * CEs [25] --> Loop 20 * CEs [26] --> Loop 21 ### Ranking functions of CR ge(V1,V,Out) * RF of phase [18]: [V,V1] #### Partial ranking functions of CR ge(V1,V,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V V1 ### Specialization of cost equations length/2 * CE 18 is refined into CE [28] * CE 19 is refined into CE [29] ### Cost equations --> "Loop" of length/2 * CEs [29] --> Loop 22 * CEs [28] --> Loop 23 ### Ranking functions of CR length(V1,Out) * RF of phase [22]: [V1] #### Partial ranking functions of CR length(V1,Out) * Partial RF of phase [22]: - RF of loop [22:1]: V1 ### Specialization of cost equations fun/3 * CE 9 is refined into CE [30,31,32,33,34,35,36,37,38,39] * CE 8 is refined into CE [40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73] ### Cost equations --> "Loop" of fun/3 * CEs [45,51,61,67,73] --> Loop 24 * CEs [41,43,44,47,49,50,53,55,57,59,60,63,65,66,69,71,72] --> Loop 25 * CEs [40,42,46,48,52,54,56,58,62,64,68,70] --> Loop 26 * CEs [39] --> Loop 27 * CEs [35,37,38] --> Loop 28 * CEs [34,36] --> Loop 29 * CEs [31,33] --> Loop 30 * CEs [30,32] --> Loop 31 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [27,28,29]: [-V1+V] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [27,28,29]: - RF of loop [27:1,28:1,29:1]: -V1+V ### Specialization of cost equations start/3 * CE 1 is refined into CE [74] * CE 2 is refined into CE [75,76,77,78] * CE 3 is refined into CE [79,80,81,82,83,84,85,86,87] * CE 4 is refined into CE [88,89] * CE 5 is refined into CE [90,91] * CE 6 is refined into CE [92,93,94,95,96] * CE 7 is refined into CE [97,98] ### Cost equations --> "Loop" of start/3 * CEs [93] --> Loop 32 * CEs [75,76,77,78] --> Loop 33 * CEs [74,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98] --> Loop 34 ### Ranking functions of CR start(V1,V,V9) #### Partial ranking functions of CR start(V1,V,V9) Computing Bounds ===================================== #### Cost of chains of fun2(V1,V,Out): * Chain [[14],15]: 1*it(14)+0 Such that:it(14) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [15]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun3(V1,Out): * Chain [[16],17]: 1*it(16)+0 Such that:it(16) =< V1 with precondition: [Out>=1,V1>=Out] * Chain [17]: 0 with precondition: [Out=0,V1>=0] #### Cost of chains of ge(V1,V,Out): * Chain [[18],21]: 0 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[18],20]: 0 with precondition: [Out=2,V>=1,V1>=V] * Chain [[18],19]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [21]: 0 with precondition: [V1=0,Out=1,V>=1] * Chain [20]: 0 with precondition: [V=0,Out=2,V1>=0] * Chain [19]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of length(V1,Out): * Chain [[22],23]: 0 with precondition: [Out>=1,V1>=Out] * Chain [23]: 0 with precondition: [Out=0,V1>=0] #### Cost of chains of fun(V1,V,Out): * Chain [[27,28,29],26]: 6*it(27)+2*s(11)+2*s(13)+1*s(14)+1 Such that:aux(8) =< V aux(9) =< -V1+V it(27) =< aux(9) aux(4) =< aux(8) s(11) =< it(27)*aux(8) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1>=1,Out>=3,V>=V1+1] * Chain [[27,28,29],25]: 6*it(27)+2*s(11)+2*s(13)+1*s(14)+17*s(16)+1 Such that:aux(11) =< -V1+V aux(12) =< V s(16) =< aux(12) it(27) =< aux(11) aux(4) =< aux(12) s(11) =< it(27)*aux(12) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1>=1,Out>=4,V>=V1+1] * Chain [[27,28,29],24]: 6*it(27)+2*s(11)+2*s(13)+1*s(14)+10*s(33)+1 Such that:aux(18) =< -V1+V aux(19) =< V s(33) =< aux(19) it(27) =< aux(18) aux(4) =< aux(19) s(11) =< it(27)*aux(19) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1>=1,Out>=5,V>=V1+1] * Chain [31,[27,28,29],26]: 6*it(27)+2*s(11)+2*s(13)+1*s(14)+3 Such that:aux(20) =< V it(27) =< aux(20) aux(4) =< aux(20) s(11) =< it(27)*aux(20) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1=0,V>=2,Out>=5] * Chain [31,[27,28,29],25]: 23*it(27)+2*s(11)+2*s(13)+1*s(14)+3 Such that:aux(21) =< V it(27) =< aux(21) aux(4) =< aux(21) s(11) =< it(27)*aux(21) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1=0,V>=2,Out>=6] * Chain [31,[27,28,29],24]: 16*it(27)+2*s(11)+2*s(13)+1*s(14)+3 Such that:aux(22) =< V it(27) =< aux(22) aux(4) =< aux(22) s(11) =< it(27)*aux(22) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1=0,V>=2,Out>=7] * Chain [31,26]: 3 with precondition: [V1=0,Out=3,V>=1] * Chain [31,25]: 16*s(16)+1*s(29)+3 Such that:s(29) =< 1 aux(10) =< V s(16) =< aux(10) with precondition: [V1=0,Out>=4,V+3>=Out] * Chain [31,24]: 9*s(33)+1*s(39)+3 Such that:s(39) =< 1 aux(17) =< V s(33) =< aux(17) with precondition: [V1=0,Out>=5,V+4>=Out] * Chain [30,[27,28,29],26]: 8*it(27)+2*s(11)+2*s(13)+1*s(14)+3 Such that:aux(24) =< V it(27) =< aux(24) aux(4) =< aux(24) s(11) =< it(27)*aux(24) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1=0,V>=2,Out>=6] * Chain [30,[27,28,29],25]: 25*it(27)+2*s(11)+2*s(13)+1*s(14)+3 Such that:aux(25) =< V it(27) =< aux(25) aux(4) =< aux(25) s(11) =< it(27)*aux(25) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1=0,V>=2,Out>=7] * Chain [30,[27,28,29],24]: 18*it(27)+2*s(11)+2*s(13)+1*s(14)+3 Such that:aux(26) =< V it(27) =< aux(26) aux(4) =< aux(26) s(11) =< it(27)*aux(26) s(15) =< it(27)*aux(4) s(14) =< it(27)*aux(4) s(13) =< s(15) with precondition: [V1=0,V>=2,Out>=8] * Chain [30,26]: 2*s(43)+3 Such that:aux(23) =< V s(43) =< aux(23) with precondition: [V1=0,Out>=4,V+3>=Out] * Chain [30,25]: 18*s(16)+1*s(29)+3 Such that:s(29) =< 1 aux(27) =< V s(16) =< aux(27) with precondition: [V1=0,Out>=5,2*V+3>=Out] * Chain [30,24]: 11*s(33)+1*s(39)+3 Such that:s(39) =< 1 aux(28) =< V s(33) =< aux(28) with precondition: [V1=0,Out>=6,2*V+4>=Out] * Chain [26]: 1 with precondition: [Out=1,V1>=0,V>=0] * Chain [25]: 16*s(16)+1*s(29)+1 Such that:s(29) =< V1 aux(10) =< V s(16) =< aux(10) with precondition: [V1>=0,Out>=2,V+1>=Out] * Chain [24]: 9*s(33)+1*s(39)+1 Such that:s(39) =< V1 aux(17) =< V s(33) =< aux(17) with precondition: [V1>=1,Out>=3,2*V+1>=Out,V+V1+1>=Out] #### Cost of chains of start(V1,V,V9): * Chain [34]: 205*s(125)+12*s(127)+6*s(129)+12*s(130)+4*s(131)+3*s(141)+18*s(147)+6*s(149)+3*s(151)+6*s(152)+3 Such that:s(144) =< -V1+V aux(35) =< 1 aux(36) =< V1 aux(37) =< V s(131) =< aux(35) s(141) =< aux(36) s(125) =< aux(37) s(147) =< s(144) s(126) =< aux(37) s(149) =< s(147)*aux(37) s(150) =< s(147)*s(126) s(151) =< s(147)*s(126) s(152) =< s(150) s(127) =< s(125)*aux(37) s(128) =< s(125)*s(126) s(129) =< s(125)*s(126) s(130) =< s(128) with precondition: [V1>=0] * Chain [33]: 2*s(158)+52*s(160)+18*s(164)+6*s(166)+3*s(168)+6*s(169)+2 Such that:s(161) =< -V+V9 aux(38) =< V+1 aux(39) =< V9 s(158) =< aux(38) s(160) =< aux(39) s(164) =< s(161) s(165) =< aux(39) s(166) =< s(164)*aux(39) s(167) =< s(164)*s(165) s(168) =< s(164)*s(165) s(169) =< s(167) with precondition: [V1=1,V>=0,V9>=0] * Chain [32]: 0 with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V,V9): ------------------------------------- * Chain [34] with precondition: [V1>=0] - Upper bound: 3*V1+7+nat(V)*205+nat(V)*30*nat(V)+nat(V)*15*nat(-V1+V)+nat(-V1+V)*18 - Complexity: n^2 * Chain [33] with precondition: [V1=1,V>=0,V9>=0] - Upper bound: 52*V9+2+15*V9*nat(-V+V9)+(2*V+2)+nat(-V+V9)*18 - Complexity: n^2 * Chain [32] with precondition: [V=0,V1>=0] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V9): max([nat(V9)*52+2+nat(V9)*15*nat(-V+V9)+nat(V+1)*2+nat(-V+V9)*18,3*V1+7+nat(V)*205+nat(V)*30*nat(V)+nat(V)*15*nat(-V1+V)+nat(-V1+V)*18]) Asymptotic class: n^2 * Total analysis performed in 748 ms. ---------------------------------------- (20) BOUNDS(1, n^2) ---------------------------------------- (21) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (22) Obligation: Complexity Dependency Tuples Problem Rules: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0) -> c7 GE(0, s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) S tuples: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0) -> c7 GE(0, s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) K tuples:none Defined Rule Symbols: nthtail_2, cond_3, tail_1, length_1, ge_2 Defined Pair Symbols: NTHTAIL_2, COND_3, TAIL_1, LENGTH_1, GE_2 Compound Symbols: c_3, c1, c2_2, c3, c4, c5, c6_1, c7, c8, c9_1 ---------------------------------------- (23) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (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: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0) -> c7 GE(0, s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) The (relative) TRS S consists of the following rules: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0 length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (25) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (26) 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: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) The (relative) TRS S consists of the following rules: nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (27) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (28) Obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 ---------------------------------------- (29) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: NTHTAIL, ge, length, GE, LENGTH, nthtail They will be analysed ascendingly in the following order: ge < NTHTAIL length < NTHTAIL GE < NTHTAIL LENGTH < NTHTAIL nthtail < NTHTAIL ge < nthtail length < nthtail ---------------------------------------- (30) Obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 Generator Equations: gen_s:0'10_10(0) <=> 0' gen_s:0'10_10(+(x, 1)) <=> s(gen_s:0'10_10(x)) gen_nil:cons11_10(0) <=> nil gen_nil:cons11_10(+(x, 1)) <=> cons(hole_a9_10, gen_nil:cons11_10(x)) gen_c7:c8:c912_10(0) <=> c7 gen_c7:c8:c912_10(+(x, 1)) <=> c9(gen_c7:c8:c912_10(x)) gen_c5:c613_10(0) <=> c5 gen_c5:c613_10(+(x, 1)) <=> c6(gen_c5:c613_10(x)) The following defined symbols remain to be analysed: ge, NTHTAIL, length, GE, LENGTH, nthtail They will be analysed ascendingly in the following order: ge < NTHTAIL length < NTHTAIL GE < NTHTAIL LENGTH < NTHTAIL nthtail < NTHTAIL ge < nthtail length < nthtail ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) -> true, rt in Omega(0) Induction Base: ge(gen_s:0'10_10(0), gen_s:0'10_10(0)) ->_R^Omega(0) true Induction Step: ge(gen_s:0'10_10(+(n15_10, 1)), gen_s:0'10_10(+(n15_10, 1))) ->_R^Omega(0) ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (32) Obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 Lemmas: ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) -> true, rt in Omega(0) Generator Equations: gen_s:0'10_10(0) <=> 0' gen_s:0'10_10(+(x, 1)) <=> s(gen_s:0'10_10(x)) gen_nil:cons11_10(0) <=> nil gen_nil:cons11_10(+(x, 1)) <=> cons(hole_a9_10, gen_nil:cons11_10(x)) gen_c7:c8:c912_10(0) <=> c7 gen_c7:c8:c912_10(+(x, 1)) <=> c9(gen_c7:c8:c912_10(x)) gen_c5:c613_10(0) <=> c5 gen_c5:c613_10(+(x, 1)) <=> c6(gen_c5:c613_10(x)) The following defined symbols remain to be analysed: length, NTHTAIL, GE, LENGTH, nthtail They will be analysed ascendingly in the following order: length < NTHTAIL GE < NTHTAIL LENGTH < NTHTAIL nthtail < NTHTAIL length < nthtail ---------------------------------------- (33) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: length(gen_nil:cons11_10(n345_10)) -> gen_s:0'10_10(n345_10), rt in Omega(0) Induction Base: length(gen_nil:cons11_10(0)) ->_R^Omega(0) 0' Induction Step: length(gen_nil:cons11_10(+(n345_10, 1))) ->_R^Omega(0) s(length(gen_nil:cons11_10(n345_10))) ->_IH s(gen_s:0'10_10(c346_10)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (34) Obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 Lemmas: ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) -> true, rt in Omega(0) length(gen_nil:cons11_10(n345_10)) -> gen_s:0'10_10(n345_10), rt in Omega(0) Generator Equations: gen_s:0'10_10(0) <=> 0' gen_s:0'10_10(+(x, 1)) <=> s(gen_s:0'10_10(x)) gen_nil:cons11_10(0) <=> nil gen_nil:cons11_10(+(x, 1)) <=> cons(hole_a9_10, gen_nil:cons11_10(x)) gen_c7:c8:c912_10(0) <=> c7 gen_c7:c8:c912_10(+(x, 1)) <=> c9(gen_c7:c8:c912_10(x)) gen_c5:c613_10(0) <=> c5 gen_c5:c613_10(+(x, 1)) <=> c6(gen_c5:c613_10(x)) The following defined symbols remain to be analysed: GE, NTHTAIL, LENGTH, nthtail They will be analysed ascendingly in the following order: GE < NTHTAIL LENGTH < NTHTAIL nthtail < NTHTAIL ---------------------------------------- (35) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GE(gen_s:0'10_10(n634_10), gen_s:0'10_10(n634_10)) -> gen_c7:c8:c912_10(n634_10), rt in Omega(1 + n634_10) Induction Base: GE(gen_s:0'10_10(0), gen_s:0'10_10(0)) ->_R^Omega(1) c7 Induction Step: GE(gen_s:0'10_10(+(n634_10, 1)), gen_s:0'10_10(+(n634_10, 1))) ->_R^Omega(1) c9(GE(gen_s:0'10_10(n634_10), gen_s:0'10_10(n634_10))) ->_IH c9(gen_c7:c8:c912_10(c635_10)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (36) Complex Obligation (BEST) ---------------------------------------- (37) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 Lemmas: ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) -> true, rt in Omega(0) length(gen_nil:cons11_10(n345_10)) -> gen_s:0'10_10(n345_10), rt in Omega(0) Generator Equations: gen_s:0'10_10(0) <=> 0' gen_s:0'10_10(+(x, 1)) <=> s(gen_s:0'10_10(x)) gen_nil:cons11_10(0) <=> nil gen_nil:cons11_10(+(x, 1)) <=> cons(hole_a9_10, gen_nil:cons11_10(x)) gen_c7:c8:c912_10(0) <=> c7 gen_c7:c8:c912_10(+(x, 1)) <=> c9(gen_c7:c8:c912_10(x)) gen_c5:c613_10(0) <=> c5 gen_c5:c613_10(+(x, 1)) <=> c6(gen_c5:c613_10(x)) The following defined symbols remain to be analysed: GE, NTHTAIL, LENGTH, nthtail They will be analysed ascendingly in the following order: GE < NTHTAIL LENGTH < NTHTAIL nthtail < NTHTAIL ---------------------------------------- (38) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (39) BOUNDS(n^1, INF) ---------------------------------------- (40) Obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 Lemmas: ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) -> true, rt in Omega(0) length(gen_nil:cons11_10(n345_10)) -> gen_s:0'10_10(n345_10), rt in Omega(0) GE(gen_s:0'10_10(n634_10), gen_s:0'10_10(n634_10)) -> gen_c7:c8:c912_10(n634_10), rt in Omega(1 + n634_10) Generator Equations: gen_s:0'10_10(0) <=> 0' gen_s:0'10_10(+(x, 1)) <=> s(gen_s:0'10_10(x)) gen_nil:cons11_10(0) <=> nil gen_nil:cons11_10(+(x, 1)) <=> cons(hole_a9_10, gen_nil:cons11_10(x)) gen_c7:c8:c912_10(0) <=> c7 gen_c7:c8:c912_10(+(x, 1)) <=> c9(gen_c7:c8:c912_10(x)) gen_c5:c613_10(0) <=> c5 gen_c5:c613_10(+(x, 1)) <=> c6(gen_c5:c613_10(x)) The following defined symbols remain to be analysed: LENGTH, NTHTAIL, nthtail They will be analysed ascendingly in the following order: LENGTH < NTHTAIL nthtail < NTHTAIL ---------------------------------------- (41) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LENGTH(gen_nil:cons11_10(n1273_10)) -> gen_c5:c613_10(n1273_10), rt in Omega(1 + n1273_10) Induction Base: LENGTH(gen_nil:cons11_10(0)) ->_R^Omega(1) c5 Induction Step: LENGTH(gen_nil:cons11_10(+(n1273_10, 1))) ->_R^Omega(1) c6(LENGTH(gen_nil:cons11_10(n1273_10))) ->_IH c6(gen_c5:c613_10(c1274_10)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (42) Obligation: Innermost TRS: Rules: NTHTAIL(z0, z1) -> c(COND(ge(z0, length(z1)), z0, z1), GE(z0, length(z1)), LENGTH(z1)) COND(true, z0, z1) -> c1 COND(false, z0, z1) -> c2(TAIL(nthtail(s(z0), z1)), NTHTAIL(s(z0), z1)) TAIL(nil) -> c3 TAIL(cons(z0, z1)) -> c4 LENGTH(nil) -> c5 LENGTH(cons(z0, z1)) -> c6(LENGTH(z1)) GE(z0, 0') -> c7 GE(0', s(z0)) -> c8 GE(s(z0), s(z1)) -> c9(GE(z0, z1)) nthtail(z0, z1) -> cond(ge(z0, length(z1)), z0, z1) cond(true, z0, z1) -> z1 cond(false, z0, z1) -> tail(nthtail(s(z0), z1)) tail(nil) -> nil tail(cons(z0, z1)) -> z1 length(nil) -> 0' length(cons(z0, z1)) -> s(length(z1)) ge(z0, 0') -> true ge(0', s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) Types: NTHTAIL :: s:0' -> nil:cons -> c c :: c1:c2 -> c7:c8:c9 -> c5:c6 -> c COND :: true:false -> s:0' -> nil:cons -> c1:c2 ge :: s:0' -> s:0' -> true:false length :: nil:cons -> s:0' GE :: s:0' -> s:0' -> c7:c8:c9 LENGTH :: nil:cons -> c5:c6 true :: true:false c1 :: c1:c2 false :: true:false c2 :: c3:c4 -> c -> c1:c2 TAIL :: nil:cons -> c3:c4 nthtail :: s:0' -> nil:cons -> nil:cons s :: s:0' -> s:0' nil :: nil:cons c3 :: c3:c4 cons :: a -> nil:cons -> nil:cons c4 :: c3:c4 c5 :: c5:c6 c6 :: c5:c6 -> c5:c6 0' :: s:0' c7 :: c7:c8:c9 c8 :: c7:c8:c9 c9 :: c7:c8:c9 -> c7:c8:c9 cond :: true:false -> s:0' -> nil:cons -> nil:cons tail :: nil:cons -> nil:cons hole_c1_10 :: c hole_s:0'2_10 :: s:0' hole_nil:cons3_10 :: nil:cons hole_c1:c24_10 :: c1:c2 hole_c7:c8:c95_10 :: c7:c8:c9 hole_c5:c66_10 :: c5:c6 hole_true:false7_10 :: true:false hole_c3:c48_10 :: c3:c4 hole_a9_10 :: a gen_s:0'10_10 :: Nat -> s:0' gen_nil:cons11_10 :: Nat -> nil:cons gen_c7:c8:c912_10 :: Nat -> c7:c8:c9 gen_c5:c613_10 :: Nat -> c5:c6 Lemmas: ge(gen_s:0'10_10(n15_10), gen_s:0'10_10(n15_10)) -> true, rt in Omega(0) length(gen_nil:cons11_10(n345_10)) -> gen_s:0'10_10(n345_10), rt in Omega(0) GE(gen_s:0'10_10(n634_10), gen_s:0'10_10(n634_10)) -> gen_c7:c8:c912_10(n634_10), rt in Omega(1 + n634_10) LENGTH(gen_nil:cons11_10(n1273_10)) -> gen_c5:c613_10(n1273_10), rt in Omega(1 + n1273_10) Generator Equations: gen_s:0'10_10(0) <=> 0' gen_s:0'10_10(+(x, 1)) <=> s(gen_s:0'10_10(x)) gen_nil:cons11_10(0) <=> nil gen_nil:cons11_10(+(x, 1)) <=> cons(hole_a9_10, gen_nil:cons11_10(x)) gen_c7:c8:c912_10(0) <=> c7 gen_c7:c8:c912_10(+(x, 1)) <=> c9(gen_c7:c8:c912_10(x)) gen_c5:c613_10(0) <=> c5 gen_c5:c613_10(+(x, 1)) <=> c6(gen_c5:c613_10(x)) The following defined symbols remain to be analysed: nthtail, NTHTAIL They will be analysed ascendingly in the following order: nthtail < NTHTAIL