WORST_CASE(Omega(n^1),O(n^1)) proof of input_c9a9TSj6a5.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^1). (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, 807 ms] (20) BOUNDS(1, n^1) (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), 419 ms] (32) BEST (33) proven lower bound (34) LowerBoundPropagationProof [FINISHED, 0 ms] (35) BOUNDS(n^1, INF) (36) typed CpxTrs (37) RewriteLemmaProof [LOWER BOUND(ID), 955 ms] (38) typed CpxTrs (39) RewriteLemmaProof [LOWER BOUND(ID), 877 ms] (40) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) pred(s(x)) -> x minus(x, 0) -> x minus(x, s(y)) -> pred(minus(x, y)) mod(0, y) -> 0 mod(s(x), 0) -> 0 mod(s(x), s(y)) -> if_mod(le(y, x), s(x), s(y)) if_mod(true, s(x), s(y)) -> mod(minus(x, y), s(y)) if_mod(false, s(x), s(y)) -> s(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: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0, z0) -> 0 mod(s(z0), 0) -> 0 mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0) -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0, z0) -> c6 MOD(s(z0), 0) -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 S tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0) -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0, z0) -> c6 MOD(s(z0), 0) -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 K tuples:none Defined Rule Symbols: le_2, pred_1, minus_2, mod_2, if_mod_3 Defined Pair Symbols: LE_2, PRED_1, MINUS_2, MOD_2, IF_MOD_3 Compound Symbols: c, c1, c2_1, c3, c4, c5_2, c6, c7, c8_2, c9_2, c10 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 7 trailing nodes: LE(s(z0), 0) -> c1 IF_MOD(false, s(z0), s(z1)) -> c10 MOD(s(z0), 0) -> c7 PRED(s(z0)) -> c3 MOD(0, z0) -> c6 MINUS(z0, 0) -> c4 LE(0, z0) -> c ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0, z0) -> 0 mod(s(z0), 0) -> 0 mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) S tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: le_2, pred_1, minus_2, mod_2, if_mod_3 Defined Pair Symbols: LE_2, MINUS_2, MOD_2, IF_MOD_3 Compound Symbols: c2_1, c5_2, c8_2, c9_2 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0, z0) -> 0 mod(s(z0), 0) -> 0 mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) S tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) K tuples:none Defined Rule Symbols: le_2, pred_1, minus_2, mod_2, if_mod_3 Defined Pair Symbols: LE_2, MOD_2, IF_MOD_3, MINUS_2 Compound Symbols: c2_1, c8_2, c9_2, c5_1 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: mod(0, z0) -> 0 mod(s(z0), 0) -> 0 mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) pred(s(z0)) -> z0 Tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) S tuples: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) K tuples:none Defined Rule Symbols: le_2, minus_2, pred_1 Defined Pair Symbols: LE_2, MOD_2, IF_MOD_3, MINUS_2 Compound Symbols: c2_1, c8_2, c9_2, c5_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^1). The TRS R consists of the following rules: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) The (relative) TRS S consists of the following rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) pred(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^1). The TRS R consists of the following rules: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) [1] MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) [1] IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) [1] MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) [1] le(0, z0) -> true [0] le(s(z0), 0) -> false [0] le(s(z0), s(z1)) -> le(z0, z1) [0] minus(z0, 0) -> z0 [0] minus(z0, s(z1)) -> pred(minus(z0, z1)) [0] pred(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: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) [1] MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) [1] IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) [1] MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) [1] le(0, z0) -> true [0] le(s(z0), 0) -> false [0] le(s(z0), s(z1)) -> le(z0, z1) [0] minus(z0, 0) -> z0 [0] minus(z0, s(z1)) -> pred(minus(z0, z1)) [0] pred(s(z0)) -> z0 [0] The TRS has the following type information: LE :: s:0 -> s:0 -> c2 s :: s:0 -> s:0 c2 :: c2 -> c2 MOD :: s:0 -> s:0 -> c8 c8 :: c9 -> c2 -> c8 IF_MOD :: true:false -> s:0 -> s:0 -> c9 le :: s:0 -> s:0 -> true:false true :: true:false c9 :: c8 -> c5 -> c9 minus :: s:0 -> s:0 -> s:0 MINUS :: s:0 -> s:0 -> c5 c5 :: c5 -> c5 0 :: s:0 false :: true:false pred :: s: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: le(v0, v1) -> null_le [0] minus(v0, v1) -> null_minus [0] pred(v0) -> null_pred [0] LE(v0, v1) -> null_LE [0] MOD(v0, v1) -> null_MOD [0] IF_MOD(v0, v1, v2) -> null_IF_MOD [0] MINUS(v0, v1) -> null_MINUS [0] And the following fresh constants: null_le, null_minus, null_pred, null_LE, null_MOD, null_IF_MOD, null_MINUS ---------------------------------------- (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: LE(s(z0), s(z1)) -> c2(LE(z0, z1)) [1] MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) [1] IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) [1] MINUS(z0, s(z1)) -> c5(MINUS(z0, z1)) [1] le(0, z0) -> true [0] le(s(z0), 0) -> false [0] le(s(z0), s(z1)) -> le(z0, z1) [0] minus(z0, 0) -> z0 [0] minus(z0, s(z1)) -> pred(minus(z0, z1)) [0] pred(s(z0)) -> z0 [0] le(v0, v1) -> null_le [0] minus(v0, v1) -> null_minus [0] pred(v0) -> null_pred [0] LE(v0, v1) -> null_LE [0] MOD(v0, v1) -> null_MOD [0] IF_MOD(v0, v1, v2) -> null_IF_MOD [0] MINUS(v0, v1) -> null_MINUS [0] The TRS has the following type information: LE :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred -> c2:null_LE s :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred c2 :: c2:null_LE -> c2:null_LE MOD :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred -> c8:null_MOD c8 :: c9:null_IF_MOD -> c2:null_LE -> c8:null_MOD IF_MOD :: true:false:null_le -> s:0:null_minus:null_pred -> s:0:null_minus:null_pred -> c9:null_IF_MOD le :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred -> true:false:null_le true :: true:false:null_le c9 :: c8:null_MOD -> c5:null_MINUS -> c9:null_IF_MOD minus :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred -> s:0:null_minus:null_pred MINUS :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred -> c5:null_MINUS c5 :: c5:null_MINUS -> c5:null_MINUS 0 :: s:0:null_minus:null_pred false :: true:false:null_le pred :: s:0:null_minus:null_pred -> s:0:null_minus:null_pred null_le :: true:false:null_le null_minus :: s:0:null_minus:null_pred null_pred :: s:0:null_minus:null_pred null_LE :: c2:null_LE null_MOD :: c8:null_MOD null_IF_MOD :: c9:null_IF_MOD null_MINUS :: c5:null_MINUS 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 0 => 0 false => 1 null_le => 0 null_minus => 0 null_pred => 0 null_LE => 0 null_MOD => 0 null_IF_MOD => 0 null_MINUS => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: IF_MOD(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 IF_MOD(z, z', z'') -{ 1 }-> 1 + MOD(minus(z0, z1), 1 + z1) + MINUS(z0, z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = 1 + z0, z'' = 1 + z1 LE(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 LE(z, z') -{ 1 }-> 1 + LE(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 MINUS(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 MINUS(z, z') -{ 1 }-> 1 + MINUS(z0, z1) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 MOD(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 MOD(z, z') -{ 1 }-> 1 + IF_MOD(le(z1, z0), 1 + z0, 1 + z1) + LE(z1, z0) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 le(z, z') -{ 0 }-> le(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 le(z, z') -{ 0 }-> 2 :|: z0 >= 0, z = 0, z' = z0 le(z, z') -{ 0 }-> 1 :|: z = 1 + z0, z0 >= 0, z' = 0 le(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 minus(z, z') -{ 0 }-> z0 :|: z = z0, z0 >= 0, z' = 0 minus(z, z') -{ 0 }-> pred(minus(z0, z1)) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 pred(z) -{ 0 }-> z0 :|: z = 1 + z0, z0 >= 0 pred(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, V6),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[fun1(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[fun2(V1, V, V6, Out)],[V1 >= 0,V >= 0,V6 >= 0]). eq(start(V1, V, V6),0,[fun3(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[le(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[pred(V1, Out)],[V1 >= 0]). eq(fun(V1, V, Out),1,[fun(V3, V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V1 = 1 + V3,V3 >= 0,V = 1 + V2]). eq(fun1(V1, V, Out),1,[le(V4, V5, Ret010),fun2(Ret010, 1 + V5, 1 + V4, Ret01),fun(V4, V5, Ret11)],[Out = 1 + Ret01 + Ret11,V4 >= 0,V1 = 1 + V5,V5 >= 0,V = 1 + V4]). eq(fun2(V1, V, V6, Out),1,[minus(V8, V7, Ret0101),fun1(Ret0101, 1 + V7, Ret011),fun3(V8, V7, Ret12)],[Out = 1 + Ret011 + Ret12,V1 = 2,V7 >= 0,V8 >= 0,V = 1 + V8,V6 = 1 + V7]). eq(fun3(V1, V, Out),1,[fun3(V9, V10, Ret13)],[Out = 1 + Ret13,V1 = V9,V10 >= 0,V9 >= 0,V = 1 + V10]). eq(le(V1, V, Out),0,[],[Out = 2,V11 >= 0,V1 = 0,V = V11]). eq(le(V1, V, Out),0,[],[Out = 1,V1 = 1 + V12,V12 >= 0,V = 0]). eq(le(V1, V, Out),0,[le(V14, V13, Ret)],[Out = Ret,V13 >= 0,V1 = 1 + V14,V14 >= 0,V = 1 + V13]). eq(minus(V1, V, Out),0,[],[Out = V15,V1 = V15,V15 >= 0,V = 0]). eq(minus(V1, V, Out),0,[minus(V17, V16, Ret0),pred(Ret0, Ret2)],[Out = Ret2,V1 = V17,V16 >= 0,V17 >= 0,V = 1 + V16]). eq(pred(V1, Out),0,[],[Out = V18,V1 = 1 + V18,V18 >= 0]). eq(le(V1, V, Out),0,[],[Out = 0,V20 >= 0,V19 >= 0,V1 = V20,V = V19]). eq(minus(V1, V, Out),0,[],[Out = 0,V22 >= 0,V21 >= 0,V1 = V22,V = V21]). eq(pred(V1, Out),0,[],[Out = 0,V23 >= 0,V1 = V23]). eq(fun(V1, V, Out),0,[],[Out = 0,V24 >= 0,V25 >= 0,V1 = V24,V = V25]). eq(fun1(V1, V, Out),0,[],[Out = 0,V26 >= 0,V27 >= 0,V1 = V26,V = V27]). eq(fun2(V1, V, V6, Out),0,[],[Out = 0,V29 >= 0,V6 = V30,V28 >= 0,V1 = V29,V = V28,V30 >= 0]). eq(fun3(V1, V, Out),0,[],[Out = 0,V32 >= 0,V31 >= 0,V1 = V32,V = V31]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(fun2(V1,V,V6,Out),[V1,V,V6],[Out]). input_output_vars(fun3(V1,V,Out),[V1,V],[Out]). input_output_vars(le(V1,V,Out),[V1,V],[Out]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). input_output_vars(pred(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive : [fun3/3] 2. non_recursive : [pred/2] 3. recursive [non_tail] : [minus/3] 4. recursive : [le/3] 5. recursive [non_tail] : [fun1/3,fun2/4] 6. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into fun3/3 2. SCC is partially evaluated into pred/2 3. SCC is partially evaluated into minus/3 4. SCC is partially evaluated into le/3 5. SCC is partially evaluated into fun1/3 6. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 18 is refined into CE [25] * CE 17 is refined into CE [26] ### Cost equations --> "Loop" of fun/3 * CEs [26] --> Loop 18 * CEs [25] --> Loop 19 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [18]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V V1 ### Specialization of cost equations fun3/3 * CE 16 is refined into CE [27] * CE 15 is refined into CE [28] ### Cost equations --> "Loop" of fun3/3 * CEs [28] --> Loop 20 * CEs [27] --> Loop 21 ### Ranking functions of CR fun3(V1,V,Out) * RF of phase [20]: [V] #### Partial ranking functions of CR fun3(V1,V,Out) * Partial RF of phase [20]: - RF of loop [20:1]: V ### Specialization of cost equations pred/2 * CE 23 is refined into CE [29] * CE 24 is refined into CE [30] ### Cost equations --> "Loop" of pred/2 * CEs [29] --> Loop 22 * CEs [30] --> Loop 23 ### Ranking functions of CR pred(V1,Out) #### Partial ranking functions of CR pred(V1,Out) ### Specialization of cost equations minus/3 * CE 11 is refined into CE [31] * CE 9 is refined into CE [32] * CE 10 is refined into CE [33,34] ### Cost equations --> "Loop" of minus/3 * CEs [34] --> Loop 24 * CEs [33] --> Loop 25 * CEs [31] --> Loop 26 * CEs [32] --> Loop 27 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [24]: [V] * RF of phase [25]: [V] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [24]: - RF of loop [24:1]: V * Partial RF of phase [25]: - RF of loop [25:1]: V ### Specialization of cost equations le/3 * CE 22 is refined into CE [35] * CE 20 is refined into CE [36] * CE 19 is refined into CE [37] * CE 21 is refined into CE [38] ### Cost equations --> "Loop" of le/3 * CEs [38] --> Loop 28 * CEs [35] --> Loop 29 * CEs [36] --> Loop 30 * CEs [37] --> Loop 31 ### Ranking functions of CR le(V1,V,Out) * RF of phase [28]: [V,V1] #### Partial ranking functions of CR le(V1,V,Out) * Partial RF of phase [28]: - RF of loop [28:1]: V V1 ### Specialization of cost equations fun1/3 * CE 12 is refined into CE [39,40,41,42,43,44,45,46] * CE 14 is refined into CE [47] * CE 13 is refined into CE [48,49,50,51,52,53,54,55,56,57] ### Cost equations --> "Loop" of fun1/3 * CEs [55,56] --> Loop 32 * CEs [57] --> Loop 33 * CEs [54] --> Loop 34 * CEs [53] --> Loop 35 * CEs [51,52] --> Loop 36 * CEs [50] --> Loop 37 * CEs [48] --> Loop 38 * CEs [49] --> Loop 39 * CEs [46] --> Loop 40 * CEs [42,44] --> Loop 41 * CEs [47] --> Loop 42 * CEs [39] --> Loop 43 * CEs [40,41,43,45] --> Loop 44 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [32,33,34]: [V1-1,V1-V+1] * RF of phase [38]: [V1] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [32,33,34]: - RF of loop [32:1,33:1,34:1]: V1-1 V1-V+1 * Partial RF of phase [38]: - RF of loop [38:1]: V1 ### Specialization of cost equations start/3 * CE 1 is refined into CE [58] * CE 2 is refined into CE [59,60,61,62,63,64,65,66,67,68,69,70,71] * CE 3 is refined into CE [72,73] * CE 4 is refined into CE [74,75,76,77,78] * CE 5 is refined into CE [79,80] * CE 6 is refined into CE [81,82,83,84,85] * CE 7 is refined into CE [86,87,88] * CE 8 is refined into CE [89,90] ### Cost equations --> "Loop" of start/3 * CEs [75] --> Loop 45 * CEs [82,86] --> Loop 46 * CEs [59,60,61,62,63,64,65,66,67,68,69,70,71] --> Loop 47 * CEs [58,72,73,74,76,77,78,79,80,81,83,84,85,87,88,89,90] --> Loop 48 ### Ranking functions of CR start(V1,V,V6) #### Partial ranking functions of CR start(V1,V,V6) Computing Bounds ===================================== #### Cost of chains of fun(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 fun3(V1,V,Out): * Chain [[20],21]: 1*it(20)+0 Such that:it(20) =< Out with precondition: [V1>=0,Out>=1,V>=Out] * Chain [21]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of pred(V1,Out): * Chain [23]: 0 with precondition: [Out=0,V1>=0] * Chain [22]: 0 with precondition: [V1=Out+1,V1>=1] #### Cost of chains of minus(V1,V,Out): * Chain [[25],[24],27]: 0 with precondition: [Out=0,V1>=1,V>=2] * Chain [[25],27]: 0 with precondition: [Out=0,V1>=0,V>=1] * Chain [[25],26]: 0 with precondition: [Out=0,V1>=0,V>=1] * Chain [[24],27]: 0 with precondition: [V1=Out+V,V>=1,V1>=V] * Chain [27]: 0 with precondition: [V=0,V1=Out,V1>=0] * Chain [26]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of le(V1,V,Out): * Chain [[28],31]: 0 with precondition: [Out=2,V1>=1,V>=V1] * Chain [[28],30]: 0 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[28],29]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [31]: 0 with precondition: [V1=0,Out=2,V>=0] * Chain [30]: 0 with precondition: [V=0,Out=1,V1>=1] * Chain [29]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,V,Out): * Chain [[38],44]: 2*it(38)+1 Such that:it(38) =< Out/2 with precondition: [V=1,Out>=3,2*V1>=Out+1] * Chain [[38],43]: 2*it(38)+1 Such that:it(38) =< Out/2 with precondition: [V=1,Out>=3,2*V1>=Out+1] * Chain [[38],42]: 2*it(38)+0 Such that:it(38) =< Out/2 with precondition: [V=1,Out>=2,2*V1>=Out] * Chain [[38],39,42]: 2*it(38)+2 Such that:it(38) =< Out/2 with precondition: [V=1,Out>=4,2*V1>=Out] * Chain [[32,33,34],44]: 6*it(32)+4*s(9)+1 Such that:aux(4) =< V1-V+1 aux(7) =< V1 it(32) =< aux(7) it(32) =< aux(4) s(9) =< aux(7) with precondition: [V>=2,Out>=3,V1>=V+1,2*V1>=Out+1] * Chain [[32,33,34],42]: 6*it(32)+4*s(9)+0 Such that:aux(4) =< V1-V+1 aux(8) =< V1 it(32) =< aux(8) it(32) =< aux(4) s(9) =< aux(8) with precondition: [V>=2,Out>=2,V1>=V,2*V1>=Out] * Chain [[32,33,34],41]: 6*it(32)+5*s(9)+1*s(13)+1 Such that:aux(4) =< V1-V+1 s(13) =< V aux(9) =< V1 s(9) =< aux(9) it(32) =< aux(9) it(32) =< aux(4) with precondition: [V>=2,Out>=4,V1>=V+2,2*V1>=Out+2] * Chain [[32,33,34],40]: 6*it(32)+4*s(9)+1*s(15)+1 Such that:aux(3) =< V1 aux(4) =< V1-V+1 s(15) =< V aux(10) =< V1-V it(32) =< aux(3) s(10) =< aux(3) it(32) =< aux(4) it(32) =< aux(10) s(10) =< aux(10) s(9) =< s(10) with precondition: [V>=2,Out>=4,V1>=2*V,2*V1>=Out+V] * Chain [[32,33,34],37,42]: 6*it(32)+4*s(9)+2 Such that:aux(3) =< V1 aux(4) =< V1-V+1 aux(11) =< V1-V it(32) =< aux(3) s(10) =< aux(3) it(32) =< aux(4) it(32) =< aux(11) s(10) =< aux(11) s(9) =< s(10) with precondition: [V>=2,Out>=4,V1>=2*V,2*V1+2>=2*V+Out] * Chain [[32,33,34],36,42]: 6*it(32)+4*s(9)+2*s(16)+2 Such that:aux(3) =< V1 aux(4) =< V1-V+1 aux(12) =< V aux(13) =< V1-V s(16) =< aux(12) it(32) =< aux(3) s(10) =< aux(3) it(32) =< aux(4) it(32) =< aux(13) s(10) =< aux(13) s(9) =< s(10) with precondition: [V>=2,Out>=5,V1>=2*V,2*V1+1>=Out+V] * Chain [[32,33,34],35,42]: 6*it(32)+4*s(9)+2*s(18)+2 Such that:aux(3) =< V1 aux(4) =< V1-V+1 aux(14) =< V aux(15) =< V1-V s(18) =< aux(14) it(32) =< aux(3) s(10) =< aux(3) it(32) =< aux(4) it(32) =< aux(15) s(10) =< aux(15) s(9) =< s(10) with precondition: [V>=2,Out>=6,V1>=2*V,2*V1>=Out] * Chain [44]: 1 with precondition: [Out=1,V1>=1,V>=1] * Chain [43]: 1 with precondition: [V=1,Out=1,V1>=1] * Chain [42]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [41]: 1*s(13)+1*s(14)+1 Such that:s(14) =< V1 s(13) =< V with precondition: [Out>=2,V1>=Out,V>=Out] * Chain [40]: 1*s(15)+1 Such that:s(15) =< V with precondition: [Out>=2,V1>=V,V>=Out] * Chain [39,42]: 2 with precondition: [V=1,Out=2,V1>=1] * Chain [37,42]: 2 with precondition: [Out=2,V>=2,V1>=V] * Chain [36,42]: 2*s(16)+2 Such that:aux(12) =< V s(16) =< aux(12) with precondition: [Out>=3,V1>=V,V+1>=Out] * Chain [35,42]: 2*s(18)+2 Such that:aux(14) =< V s(18) =< aux(14) with precondition: [Out>=4,V1>=V,2*V>=Out] #### Cost of chains of start(V1,V,V6): * Chain [48]: 14*s(71)+24*s(77)+16*s(79)+14*s(80)+18*s(81)+2 Such that:s(73) =< V1-V s(74) =< V1-V+1 aux(21) =< V1 aux(22) =< V s(80) =< aux(21) s(71) =< aux(22) s(77) =< aux(21) s(78) =< aux(21) s(77) =< s(74) s(77) =< s(73) s(78) =< s(73) s(79) =< s(78) s(81) =< aux(21) s(81) =< s(74) with precondition: [V1>=0] * Chain [47]: 8*s(86)+29*s(87)+48*s(95)+32*s(97)+28*s(98)+36*s(99)+3 Such that:s(85) =< V aux(25) =< V-2*V6 aux(26) =< V-2*V6+1 aux(27) =< V-V6 aux(28) =< V6 s(98) =< aux(27) s(87) =< aux(28) s(86) =< s(85) s(95) =< aux(27) s(96) =< aux(27) s(95) =< aux(26) s(95) =< aux(25) s(96) =< aux(25) s(97) =< s(96) s(99) =< aux(27) s(99) =< aux(26) with precondition: [V1=2,V>=1,V6>=1] * Chain [46]: 0 with precondition: [V=0,V1>=0] * Chain [45]: 8*s(117)+2 Such that:s(116) =< V1 s(117) =< s(116) with precondition: [V=1,V1>=1] Closed-form bounds of start(V1,V,V6): ------------------------------------- * Chain [48] with precondition: [V1>=0] - Upper bound: 72*V1+2+nat(V)*14 - Complexity: n * Chain [47] with precondition: [V1=2,V>=1,V6>=1] - Upper bound: 8*V+29*V6+3+nat(V-V6)*144 - Complexity: n * Chain [46] with precondition: [V=0,V1>=0] - Upper bound: 0 - Complexity: constant * Chain [45] with precondition: [V=1,V1>=1] - Upper bound: 8*V1+2 - Complexity: n ### Maximum cost of start(V1,V,V6): max([nat(V)*14+64*V1+(8*V1+2),nat(V)*8+3+nat(V6)*29+nat(V-V6)*144]) Asymptotic class: n * Total analysis performed in 720 ms. ---------------------------------------- (20) BOUNDS(1, n^1) ---------------------------------------- (21) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (22) Obligation: Complexity Dependency Tuples Problem Rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0, z0) -> 0 mod(s(z0), 0) -> 0 mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0) -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0, z0) -> c6 MOD(s(z0), 0) -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 S tuples: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0) -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0, z0) -> c6 MOD(s(z0), 0) -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 K tuples:none Defined Rule Symbols: le_2, pred_1, minus_2, mod_2, if_mod_3 Defined Pair Symbols: LE_2, PRED_1, MINUS_2, MOD_2, IF_MOD_3 Compound Symbols: c, c1, c2_1, c3, c4, c5_2, c6, c7, c8_2, c9_2, c10 ---------------------------------------- (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: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0) -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0, z0) -> c6 MOD(s(z0), 0) -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 The (relative) TRS S consists of the following rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0) -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0, z0) -> 0 mod(s(z0), 0) -> 0 mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(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: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 The (relative) TRS S consists of the following rules: le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Rewrite Strategy: INNERMOST ---------------------------------------- (27) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (28) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 PRED :: 0':s -> c3 c3 :: c3 MINUS :: 0':s -> 0':s -> c4:c5 c4 :: c4:c5 c5 :: c3 -> c4:c5 -> c4:c5 minus :: 0':s -> 0':s -> 0':s MOD :: 0':s -> 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c9:c10 -> c:c1:c2 -> c6:c7:c8 IF_MOD :: true:false -> 0':s -> 0':s -> c9:c10 le :: 0':s -> 0':s -> true:false true :: true:false c9 :: c6:c7:c8 -> c4:c5 -> c9:c10 false :: true:false c10 :: c9:c10 pred :: 0':s -> 0':s mod :: 0':s -> 0':s -> 0':s if_mod :: true:false -> 0':s -> 0':s -> 0':s hole_c:c1:c21_11 :: c:c1:c2 hole_0':s2_11 :: 0':s hole_c33_11 :: c3 hole_c4:c54_11 :: c4:c5 hole_c6:c7:c85_11 :: c6:c7:c8 hole_c9:c106_11 :: c9:c10 hole_true:false7_11 :: true:false gen_c:c1:c28_11 :: Nat -> c:c1:c2 gen_0':s9_11 :: Nat -> 0':s gen_c4:c510_11 :: Nat -> c4:c5 ---------------------------------------- (29) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: LE, MINUS, minus, MOD, le, mod They will be analysed ascendingly in the following order: LE < MOD minus < MINUS MINUS < MOD minus < MOD minus < mod le < MOD le < mod ---------------------------------------- (30) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 PRED :: 0':s -> c3 c3 :: c3 MINUS :: 0':s -> 0':s -> c4:c5 c4 :: c4:c5 c5 :: c3 -> c4:c5 -> c4:c5 minus :: 0':s -> 0':s -> 0':s MOD :: 0':s -> 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c9:c10 -> c:c1:c2 -> c6:c7:c8 IF_MOD :: true:false -> 0':s -> 0':s -> c9:c10 le :: 0':s -> 0':s -> true:false true :: true:false c9 :: c6:c7:c8 -> c4:c5 -> c9:c10 false :: true:false c10 :: c9:c10 pred :: 0':s -> 0':s mod :: 0':s -> 0':s -> 0':s if_mod :: true:false -> 0':s -> 0':s -> 0':s hole_c:c1:c21_11 :: c:c1:c2 hole_0':s2_11 :: 0':s hole_c33_11 :: c3 hole_c4:c54_11 :: c4:c5 hole_c6:c7:c85_11 :: c6:c7:c8 hole_c9:c106_11 :: c9:c10 hole_true:false7_11 :: true:false gen_c:c1:c28_11 :: Nat -> c:c1:c2 gen_0':s9_11 :: Nat -> 0':s gen_c4:c510_11 :: Nat -> c4:c5 Generator Equations: gen_c:c1:c28_11(0) <=> c gen_c:c1:c28_11(+(x, 1)) <=> c2(gen_c:c1:c28_11(x)) gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) gen_c4:c510_11(0) <=> c4 gen_c4:c510_11(+(x, 1)) <=> c5(c3, gen_c4:c510_11(x)) The following defined symbols remain to be analysed: LE, MINUS, minus, MOD, le, mod They will be analysed ascendingly in the following order: LE < MOD minus < MINUS MINUS < MOD minus < MOD minus < mod le < MOD le < mod ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LE(gen_0':s9_11(n12_11), gen_0':s9_11(n12_11)) -> gen_c:c1:c28_11(n12_11), rt in Omega(1 + n12_11) Induction Base: LE(gen_0':s9_11(0), gen_0':s9_11(0)) ->_R^Omega(1) c Induction Step: LE(gen_0':s9_11(+(n12_11, 1)), gen_0':s9_11(+(n12_11, 1))) ->_R^Omega(1) c2(LE(gen_0':s9_11(n12_11), gen_0':s9_11(n12_11))) ->_IH c2(gen_c:c1:c28_11(c13_11)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (32) Complex Obligation (BEST) ---------------------------------------- (33) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 PRED :: 0':s -> c3 c3 :: c3 MINUS :: 0':s -> 0':s -> c4:c5 c4 :: c4:c5 c5 :: c3 -> c4:c5 -> c4:c5 minus :: 0':s -> 0':s -> 0':s MOD :: 0':s -> 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c9:c10 -> c:c1:c2 -> c6:c7:c8 IF_MOD :: true:false -> 0':s -> 0':s -> c9:c10 le :: 0':s -> 0':s -> true:false true :: true:false c9 :: c6:c7:c8 -> c4:c5 -> c9:c10 false :: true:false c10 :: c9:c10 pred :: 0':s -> 0':s mod :: 0':s -> 0':s -> 0':s if_mod :: true:false -> 0':s -> 0':s -> 0':s hole_c:c1:c21_11 :: c:c1:c2 hole_0':s2_11 :: 0':s hole_c33_11 :: c3 hole_c4:c54_11 :: c4:c5 hole_c6:c7:c85_11 :: c6:c7:c8 hole_c9:c106_11 :: c9:c10 hole_true:false7_11 :: true:false gen_c:c1:c28_11 :: Nat -> c:c1:c2 gen_0':s9_11 :: Nat -> 0':s gen_c4:c510_11 :: Nat -> c4:c5 Generator Equations: gen_c:c1:c28_11(0) <=> c gen_c:c1:c28_11(+(x, 1)) <=> c2(gen_c:c1:c28_11(x)) gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) gen_c4:c510_11(0) <=> c4 gen_c4:c510_11(+(x, 1)) <=> c5(c3, gen_c4:c510_11(x)) The following defined symbols remain to be analysed: LE, MINUS, minus, MOD, le, mod They will be analysed ascendingly in the following order: LE < MOD minus < MINUS MINUS < MOD minus < MOD minus < mod le < MOD le < mod ---------------------------------------- (34) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (35) BOUNDS(n^1, INF) ---------------------------------------- (36) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 PRED :: 0':s -> c3 c3 :: c3 MINUS :: 0':s -> 0':s -> c4:c5 c4 :: c4:c5 c5 :: c3 -> c4:c5 -> c4:c5 minus :: 0':s -> 0':s -> 0':s MOD :: 0':s -> 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c9:c10 -> c:c1:c2 -> c6:c7:c8 IF_MOD :: true:false -> 0':s -> 0':s -> c9:c10 le :: 0':s -> 0':s -> true:false true :: true:false c9 :: c6:c7:c8 -> c4:c5 -> c9:c10 false :: true:false c10 :: c9:c10 pred :: 0':s -> 0':s mod :: 0':s -> 0':s -> 0':s if_mod :: true:false -> 0':s -> 0':s -> 0':s hole_c:c1:c21_11 :: c:c1:c2 hole_0':s2_11 :: 0':s hole_c33_11 :: c3 hole_c4:c54_11 :: c4:c5 hole_c6:c7:c85_11 :: c6:c7:c8 hole_c9:c106_11 :: c9:c10 hole_true:false7_11 :: true:false gen_c:c1:c28_11 :: Nat -> c:c1:c2 gen_0':s9_11 :: Nat -> 0':s gen_c4:c510_11 :: Nat -> c4:c5 Lemmas: LE(gen_0':s9_11(n12_11), gen_0':s9_11(n12_11)) -> gen_c:c1:c28_11(n12_11), rt in Omega(1 + n12_11) Generator Equations: gen_c:c1:c28_11(0) <=> c gen_c:c1:c28_11(+(x, 1)) <=> c2(gen_c:c1:c28_11(x)) gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) gen_c4:c510_11(0) <=> c4 gen_c4:c510_11(+(x, 1)) <=> c5(c3, gen_c4:c510_11(x)) The following defined symbols remain to be analysed: minus, MINUS, MOD, le, mod They will be analysed ascendingly in the following order: minus < MINUS MINUS < MOD minus < MOD minus < mod le < MOD le < mod ---------------------------------------- (37) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: minus(gen_0':s9_11(a), gen_0':s9_11(+(1, n610_11))) -> *11_11, rt in Omega(0) Induction Base: minus(gen_0':s9_11(a), gen_0':s9_11(+(1, 0))) Induction Step: minus(gen_0':s9_11(a), gen_0':s9_11(+(1, +(n610_11, 1)))) ->_R^Omega(0) pred(minus(gen_0':s9_11(a), gen_0':s9_11(+(1, n610_11)))) ->_IH pred(*11_11) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (38) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 PRED :: 0':s -> c3 c3 :: c3 MINUS :: 0':s -> 0':s -> c4:c5 c4 :: c4:c5 c5 :: c3 -> c4:c5 -> c4:c5 minus :: 0':s -> 0':s -> 0':s MOD :: 0':s -> 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c9:c10 -> c:c1:c2 -> c6:c7:c8 IF_MOD :: true:false -> 0':s -> 0':s -> c9:c10 le :: 0':s -> 0':s -> true:false true :: true:false c9 :: c6:c7:c8 -> c4:c5 -> c9:c10 false :: true:false c10 :: c9:c10 pred :: 0':s -> 0':s mod :: 0':s -> 0':s -> 0':s if_mod :: true:false -> 0':s -> 0':s -> 0':s hole_c:c1:c21_11 :: c:c1:c2 hole_0':s2_11 :: 0':s hole_c33_11 :: c3 hole_c4:c54_11 :: c4:c5 hole_c6:c7:c85_11 :: c6:c7:c8 hole_c9:c106_11 :: c9:c10 hole_true:false7_11 :: true:false gen_c:c1:c28_11 :: Nat -> c:c1:c2 gen_0':s9_11 :: Nat -> 0':s gen_c4:c510_11 :: Nat -> c4:c5 Lemmas: LE(gen_0':s9_11(n12_11), gen_0':s9_11(n12_11)) -> gen_c:c1:c28_11(n12_11), rt in Omega(1 + n12_11) minus(gen_0':s9_11(a), gen_0':s9_11(+(1, n610_11))) -> *11_11, rt in Omega(0) Generator Equations: gen_c:c1:c28_11(0) <=> c gen_c:c1:c28_11(+(x, 1)) <=> c2(gen_c:c1:c28_11(x)) gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) gen_c4:c510_11(0) <=> c4 gen_c4:c510_11(+(x, 1)) <=> c5(c3, gen_c4:c510_11(x)) The following defined symbols remain to be analysed: MINUS, MOD, le, mod They will be analysed ascendingly in the following order: MINUS < MOD le < MOD le < mod ---------------------------------------- (39) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: le(gen_0':s9_11(n18559_11), gen_0':s9_11(n18559_11)) -> true, rt in Omega(0) Induction Base: le(gen_0':s9_11(0), gen_0':s9_11(0)) ->_R^Omega(0) true Induction Step: le(gen_0':s9_11(+(n18559_11, 1)), gen_0':s9_11(+(n18559_11, 1))) ->_R^Omega(0) le(gen_0':s9_11(n18559_11), gen_0':s9_11(n18559_11)) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (40) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) PRED(s(z0)) -> c3 MINUS(z0, 0') -> c4 MINUS(z0, s(z1)) -> c5(PRED(minus(z0, z1)), MINUS(z0, z1)) MOD(0', z0) -> c6 MOD(s(z0), 0') -> c7 MOD(s(z0), s(z1)) -> c8(IF_MOD(le(z1, z0), s(z0), s(z1)), LE(z1, z0)) IF_MOD(true, s(z0), s(z1)) -> c9(MOD(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF_MOD(false, s(z0), s(z1)) -> c10 le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) pred(s(z0)) -> z0 minus(z0, 0') -> z0 minus(z0, s(z1)) -> pred(minus(z0, z1)) mod(0', z0) -> 0' mod(s(z0), 0') -> 0' mod(s(z0), s(z1)) -> if_mod(le(z1, z0), s(z0), s(z1)) if_mod(true, s(z0), s(z1)) -> mod(minus(z0, z1), s(z1)) if_mod(false, s(z0), s(z1)) -> s(z0) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 PRED :: 0':s -> c3 c3 :: c3 MINUS :: 0':s -> 0':s -> c4:c5 c4 :: c4:c5 c5 :: c3 -> c4:c5 -> c4:c5 minus :: 0':s -> 0':s -> 0':s MOD :: 0':s -> 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 c8 :: c9:c10 -> c:c1:c2 -> c6:c7:c8 IF_MOD :: true:false -> 0':s -> 0':s -> c9:c10 le :: 0':s -> 0':s -> true:false true :: true:false c9 :: c6:c7:c8 -> c4:c5 -> c9:c10 false :: true:false c10 :: c9:c10 pred :: 0':s -> 0':s mod :: 0':s -> 0':s -> 0':s if_mod :: true:false -> 0':s -> 0':s -> 0':s hole_c:c1:c21_11 :: c:c1:c2 hole_0':s2_11 :: 0':s hole_c33_11 :: c3 hole_c4:c54_11 :: c4:c5 hole_c6:c7:c85_11 :: c6:c7:c8 hole_c9:c106_11 :: c9:c10 hole_true:false7_11 :: true:false gen_c:c1:c28_11 :: Nat -> c:c1:c2 gen_0':s9_11 :: Nat -> 0':s gen_c4:c510_11 :: Nat -> c4:c5 Lemmas: LE(gen_0':s9_11(n12_11), gen_0':s9_11(n12_11)) -> gen_c:c1:c28_11(n12_11), rt in Omega(1 + n12_11) minus(gen_0':s9_11(a), gen_0':s9_11(+(1, n610_11))) -> *11_11, rt in Omega(0) le(gen_0':s9_11(n18559_11), gen_0':s9_11(n18559_11)) -> true, rt in Omega(0) Generator Equations: gen_c:c1:c28_11(0) <=> c gen_c:c1:c28_11(+(x, 1)) <=> c2(gen_c:c1:c28_11(x)) gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) gen_c4:c510_11(0) <=> c4 gen_c4:c510_11(+(x, 1)) <=> c5(c3, gen_c4:c510_11(x)) The following defined symbols remain to be analysed: MOD, mod