/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), ?) proof of /export/starexec/sandbox/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^1, INF). (0) CpxTRS (1) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) typed CpxTrs (5) OrderProof [LOWER BOUND(ID), 0 ms] (6) typed CpxTrs (7) RewriteLemmaProof [LOWER BOUND(ID), 264 ms] (8) BEST (9) proven lower bound (10) LowerBoundPropagationProof [FINISHED, 0 ms] (11) BOUNDS(n^1, INF) (12) typed CpxTrs (13) RewriteLemmaProof [LOWER BOUND(ID), 645 ms] (14) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: plus(x, y) -> plusIter(x, y, 0) plusIter(x, y, z) -> ifPlus(le(x, z), x, y, z) ifPlus(true, x, y, z) -> y ifPlus(false, x, y, z) -> plusIter(x, s(y), s(z)) le(s(x), 0) -> false le(0, y) -> true le(s(x), s(y)) -> le(x, y) sum(xs) -> sumIter(xs, 0) sumIter(xs, x) -> ifSum(isempty(xs), xs, x, plus(x, head(xs))) ifSum(true, xs, x, y) -> x ifSum(false, xs, x, y) -> sumIter(tail(xs), y) isempty(nil) -> true isempty(cons(x, xs)) -> false head(nil) -> error head(cons(x, xs)) -> x tail(nil) -> nil tail(cons(x, xs)) -> xs a -> b a -> c S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (2) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: plus(x, y) -> plusIter(x, y, 0') plusIter(x, y, z) -> ifPlus(le(x, z), x, y, z) ifPlus(true, x, y, z) -> y ifPlus(false, x, y, z) -> plusIter(x, s(y), s(z)) le(s(x), 0') -> false le(0', y) -> true le(s(x), s(y)) -> le(x, y) sum(xs) -> sumIter(xs, 0') sumIter(xs, x) -> ifSum(isempty(xs), xs, x, plus(x, head(xs))) ifSum(true, xs, x, y) -> x ifSum(false, xs, x, y) -> sumIter(tail(xs), y) isempty(nil) -> true isempty(cons(x, xs)) -> false head(nil) -> error head(cons(x, xs)) -> x tail(nil) -> nil tail(cons(x, xs)) -> xs a -> b a -> c S is empty. Rewrite Strategy: FULL ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: TRS: Rules: plus(x, y) -> plusIter(x, y, 0') plusIter(x, y, z) -> ifPlus(le(x, z), x, y, z) ifPlus(true, x, y, z) -> y ifPlus(false, x, y, z) -> plusIter(x, s(y), s(z)) le(s(x), 0') -> false le(0', y) -> true le(s(x), s(y)) -> le(x, y) sum(xs) -> sumIter(xs, 0') sumIter(xs, x) -> ifSum(isempty(xs), xs, x, plus(x, head(xs))) ifSum(true, xs, x, y) -> x ifSum(false, xs, x, y) -> sumIter(tail(xs), y) isempty(nil) -> true isempty(cons(x, xs)) -> false head(nil) -> error head(cons(x, xs)) -> x tail(nil) -> nil tail(cons(x, xs)) -> xs a -> b a -> c Types: plus :: 0':s:error -> 0':s:error -> 0':s:error plusIter :: 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error 0' :: 0':s:error ifPlus :: true:false -> 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error le :: 0':s:error -> 0':s:error -> true:false true :: true:false false :: true:false s :: 0':s:error -> 0':s:error sum :: nil:cons -> 0':s:error sumIter :: nil:cons -> 0':s:error -> 0':s:error ifSum :: true:false -> nil:cons -> 0':s:error -> 0':s:error -> 0':s:error isempty :: nil:cons -> true:false head :: nil:cons -> 0':s:error tail :: nil:cons -> nil:cons nil :: nil:cons cons :: 0':s:error -> nil:cons -> nil:cons error :: 0':s:error a :: b:c b :: b:c c :: b:c hole_0':s:error1_0 :: 0':s:error hole_true:false2_0 :: true:false hole_nil:cons3_0 :: nil:cons hole_b:c4_0 :: b:c gen_0':s:error5_0 :: Nat -> 0':s:error gen_nil:cons6_0 :: Nat -> nil:cons ---------------------------------------- (5) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: plusIter, le, sumIter They will be analysed ascendingly in the following order: le < plusIter ---------------------------------------- (6) Obligation: TRS: Rules: plus(x, y) -> plusIter(x, y, 0') plusIter(x, y, z) -> ifPlus(le(x, z), x, y, z) ifPlus(true, x, y, z) -> y ifPlus(false, x, y, z) -> plusIter(x, s(y), s(z)) le(s(x), 0') -> false le(0', y) -> true le(s(x), s(y)) -> le(x, y) sum(xs) -> sumIter(xs, 0') sumIter(xs, x) -> ifSum(isempty(xs), xs, x, plus(x, head(xs))) ifSum(true, xs, x, y) -> x ifSum(false, xs, x, y) -> sumIter(tail(xs), y) isempty(nil) -> true isempty(cons(x, xs)) -> false head(nil) -> error head(cons(x, xs)) -> x tail(nil) -> nil tail(cons(x, xs)) -> xs a -> b a -> c Types: plus :: 0':s:error -> 0':s:error -> 0':s:error plusIter :: 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error 0' :: 0':s:error ifPlus :: true:false -> 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error le :: 0':s:error -> 0':s:error -> true:false true :: true:false false :: true:false s :: 0':s:error -> 0':s:error sum :: nil:cons -> 0':s:error sumIter :: nil:cons -> 0':s:error -> 0':s:error ifSum :: true:false -> nil:cons -> 0':s:error -> 0':s:error -> 0':s:error isempty :: nil:cons -> true:false head :: nil:cons -> 0':s:error tail :: nil:cons -> nil:cons nil :: nil:cons cons :: 0':s:error -> nil:cons -> nil:cons error :: 0':s:error a :: b:c b :: b:c c :: b:c hole_0':s:error1_0 :: 0':s:error hole_true:false2_0 :: true:false hole_nil:cons3_0 :: nil:cons hole_b:c4_0 :: b:c gen_0':s:error5_0 :: Nat -> 0':s:error gen_nil:cons6_0 :: Nat -> nil:cons Generator Equations: gen_0':s:error5_0(0) <=> 0' gen_0':s:error5_0(+(x, 1)) <=> s(gen_0':s:error5_0(x)) gen_nil:cons6_0(0) <=> nil gen_nil:cons6_0(+(x, 1)) <=> cons(0', gen_nil:cons6_0(x)) The following defined symbols remain to be analysed: le, plusIter, sumIter They will be analysed ascendingly in the following order: le < plusIter ---------------------------------------- (7) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) -> false, rt in Omega(1 + n8_0) Induction Base: le(gen_0':s:error5_0(+(1, 0)), gen_0':s:error5_0(0)) ->_R^Omega(1) false Induction Step: le(gen_0':s:error5_0(+(1, +(n8_0, 1))), gen_0':s:error5_0(+(n8_0, 1))) ->_R^Omega(1) le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) ->_IH false We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (8) Complex Obligation (BEST) ---------------------------------------- (9) Obligation: Proved the lower bound n^1 for the following obligation: TRS: Rules: plus(x, y) -> plusIter(x, y, 0') plusIter(x, y, z) -> ifPlus(le(x, z), x, y, z) ifPlus(true, x, y, z) -> y ifPlus(false, x, y, z) -> plusIter(x, s(y), s(z)) le(s(x), 0') -> false le(0', y) -> true le(s(x), s(y)) -> le(x, y) sum(xs) -> sumIter(xs, 0') sumIter(xs, x) -> ifSum(isempty(xs), xs, x, plus(x, head(xs))) ifSum(true, xs, x, y) -> x ifSum(false, xs, x, y) -> sumIter(tail(xs), y) isempty(nil) -> true isempty(cons(x, xs)) -> false head(nil) -> error head(cons(x, xs)) -> x tail(nil) -> nil tail(cons(x, xs)) -> xs a -> b a -> c Types: plus :: 0':s:error -> 0':s:error -> 0':s:error plusIter :: 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error 0' :: 0':s:error ifPlus :: true:false -> 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error le :: 0':s:error -> 0':s:error -> true:false true :: true:false false :: true:false s :: 0':s:error -> 0':s:error sum :: nil:cons -> 0':s:error sumIter :: nil:cons -> 0':s:error -> 0':s:error ifSum :: true:false -> nil:cons -> 0':s:error -> 0':s:error -> 0':s:error isempty :: nil:cons -> true:false head :: nil:cons -> 0':s:error tail :: nil:cons -> nil:cons nil :: nil:cons cons :: 0':s:error -> nil:cons -> nil:cons error :: 0':s:error a :: b:c b :: b:c c :: b:c hole_0':s:error1_0 :: 0':s:error hole_true:false2_0 :: true:false hole_nil:cons3_0 :: nil:cons hole_b:c4_0 :: b:c gen_0':s:error5_0 :: Nat -> 0':s:error gen_nil:cons6_0 :: Nat -> nil:cons Generator Equations: gen_0':s:error5_0(0) <=> 0' gen_0':s:error5_0(+(x, 1)) <=> s(gen_0':s:error5_0(x)) gen_nil:cons6_0(0) <=> nil gen_nil:cons6_0(+(x, 1)) <=> cons(0', gen_nil:cons6_0(x)) The following defined symbols remain to be analysed: le, plusIter, sumIter They will be analysed ascendingly in the following order: le < plusIter ---------------------------------------- (10) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (11) BOUNDS(n^1, INF) ---------------------------------------- (12) Obligation: TRS: Rules: plus(x, y) -> plusIter(x, y, 0') plusIter(x, y, z) -> ifPlus(le(x, z), x, y, z) ifPlus(true, x, y, z) -> y ifPlus(false, x, y, z) -> plusIter(x, s(y), s(z)) le(s(x), 0') -> false le(0', y) -> true le(s(x), s(y)) -> le(x, y) sum(xs) -> sumIter(xs, 0') sumIter(xs, x) -> ifSum(isempty(xs), xs, x, plus(x, head(xs))) ifSum(true, xs, x, y) -> x ifSum(false, xs, x, y) -> sumIter(tail(xs), y) isempty(nil) -> true isempty(cons(x, xs)) -> false head(nil) -> error head(cons(x, xs)) -> x tail(nil) -> nil tail(cons(x, xs)) -> xs a -> b a -> c Types: plus :: 0':s:error -> 0':s:error -> 0':s:error plusIter :: 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error 0' :: 0':s:error ifPlus :: true:false -> 0':s:error -> 0':s:error -> 0':s:error -> 0':s:error le :: 0':s:error -> 0':s:error -> true:false true :: true:false false :: true:false s :: 0':s:error -> 0':s:error sum :: nil:cons -> 0':s:error sumIter :: nil:cons -> 0':s:error -> 0':s:error ifSum :: true:false -> nil:cons -> 0':s:error -> 0':s:error -> 0':s:error isempty :: nil:cons -> true:false head :: nil:cons -> 0':s:error tail :: nil:cons -> nil:cons nil :: nil:cons cons :: 0':s:error -> nil:cons -> nil:cons error :: 0':s:error a :: b:c b :: b:c c :: b:c hole_0':s:error1_0 :: 0':s:error hole_true:false2_0 :: true:false hole_nil:cons3_0 :: nil:cons hole_b:c4_0 :: b:c gen_0':s:error5_0 :: Nat -> 0':s:error gen_nil:cons6_0 :: Nat -> nil:cons Lemmas: le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) -> false, rt in Omega(1 + n8_0) Generator Equations: gen_0':s:error5_0(0) <=> 0' gen_0':s:error5_0(+(x, 1)) <=> s(gen_0':s:error5_0(x)) gen_nil:cons6_0(0) <=> nil gen_nil:cons6_0(+(x, 1)) <=> cons(0', gen_nil:cons6_0(x)) The following defined symbols remain to be analysed: plusIter, sumIter ---------------------------------------- (13) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: sumIter(gen_nil:cons6_0(n2686_0), gen_0':s:error5_0(1)) -> *7_0, rt in Omega(n2686_0) Induction Base: sumIter(gen_nil:cons6_0(0), gen_0':s:error5_0(1)) Induction Step: sumIter(gen_nil:cons6_0(+(n2686_0, 1)), gen_0':s:error5_0(1)) ->_R^Omega(1) ifSum(isempty(gen_nil:cons6_0(+(n2686_0, 1))), gen_nil:cons6_0(+(n2686_0, 1)), gen_0':s:error5_0(1), plus(gen_0':s:error5_0(1), head(gen_nil:cons6_0(+(n2686_0, 1))))) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), plus(gen_0':s:error5_0(1), head(gen_nil:cons6_0(+(1, n2686_0))))) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), plus(gen_0':s:error5_0(1), 0')) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), plusIter(gen_0':s:error5_0(1), 0', 0')) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), ifPlus(le(gen_0':s:error5_0(1), 0'), gen_0':s:error5_0(1), 0', 0')) ->_L^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), ifPlus(false, gen_0':s:error5_0(1), 0', 0')) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), plusIter(gen_0':s:error5_0(1), s(0'), s(0'))) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), ifPlus(le(gen_0':s:error5_0(1), s(0')), gen_0':s:error5_0(1), s(0'), s(0'))) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), ifPlus(le(gen_0':s:error5_0(0), 0'), gen_0':s:error5_0(1), s(0'), s(0'))) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), ifPlus(true, gen_0':s:error5_0(1), s(0'), s(0'))) ->_R^Omega(1) ifSum(false, gen_nil:cons6_0(+(1, n2686_0)), gen_0':s:error5_0(1), s(0')) ->_R^Omega(1) sumIter(tail(gen_nil:cons6_0(+(1, n2686_0))), s(0')) ->_R^Omega(1) sumIter(gen_nil:cons6_0(n2686_0), s(0')) ->_IH *7_0 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (14) BOUNDS(1, INF)