WORST_CASE(Omega(n^2), O(n^2)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). (0) CpxTRS (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (4) CdtProblem (5) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CdtProblem (9) CdtRuleRemovalProof [UPPER BOUND(ADD(n^1)), 58 ms] (10) CdtProblem (11) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 38 ms] (12) CdtProblem (13) SIsEmptyProof [BOTH BOUNDS(ID, ID), 0 ms] (14) BOUNDS(1, 1) (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 0 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 253 ms] (22) BEST (23) proven lower bound (24) LowerBoundPropagationProof [FINISHED, 0 ms] (25) BOUNDS(n^1, INF) (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 16 ms] (28) proven lower bound (29) LowerBoundPropagationProof [FINISHED, 0 ms] (30) BOUNDS(n^2, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). The TRS R consists of the following rules: and(tt, X) -> activate(X) plus(N, 0) -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0) -> 0 x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: x([], s(M)) The defined contexts are: plus([], x1) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: and(tt, X) -> activate(X) plus(N, 0) -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0) -> 0 x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (3) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS to CDT ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: and(tt, z0) -> activate(z0) plus(z0, 0) -> z0 plus(z0, s(z1)) -> s(plus(z0, z1)) x(z0, 0) -> 0 x(z0, s(z1)) -> plus(x(z0, z1), z0) activate(z0) -> z0 Tuples: AND(tt, z0) -> c(ACTIVATE(z0)) PLUS(z0, 0) -> c1 PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, 0) -> c3 X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) ACTIVATE(z0) -> c5 S tuples: AND(tt, z0) -> c(ACTIVATE(z0)) PLUS(z0, 0) -> c1 PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, 0) -> c3 X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) ACTIVATE(z0) -> c5 K tuples:none Defined Rule Symbols: and_2, plus_2, x_2, activate_1 Defined Pair Symbols: AND_2, PLUS_2, X_2, ACTIVATE_1 Compound Symbols: c_1, c1, c2_1, c3, c4_2, c5 ---------------------------------------- (5) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 4 trailing nodes: ACTIVATE(z0) -> c5 X(z0, 0) -> c3 AND(tt, z0) -> c(ACTIVATE(z0)) PLUS(z0, 0) -> c1 ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: and(tt, z0) -> activate(z0) plus(z0, 0) -> z0 plus(z0, s(z1)) -> s(plus(z0, z1)) x(z0, 0) -> 0 x(z0, s(z1)) -> plus(x(z0, z1), z0) activate(z0) -> z0 Tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) S tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) K tuples:none Defined Rule Symbols: and_2, plus_2, x_2, activate_1 Defined Pair Symbols: PLUS_2, X_2 Compound Symbols: c2_1, c4_2 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: and(tt, z0) -> activate(z0) activate(z0) -> z0 ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: x(z0, 0) -> 0 x(z0, s(z1)) -> plus(x(z0, z1), z0) plus(z0, 0) -> z0 plus(z0, s(z1)) -> s(plus(z0, z1)) Tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) S tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) K tuples:none Defined Rule Symbols: x_2, plus_2 Defined Pair Symbols: PLUS_2, X_2 Compound Symbols: c2_1, c4_2 ---------------------------------------- (9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) We considered the (Usable) Rules:none And the Tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = [1] POL(PLUS(x_1, x_2)) = 0 POL(X(x_1, x_2)) = x_2 POL(c2(x_1)) = x_1 POL(c4(x_1, x_2)) = x_1 + x_2 POL(plus(x_1, x_2)) = [1] + x_1 + x_2 POL(s(x_1)) = [1] + x_1 POL(x(x_1, x_2)) = [1] + x_1 + x_2 ---------------------------------------- (10) Obligation: Complexity Dependency Tuples Problem Rules: x(z0, 0) -> 0 x(z0, s(z1)) -> plus(x(z0, z1), z0) plus(z0, 0) -> z0 plus(z0, s(z1)) -> s(plus(z0, z1)) Tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) S tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) K tuples: X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) Defined Rule Symbols: x_2, plus_2 Defined Pair Symbols: PLUS_2, X_2 Compound Symbols: c2_1, c4_2 ---------------------------------------- (11) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) We considered the (Usable) Rules:none And the Tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(PLUS(x_1, x_2)) = [2] + [2]x_2 POL(X(x_1, x_2)) = x_2^2 + [2]x_1*x_2 POL(c2(x_1)) = x_1 POL(c4(x_1, x_2)) = x_1 + x_2 POL(plus(x_1, x_2)) = [2] + x_2^2 POL(s(x_1)) = [2] + x_1 POL(x(x_1, x_2)) = x_1^2 ---------------------------------------- (12) Obligation: Complexity Dependency Tuples Problem Rules: x(z0, 0) -> 0 x(z0, s(z1)) -> plus(x(z0, z1), z0) plus(z0, 0) -> z0 plus(z0, s(z1)) -> s(plus(z0, z1)) Tuples: PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) S tuples:none K tuples: X(z0, s(z1)) -> c4(PLUS(x(z0, z1), z0), X(z0, z1)) PLUS(z0, s(z1)) -> c2(PLUS(z0, z1)) Defined Rule Symbols: x_2, plus_2 Defined Pair Symbols: PLUS_2, X_2 Compound Symbols: c2_1, c4_2 ---------------------------------------- (13) SIsEmptyProof (BOTH BOUNDS(ID, ID)) The set S is empty ---------------------------------------- (14) BOUNDS(1, 1) ---------------------------------------- (15) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (16) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^2, INF). The TRS R consists of the following rules: and(tt, X) -> activate(X) plus(N, 0') -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0') -> 0' x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X S is empty. Rewrite Strategy: FULL ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (18) Obligation: TRS: Rules: and(tt, X) -> activate(X) plus(N, 0') -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0') -> 0' x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X Types: and :: tt -> and:activate -> and:activate tt :: tt activate :: and:activate -> and:activate plus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s x :: 0':s -> 0':s -> 0':s hole_and:activate1_0 :: and:activate hole_tt2_0 :: tt hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: plus, x They will be analysed ascendingly in the following order: plus < x ---------------------------------------- (20) Obligation: TRS: Rules: and(tt, X) -> activate(X) plus(N, 0') -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0') -> 0' x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X Types: and :: tt -> and:activate -> and:activate tt :: tt activate :: and:activate -> and:activate plus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s x :: 0':s -> 0':s -> 0':s hole_and:activate1_0 :: and:activate hole_tt2_0 :: tt hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: plus, x They will be analysed ascendingly in the following order: plus < x ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: plus(gen_0':s4_0(a), gen_0':s4_0(n6_0)) -> gen_0':s4_0(+(n6_0, a)), rt in Omega(1 + n6_0) Induction Base: plus(gen_0':s4_0(a), gen_0':s4_0(0)) ->_R^Omega(1) gen_0':s4_0(a) Induction Step: plus(gen_0':s4_0(a), gen_0':s4_0(+(n6_0, 1))) ->_R^Omega(1) s(plus(gen_0':s4_0(a), gen_0':s4_0(n6_0))) ->_IH s(gen_0':s4_0(+(a, c7_0))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (22) Complex Obligation (BEST) ---------------------------------------- (23) Obligation: Proved the lower bound n^1 for the following obligation: TRS: Rules: and(tt, X) -> activate(X) plus(N, 0') -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0') -> 0' x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X Types: and :: tt -> and:activate -> and:activate tt :: tt activate :: and:activate -> and:activate plus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s x :: 0':s -> 0':s -> 0':s hole_and:activate1_0 :: and:activate hole_tt2_0 :: tt hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: plus, x They will be analysed ascendingly in the following order: plus < x ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: TRS: Rules: and(tt, X) -> activate(X) plus(N, 0') -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0') -> 0' x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X Types: and :: tt -> and:activate -> and:activate tt :: tt activate :: and:activate -> and:activate plus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s x :: 0':s -> 0':s -> 0':s hole_and:activate1_0 :: and:activate hole_tt2_0 :: tt hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Lemmas: plus(gen_0':s4_0(a), gen_0':s4_0(n6_0)) -> gen_0':s4_0(+(n6_0, a)), rt in Omega(1 + n6_0) Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: x ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: x(gen_0':s4_0(a), gen_0':s4_0(n441_0)) -> gen_0':s4_0(*(n441_0, a)), rt in Omega(1 + a*n441_0 + n441_0) Induction Base: x(gen_0':s4_0(a), gen_0':s4_0(0)) ->_R^Omega(1) 0' Induction Step: x(gen_0':s4_0(a), gen_0':s4_0(+(n441_0, 1))) ->_R^Omega(1) plus(x(gen_0':s4_0(a), gen_0':s4_0(n441_0)), gen_0':s4_0(a)) ->_IH plus(gen_0':s4_0(*(c442_0, a)), gen_0':s4_0(a)) ->_L^Omega(1 + a) gen_0':s4_0(+(a, *(n441_0, a))) 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: TRS: Rules: and(tt, X) -> activate(X) plus(N, 0') -> N plus(N, s(M)) -> s(plus(N, M)) x(N, 0') -> 0' x(N, s(M)) -> plus(x(N, M), N) activate(X) -> X Types: and :: tt -> and:activate -> and:activate tt :: tt activate :: and:activate -> and:activate plus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s x :: 0':s -> 0':s -> 0':s hole_and:activate1_0 :: and:activate hole_tt2_0 :: tt hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Lemmas: plus(gen_0':s4_0(a), gen_0':s4_0(n6_0)) -> gen_0':s4_0(+(n6_0, a)), rt in Omega(1 + n6_0) Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: x ---------------------------------------- (29) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (30) BOUNDS(n^2, INF)