/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^2), O(n^2)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtRuleRemovalProof [UPPER BOUND(ADD(n^1)), 86 ms] (6) CdtProblem (7) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 47 ms] (8) CdtProblem (9) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 45 ms] (10) CdtProblem (11) SIsEmptyProof [BOTH BOUNDS(ID, ID), 0 ms] (12) BOUNDS(1, 1) (13) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxTRS (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), 284 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), 80 ms] (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 120 ms] (28) proven lower bound (29) LowerBoundPropagationProof [FINISHED, 0 ms] (30) BOUNDS(n^2, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). The TRS R consists of the following rules: sqr(0) -> 0 sqr(s(x)) -> +(sqr(x), s(double(x))) double(0) -> 0 double(s(x)) -> s(s(double(x))) +(x, 0) -> x +(x, s(y)) -> s(+(x, y)) sqr(s(x)) -> s(+(sqr(x), double(x))) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS to CDT ---------------------------------------- (2) Obligation: Complexity Dependency Tuples Problem Rules: sqr(0) -> 0 sqr(s(z0)) -> +(sqr(z0), s(double(z0))) sqr(s(z0)) -> s(+(sqr(z0), double(z0))) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) +(z0, 0) -> z0 +(z0, s(z1)) -> s(+(z0, z1)) Tuples: SQR(0) -> c SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(0) -> c3 DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, 0) -> c5 +'(z0, s(z1)) -> c6(+'(z0, z1)) S tuples: SQR(0) -> c SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(0) -> c3 DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, 0) -> c5 +'(z0, s(z1)) -> c6(+'(z0, z1)) K tuples:none Defined Rule Symbols: sqr_1, double_1, +_2 Defined Pair Symbols: SQR_1, DOUBLE_1, +'_2 Compound Symbols: c, c1_3, c2_3, c3, c4_1, c5, c6_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing nodes: +'(z0, 0) -> c5 SQR(0) -> c DOUBLE(0) -> c3 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: sqr(0) -> 0 sqr(s(z0)) -> +(sqr(z0), s(double(z0))) sqr(s(z0)) -> s(+(sqr(z0), double(z0))) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) +(z0, 0) -> z0 +(z0, s(z1)) -> s(+(z0, z1)) Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) S tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) K tuples:none Defined Rule Symbols: sqr_1, double_1, +_2 Defined Pair Symbols: SQR_1, DOUBLE_1, +'_2 Compound Symbols: c1_3, c2_3, c4_1, c6_1 ---------------------------------------- (5) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) We considered the (Usable) Rules:none And the Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(+(x_1, x_2)) = [3] POL(+'(x_1, x_2)) = 0 POL(0) = [3] POL(DOUBLE(x_1)) = [3] POL(SQR(x_1)) = [2]x_1 POL(c1(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c2(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c4(x_1)) = x_1 POL(c6(x_1)) = x_1 POL(double(x_1)) = 0 POL(s(x_1)) = [2] + x_1 POL(sqr(x_1)) = [3] ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: sqr(0) -> 0 sqr(s(z0)) -> +(sqr(z0), s(double(z0))) sqr(s(z0)) -> s(+(sqr(z0), double(z0))) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) +(z0, 0) -> z0 +(z0, s(z1)) -> s(+(z0, z1)) Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) S tuples: DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) K tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) Defined Rule Symbols: sqr_1, double_1, +_2 Defined Pair Symbols: SQR_1, DOUBLE_1, +'_2 Compound Symbols: c1_3, c2_3, c4_1, c6_1 ---------------------------------------- (7) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. DOUBLE(s(z0)) -> c4(DOUBLE(z0)) We considered the (Usable) Rules:none And the Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(+(x_1, x_2)) = [2] POL(+'(x_1, x_2)) = 0 POL(0) = 0 POL(DOUBLE(x_1)) = x_1 POL(SQR(x_1)) = x_1^2 POL(c1(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c2(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c4(x_1)) = x_1 POL(c6(x_1)) = x_1 POL(double(x_1)) = 0 POL(s(x_1)) = [1] + x_1 POL(sqr(x_1)) = 0 ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: sqr(0) -> 0 sqr(s(z0)) -> +(sqr(z0), s(double(z0))) sqr(s(z0)) -> s(+(sqr(z0), double(z0))) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) +(z0, 0) -> z0 +(z0, s(z1)) -> s(+(z0, z1)) Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) S tuples: +'(z0, s(z1)) -> c6(+'(z0, z1)) K tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) Defined Rule Symbols: sqr_1, double_1, +_2 Defined Pair Symbols: SQR_1, DOUBLE_1, +'_2 Compound Symbols: c1_3, c2_3, c4_1, c6_1 ---------------------------------------- (9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. +'(z0, s(z1)) -> c6(+'(z0, z1)) We considered the (Usable) Rules: double(0) -> 0 double(s(z0)) -> s(s(double(z0))) And the Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(+(x_1, x_2)) = [2] + [2]x_2 POL(+'(x_1, x_2)) = x_2 POL(0) = 0 POL(DOUBLE(x_1)) = 0 POL(SQR(x_1)) = x_1^2 POL(c1(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c2(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c4(x_1)) = x_1 POL(c6(x_1)) = x_1 POL(double(x_1)) = [2]x_1 POL(s(x_1)) = [1] + x_1 POL(sqr(x_1)) = [2] + [2]x_1^2 ---------------------------------------- (10) Obligation: Complexity Dependency Tuples Problem Rules: sqr(0) -> 0 sqr(s(z0)) -> +(sqr(z0), s(double(z0))) sqr(s(z0)) -> s(+(sqr(z0), double(z0))) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) +(z0, 0) -> z0 +(z0, s(z1)) -> s(+(z0, z1)) Tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) S tuples:none K tuples: SQR(s(z0)) -> c1(+'(sqr(z0), s(double(z0))), SQR(z0), DOUBLE(z0)) SQR(s(z0)) -> c2(+'(sqr(z0), double(z0)), SQR(z0), DOUBLE(z0)) DOUBLE(s(z0)) -> c4(DOUBLE(z0)) +'(z0, s(z1)) -> c6(+'(z0, z1)) Defined Rule Symbols: sqr_1, double_1, +_2 Defined Pair Symbols: SQR_1, DOUBLE_1, +'_2 Compound Symbols: c1_3, c2_3, c4_1, c6_1 ---------------------------------------- (11) SIsEmptyProof (BOTH BOUNDS(ID, ID)) The set S is empty ---------------------------------------- (12) BOUNDS(1, 1) ---------------------------------------- (13) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (14) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, INF). The TRS R consists of the following rules: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) Obligation: Innermost TRS: Rules: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) Types: sqr :: 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s +' :: 0':s -> 0':s -> 0':s double :: 0':s -> 0':s hole_0':s1_0 :: 0':s gen_0':s2_0 :: Nat -> 0':s ---------------------------------------- (17) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: sqr, +', double They will be analysed ascendingly in the following order: +' < sqr double < sqr ---------------------------------------- (18) Obligation: Innermost TRS: Rules: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) Types: sqr :: 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s +' :: 0':s -> 0':s -> 0':s double :: 0':s -> 0':s hole_0':s1_0 :: 0':s gen_0':s2_0 :: Nat -> 0':s Generator Equations: gen_0':s2_0(0) <=> 0' gen_0':s2_0(+(x, 1)) <=> s(gen_0':s2_0(x)) The following defined symbols remain to be analysed: +', sqr, double They will be analysed ascendingly in the following order: +' < sqr double < sqr ---------------------------------------- (19) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: +'(gen_0':s2_0(a), gen_0':s2_0(n4_0)) -> gen_0':s2_0(+(n4_0, a)), rt in Omega(1 + n4_0) Induction Base: +'(gen_0':s2_0(a), gen_0':s2_0(0)) ->_R^Omega(1) gen_0':s2_0(a) Induction Step: +'(gen_0':s2_0(a), gen_0':s2_0(+(n4_0, 1))) ->_R^Omega(1) s(+'(gen_0':s2_0(a), gen_0':s2_0(n4_0))) ->_IH s(gen_0':s2_0(+(a, c5_0))) 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: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) Types: sqr :: 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s +' :: 0':s -> 0':s -> 0':s double :: 0':s -> 0':s hole_0':s1_0 :: 0':s gen_0':s2_0 :: Nat -> 0':s Generator Equations: gen_0':s2_0(0) <=> 0' gen_0':s2_0(+(x, 1)) <=> s(gen_0':s2_0(x)) The following defined symbols remain to be analysed: +', sqr, double They will be analysed ascendingly in the following order: +' < sqr double < sqr ---------------------------------------- (22) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (23) BOUNDS(n^1, INF) ---------------------------------------- (24) Obligation: Innermost TRS: Rules: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) Types: sqr :: 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s +' :: 0':s -> 0':s -> 0':s double :: 0':s -> 0':s hole_0':s1_0 :: 0':s gen_0':s2_0 :: Nat -> 0':s Lemmas: +'(gen_0':s2_0(a), gen_0':s2_0(n4_0)) -> gen_0':s2_0(+(n4_0, a)), rt in Omega(1 + n4_0) Generator Equations: gen_0':s2_0(0) <=> 0' gen_0':s2_0(+(x, 1)) <=> s(gen_0':s2_0(x)) The following defined symbols remain to be analysed: double, sqr They will be analysed ascendingly in the following order: double < sqr ---------------------------------------- (25) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: double(gen_0':s2_0(n513_0)) -> gen_0':s2_0(*(2, n513_0)), rt in Omega(1 + n513_0) Induction Base: double(gen_0':s2_0(0)) ->_R^Omega(1) 0' Induction Step: double(gen_0':s2_0(+(n513_0, 1))) ->_R^Omega(1) s(s(double(gen_0':s2_0(n513_0)))) ->_IH s(s(gen_0':s2_0(*(2, c514_0)))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (26) Obligation: Innermost TRS: Rules: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) Types: sqr :: 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s +' :: 0':s -> 0':s -> 0':s double :: 0':s -> 0':s hole_0':s1_0 :: 0':s gen_0':s2_0 :: Nat -> 0':s Lemmas: +'(gen_0':s2_0(a), gen_0':s2_0(n4_0)) -> gen_0':s2_0(+(n4_0, a)), rt in Omega(1 + n4_0) double(gen_0':s2_0(n513_0)) -> gen_0':s2_0(*(2, n513_0)), rt in Omega(1 + n513_0) Generator Equations: gen_0':s2_0(0) <=> 0' gen_0':s2_0(+(x, 1)) <=> s(gen_0':s2_0(x)) The following defined symbols remain to be analysed: sqr ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: sqr(gen_0':s2_0(n777_0)) -> gen_0':s2_0(*(n777_0, n777_0)), rt in Omega(1 + n777_0 + n777_0^2) Induction Base: sqr(gen_0':s2_0(0)) ->_R^Omega(1) 0' Induction Step: sqr(gen_0':s2_0(+(n777_0, 1))) ->_R^Omega(1) +'(sqr(gen_0':s2_0(n777_0)), s(double(gen_0':s2_0(n777_0)))) ->_IH +'(gen_0':s2_0(*(c778_0, c778_0)), s(double(gen_0':s2_0(n777_0)))) ->_L^Omega(1 + n777_0) +'(gen_0':s2_0(*(n777_0, n777_0)), s(gen_0':s2_0(*(2, n777_0)))) ->_L^Omega(2 + 2*n777_0) gen_0':s2_0(+(+(*(2, n777_0), 1), *(n777_0, n777_0))) We have rt in Omega(n^2) and sz in O(n). Thus, we have irc_R in Omega(n^2). ---------------------------------------- (28) Obligation: Proved the lower bound n^2 for the following obligation: Innermost TRS: Rules: sqr(0') -> 0' sqr(s(x)) -> +'(sqr(x), s(double(x))) double(0') -> 0' double(s(x)) -> s(s(double(x))) +'(x, 0') -> x +'(x, s(y)) -> s(+'(x, y)) sqr(s(x)) -> s(+'(sqr(x), double(x))) Types: sqr :: 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s +' :: 0':s -> 0':s -> 0':s double :: 0':s -> 0':s hole_0':s1_0 :: 0':s gen_0':s2_0 :: Nat -> 0':s Lemmas: +'(gen_0':s2_0(a), gen_0':s2_0(n4_0)) -> gen_0':s2_0(+(n4_0, a)), rt in Omega(1 + n4_0) double(gen_0':s2_0(n513_0)) -> gen_0':s2_0(*(2, n513_0)), rt in Omega(1 + n513_0) Generator Equations: gen_0':s2_0(0) <=> 0' gen_0':s2_0(+(x, 1)) <=> s(gen_0':s2_0(x)) The following defined symbols remain to be analysed: sqr ---------------------------------------- (29) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (30) BOUNDS(n^2, INF)