/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) 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^1, n^1). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [ComplexityIfPolyImplication, 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) CdtRuleRemovalProof [UPPER BOUND(ADD(n^1)), 68 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), 236 ms] (20) proven lower bound (21) LowerBoundPropagationProof [FINISHED, 0 ms] (22) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: foldl(x, Cons(S(0), xs)) -> foldl(S(x), xs) foldl(S(0), Cons(x, xs)) -> foldl(S(x), xs) foldr(a, Cons(x, xs)) -> op(x, foldr(a, xs)) foldr(a, Nil) -> a foldl(a, Nil) -> a notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False op(x, S(0)) -> S(x) op(S(0), y) -> S(y) fold(a, xs) -> Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS to CDT ---------------------------------------- (2) Obligation: Complexity Dependency Tuples Problem Rules: foldl(z0, Cons(S(0), z1)) -> foldl(S(z0), z1) foldl(S(0), Cons(z0, z1)) -> foldl(S(z0), z1) foldl(z0, Nil) -> z0 foldr(z0, Cons(z1, z2)) -> op(z1, foldr(z0, z2)) foldr(z0, Nil) -> z0 notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False op(z0, S(0)) -> S(z0) op(S(0), z0) -> S(z0) fold(z0, z1) -> Cons(foldl(z0, z1), Cons(foldr(z0, z1), Nil)) Tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDL(z0, Nil) -> c2 FOLDR(z0, Cons(z1, z2)) -> c3(OP(z1, foldr(z0, z2)), FOLDR(z0, z2)) FOLDR(z0, Nil) -> c4 NOTEMPTY(Cons(z0, z1)) -> c5 NOTEMPTY(Nil) -> c6 OP(z0, S(0)) -> c7 OP(S(0), z0) -> c8 FOLD(z0, z1) -> c9(FOLDL(z0, z1), FOLDR(z0, z1)) S tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDL(z0, Nil) -> c2 FOLDR(z0, Cons(z1, z2)) -> c3(OP(z1, foldr(z0, z2)), FOLDR(z0, z2)) FOLDR(z0, Nil) -> c4 NOTEMPTY(Cons(z0, z1)) -> c5 NOTEMPTY(Nil) -> c6 OP(z0, S(0)) -> c7 OP(S(0), z0) -> c8 FOLD(z0, z1) -> c9(FOLDL(z0, z1), FOLDR(z0, z1)) K tuples:none Defined Rule Symbols: foldl_2, foldr_2, notEmpty_1, op_2, fold_2 Defined Pair Symbols: FOLDL_2, FOLDR_2, NOTEMPTY_1, OP_2, FOLD_2 Compound Symbols: c_1, c1_1, c2, c3_2, c4, c5, c6, c7, c8, c9_2 ---------------------------------------- (3) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: FOLD(z0, z1) -> c9(FOLDL(z0, z1), FOLDR(z0, z1)) Removed 6 trailing nodes: OP(z0, S(0)) -> c7 FOLDL(z0, Nil) -> c2 FOLDR(z0, Nil) -> c4 OP(S(0), z0) -> c8 NOTEMPTY(Nil) -> c6 NOTEMPTY(Cons(z0, z1)) -> c5 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: foldl(z0, Cons(S(0), z1)) -> foldl(S(z0), z1) foldl(S(0), Cons(z0, z1)) -> foldl(S(z0), z1) foldl(z0, Nil) -> z0 foldr(z0, Cons(z1, z2)) -> op(z1, foldr(z0, z2)) foldr(z0, Nil) -> z0 notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False op(z0, S(0)) -> S(z0) op(S(0), z0) -> S(z0) fold(z0, z1) -> Cons(foldl(z0, z1), Cons(foldr(z0, z1), Nil)) Tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(OP(z1, foldr(z0, z2)), FOLDR(z0, z2)) S tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(OP(z1, foldr(z0, z2)), FOLDR(z0, z2)) K tuples:none Defined Rule Symbols: foldl_2, foldr_2, notEmpty_1, op_2, fold_2 Defined Pair Symbols: FOLDL_2, FOLDR_2 Compound Symbols: c_1, c1_1, c3_2 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: foldl(z0, Cons(S(0), z1)) -> foldl(S(z0), z1) foldl(S(0), Cons(z0, z1)) -> foldl(S(z0), z1) foldl(z0, Nil) -> z0 foldr(z0, Cons(z1, z2)) -> op(z1, foldr(z0, z2)) foldr(z0, Nil) -> z0 notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False op(z0, S(0)) -> S(z0) op(S(0), z0) -> S(z0) fold(z0, z1) -> Cons(foldl(z0, z1), Cons(foldr(z0, z1), Nil)) Tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) S tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) K tuples:none Defined Rule Symbols: foldl_2, foldr_2, notEmpty_1, op_2, fold_2 Defined Pair Symbols: FOLDL_2, FOLDR_2 Compound Symbols: c_1, c1_1, c3_1 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: foldl(z0, Cons(S(0), z1)) -> foldl(S(z0), z1) foldl(S(0), Cons(z0, z1)) -> foldl(S(z0), z1) foldl(z0, Nil) -> z0 foldr(z0, Cons(z1, z2)) -> op(z1, foldr(z0, z2)) foldr(z0, Nil) -> z0 notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False op(z0, S(0)) -> S(z0) op(S(0), z0) -> S(z0) fold(z0, z1) -> Cons(foldl(z0, z1), Cons(foldr(z0, z1), Nil)) ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules:none Tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) S tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) K tuples:none Defined Rule Symbols:none Defined Pair Symbols: FOLDL_2, FOLDR_2 Compound Symbols: c_1, c1_1, c3_1 ---------------------------------------- (9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) We considered the (Usable) Rules:none And the Tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = [1] POL(Cons(x_1, x_2)) = [1] + x_1 + x_2 POL(FOLDL(x_1, x_2)) = x_1 + x_2 POL(FOLDR(x_1, x_2)) = x_2 POL(S(x_1)) = x_1 POL(c(x_1)) = x_1 POL(c1(x_1)) = x_1 POL(c3(x_1)) = x_1 ---------------------------------------- (10) Obligation: Complexity Dependency Tuples Problem Rules:none Tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) S tuples:none K tuples: FOLDL(z0, Cons(S(0), z1)) -> c(FOLDL(S(z0), z1)) FOLDL(S(0), Cons(z0, z1)) -> c1(FOLDL(S(z0), z1)) FOLDR(z0, Cons(z1, z2)) -> c3(FOLDR(z0, z2)) Defined Rule Symbols:none Defined Pair Symbols: FOLDL_2, FOLDR_2 Compound Symbols: c_1, c1_1, c3_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^1, INF). The TRS R consists of the following rules: foldl(x, Cons(S(0'), xs)) -> foldl(S(x), xs) foldl(S(0'), Cons(x, xs)) -> foldl(S(x), xs) foldr(a, Cons(x, xs)) -> op(x, foldr(a, xs)) foldr(a, Nil) -> a foldl(a, Nil) -> a notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False op(x, S(0')) -> S(x) op(S(0'), y) -> S(y) fold(a, xs) -> Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) Obligation: Innermost TRS: Rules: foldl(x, Cons(S(0'), xs)) -> foldl(S(x), xs) foldl(S(0'), Cons(x, xs)) -> foldl(S(x), xs) foldr(a, Cons(x, xs)) -> op(x, foldr(a, xs)) foldr(a, Nil) -> a foldl(a, Nil) -> a notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False op(x, S(0')) -> S(x) op(S(0'), y) -> S(y) fold(a, xs) -> Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) Types: foldl :: 0':S -> Cons:Nil -> 0':S Cons :: 0':S -> Cons:Nil -> Cons:Nil S :: 0':S -> 0':S 0' :: 0':S foldr :: 0':S -> Cons:Nil -> 0':S op :: 0':S -> 0':S -> 0':S Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False fold :: 0':S -> Cons:Nil -> Cons:Nil hole_0':S1_0 :: 0':S hole_Cons:Nil2_0 :: Cons:Nil hole_True:False3_0 :: True:False gen_0':S4_0 :: Nat -> 0':S gen_Cons:Nil5_0 :: Nat -> Cons:Nil ---------------------------------------- (17) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: foldl, foldr ---------------------------------------- (18) Obligation: Innermost TRS: Rules: foldl(x, Cons(S(0'), xs)) -> foldl(S(x), xs) foldl(S(0'), Cons(x, xs)) -> foldl(S(x), xs) foldr(a, Cons(x, xs)) -> op(x, foldr(a, xs)) foldr(a, Nil) -> a foldl(a, Nil) -> a notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False op(x, S(0')) -> S(x) op(S(0'), y) -> S(y) fold(a, xs) -> Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) Types: foldl :: 0':S -> Cons:Nil -> 0':S Cons :: 0':S -> Cons:Nil -> Cons:Nil S :: 0':S -> 0':S 0' :: 0':S foldr :: 0':S -> Cons:Nil -> 0':S op :: 0':S -> 0':S -> 0':S Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False fold :: 0':S -> Cons:Nil -> Cons:Nil hole_0':S1_0 :: 0':S hole_Cons:Nil2_0 :: Cons:Nil hole_True:False3_0 :: True:False gen_0':S4_0 :: Nat -> 0':S gen_Cons:Nil5_0 :: Nat -> Cons:Nil Generator Equations: gen_0':S4_0(0) <=> 0' gen_0':S4_0(+(x, 1)) <=> S(gen_0':S4_0(x)) gen_Cons:Nil5_0(0) <=> Nil gen_Cons:Nil5_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil5_0(x)) The following defined symbols remain to be analysed: foldl, foldr ---------------------------------------- (19) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0)) -> gen_0':S4_0(1), rt in Omega(1 + n18_0) Induction Base: foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(0)) ->_R^Omega(1) gen_0':S4_0(1) Induction Step: foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(+(n18_0, 1))) ->_R^Omega(1) op(0', foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0))) ->_IH op(0', gen_0':S4_0(1)) ->_R^Omega(1) S(0') We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (20) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: foldl(x, Cons(S(0'), xs)) -> foldl(S(x), xs) foldl(S(0'), Cons(x, xs)) -> foldl(S(x), xs) foldr(a, Cons(x, xs)) -> op(x, foldr(a, xs)) foldr(a, Nil) -> a foldl(a, Nil) -> a notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False op(x, S(0')) -> S(x) op(S(0'), y) -> S(y) fold(a, xs) -> Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) Types: foldl :: 0':S -> Cons:Nil -> 0':S Cons :: 0':S -> Cons:Nil -> Cons:Nil S :: 0':S -> 0':S 0' :: 0':S foldr :: 0':S -> Cons:Nil -> 0':S op :: 0':S -> 0':S -> 0':S Nil :: Cons:Nil notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False fold :: 0':S -> Cons:Nil -> Cons:Nil hole_0':S1_0 :: 0':S hole_Cons:Nil2_0 :: Cons:Nil hole_True:False3_0 :: True:False gen_0':S4_0 :: Nat -> 0':S gen_Cons:Nil5_0 :: Nat -> Cons:Nil Generator Equations: gen_0':S4_0(0) <=> 0' gen_0':S4_0(+(x, 1)) <=> S(gen_0':S4_0(x)) gen_Cons:Nil5_0(0) <=> Nil gen_Cons:Nil5_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil5_0(x)) The following defined symbols remain to be analysed: foldr ---------------------------------------- (21) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (22) BOUNDS(n^1, INF)