WORST_CASE(Omega(n^1),O(n^2)) proof of /export/starexec/sandbox/benchmark/theBenchmark.trs # AProVE Commit ID: c69e44bd14796315568835c1ffa2502984884775 mhark 20210624 unpublished The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 1040 ms] (2) CpxRelTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxTypedWeightedTrs (7) CompletionProof [UPPER BOUND(ID), 0 ms] (8) CpxTypedWeightedCompleteTrs (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (10) CpxRNTS (11) CompleteCoflocoProof [FINISHED, 517 ms] (12) BOUNDS(1, n^2) (13) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRelTRS (15) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (16) typed CpxTrs (17) OrderProof [LOWER BOUND(ID), 0 ms] (18) typed CpxTrs (19) RewriteLemmaProof [LOWER BOUND(ID), 370 ms] (20) BEST (21) proven lower bound (22) LowerBoundPropagationProof [FINISHED, 0 ms] (23) BOUNDS(n^1, INF) (24) typed CpxTrs (25) RewriteLemmaProof [LOWER BOUND(ID), 92 ms] (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 606 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 36 ms] (30) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). 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 ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). 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 ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (4) 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) -> c [1] SUB(s(z0), 0) -> c1 [1] SUB(0, s(z0)) -> c2 [1] SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) [1] ZERO(nil) -> c4(ZERO2(0, nil)) [1] ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) [1] ZERO2(0, nil) -> c6 [1] ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) [1] ZERO2(s(z0), nil) -> c9(ZERO(nil)) [1] ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) [1] sub(0, 0) -> 0 [0] sub(s(z0), 0) -> s(z0) [0] sub(0, s(z0)) -> 0 [0] sub(s(z0), s(z1)) -> sub(z0, z1) [0] zero(nil) -> zero2(0, nil) [0] zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) [0] zero2(0, nil) -> nil [0] zero2(0, cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) [0] zero2(s(z0), nil) -> zero(nil) [0] zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (5) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: SUB(0, 0) -> c [1] SUB(s(z0), 0) -> c1 [1] SUB(0, s(z0)) -> c2 [1] SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) [1] ZERO(nil) -> c4(ZERO2(0, nil)) [1] ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) [1] ZERO2(0, nil) -> c6 [1] ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) [1] ZERO2(s(z0), nil) -> c9(ZERO(nil)) [1] ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) [1] sub(0, 0) -> 0 [0] sub(s(z0), 0) -> s(z0) [0] sub(0, s(z0)) -> 0 [0] sub(s(z0), s(z1)) -> sub(z0, z1) [0] zero(nil) -> zero2(0, nil) [0] zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) [0] zero2(0, nil) -> nil [0] zero2(0, cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) [0] zero2(s(z0), nil) -> zero(nil) [0] zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) [0] The TRS has the following type information: 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 Rewrite Strategy: INNERMOST ---------------------------------------- (7) 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] zero(v0) -> null_zero [0] zero2(v0, v1) -> null_zero2 [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_zero, null_zero2, null_SUB, null_ZERO, null_ZERO2 ---------------------------------------- (8) 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) -> c [1] SUB(s(z0), 0) -> c1 [1] SUB(0, s(z0)) -> c2 [1] SUB(s(z0), s(z1)) -> c3(SUB(z0, z1)) [1] ZERO(nil) -> c4(ZERO2(0, nil)) [1] ZERO(cons(z0, z1)) -> c5(ZERO2(sub(z0, z0), cons(z0, z1)), SUB(z0, z0)) [1] ZERO2(0, nil) -> c6 [1] ZERO2(0, cons(z0, z1)) -> c7(SUB(z0, z0)) [1] ZERO2(0, cons(z0, z1)) -> c8(ZERO(z1)) [1] ZERO2(s(z0), nil) -> c9(ZERO(nil)) [1] ZERO2(s(z0), cons(z1, z2)) -> c10(ZERO(cons(z1, z2))) [1] sub(0, 0) -> 0 [0] sub(s(z0), 0) -> s(z0) [0] sub(0, s(z0)) -> 0 [0] sub(s(z0), s(z1)) -> sub(z0, z1) [0] zero(nil) -> zero2(0, nil) [0] zero(cons(z0, z1)) -> zero2(sub(z0, z0), cons(z0, z1)) [0] zero2(0, nil) -> nil [0] zero2(0, cons(z0, z1)) -> cons(sub(z0, z0), zero(z1)) [0] zero2(s(z0), nil) -> zero(nil) [0] zero2(s(z0), cons(z1, z2)) -> zero(cons(z1, z2)) [0] sub(v0, v1) -> null_sub [0] zero(v0) -> null_zero [0] zero2(v0, v1) -> null_zero2 [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 :: 0:s:null_sub -> 0:s:null_sub -> c:c1:c2:c3:null_SUB 0 :: 0:s:null_sub c :: c:c1:c2:c3:null_SUB s :: 0:s:null_sub -> 0:s:null_sub c1 :: c:c1:c2:c3:null_SUB c2 :: c:c1:c2:c3:null_SUB c3 :: c:c1:c2:c3:null_SUB -> c:c1:c2:c3:null_SUB ZERO :: nil:cons:null_zero:null_zero2 -> c4:c5:null_ZERO nil :: nil:cons:null_zero:null_zero2 c4 :: c6:c7:c8:c9:c10:null_ZERO2 -> c4:c5:null_ZERO ZERO2 :: 0:s:null_sub -> nil:cons:null_zero:null_zero2 -> c6:c7:c8:c9:c10:null_ZERO2 cons :: 0:s:null_sub -> nil:cons:null_zero:null_zero2 -> nil:cons:null_zero:null_zero2 c5 :: c6:c7:c8:c9:c10:null_ZERO2 -> c:c1:c2:c3:null_SUB -> c4:c5:null_ZERO sub :: 0:s:null_sub -> 0:s:null_sub -> 0:s:null_sub c6 :: c6:c7:c8:c9:c10:null_ZERO2 c7 :: c:c1:c2:c3:null_SUB -> c6:c7:c8:c9:c10:null_ZERO2 c8 :: c4:c5:null_ZERO -> c6:c7:c8:c9:c10:null_ZERO2 c9 :: c4:c5:null_ZERO -> c6:c7:c8:c9:c10:null_ZERO2 c10 :: c4:c5:null_ZERO -> c6:c7:c8:c9:c10:null_ZERO2 zero :: nil:cons:null_zero:null_zero2 -> nil:cons:null_zero:null_zero2 zero2 :: 0:s:null_sub -> nil:cons:null_zero:null_zero2 -> nil:cons:null_zero:null_zero2 null_sub :: 0:s:null_sub null_zero :: nil:cons:null_zero:null_zero2 null_zero2 :: nil:cons:null_zero:null_zero2 null_SUB :: c:c1:c2:c3:null_SUB null_ZERO :: c4:c5:null_ZERO null_ZERO2 :: c6:c7:c8:c9:c10:null_ZERO2 Rewrite Strategy: INNERMOST ---------------------------------------- (9) 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 c => 0 c1 => 1 c2 => 2 nil => 0 c6 => 0 null_sub => 0 null_zero => 0 null_zero2 => 0 null_SUB => 0 null_ZERO => 0 null_ZERO2 => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: SUB(z, z') -{ 1 }-> 2 :|: z0 >= 0, z' = 1 + z0, z = 0 SUB(z, z') -{ 1 }-> 1 :|: z = 1 + z0, z0 >= 0, z' = 0 SUB(z, z') -{ 1 }-> 0 :|: z = 0, z' = 0 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(0, 0) :|: z = 0 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') -{ 1 }-> 0 :|: z = 0, z' = 0 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(0) :|: z = 1 + z0, 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 zero(z) -{ 0 }-> zero2(sub(z0, z0), 1 + z0 + z1) :|: z1 >= 0, z0 >= 0, z = 1 + z0 + z1 zero(z) -{ 0 }-> zero2(0, 0) :|: z = 0 zero(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 zero2(z, z') -{ 0 }-> zero(0) :|: z = 1 + z0, z0 >= 0, z' = 0 zero2(z, z') -{ 0 }-> zero(1 + z1 + z2) :|: z1 >= 0, z' = 1 + z1 + z2, z = 1 + z0, z0 >= 0, z2 >= 0 zero2(z, z') -{ 0 }-> 0 :|: z = 0, z' = 0 zero2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 zero2(z, z') -{ 0 }-> 1 + sub(z0, z0) + zero(z1) :|: z' = 1 + z0 + z1, z1 >= 0, z0 >= 0, z = 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (11) 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(start(V1, V),0,[zero(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[zero2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[],[Out = 0,V1 = 0,V = 0]). eq(fun(V1, V, Out),1,[],[Out = 1,V1 = 1 + V2,V2 >= 0,V = 0]). eq(fun(V1, V, Out),1,[],[Out = 2,V3 >= 0,V = 1 + V3,V1 = 0]). eq(fun(V1, V, Out),1,[fun(V5, V4, Ret1)],[Out = 1 + Ret1,V4 >= 0,V1 = 1 + V5,V5 >= 0,V = 1 + V4]). eq(fun1(V1, Out),1,[fun2(0, 0, Ret11)],[Out = 1 + Ret11,V1 = 0]). eq(fun1(V1, Out),1,[sub(V6, V6, Ret010),fun2(Ret010, 1 + V6 + V7, Ret01),fun(V6, V6, Ret12)],[Out = 1 + Ret01 + Ret12,V7 >= 0,V6 >= 0,V1 = 1 + V6 + V7]). eq(fun2(V1, V, Out),1,[],[Out = 0,V1 = 0,V = 0]). eq(fun2(V1, V, Out),1,[fun(V8, V8, Ret13)],[Out = 1 + Ret13,V = 1 + V8 + V9,V9 >= 0,V8 >= 0,V1 = 0]). eq(fun2(V1, V, Out),1,[fun1(V11, Ret14)],[Out = 1 + Ret14,V = 1 + V10 + V11,V11 >= 0,V10 >= 0,V1 = 0]). eq(fun2(V1, V, Out),1,[fun1(0, Ret15)],[Out = 1 + Ret15,V1 = 1 + V12,V12 >= 0,V = 0]). eq(fun2(V1, V, Out),1,[fun1(1 + V13 + V14, Ret16)],[Out = 1 + Ret16,V13 >= 0,V = 1 + V13 + V14,V1 = 1 + V15,V15 >= 0,V14 >= 0]). eq(sub(V1, V, Out),0,[],[Out = 0,V1 = 0,V = 0]). eq(sub(V1, V, Out),0,[],[Out = 1 + V16,V1 = 1 + V16,V16 >= 0,V = 0]). eq(sub(V1, V, Out),0,[],[Out = 0,V17 >= 0,V = 1 + V17,V1 = 0]). eq(sub(V1, V, Out),0,[sub(V19, V18, Ret)],[Out = Ret,V18 >= 0,V1 = 1 + V19,V19 >= 0,V = 1 + V18]). eq(zero(V1, Out),0,[zero2(0, 0, Ret2)],[Out = Ret2,V1 = 0]). eq(zero(V1, Out),0,[sub(V21, V21, Ret0),zero2(Ret0, 1 + V21 + V20, Ret3)],[Out = Ret3,V20 >= 0,V21 >= 0,V1 = 1 + V20 + V21]). eq(zero2(V1, V, Out),0,[],[Out = 0,V1 = 0,V = 0]). eq(zero2(V1, V, Out),0,[sub(V23, V23, Ret011),zero(V22, Ret17)],[Out = 1 + Ret011 + Ret17,V = 1 + V22 + V23,V22 >= 0,V23 >= 0,V1 = 0]). eq(zero2(V1, V, Out),0,[zero(0, Ret4)],[Out = Ret4,V1 = 1 + V24,V24 >= 0,V = 0]). eq(zero2(V1, V, Out),0,[zero(1 + V27 + V25, Ret5)],[Out = Ret5,V27 >= 0,V = 1 + V25 + V27,V1 = 1 + V26,V26 >= 0,V25 >= 0]). eq(sub(V1, V, Out),0,[],[Out = 0,V29 >= 0,V28 >= 0,V1 = V29,V = V28]). eq(zero(V1, Out),0,[],[Out = 0,V30 >= 0,V1 = V30]). eq(zero2(V1, V, Out),0,[],[Out = 0,V32 >= 0,V31 >= 0,V1 = V32,V = V31]). eq(fun(V1, V, Out),0,[],[Out = 0,V33 >= 0,V34 >= 0,V1 = V33,V = V34]). eq(fun1(V1, Out),0,[],[Out = 0,V35 >= 0,V1 = V35]). eq(fun2(V1, V, Out),0,[],[Out = 0,V36 >= 0,V37 >= 0,V1 = V36,V = V37]). 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]). 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 : [fun/3] 1. recursive : [sub/3] 2. recursive [non_tail] : [fun1/2,fun2/3] 3. recursive : [zero/2,zero2/3] 4. 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 zero/2 4. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 30 is refined into CE [34] * CE 31 is refined into CE [35] * CE 29 is refined into CE [36] * CE 33 is refined into CE [37] * CE 32 is refined into CE [38] ### Cost equations --> "Loop" of fun/3 * CEs [38] --> Loop 19 * CEs [34] --> Loop 20 * CEs [35] --> Loop 21 * CEs [36,37] --> Loop 22 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [19]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [19]: - RF of loop [19:1]: V V1 ### Specialization of cost equations sub/3 * CE 19 is refined into CE [39] * CE 18 is refined into CE [40] * CE 20 is refined into CE [41] * CE 21 is refined into CE [42] ### Cost equations --> "Loop" of sub/3 * CEs [42] --> Loop 23 * CEs [39] --> Loop 24 * CEs [40,41] --> Loop 25 ### Ranking functions of CR sub(V1,V,Out) * RF of phase [23]: [V,V1] #### Partial ranking functions of CR sub(V1,V,Out) * Partial RF of phase [23]: - RF of loop [23:1]: V V1 ### Specialization of cost equations fun1/2 * CE 22 is refined into CE [43,44] * CE 26 is refined into CE [45,46,47,48] * CE 28 is refined into CE [49] * CE 23 is refined into CE [50] * CE 27 is refined into CE [51] * CE 25 is refined into CE [52,53] * CE 24 is discarded (unfeasible) ### Cost equations --> "Loop" of fun1/2 * CEs [53] --> Loop 26 * CEs [52] --> Loop 27 * CEs [48] --> Loop 28 * CEs [46,47] --> Loop 29 * CEs [44] --> Loop 30 * CEs [45] --> Loop 31 * CEs [43] --> Loop 32 * CEs [49] --> Loop 33 * CEs [50,51] --> Loop 34 ### Ranking functions of CR fun1(V1,Out) * RF of phase [26,27]: [V1] #### Partial ranking functions of CR fun1(V1,Out) * Partial RF of phase [26,27]: - RF of loop [26:1]: V1-1 - RF of loop [27:1]: V1 ### Specialization of cost equations zero/2 * CE 14 is refined into CE [54] * CE 15 is refined into CE [55] * CE 17 is refined into CE [56] * CE 16 is discarded (unfeasible) ### Cost equations --> "Loop" of zero/2 * CEs [56] --> Loop 35 * CEs [54,55] --> Loop 36 ### Ranking functions of CR zero(V1,Out) * RF of phase [35]: [V1] #### Partial ranking functions of CR zero(V1,Out) * Partial RF of phase [35]: - RF of loop [35:1]: V1 ### Specialization of cost equations start/2 * CE 3 is refined into CE [57] * CE 6 is refined into CE [58,59] * CE 4 is refined into CE [60,61] * CE 7 is refined into CE [62,63,64,65] * CE 8 is refined into CE [66,67] * CE 1 is refined into CE [68] * CE 2 is refined into CE [69,70] * CE 5 is refined into CE [71,72,73] * CE 9 is refined into CE [74] * CE 10 is refined into CE [75,76,77,78,79,80] * CE 11 is refined into CE [81,82,83,84] * CE 12 is refined into CE [85,86,87] * CE 13 is refined into CE [88,89] ### Cost equations --> "Loop" of start/2 * CEs [57,58,59,76,85] --> Loop 37 * CEs [60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,86,87,88,89] --> Loop 38 ### 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 [[19],22]: 1*it(19)+1 Such that:it(19) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [[19],21]: 1*it(19)+1 Such that:it(19) =< Out with precondition: [V1+2=Out,V1>=1,V>=V1+1] * Chain [[19],20]: 1*it(19)+1 Such that:it(19) =< Out with precondition: [V+1=Out,V>=1,V1>=V+1] * Chain [22]: 1 with precondition: [Out=0,V1>=0,V>=0] * Chain [21]: 1 with precondition: [V1=0,Out=2,V>=1] * Chain [20]: 1 with precondition: [V=0,Out=1,V1>=1] #### Cost of chains of sub(V1,V,Out): * Chain [[23],25]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [[23],24]: 0 with precondition: [V1=Out+V,V>=1,V1>=V+1] * Chain [25]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [24]: 0 with precondition: [V=0,V1=Out,V1>=1] #### Cost of chains of fun1(V1,Out): * Chain [[26,27],34]: 6*it(26)+1*s(3)+2 Such that:aux(4) =< V1 it(26) =< aux(4) s(3) =< it(26)*aux(4) with precondition: [V1>=1,Out>=3] * Chain [[26,27],33]: 6*it(26)+1*s(3)+0 Such that:aux(5) =< V1 it(26) =< aux(5) s(3) =< it(26)*aux(5) with precondition: [V1>=1,Out>=2] * Chain [[26,27],32]: 6*it(26)+1*s(3)+2 Such that:aux(6) =< V1 it(26) =< aux(6) s(3) =< it(26)*aux(6) with precondition: [V1>=2,Out>=3] * Chain [[26,27],31]: 6*it(26)+1*s(3)+4 Such that:aux(7) =< V1 it(26) =< aux(7) s(3) =< it(26)*aux(7) with precondition: [V1>=2,Out>=4] * Chain [[26,27],30]: 7*it(26)+1*s(3)+2 Such that:aux(8) =< V1 it(26) =< aux(8) s(3) =< it(26)*aux(8) with precondition: [V1>=3,Out>=4] * Chain [[26,27],29]: 8*it(26)+1*s(3)+4 Such that:aux(10) =< V1 it(26) =< aux(10) s(3) =< it(26)*aux(10) with precondition: [V1>=3,Out>=5] * Chain [[26,27],28]: 8*it(26)+1*s(3)+4 Such that:aux(12) =< V1 it(26) =< aux(12) s(3) =< it(26)*aux(12) with precondition: [V1>=3,Out>=6] * Chain [34]: 2 with precondition: [V1=0,Out=1] * Chain [33]: 0 with precondition: [Out=0,V1>=0] * Chain [32]: 2 with precondition: [Out=1,V1>=1] * Chain [31]: 4 with precondition: [Out=2,V1>=1] * Chain [30]: 1*s(4)+2 Such that:s(4) =< V1 with precondition: [Out>=2,V1>=Out] * Chain [29]: 2*s(5)+4 Such that:aux(9) =< V1 s(5) =< aux(9) with precondition: [Out>=3,V1+1>=Out] * Chain [28]: 2*s(7)+4 Such that:aux(11) =< V1 s(7) =< aux(11) with precondition: [Out>=4,2*V1>=Out] #### Cost of chains of zero(V1,Out): * Chain [[35],36]: 0 with precondition: [Out>=1,V1>=Out] * Chain [36]: 0 with precondition: [Out=0,V1>=0] #### Cost of chains of start(V1,V): * Chain [38]: 106*s(36)+14*s(37)+1*s(42)+1*s(43)+52*s(46)+7*s(47)+5 Such that:s(45) =< V1 s(42) =< V1+2 s(43) =< V+1 aux(14) =< V s(36) =< aux(14) s(46) =< s(45) s(47) =< s(46)*s(45) s(37) =< s(36)*aux(14) with precondition: [V1>=0] * Chain [37]: 3 with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [38] with precondition: [V1>=0] - Upper bound: 52*V1+5+7*V1*V1+nat(V)*106+nat(V)*14*nat(V)+(V1+2)+nat(V+1) - Complexity: n^2 * Chain [37] with precondition: [V=0,V1>=1] - Upper bound: 3 - Complexity: constant ### Maximum cost of start(V1,V): 52*V1+2+7*V1*V1+nat(V)*106+nat(V)*14*nat(V)+(V1+2)+nat(V+1)+3 Asymptotic class: n^2 * Total analysis performed in 417 ms. ---------------------------------------- (12) BOUNDS(1, n^2) ---------------------------------------- (13) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (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) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) 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 ---------------------------------------- (17) 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 ---------------------------------------- (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 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 ---------------------------------------- (19) 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). ---------------------------------------- (20) Complex Obligation (BEST) ---------------------------------------- (21) 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 ---------------------------------------- (22) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (23) BOUNDS(n^1, INF) ---------------------------------------- (24) 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 ---------------------------------------- (25) 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). ---------------------------------------- (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) 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 ---------------------------------------- (27) 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). ---------------------------------------- (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) 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 ---------------------------------------- (29) 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). ---------------------------------------- (30) BOUNDS(1, INF)