WORST_CASE(Omega(n^1),O(n^2)) proof of input_tASkpqDJtf.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, 577 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), 18 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 317 ms] (32) typed CpxTrs (33) RewriteLemmaProof [LOWER BOUND(ID), 114 ms] (34) BEST (35) proven lower bound (36) LowerBoundPropagationProof [FINISHED, 0 ms] (37) BOUNDS(n^1, INF) (38) typed CpxTrs (39) RewriteLemmaProof [LOWER BOUND(ID), 1080 ms] (40) typed CpxTrs (41) RewriteLemmaProof [LOWER BOUND(ID), 1939 ms] (42) 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: cond1(s(x), y) -> cond2(gr(s(x), y), s(x), y) cond2(true, x, y) -> cond1(y, y) cond2(false, x, y) -> cond1(p(x), y) gr(0, x) -> false gr(s(x), 0) -> true gr(s(x), s(y)) -> gr(x, y) neq(0, 0) -> false neq(0, s(x)) -> true neq(s(x), 0) -> true neq(s(x), s(y)) -> neq(x, y) p(0) -> 0 p(s(x)) -> x 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: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0, z0) -> false gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0, 0) -> false neq(0, s(z0)) -> true neq(s(z0), 0) -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0) -> 0 p(s(z0)) -> z0 Tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0, z0) -> c3 GR(s(z0), 0) -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0, 0) -> c6 NEQ(0, s(z0)) -> c7 NEQ(s(z0), 0) -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0) -> c10 P(s(z0)) -> c11 S tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0, z0) -> c3 GR(s(z0), 0) -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0, 0) -> c6 NEQ(0, s(z0)) -> c7 NEQ(s(z0), 0) -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0) -> c10 P(s(z0)) -> c11 K tuples:none Defined Rule Symbols: cond1_2, cond2_3, gr_2, neq_2, p_1 Defined Pair Symbols: COND1_2, COND2_3, GR_2, NEQ_2, P_1 Compound Symbols: c_2, c1_1, c2_2, c3, c4, c5_1, c6, c7, c8, c9_1, c10, c11 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 7 trailing nodes: NEQ(0, s(z0)) -> c7 GR(0, z0) -> c3 P(s(z0)) -> c11 NEQ(s(z0), 0) -> c8 P(0) -> c10 GR(s(z0), 0) -> c4 NEQ(0, 0) -> c6 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0, z0) -> false gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0, 0) -> false neq(0, s(z0)) -> true neq(s(z0), 0) -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0) -> 0 p(s(z0)) -> z0 Tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) S tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) K tuples:none Defined Rule Symbols: cond1_2, cond2_3, gr_2, neq_2, p_1 Defined Pair Symbols: COND1_2, COND2_3, GR_2, NEQ_2 Compound Symbols: c_2, c1_1, c2_2, c5_1, c9_1 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0, z0) -> false gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0, 0) -> false neq(0, s(z0)) -> true neq(s(z0), 0) -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0) -> 0 p(s(z0)) -> z0 Tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) S tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) K tuples:none Defined Rule Symbols: cond1_2, cond2_3, gr_2, neq_2, p_1 Defined Pair Symbols: COND1_2, COND2_3, GR_2, NEQ_2 Compound Symbols: c_2, c1_1, c5_1, c9_1, c2_1 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) neq(0, 0) -> false neq(0, s(z0)) -> true neq(s(z0), 0) -> true neq(s(z0), s(z1)) -> neq(z0, z1) ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) gr(0, z0) -> false p(0) -> 0 p(s(z0)) -> z0 Tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) S tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) K tuples:none Defined Rule Symbols: gr_2, p_1 Defined Pair Symbols: COND1_2, COND2_3, GR_2, NEQ_2 Compound Symbols: c_2, c1_1, c5_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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) The (relative) TRS S consists of the following rules: gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) gr(0, z0) -> false p(0) -> 0 p(s(z0)) -> z0 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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) [1] COND2(true, z0, z1) -> c1(COND1(z1, z1)) [1] GR(s(z0), s(z1)) -> c5(GR(z0, z1)) [1] NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) [1] COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) [1] gr(s(z0), 0) -> true [0] gr(s(z0), s(z1)) -> gr(z0, z1) [0] gr(0, z0) -> false [0] p(0) -> 0 [0] p(s(z0)) -> z0 [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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) [1] COND2(true, z0, z1) -> c1(COND1(z1, z1)) [1] GR(s(z0), s(z1)) -> c5(GR(z0, z1)) [1] NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) [1] COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) [1] gr(s(z0), 0) -> true [0] gr(s(z0), s(z1)) -> gr(z0, z1) [0] gr(0, z0) -> false [0] p(0) -> 0 [0] p(s(z0)) -> z0 [0] The TRS has the following type information: COND1 :: s:0 -> s:0 -> c s :: s:0 -> s:0 c :: c1:c2 -> c5 -> c COND2 :: true:false -> s:0 -> s:0 -> c1:c2 gr :: s:0 -> s:0 -> true:false GR :: s:0 -> s:0 -> c5 true :: true:false c1 :: c -> c1:c2 c5 :: c5 -> c5 NEQ :: s:0 -> s:0 -> c9 c9 :: c9 -> c9 false :: true:false c2 :: c -> c1:c2 p :: s:0 -> s:0 0 :: s:0 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: gr(v0, v1) -> null_gr [0] p(v0) -> null_p [0] COND1(v0, v1) -> null_COND1 [0] COND2(v0, v1, v2) -> null_COND2 [0] GR(v0, v1) -> null_GR [0] NEQ(v0, v1) -> null_NEQ [0] And the following fresh constants: null_gr, null_p, null_COND1, null_COND2, null_GR, null_NEQ ---------------------------------------- (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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) [1] COND2(true, z0, z1) -> c1(COND1(z1, z1)) [1] GR(s(z0), s(z1)) -> c5(GR(z0, z1)) [1] NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) [1] COND2(false, z0, z1) -> c2(COND1(p(z0), z1)) [1] gr(s(z0), 0) -> true [0] gr(s(z0), s(z1)) -> gr(z0, z1) [0] gr(0, z0) -> false [0] p(0) -> 0 [0] p(s(z0)) -> z0 [0] gr(v0, v1) -> null_gr [0] p(v0) -> null_p [0] COND1(v0, v1) -> null_COND1 [0] COND2(v0, v1, v2) -> null_COND2 [0] GR(v0, v1) -> null_GR [0] NEQ(v0, v1) -> null_NEQ [0] The TRS has the following type information: COND1 :: s:0:null_p -> s:0:null_p -> c:null_COND1 s :: s:0:null_p -> s:0:null_p c :: c1:c2:null_COND2 -> c5:null_GR -> c:null_COND1 COND2 :: true:false:null_gr -> s:0:null_p -> s:0:null_p -> c1:c2:null_COND2 gr :: s:0:null_p -> s:0:null_p -> true:false:null_gr GR :: s:0:null_p -> s:0:null_p -> c5:null_GR true :: true:false:null_gr c1 :: c:null_COND1 -> c1:c2:null_COND2 c5 :: c5:null_GR -> c5:null_GR NEQ :: s:0:null_p -> s:0:null_p -> c9:null_NEQ c9 :: c9:null_NEQ -> c9:null_NEQ false :: true:false:null_gr c2 :: c:null_COND1 -> c1:c2:null_COND2 p :: s:0:null_p -> s:0:null_p 0 :: s:0:null_p null_gr :: true:false:null_gr null_p :: s:0:null_p null_COND1 :: c:null_COND1 null_COND2 :: c1:c2:null_COND2 null_GR :: c5:null_GR null_NEQ :: c9:null_NEQ 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: true => 2 false => 1 0 => 0 null_gr => 0 null_p => 0 null_COND1 => 0 null_COND2 => 0 null_GR => 0 null_NEQ => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: COND1(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 COND1(z, z') -{ 1 }-> 1 + COND2(gr(1 + z0, z1), 1 + z0, z1) + GR(1 + z0, z1) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 COND2(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 COND2(z, z', z'') -{ 1 }-> 1 + COND1(z1, z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = z0, z'' = z1 COND2(z, z', z'') -{ 1 }-> 1 + COND1(p(z0), z1) :|: z1 >= 0, z = 1, z0 >= 0, z' = z0, z'' = z1 GR(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 GR(z, z') -{ 1 }-> 1 + GR(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 NEQ(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 NEQ(z, z') -{ 1 }-> 1 + NEQ(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 gr(z, z') -{ 0 }-> gr(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 gr(z, z') -{ 0 }-> 2 :|: z = 1 + z0, z0 >= 0, z' = 0 gr(z, z') -{ 0 }-> 1 :|: z0 >= 0, z = 0, z' = z0 gr(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 p(z) -{ 0 }-> z0 :|: z = 1 + z0, z0 >= 0 p(z) -{ 0 }-> 0 :|: z = 0 p(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 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, V4),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[fun1(V1, V, V4, Out)],[V1 >= 0,V >= 0,V4 >= 0]). eq(start(V1, V, V4),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[fun3(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[gr(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[p(V1, Out)],[V1 >= 0]). eq(fun(V1, V, Out),1,[gr(1 + V3, V2, Ret010),fun1(Ret010, 1 + V3, V2, Ret01),fun2(1 + V3, V2, Ret1)],[Out = 1 + Ret01 + Ret1,V2 >= 0,V1 = 1 + V3,V = V2,V3 >= 0]). eq(fun1(V1, V, V4, Out),1,[fun(V5, V5, Ret11)],[Out = 1 + Ret11,V1 = 2,V5 >= 0,V6 >= 0,V = V6,V4 = V5]). eq(fun2(V1, V, Out),1,[fun2(V8, V7, Ret12)],[Out = 1 + Ret12,V7 >= 0,V1 = 1 + V8,V8 >= 0,V = 1 + V7]). eq(fun3(V1, V, Out),1,[fun3(V9, V10, Ret13)],[Out = 1 + Ret13,V10 >= 0,V1 = 1 + V9,V9 >= 0,V = 1 + V10]). eq(fun1(V1, V, V4, Out),1,[p(V12, Ret10),fun(Ret10, V11, Ret14)],[Out = 1 + Ret14,V11 >= 0,V1 = 1,V12 >= 0,V = V12,V4 = V11]). eq(gr(V1, V, Out),0,[],[Out = 2,V1 = 1 + V13,V13 >= 0,V = 0]). eq(gr(V1, V, Out),0,[gr(V15, V14, Ret)],[Out = Ret,V14 >= 0,V1 = 1 + V15,V15 >= 0,V = 1 + V14]). eq(gr(V1, V, Out),0,[],[Out = 1,V16 >= 0,V1 = 0,V = V16]). eq(p(V1, Out),0,[],[Out = 0,V1 = 0]). eq(p(V1, Out),0,[],[Out = V17,V1 = 1 + V17,V17 >= 0]). eq(gr(V1, V, Out),0,[],[Out = 0,V19 >= 0,V18 >= 0,V1 = V19,V = V18]). eq(p(V1, Out),0,[],[Out = 0,V20 >= 0,V1 = V20]). eq(fun(V1, V, Out),0,[],[Out = 0,V22 >= 0,V21 >= 0,V1 = V22,V = V21]). eq(fun1(V1, V, V4, Out),0,[],[Out = 0,V23 >= 0,V4 = V25,V24 >= 0,V1 = V23,V = V24,V25 >= 0]). eq(fun2(V1, V, Out),0,[],[Out = 0,V26 >= 0,V27 >= 0,V1 = V26,V = V27]). eq(fun3(V1, V, Out),0,[],[Out = 0,V29 >= 0,V28 >= 0,V1 = V29,V = V28]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,V4,Out),[V1,V,V4],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(fun3(V1,V,Out),[V1,V],[Out]). input_output_vars(gr(V1,V,Out),[V1,V],[Out]). input_output_vars(p(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [p/2] 1. recursive : [fun2/3] 2. recursive : [gr/3] 3. recursive [non_tail] : [fun/3,fun1/4] 4. recursive : [fun3/3] 5. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into p/2 1. SCC is partially evaluated into fun2/3 2. SCC is partially evaluated into gr/3 3. SCC is partially evaluated into fun/3 4. SCC is partially evaluated into fun3/3 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations p/2 * CE 10 is refined into CE [23] * CE 9 is refined into CE [24] ### Cost equations --> "Loop" of p/2 * CEs [23] --> Loop 16 * CEs [24] --> Loop 17 ### Ranking functions of CR p(V1,Out) #### Partial ranking functions of CR p(V1,Out) ### Specialization of cost equations fun2/3 * CE 16 is refined into CE [25] * CE 15 is refined into CE [26] ### Cost equations --> "Loop" of fun2/3 * CEs [26] --> Loop 18 * CEs [25] --> Loop 19 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [18]: [V,V1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V V1 ### Specialization of cost equations gr/3 * CE 22 is refined into CE [27] * CE 19 is refined into CE [28] * CE 21 is refined into CE [29] * CE 20 is refined into CE [30] ### Cost equations --> "Loop" of gr/3 * CEs [30] --> Loop 20 * CEs [27] --> Loop 21 * CEs [28] --> Loop 22 * CEs [29] --> Loop 23 ### Ranking functions of CR gr(V1,V,Out) * RF of phase [20]: [V,V1] #### Partial ranking functions of CR gr(V1,V,Out) * Partial RF of phase [20]: - RF of loop [20:1]: V V1 ### Specialization of cost equations fun/3 * CE 11 is refined into CE [31,32,33,34,35,36,37] * CE 14 is refined into CE [38] * CE 12 is refined into CE [39,40,41,42] * CE 13 is refined into CE [43,44,45] ### Cost equations --> "Loop" of fun/3 * CEs [45] --> Loop 24 * CEs [44] --> Loop 25 * CEs [42] --> Loop 26 * CEs [41] --> Loop 27 * CEs [40] --> Loop 28 * CEs [39] --> Loop 29 * CEs [43] --> Loop 30 * CEs [37] --> Loop 31 * CEs [33,35] --> Loop 32 * CEs [38] --> Loop 33 * CEs [31,32,34,36] --> Loop 34 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [26,27]: [V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [26,27]: - RF of loop [26:1,27:1]: V1 ### Specialization of cost equations fun3/3 * CE 18 is refined into CE [46] * CE 17 is refined into CE [47] ### Cost equations --> "Loop" of fun3/3 * CEs [47] --> Loop 35 * CEs [46] --> Loop 36 ### Ranking functions of CR fun3(V1,V,Out) * RF of phase [35]: [V,V1] #### Partial ranking functions of CR fun3(V1,V,Out) * Partial RF of phase [35]: - RF of loop [35:1]: V V1 ### Specialization of cost equations start/3 * CE 3 is refined into CE [48,49,50,51] * CE 1 is refined into CE [52] * CE 2 is refined into CE [53,54,55,56,57,58,59,60] * CE 4 is refined into CE [61,62,63,64,65,66,67] * CE 5 is refined into CE [68,69] * CE 6 is refined into CE [70,71] * CE 7 is refined into CE [72,73,74,75,76] * CE 8 is refined into CE [77,78] ### Cost equations --> "Loop" of start/3 * CEs [61,73] --> Loop 37 * CEs [48,49,50,51] --> Loop 38 * CEs [53,54,55,56,57,58,59,60] --> Loop 39 * CEs [52,62,63,64,65,66,67,68,69,70,71,72,74,75,76,77,78] --> Loop 40 ### Ranking functions of CR start(V1,V,V4) #### Partial ranking functions of CR start(V1,V,V4) Computing Bounds ===================================== #### Cost of chains of p(V1,Out): * Chain [17]: 0 with precondition: [Out=0,V1>=0] * Chain [16]: 0 with precondition: [V1=Out+1,V1>=1] #### Cost of chains of fun2(V1,V,Out): * Chain [[18],19]: 1*it(18)+0 Such that:it(18) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [19]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of gr(V1,V,Out): * Chain [[20],23]: 0 with precondition: [Out=1,V1>=1,V>=V1] * Chain [[20],22]: 0 with precondition: [Out=2,V>=1,V1>=V+1] * Chain [[20],21]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [23]: 0 with precondition: [V1=0,Out=1,V>=0] * Chain [22]: 0 with precondition: [V=0,Out=2,V1>=1] * Chain [21]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun(V1,V,Out): * Chain [[26,27],34]: 4*it(26)+1*s(3)+1 Such that:aux(4) =< V1 it(26) =< aux(4) s(3) =< it(26)*aux(4) with precondition: [V1>=2,Out>=3,V>=V1] * Chain [[26,27],33]: 4*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,V>=V1] * Chain [[26,27],32]: 5*it(26)+1*s(3)+1*s(4)+1 Such that:s(4) =< V aux(6) =< V1 it(26) =< aux(6) s(3) =< it(26)*aux(6) with precondition: [V1>=2,Out>=4,V>=V1] * Chain [[26,27],29,33]: 4*it(26)+1*s(3)+2 Such that:aux(7) =< V1 it(26) =< aux(7) s(3) =< it(26)*aux(7) with precondition: [V1>=2,Out>=4,V>=V1] * Chain [[26,27],28,33]: 5*it(26)+1*s(3)+2 Such that:aux(8) =< V1 it(26) =< aux(8) s(3) =< it(26)*aux(8) with precondition: [V1>=2,Out>=5,V>=V1] * Chain [34]: 1 with precondition: [Out=1,V1>=1,V>=0] * Chain [33]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [32]: 1*s(4)+1*s(5)+1 Such that:s(5) =< V1 s(4) =< V with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [31]: 1*s(7)+1 Such that:s(7) =< V with precondition: [Out>=2,V1>=V+1,V+1>=Out] * Chain [30,33]: 2 with precondition: [V=0,Out=2,V1>=1] * Chain [29,33]: 2 with precondition: [Out=2,V1>=1,V>=V1] * Chain [28,33]: 1*s(6)+2 Such that:s(6) =< V1 with precondition: [Out>=3,V>=V1,V1+2>=Out] * Chain [25,[26,27],34]: 4*it(26)+1*s(3)+3 Such that:aux(4) =< V it(26) =< aux(4) s(3) =< it(26)*aux(4) with precondition: [V>=2,Out>=5,V1>=V+1] * Chain [25,[26,27],33]: 4*it(26)+1*s(3)+2 Such that:aux(5) =< V it(26) =< aux(5) s(3) =< it(26)*aux(5) with precondition: [V>=1,Out>=4,V1>=V+1] * Chain [25,[26,27],32]: 6*it(26)+1*s(3)+3 Such that:aux(9) =< V it(26) =< aux(9) s(3) =< it(26)*aux(9) with precondition: [V>=2,Out>=6,V1>=V+1] * Chain [25,[26,27],29,33]: 4*it(26)+1*s(3)+4 Such that:aux(7) =< V it(26) =< aux(7) s(3) =< it(26)*aux(7) with precondition: [V>=2,Out>=6,V1>=V+1] * Chain [25,[26,27],28,33]: 5*it(26)+1*s(3)+4 Such that:aux(8) =< V it(26) =< aux(8) s(3) =< it(26)*aux(8) with precondition: [V>=2,Out>=7,V1>=V+1] * Chain [25,34]: 3 with precondition: [Out=3,V>=1,V1>=V+1] * Chain [25,33]: 2 with precondition: [Out=2,V>=1,V1>=V+1] * Chain [25,32]: 2*s(4)+3 Such that:aux(10) =< V s(4) =< aux(10) with precondition: [Out>=4,V1>=V+1,V+3>=Out] * Chain [25,29,33]: 4 with precondition: [Out=4,V>=1,V1>=V+1] * Chain [25,28,33]: 1*s(6)+4 Such that:s(6) =< V with precondition: [Out>=5,V1>=V+1,V+4>=Out] * Chain [24,[26,27],34]: 5*it(26)+1*s(3)+3 Such that:aux(11) =< V it(26) =< aux(11) s(3) =< it(26)*aux(11) with precondition: [V>=2,Out>=6,V1>=V+1] * Chain [24,[26,27],33]: 5*it(26)+1*s(3)+2 Such that:aux(12) =< V it(26) =< aux(12) s(3) =< it(26)*aux(12) with precondition: [V>=1,Out>=5,V1>=V+1] * Chain [24,[26,27],32]: 7*it(26)+1*s(3)+3 Such that:aux(13) =< V it(26) =< aux(13) s(3) =< it(26)*aux(13) with precondition: [V>=2,Out>=7,V1>=V+1] * Chain [24,[26,27],29,33]: 5*it(26)+1*s(3)+4 Such that:aux(14) =< V it(26) =< aux(14) s(3) =< it(26)*aux(14) with precondition: [V>=2,Out>=7,V1>=V+1] * Chain [24,[26,27],28,33]: 6*it(26)+1*s(3)+4 Such that:aux(15) =< V it(26) =< aux(15) s(3) =< it(26)*aux(15) with precondition: [V>=2,Out>=8,V1>=V+1] * Chain [24,34]: 1*s(8)+3 Such that:s(8) =< V with precondition: [Out>=4,V1>=V+1,V+3>=Out] * Chain [24,33]: 1*s(8)+2 Such that:s(8) =< V with precondition: [Out>=3,V1>=V+1,V+2>=Out] * Chain [24,32]: 3*s(4)+3 Such that:aux(16) =< V s(4) =< aux(16) with precondition: [Out>=5,V1>=V+1,2*V+3>=Out] * Chain [24,29,33]: 1*s(8)+4 Such that:s(8) =< V with precondition: [Out>=5,V1>=V+1,V+4>=Out] * Chain [24,28,33]: 2*s(6)+4 Such that:aux(17) =< V s(6) =< aux(17) with precondition: [Out>=6,V1>=V+1,2*V+4>=Out] #### Cost of chains of fun3(V1,V,Out): * Chain [[35],36]: 1*it(35)+0 Such that:it(35) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [36]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of start(V1,V,V4): * Chain [40]: 67*s(69)+24*s(71)+5*s(72)+10*s(79)+4 Such that:aux(21) =< V1 aux(22) =< V s(71) =< aux(21) s(69) =< aux(22) s(72) =< s(71)*aux(21) s(79) =< s(69)*aux(22) with precondition: [V1>=0] * Chain [39]: 65*s(82)+24*s(84)+5*s(85)+10*s(92)+5 Such that:aux(23) =< V aux(24) =< V4 s(84) =< aux(23) s(82) =< aux(24) s(85) =< s(84)*aux(23) s(92) =< s(82)*aux(24) with precondition: [V1=1,V>=0,V4>=0] * Chain [38]: 27*s(93)+5*s(96)+3 Such that:aux(27) =< V4 s(93) =< aux(27) s(96) =< s(93)*aux(27) with precondition: [V1=2,V>=0,V4>=0] * Chain [37]: 2 with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V,V4): ------------------------------------- * Chain [40] with precondition: [V1>=0] - Upper bound: 24*V1+4+5*V1*V1+nat(V)*67+nat(V)*10*nat(V) - Complexity: n^2 * Chain [39] with precondition: [V1=1,V>=0,V4>=0] - Upper bound: 24*V+5+5*V*V+65*V4+10*V4*V4 - Complexity: n^2 * Chain [38] with precondition: [V1=2,V>=0,V4>=0] - Upper bound: 27*V4+3+5*V4*V4 - Complexity: n^2 * Chain [37] with precondition: [V=0,V1>=1] - Upper bound: 2 - Complexity: constant ### Maximum cost of start(V1,V,V4): max([nat(V4)*27+1+nat(V4)*5*nat(V4),nat(V)*24+2+nat(V)*5*nat(V)+max([nat(V4)*65+1+nat(V4)*10*nat(V4),5*V1*V1+24*V1+nat(V)*43+nat(V)*5*nat(V)])])+2 Asymptotic class: n^2 * Total analysis performed in 565 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: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0, z0) -> false gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0, 0) -> false neq(0, s(z0)) -> true neq(s(z0), 0) -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0) -> 0 p(s(z0)) -> z0 Tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0, z0) -> c3 GR(s(z0), 0) -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0, 0) -> c6 NEQ(0, s(z0)) -> c7 NEQ(s(z0), 0) -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0) -> c10 P(s(z0)) -> c11 S tuples: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0, z0) -> c3 GR(s(z0), 0) -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0, 0) -> c6 NEQ(0, s(z0)) -> c7 NEQ(s(z0), 0) -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0) -> c10 P(s(z0)) -> c11 K tuples:none Defined Rule Symbols: cond1_2, cond2_3, gr_2, neq_2, p_1 Defined Pair Symbols: COND1_2, COND2_3, GR_2, NEQ_2, P_1 Compound Symbols: c_2, c1_1, c2_2, c3, c4, c5_1, c6, c7, c8, c9_1, c10, c11 ---------------------------------------- (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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0, z0) -> c3 GR(s(z0), 0) -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0, 0) -> c6 NEQ(0, s(z0)) -> c7 NEQ(s(z0), 0) -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0) -> c10 P(s(z0)) -> c11 The (relative) TRS S consists of the following rules: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0, z0) -> false gr(s(z0), 0) -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0, 0) -> false neq(0, s(z0)) -> true neq(s(z0), 0) -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0) -> 0 p(s(z0)) -> z0 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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 The (relative) TRS S consists of the following rules: cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Rewrite Strategy: INNERMOST ---------------------------------------- (27) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (28) Obligation: Innermost TRS: Rules: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Types: COND1 :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c3:c4:c5 -> c COND2 :: true:false -> s:0' -> s:0' -> c1:c2 gr :: s:0' -> s:0' -> true:false GR :: s:0' -> s:0' -> c3:c4:c5 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c -> c10:c11 -> c1:c2 p :: s:0' -> s:0' P :: s:0' -> c10:c11 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 NEQ :: s:0' -> s:0' -> c6:c7:c8:c9 c6 :: c6:c7:c8:c9 c7 :: c6:c7:c8:c9 c8 :: c6:c7:c8:c9 c9 :: c6:c7:c8:c9 -> c6:c7:c8:c9 c10 :: c10:c11 c11 :: c10:c11 cond1 :: s:0' -> s:0' -> cond1:cond2 cond2 :: true:false -> s:0' -> s:0' -> cond1:cond2 neq :: s:0' -> s:0' -> true:false hole_c1_12 :: c hole_s:0'2_12 :: s:0' hole_c1:c23_12 :: c1:c2 hole_c3:c4:c54_12 :: c3:c4:c5 hole_true:false5_12 :: true:false hole_c10:c116_12 :: c10:c11 hole_c6:c7:c8:c97_12 :: c6:c7:c8:c9 hole_cond1:cond28_12 :: cond1:cond2 gen_s:0'9_12 :: Nat -> s:0' gen_c3:c4:c510_12 :: Nat -> c3:c4:c5 gen_c6:c7:c8:c911_12 :: Nat -> c6:c7:c8:c9 ---------------------------------------- (29) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: COND1, gr, GR, NEQ, cond1, neq They will be analysed ascendingly in the following order: gr < COND1 GR < COND1 gr < cond1 ---------------------------------------- (30) Obligation: Innermost TRS: Rules: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Types: COND1 :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c3:c4:c5 -> c COND2 :: true:false -> s:0' -> s:0' -> c1:c2 gr :: s:0' -> s:0' -> true:false GR :: s:0' -> s:0' -> c3:c4:c5 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c -> c10:c11 -> c1:c2 p :: s:0' -> s:0' P :: s:0' -> c10:c11 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 NEQ :: s:0' -> s:0' -> c6:c7:c8:c9 c6 :: c6:c7:c8:c9 c7 :: c6:c7:c8:c9 c8 :: c6:c7:c8:c9 c9 :: c6:c7:c8:c9 -> c6:c7:c8:c9 c10 :: c10:c11 c11 :: c10:c11 cond1 :: s:0' -> s:0' -> cond1:cond2 cond2 :: true:false -> s:0' -> s:0' -> cond1:cond2 neq :: s:0' -> s:0' -> true:false hole_c1_12 :: c hole_s:0'2_12 :: s:0' hole_c1:c23_12 :: c1:c2 hole_c3:c4:c54_12 :: c3:c4:c5 hole_true:false5_12 :: true:false hole_c10:c116_12 :: c10:c11 hole_c6:c7:c8:c97_12 :: c6:c7:c8:c9 hole_cond1:cond28_12 :: cond1:cond2 gen_s:0'9_12 :: Nat -> s:0' gen_c3:c4:c510_12 :: Nat -> c3:c4:c5 gen_c6:c7:c8:c911_12 :: Nat -> c6:c7:c8:c9 Generator Equations: gen_s:0'9_12(0) <=> 0' gen_s:0'9_12(+(x, 1)) <=> s(gen_s:0'9_12(x)) gen_c3:c4:c510_12(0) <=> c3 gen_c3:c4:c510_12(+(x, 1)) <=> c5(gen_c3:c4:c510_12(x)) gen_c6:c7:c8:c911_12(0) <=> c6 gen_c6:c7:c8:c911_12(+(x, 1)) <=> c9(gen_c6:c7:c8:c911_12(x)) The following defined symbols remain to be analysed: gr, COND1, GR, NEQ, cond1, neq They will be analysed ascendingly in the following order: gr < COND1 GR < COND1 gr < cond1 ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: gr(gen_s:0'9_12(n13_12), gen_s:0'9_12(n13_12)) -> false, rt in Omega(0) Induction Base: gr(gen_s:0'9_12(0), gen_s:0'9_12(0)) ->_R^Omega(0) false Induction Step: gr(gen_s:0'9_12(+(n13_12, 1)), gen_s:0'9_12(+(n13_12, 1))) ->_R^Omega(0) gr(gen_s:0'9_12(n13_12), gen_s:0'9_12(n13_12)) ->_IH false 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: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Types: COND1 :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c3:c4:c5 -> c COND2 :: true:false -> s:0' -> s:0' -> c1:c2 gr :: s:0' -> s:0' -> true:false GR :: s:0' -> s:0' -> c3:c4:c5 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c -> c10:c11 -> c1:c2 p :: s:0' -> s:0' P :: s:0' -> c10:c11 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 NEQ :: s:0' -> s:0' -> c6:c7:c8:c9 c6 :: c6:c7:c8:c9 c7 :: c6:c7:c8:c9 c8 :: c6:c7:c8:c9 c9 :: c6:c7:c8:c9 -> c6:c7:c8:c9 c10 :: c10:c11 c11 :: c10:c11 cond1 :: s:0' -> s:0' -> cond1:cond2 cond2 :: true:false -> s:0' -> s:0' -> cond1:cond2 neq :: s:0' -> s:0' -> true:false hole_c1_12 :: c hole_s:0'2_12 :: s:0' hole_c1:c23_12 :: c1:c2 hole_c3:c4:c54_12 :: c3:c4:c5 hole_true:false5_12 :: true:false hole_c10:c116_12 :: c10:c11 hole_c6:c7:c8:c97_12 :: c6:c7:c8:c9 hole_cond1:cond28_12 :: cond1:cond2 gen_s:0'9_12 :: Nat -> s:0' gen_c3:c4:c510_12 :: Nat -> c3:c4:c5 gen_c6:c7:c8:c911_12 :: Nat -> c6:c7:c8:c9 Lemmas: gr(gen_s:0'9_12(n13_12), gen_s:0'9_12(n13_12)) -> false, rt in Omega(0) Generator Equations: gen_s:0'9_12(0) <=> 0' gen_s:0'9_12(+(x, 1)) <=> s(gen_s:0'9_12(x)) gen_c3:c4:c510_12(0) <=> c3 gen_c3:c4:c510_12(+(x, 1)) <=> c5(gen_c3:c4:c510_12(x)) gen_c6:c7:c8:c911_12(0) <=> c6 gen_c6:c7:c8:c911_12(+(x, 1)) <=> c9(gen_c6:c7:c8:c911_12(x)) The following defined symbols remain to be analysed: GR, COND1, NEQ, cond1, neq They will be analysed ascendingly in the following order: GR < COND1 ---------------------------------------- (33) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GR(gen_s:0'9_12(n364_12), gen_s:0'9_12(n364_12)) -> gen_c3:c4:c510_12(n364_12), rt in Omega(1 + n364_12) Induction Base: GR(gen_s:0'9_12(0), gen_s:0'9_12(0)) ->_R^Omega(1) c3 Induction Step: GR(gen_s:0'9_12(+(n364_12, 1)), gen_s:0'9_12(+(n364_12, 1))) ->_R^Omega(1) c5(GR(gen_s:0'9_12(n364_12), gen_s:0'9_12(n364_12))) ->_IH c5(gen_c3:c4:c510_12(c365_12)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (34) Complex Obligation (BEST) ---------------------------------------- (35) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Types: COND1 :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c3:c4:c5 -> c COND2 :: true:false -> s:0' -> s:0' -> c1:c2 gr :: s:0' -> s:0' -> true:false GR :: s:0' -> s:0' -> c3:c4:c5 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c -> c10:c11 -> c1:c2 p :: s:0' -> s:0' P :: s:0' -> c10:c11 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 NEQ :: s:0' -> s:0' -> c6:c7:c8:c9 c6 :: c6:c7:c8:c9 c7 :: c6:c7:c8:c9 c8 :: c6:c7:c8:c9 c9 :: c6:c7:c8:c9 -> c6:c7:c8:c9 c10 :: c10:c11 c11 :: c10:c11 cond1 :: s:0' -> s:0' -> cond1:cond2 cond2 :: true:false -> s:0' -> s:0' -> cond1:cond2 neq :: s:0' -> s:0' -> true:false hole_c1_12 :: c hole_s:0'2_12 :: s:0' hole_c1:c23_12 :: c1:c2 hole_c3:c4:c54_12 :: c3:c4:c5 hole_true:false5_12 :: true:false hole_c10:c116_12 :: c10:c11 hole_c6:c7:c8:c97_12 :: c6:c7:c8:c9 hole_cond1:cond28_12 :: cond1:cond2 gen_s:0'9_12 :: Nat -> s:0' gen_c3:c4:c510_12 :: Nat -> c3:c4:c5 gen_c6:c7:c8:c911_12 :: Nat -> c6:c7:c8:c9 Lemmas: gr(gen_s:0'9_12(n13_12), gen_s:0'9_12(n13_12)) -> false, rt in Omega(0) Generator Equations: gen_s:0'9_12(0) <=> 0' gen_s:0'9_12(+(x, 1)) <=> s(gen_s:0'9_12(x)) gen_c3:c4:c510_12(0) <=> c3 gen_c3:c4:c510_12(+(x, 1)) <=> c5(gen_c3:c4:c510_12(x)) gen_c6:c7:c8:c911_12(0) <=> c6 gen_c6:c7:c8:c911_12(+(x, 1)) <=> c9(gen_c6:c7:c8:c911_12(x)) The following defined symbols remain to be analysed: GR, COND1, NEQ, cond1, neq They will be analysed ascendingly in the following order: GR < COND1 ---------------------------------------- (36) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (37) BOUNDS(n^1, INF) ---------------------------------------- (38) Obligation: Innermost TRS: Rules: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Types: COND1 :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c3:c4:c5 -> c COND2 :: true:false -> s:0' -> s:0' -> c1:c2 gr :: s:0' -> s:0' -> true:false GR :: s:0' -> s:0' -> c3:c4:c5 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c -> c10:c11 -> c1:c2 p :: s:0' -> s:0' P :: s:0' -> c10:c11 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 NEQ :: s:0' -> s:0' -> c6:c7:c8:c9 c6 :: c6:c7:c8:c9 c7 :: c6:c7:c8:c9 c8 :: c6:c7:c8:c9 c9 :: c6:c7:c8:c9 -> c6:c7:c8:c9 c10 :: c10:c11 c11 :: c10:c11 cond1 :: s:0' -> s:0' -> cond1:cond2 cond2 :: true:false -> s:0' -> s:0' -> cond1:cond2 neq :: s:0' -> s:0' -> true:false hole_c1_12 :: c hole_s:0'2_12 :: s:0' hole_c1:c23_12 :: c1:c2 hole_c3:c4:c54_12 :: c3:c4:c5 hole_true:false5_12 :: true:false hole_c10:c116_12 :: c10:c11 hole_c6:c7:c8:c97_12 :: c6:c7:c8:c9 hole_cond1:cond28_12 :: cond1:cond2 gen_s:0'9_12 :: Nat -> s:0' gen_c3:c4:c510_12 :: Nat -> c3:c4:c5 gen_c6:c7:c8:c911_12 :: Nat -> c6:c7:c8:c9 Lemmas: gr(gen_s:0'9_12(n13_12), gen_s:0'9_12(n13_12)) -> false, rt in Omega(0) GR(gen_s:0'9_12(n364_12), gen_s:0'9_12(n364_12)) -> gen_c3:c4:c510_12(n364_12), rt in Omega(1 + n364_12) Generator Equations: gen_s:0'9_12(0) <=> 0' gen_s:0'9_12(+(x, 1)) <=> s(gen_s:0'9_12(x)) gen_c3:c4:c510_12(0) <=> c3 gen_c3:c4:c510_12(+(x, 1)) <=> c5(gen_c3:c4:c510_12(x)) gen_c6:c7:c8:c911_12(0) <=> c6 gen_c6:c7:c8:c911_12(+(x, 1)) <=> c9(gen_c6:c7:c8:c911_12(x)) The following defined symbols remain to be analysed: COND1, NEQ, cond1, neq ---------------------------------------- (39) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: NEQ(gen_s:0'9_12(n9654_12), gen_s:0'9_12(n9654_12)) -> gen_c6:c7:c8:c911_12(n9654_12), rt in Omega(1 + n9654_12) Induction Base: NEQ(gen_s:0'9_12(0), gen_s:0'9_12(0)) ->_R^Omega(1) c6 Induction Step: NEQ(gen_s:0'9_12(+(n9654_12, 1)), gen_s:0'9_12(+(n9654_12, 1))) ->_R^Omega(1) c9(NEQ(gen_s:0'9_12(n9654_12), gen_s:0'9_12(n9654_12))) ->_IH c9(gen_c6:c7:c8:c911_12(c9655_12)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (40) Obligation: Innermost TRS: Rules: COND1(s(z0), z1) -> c(COND2(gr(s(z0), z1), s(z0), z1), GR(s(z0), z1)) COND2(true, z0, z1) -> c1(COND1(z1, z1)) COND2(false, z0, z1) -> c2(COND1(p(z0), z1), P(z0)) GR(0', z0) -> c3 GR(s(z0), 0') -> c4 GR(s(z0), s(z1)) -> c5(GR(z0, z1)) NEQ(0', 0') -> c6 NEQ(0', s(z0)) -> c7 NEQ(s(z0), 0') -> c8 NEQ(s(z0), s(z1)) -> c9(NEQ(z0, z1)) P(0') -> c10 P(s(z0)) -> c11 cond1(s(z0), z1) -> cond2(gr(s(z0), z1), s(z0), z1) cond2(true, z0, z1) -> cond1(z1, z1) cond2(false, z0, z1) -> cond1(p(z0), z1) gr(0', z0) -> false gr(s(z0), 0') -> true gr(s(z0), s(z1)) -> gr(z0, z1) neq(0', 0') -> false neq(0', s(z0)) -> true neq(s(z0), 0') -> true neq(s(z0), s(z1)) -> neq(z0, z1) p(0') -> 0' p(s(z0)) -> z0 Types: COND1 :: s:0' -> s:0' -> c s :: s:0' -> s:0' c :: c1:c2 -> c3:c4:c5 -> c COND2 :: true:false -> s:0' -> s:0' -> c1:c2 gr :: s:0' -> s:0' -> true:false GR :: s:0' -> s:0' -> c3:c4:c5 true :: true:false c1 :: c -> c1:c2 false :: true:false c2 :: c -> c10:c11 -> c1:c2 p :: s:0' -> s:0' P :: s:0' -> c10:c11 0' :: s:0' c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 NEQ :: s:0' -> s:0' -> c6:c7:c8:c9 c6 :: c6:c7:c8:c9 c7 :: c6:c7:c8:c9 c8 :: c6:c7:c8:c9 c9 :: c6:c7:c8:c9 -> c6:c7:c8:c9 c10 :: c10:c11 c11 :: c10:c11 cond1 :: s:0' -> s:0' -> cond1:cond2 cond2 :: true:false -> s:0' -> s:0' -> cond1:cond2 neq :: s:0' -> s:0' -> true:false hole_c1_12 :: c hole_s:0'2_12 :: s:0' hole_c1:c23_12 :: c1:c2 hole_c3:c4:c54_12 :: c3:c4:c5 hole_true:false5_12 :: true:false hole_c10:c116_12 :: c10:c11 hole_c6:c7:c8:c97_12 :: c6:c7:c8:c9 hole_cond1:cond28_12 :: cond1:cond2 gen_s:0'9_12 :: Nat -> s:0' gen_c3:c4:c510_12 :: Nat -> c3:c4:c5 gen_c6:c7:c8:c911_12 :: Nat -> c6:c7:c8:c9 Lemmas: gr(gen_s:0'9_12(n13_12), gen_s:0'9_12(n13_12)) -> false, rt in Omega(0) GR(gen_s:0'9_12(n364_12), gen_s:0'9_12(n364_12)) -> gen_c3:c4:c510_12(n364_12), rt in Omega(1 + n364_12) NEQ(gen_s:0'9_12(n9654_12), gen_s:0'9_12(n9654_12)) -> gen_c6:c7:c8:c911_12(n9654_12), rt in Omega(1 + n9654_12) Generator Equations: gen_s:0'9_12(0) <=> 0' gen_s:0'9_12(+(x, 1)) <=> s(gen_s:0'9_12(x)) gen_c3:c4:c510_12(0) <=> c3 gen_c3:c4:c510_12(+(x, 1)) <=> c5(gen_c3:c4:c510_12(x)) gen_c6:c7:c8:c911_12(0) <=> c6 gen_c6:c7:c8:c911_12(+(x, 1)) <=> c9(gen_c6:c7:c8:c911_12(x)) The following defined symbols remain to be analysed: cond1, neq ---------------------------------------- (41) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: neq(gen_s:0'9_12(n33868_12), gen_s:0'9_12(n33868_12)) -> false, rt in Omega(0) Induction Base: neq(gen_s:0'9_12(0), gen_s:0'9_12(0)) ->_R^Omega(0) false Induction Step: neq(gen_s:0'9_12(+(n33868_12, 1)), gen_s:0'9_12(+(n33868_12, 1))) ->_R^Omega(0) neq(gen_s:0'9_12(n33868_12), gen_s:0'9_12(n33868_12)) ->_IH false We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (42) BOUNDS(1, INF)