/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: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 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 [ComplexityIfPolyImplication, 0 ms] (4) CdtProblem (5) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtRuleRemovalProof [UPPER BOUND(ADD(n^1)), 78 ms] (8) CdtProblem (9) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 65 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) SlicingProof [LOWER BOUND(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), 282 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), 13 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: naiverev(Cons(x, xs)) -> app(naiverev(xs), Cons(x, Nil)) app(Cons(x, xs), ys) -> Cons(x, app(xs, ys)) notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS to CDT ---------------------------------------- (2) Obligation: Complexity Dependency Tuples Problem Rules: naiverev(Cons(z0, z1)) -> app(naiverev(z1), Cons(z0, Nil)) naiverev(Nil) -> Nil app(Cons(z0, z1), z2) -> Cons(z0, app(z1, z2)) app(Nil, z0) -> z0 notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False goal(z0) -> naiverev(z0) Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) NAIVEREV(Nil) -> c1 APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) APP(Nil, z0) -> c3 NOTEMPTY(Cons(z0, z1)) -> c4 NOTEMPTY(Nil) -> c5 GOAL(z0) -> c6(NAIVEREV(z0)) S tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) NAIVEREV(Nil) -> c1 APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) APP(Nil, z0) -> c3 NOTEMPTY(Cons(z0, z1)) -> c4 NOTEMPTY(Nil) -> c5 GOAL(z0) -> c6(NAIVEREV(z0)) K tuples:none Defined Rule Symbols: naiverev_1, app_2, notEmpty_1, goal_1 Defined Pair Symbols: NAIVEREV_1, APP_2, NOTEMPTY_1, GOAL_1 Compound Symbols: c_2, c1, c2_1, c3, c4, c5, c6_1 ---------------------------------------- (3) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: GOAL(z0) -> c6(NAIVEREV(z0)) Removed 4 trailing nodes: APP(Nil, z0) -> c3 NOTEMPTY(Cons(z0, z1)) -> c4 NOTEMPTY(Nil) -> c5 NAIVEREV(Nil) -> c1 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: naiverev(Cons(z0, z1)) -> app(naiverev(z1), Cons(z0, Nil)) naiverev(Nil) -> Nil app(Cons(z0, z1), z2) -> Cons(z0, app(z1, z2)) app(Nil, z0) -> z0 notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False goal(z0) -> naiverev(z0) Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) S tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) K tuples:none Defined Rule Symbols: naiverev_1, app_2, notEmpty_1, goal_1 Defined Pair Symbols: NAIVEREV_1, APP_2 Compound Symbols: c_2, c2_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False goal(z0) -> naiverev(z0) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: naiverev(Cons(z0, z1)) -> app(naiverev(z1), Cons(z0, Nil)) naiverev(Nil) -> Nil app(Cons(z0, z1), z2) -> Cons(z0, app(z1, z2)) app(Nil, z0) -> z0 Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) S tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) K tuples:none Defined Rule Symbols: naiverev_1, app_2 Defined Pair Symbols: NAIVEREV_1, APP_2 Compound Symbols: c_2, c2_1 ---------------------------------------- (7) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) We considered the (Usable) Rules:none And the Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) The order we found is given by the following interpretation: Polynomial interpretation : POL(APP(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [1] + x_1 + x_2 POL(NAIVEREV(x_1)) = x_1 POL(Nil) = 0 POL(app(x_1, x_2)) = x_1 + x_2 POL(c(x_1, x_2)) = x_1 + x_2 POL(c2(x_1)) = x_1 POL(naiverev(x_1)) = [1] + x_1 ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: naiverev(Cons(z0, z1)) -> app(naiverev(z1), Cons(z0, Nil)) naiverev(Nil) -> Nil app(Cons(z0, z1), z2) -> Cons(z0, app(z1, z2)) app(Nil, z0) -> z0 Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) S tuples: APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) K tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) Defined Rule Symbols: naiverev_1, app_2 Defined Pair Symbols: NAIVEREV_1, APP_2 Compound Symbols: c_2, c2_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. APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) We considered the (Usable) Rules: naiverev(Nil) -> Nil naiverev(Cons(z0, z1)) -> app(naiverev(z1), Cons(z0, Nil)) app(Nil, z0) -> z0 app(Cons(z0, z1), z2) -> Cons(z0, app(z1, z2)) And the Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) The order we found is given by the following interpretation: Polynomial interpretation : POL(APP(x_1, x_2)) = x_1 POL(Cons(x_1, x_2)) = [1] + x_2 POL(NAIVEREV(x_1)) = x_1 + x_1^2 POL(Nil) = 0 POL(app(x_1, x_2)) = x_1 + x_2 POL(c(x_1, x_2)) = x_1 + x_2 POL(c2(x_1)) = x_1 POL(naiverev(x_1)) = x_1 ---------------------------------------- (10) Obligation: Complexity Dependency Tuples Problem Rules: naiverev(Cons(z0, z1)) -> app(naiverev(z1), Cons(z0, Nil)) naiverev(Nil) -> Nil app(Cons(z0, z1), z2) -> Cons(z0, app(z1, z2)) app(Nil, z0) -> z0 Tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) S tuples:none K tuples: NAIVEREV(Cons(z0, z1)) -> c(APP(naiverev(z1), Cons(z0, Nil)), NAIVEREV(z1)) APP(Cons(z0, z1), z2) -> c2(APP(z1, z2)) Defined Rule Symbols: naiverev_1, app_2 Defined Pair Symbols: NAIVEREV_1, APP_2 Compound Symbols: c_2, c2_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: naiverev(Cons(x, xs)) -> app(naiverev(xs), Cons(x, Nil)) app(Cons(x, xs), ys) -> Cons(x, app(xs, ys)) notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (15) SlicingProof (LOWER BOUND(ID)) Sliced the following arguments: Cons/0 ---------------------------------------- (16) 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: naiverev(Cons(xs)) -> app(naiverev(xs), Cons(Nil)) app(Cons(xs), ys) -> Cons(app(xs, ys)) notEmpty(Cons(xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: naiverev(Cons(xs)) -> app(naiverev(xs), Cons(Nil)) app(Cons(xs), ys) -> Cons(app(xs, ys)) notEmpty(Cons(xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) Types: naiverev :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil app :: Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil hole_True:False2_0 :: True:False gen_Cons:Nil3_0 :: Nat -> Cons:Nil ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: naiverev, app They will be analysed ascendingly in the following order: app < naiverev ---------------------------------------- (20) Obligation: Innermost TRS: Rules: naiverev(Cons(xs)) -> app(naiverev(xs), Cons(Nil)) app(Cons(xs), ys) -> Cons(app(xs, ys)) notEmpty(Cons(xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) Types: naiverev :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil app :: Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil hole_True:False2_0 :: True:False gen_Cons:Nil3_0 :: Nat -> Cons:Nil Generator Equations: gen_Cons:Nil3_0(0) <=> Nil gen_Cons:Nil3_0(+(x, 1)) <=> Cons(gen_Cons:Nil3_0(x)) The following defined symbols remain to be analysed: app, naiverev They will be analysed ascendingly in the following order: app < naiverev ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: app(gen_Cons:Nil3_0(n5_0), gen_Cons:Nil3_0(b)) -> gen_Cons:Nil3_0(+(n5_0, b)), rt in Omega(1 + n5_0) Induction Base: app(gen_Cons:Nil3_0(0), gen_Cons:Nil3_0(b)) ->_R^Omega(1) gen_Cons:Nil3_0(b) Induction Step: app(gen_Cons:Nil3_0(+(n5_0, 1)), gen_Cons:Nil3_0(b)) ->_R^Omega(1) Cons(app(gen_Cons:Nil3_0(n5_0), gen_Cons:Nil3_0(b))) ->_IH Cons(gen_Cons:Nil3_0(+(b, c6_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: Innermost TRS: Rules: naiverev(Cons(xs)) -> app(naiverev(xs), Cons(Nil)) app(Cons(xs), ys) -> Cons(app(xs, ys)) notEmpty(Cons(xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) Types: naiverev :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil app :: Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil hole_True:False2_0 :: True:False gen_Cons:Nil3_0 :: Nat -> Cons:Nil Generator Equations: gen_Cons:Nil3_0(0) <=> Nil gen_Cons:Nil3_0(+(x, 1)) <=> Cons(gen_Cons:Nil3_0(x)) The following defined symbols remain to be analysed: app, naiverev They will be analysed ascendingly in the following order: app < naiverev ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: Innermost TRS: Rules: naiverev(Cons(xs)) -> app(naiverev(xs), Cons(Nil)) app(Cons(xs), ys) -> Cons(app(xs, ys)) notEmpty(Cons(xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) Types: naiverev :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil app :: Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil hole_True:False2_0 :: True:False gen_Cons:Nil3_0 :: Nat -> Cons:Nil Lemmas: app(gen_Cons:Nil3_0(n5_0), gen_Cons:Nil3_0(b)) -> gen_Cons:Nil3_0(+(n5_0, b)), rt in Omega(1 + n5_0) Generator Equations: gen_Cons:Nil3_0(0) <=> Nil gen_Cons:Nil3_0(+(x, 1)) <=> Cons(gen_Cons:Nil3_0(x)) The following defined symbols remain to be analysed: naiverev ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: naiverev(gen_Cons:Nil3_0(n489_0)) -> gen_Cons:Nil3_0(n489_0), rt in Omega(1 + n489_0 + n489_0^2) Induction Base: naiverev(gen_Cons:Nil3_0(0)) ->_R^Omega(1) Nil Induction Step: naiverev(gen_Cons:Nil3_0(+(n489_0, 1))) ->_R^Omega(1) app(naiverev(gen_Cons:Nil3_0(n489_0)), Cons(Nil)) ->_IH app(gen_Cons:Nil3_0(c490_0), Cons(Nil)) ->_L^Omega(1 + n489_0) gen_Cons:Nil3_0(+(n489_0, +(0, 1))) 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: naiverev(Cons(xs)) -> app(naiverev(xs), Cons(Nil)) app(Cons(xs), ys) -> Cons(app(xs, ys)) notEmpty(Cons(xs)) -> True notEmpty(Nil) -> False naiverev(Nil) -> Nil app(Nil, ys) -> ys goal(xs) -> naiverev(xs) Types: naiverev :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil app :: Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil hole_True:False2_0 :: True:False gen_Cons:Nil3_0 :: Nat -> Cons:Nil Lemmas: app(gen_Cons:Nil3_0(n5_0), gen_Cons:Nil3_0(b)) -> gen_Cons:Nil3_0(+(n5_0, b)), rt in Omega(1 + n5_0) Generator Equations: gen_Cons:Nil3_0(0) <=> Nil gen_Cons:Nil3_0(+(x, 1)) <=> Cons(gen_Cons:Nil3_0(x)) The following defined symbols remain to be analysed: naiverev ---------------------------------------- (29) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (30) BOUNDS(n^2, INF)