WORST_CASE(Omega(n^2),?) proof of /export/starexec/sandbox/benchmark/theBenchmark.trs # AProVE Commit ID: c69e44bd14796315568835c1ffa2502984884775 mhark 20210624 unpublished The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^2, INF). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 747 ms] (2) CpxRelTRS (3) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxRelTRS (5) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (6) typed CpxTrs (7) OrderProof [LOWER BOUND(ID), 3 ms] (8) typed CpxTrs (9) RewriteLemmaProof [LOWER BOUND(ID), 353 ms] (10) BEST (11) proven lower bound (12) LowerBoundPropagationProof [FINISHED, 0 ms] (13) BOUNDS(n^1, INF) (14) typed CpxTrs (15) RewriteLemmaProof [LOWER BOUND(ID), 36 ms] (16) typed CpxTrs (17) RewriteLemmaProof [LOWER BOUND(ID), 51 ms] (18) typed CpxTrs (19) RewriteLemmaProof [LOWER BOUND(ID), 648 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 631 ms] (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 75 ms] (24) typed CpxTrs (25) RewriteLemmaProof [LOWER BOUND(ID), 70 ms] (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 67 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 99 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 457 ms] (32) proven lower bound (33) LowerBoundPropagationProof [FINISHED, 0 ms] (34) BOUNDS(n^2, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^2, INF). The TRS R consists of the following rules: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) The (relative) TRS S consists of the following rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Rewrite Strategy: INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^2, INF). The TRS R consists of the following rules: LE(0, z0) -> c LE(s(z0), 0) -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) The (relative) TRS S consists of the following rules: le(0, z0) -> true le(s(z0), 0) -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Rewrite Strategy: INNERMOST ---------------------------------------- (3) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (4) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^2, INF). The TRS R consists of the following rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) The (relative) TRS S consists of the following rules: le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Rewrite Strategy: INNERMOST ---------------------------------------- (5) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (6) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 ---------------------------------------- (7) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: LE, APP, LOW, le, HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: LE < LOW LE < HIGH APP < QUICKSORT le < LOW LOW < QUICKSORT le < HIGH le < low le < high HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (8) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: LE, APP, LOW, le, HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: LE < LOW LE < HIGH APP < QUICKSORT le < LOW LOW < QUICKSORT le < HIGH le < low le < high HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (9) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) Induction Base: LE(gen_0':s12_16(0), gen_0':s12_16(0)) ->_R^Omega(1) c Induction Step: LE(gen_0':s12_16(+(n17_16, 1)), gen_0':s12_16(+(n17_16, 1))) ->_R^Omega(1) c2(LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16))) ->_IH c2(gen_c:c1:c211_16(c18_16)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (10) Complex Obligation (BEST) ---------------------------------------- (11) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: LE, APP, LOW, le, HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: LE < LOW LE < HIGH APP < QUICKSORT le < LOW LOW < QUICKSORT le < HIGH le < low le < high HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (12) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (13) BOUNDS(n^1, INF) ---------------------------------------- (14) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: APP, LOW, le, HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: APP < QUICKSORT le < LOW LOW < QUICKSORT le < HIGH le < low le < high HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (15) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) Induction Base: APP(gen_nil:cons14_16(0), gen_nil:cons14_16(b)) ->_R^Omega(1) c3 Induction Step: APP(gen_nil:cons14_16(+(n650_16, 1)), gen_nil:cons14_16(b)) ->_R^Omega(1) c4(APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b))) ->_IH c4(gen_c3:c413_16(c651_16)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (16) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: le, LOW, HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: le < LOW LOW < QUICKSORT le < HIGH le < low le < high HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) Induction Base: le(gen_0':s12_16(0), gen_0':s12_16(0)) ->_R^Omega(0) true Induction Step: le(gen_0':s12_16(+(n1477_16, 1)), gen_0':s12_16(+(n1477_16, 1))) ->_R^Omega(0) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (18) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: LOW, HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: LOW < QUICKSORT HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (19) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) Induction Base: LOW(gen_0':s12_16(0), gen_nil:cons14_16(0)) Induction Step: LOW(gen_0':s12_16(0), gen_nil:cons14_16(+(n1878_16, 1))) ->_R^Omega(1) c6(IFLOW(le(0', gen_0':s12_16(0)), gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n1878_16))), LE(0', gen_0':s12_16(0))) ->_L^Omega(0) c6(IFLOW(true, gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n1878_16))), LE(0', gen_0':s12_16(0))) ->_R^Omega(1) c6(c7(LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16))), LE(0', gen_0':s12_16(0))) ->_IH c6(c7(*16_16), LE(0', gen_0':s12_16(0))) ->_L^Omega(1) c6(c7(*16_16), gen_c:c1:c211_16(0)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (20) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: HIGH, QUICKSORT, quicksort, low, high, app They will be analysed ascendingly in the following order: HIGH < QUICKSORT quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) Induction Base: HIGH(gen_0':s12_16(0), gen_nil:cons14_16(0)) Induction Step: HIGH(gen_0':s12_16(0), gen_nil:cons14_16(+(n7251_16, 1))) ->_R^Omega(1) c10(IFHIGH(le(0', gen_0':s12_16(0)), gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n7251_16))), LE(0', gen_0':s12_16(0))) ->_L^Omega(0) c10(IFHIGH(true, gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n7251_16))), LE(0', gen_0':s12_16(0))) ->_R^Omega(1) c10(c11(HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16))), LE(0', gen_0':s12_16(0))) ->_IH c10(c11(*16_16), LE(0', gen_0':s12_16(0))) ->_L^Omega(1) c10(c11(*16_16), gen_c:c1:c211_16(0)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (22) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: low, QUICKSORT, quicksort, high, app They will be analysed ascendingly in the following order: quicksort < QUICKSORT low < QUICKSORT high < QUICKSORT low < quicksort high < quicksort app < quicksort ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16)) -> gen_nil:cons14_16(n15532_16), rt in Omega(0) Induction Base: low(gen_0':s12_16(0), gen_nil:cons14_16(0)) ->_R^Omega(0) nil Induction Step: low(gen_0':s12_16(0), gen_nil:cons14_16(+(n15532_16, 1))) ->_R^Omega(0) iflow(le(0', gen_0':s12_16(0)), gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n15532_16))) ->_L^Omega(0) iflow(true, gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n15532_16))) ->_R^Omega(0) cons(0', low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16))) ->_IH cons(0', gen_nil:cons14_16(c15533_16)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (24) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16)) -> gen_nil:cons14_16(n15532_16), rt in Omega(0) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: high, QUICKSORT, quicksort, app They will be analysed ascendingly in the following order: quicksort < QUICKSORT high < QUICKSORT high < quicksort app < quicksort ---------------------------------------- (25) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: high(gen_0':s12_16(0), gen_nil:cons14_16(n16816_16)) -> gen_nil:cons14_16(0), rt in Omega(0) Induction Base: high(gen_0':s12_16(0), gen_nil:cons14_16(0)) ->_R^Omega(0) nil Induction Step: high(gen_0':s12_16(0), gen_nil:cons14_16(+(n16816_16, 1))) ->_R^Omega(0) ifhigh(le(0', gen_0':s12_16(0)), gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n16816_16))) ->_L^Omega(0) ifhigh(true, gen_0':s12_16(0), cons(0', gen_nil:cons14_16(n16816_16))) ->_R^Omega(0) high(gen_0':s12_16(0), gen_nil:cons14_16(n16816_16)) ->_IH gen_nil:cons14_16(0) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (26) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16)) -> gen_nil:cons14_16(n15532_16), rt in Omega(0) high(gen_0':s12_16(0), gen_nil:cons14_16(n16816_16)) -> gen_nil:cons14_16(0), rt in Omega(0) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: app, QUICKSORT, quicksort They will be analysed ascendingly in the following order: quicksort < QUICKSORT app < quicksort ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: app(gen_nil:cons14_16(n18030_16), gen_nil:cons14_16(b)) -> gen_nil:cons14_16(+(n18030_16, b)), rt in Omega(0) Induction Base: app(gen_nil:cons14_16(0), gen_nil:cons14_16(b)) ->_R^Omega(0) gen_nil:cons14_16(b) Induction Step: app(gen_nil:cons14_16(+(n18030_16, 1)), gen_nil:cons14_16(b)) ->_R^Omega(0) cons(0', app(gen_nil:cons14_16(n18030_16), gen_nil:cons14_16(b))) ->_IH cons(0', gen_nil:cons14_16(+(b, c18031_16))) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (28) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16)) -> gen_nil:cons14_16(n15532_16), rt in Omega(0) high(gen_0':s12_16(0), gen_nil:cons14_16(n16816_16)) -> gen_nil:cons14_16(0), rt in Omega(0) app(gen_nil:cons14_16(n18030_16), gen_nil:cons14_16(b)) -> gen_nil:cons14_16(+(n18030_16, b)), rt in Omega(0) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: quicksort, QUICKSORT They will be analysed ascendingly in the following order: quicksort < QUICKSORT ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: quicksort(gen_nil:cons14_16(n20145_16)) -> gen_nil:cons14_16(n20145_16), rt in Omega(0) Induction Base: quicksort(gen_nil:cons14_16(0)) ->_R^Omega(0) nil Induction Step: quicksort(gen_nil:cons14_16(+(n20145_16, 1))) ->_R^Omega(0) app(quicksort(low(0', gen_nil:cons14_16(n20145_16))), cons(0', quicksort(high(0', gen_nil:cons14_16(n20145_16))))) ->_L^Omega(0) app(quicksort(gen_nil:cons14_16(n20145_16)), cons(0', quicksort(high(0', gen_nil:cons14_16(n20145_16))))) ->_IH app(gen_nil:cons14_16(c20146_16), cons(0', quicksort(high(0', gen_nil:cons14_16(n20145_16))))) ->_L^Omega(0) app(gen_nil:cons14_16(n20145_16), cons(0', quicksort(gen_nil:cons14_16(0)))) ->_R^Omega(0) app(gen_nil:cons14_16(n20145_16), cons(0', nil)) ->_L^Omega(0) gen_nil:cons14_16(+(n20145_16, +(0, 1))) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (30) Obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16)) -> gen_nil:cons14_16(n15532_16), rt in Omega(0) high(gen_0':s12_16(0), gen_nil:cons14_16(n16816_16)) -> gen_nil:cons14_16(0), rt in Omega(0) app(gen_nil:cons14_16(n18030_16), gen_nil:cons14_16(b)) -> gen_nil:cons14_16(+(n18030_16, b)), rt in Omega(0) quicksort(gen_nil:cons14_16(n20145_16)) -> gen_nil:cons14_16(n20145_16), rt in Omega(0) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: QUICKSORT ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: QUICKSORT(gen_nil:cons14_16(n21779_16)) -> *16_16, rt in Omega(n21779_16 + n21779_16^2) Induction Base: QUICKSORT(gen_nil:cons14_16(0)) Induction Step: QUICKSORT(gen_nil:cons14_16(+(n21779_16, 1))) ->_R^Omega(1) c14(APP(quicksort(low(0', gen_nil:cons14_16(n21779_16))), cons(0', quicksort(high(0', gen_nil:cons14_16(n21779_16))))), QUICKSORT(low(0', gen_nil:cons14_16(n21779_16))), LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(0) c14(APP(quicksort(gen_nil:cons14_16(n21779_16)), cons(0', quicksort(high(0', gen_nil:cons14_16(n21779_16))))), QUICKSORT(low(0', gen_nil:cons14_16(n21779_16))), LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(0) c14(APP(gen_nil:cons14_16(n21779_16), cons(0', quicksort(high(0', gen_nil:cons14_16(n21779_16))))), QUICKSORT(low(0', gen_nil:cons14_16(n21779_16))), LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(0) c14(APP(gen_nil:cons14_16(n21779_16), cons(0', quicksort(gen_nil:cons14_16(0)))), QUICKSORT(low(0', gen_nil:cons14_16(n21779_16))), LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(0) c14(APP(gen_nil:cons14_16(n21779_16), cons(0', gen_nil:cons14_16(0))), QUICKSORT(low(0', gen_nil:cons14_16(n21779_16))), LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(1 + n21779_16) c14(gen_c3:c413_16(n21779_16), QUICKSORT(low(0', gen_nil:cons14_16(n21779_16))), LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(0) c14(gen_c3:c413_16(n21779_16), QUICKSORT(gen_nil:cons14_16(n21779_16)), LOW(0', gen_nil:cons14_16(n21779_16))) ->_IH c14(gen_c3:c413_16(n21779_16), *16_16, LOW(0', gen_nil:cons14_16(n21779_16))) ->_L^Omega(n21779_16) c14(gen_c3:c413_16(n21779_16), *16_16, *16_16) We have rt in Omega(n^2) and sz in O(n). Thus, we have irc_R in Omega(n^2). ---------------------------------------- (32) Obligation: Proved the lower bound n^2 for the following obligation: Innermost TRS: Rules: LE(0', z0) -> c LE(s(z0), 0') -> c1 LE(s(z0), s(z1)) -> c2(LE(z0, z1)) APP(nil, z0) -> c3 APP(cons(z0, z1), z2) -> c4(APP(z1, z2)) LOW(z0, nil) -> c5 LOW(z0, cons(z1, z2)) -> c6(IFLOW(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFLOW(true, z0, cons(z1, z2)) -> c7(LOW(z0, z2)) IFLOW(false, z0, cons(z1, z2)) -> c8(LOW(z0, z2)) HIGH(z0, nil) -> c9 HIGH(z0, cons(z1, z2)) -> c10(IFHIGH(le(z1, z0), z0, cons(z1, z2)), LE(z1, z0)) IFHIGH(true, z0, cons(z1, z2)) -> c11(HIGH(z0, z2)) IFHIGH(false, z0, cons(z1, z2)) -> c12(HIGH(z0, z2)) QUICKSORT(nil) -> c13 QUICKSORT(cons(z0, z1)) -> c14(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(low(z0, z1)), LOW(z0, z1)) QUICKSORT(cons(z0, z1)) -> c15(APP(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))), QUICKSORT(high(z0, z1)), HIGH(z0, z1)) le(0', z0) -> true le(s(z0), 0') -> false le(s(z0), s(z1)) -> le(z0, z1) app(nil, z0) -> z0 app(cons(z0, z1), z2) -> cons(z0, app(z1, z2)) low(z0, nil) -> nil low(z0, cons(z1, z2)) -> iflow(le(z1, z0), z0, cons(z1, z2)) iflow(true, z0, cons(z1, z2)) -> cons(z1, low(z0, z2)) iflow(false, z0, cons(z1, z2)) -> low(z0, z2) high(z0, nil) -> nil high(z0, cons(z1, z2)) -> ifhigh(le(z1, z0), z0, cons(z1, z2)) ifhigh(true, z0, cons(z1, z2)) -> high(z0, z2) ifhigh(false, z0, cons(z1, z2)) -> cons(z1, high(z0, z2)) quicksort(nil) -> nil quicksort(cons(z0, z1)) -> app(quicksort(low(z0, z1)), cons(z0, quicksort(high(z0, z1)))) Types: LE :: 0':s -> 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 APP :: nil:cons -> nil:cons -> c3:c4 nil :: nil:cons c3 :: c3:c4 cons :: 0':s -> nil:cons -> nil:cons c4 :: c3:c4 -> c3:c4 LOW :: 0':s -> nil:cons -> c5:c6 c5 :: c5:c6 c6 :: c7:c8 -> c:c1:c2 -> c5:c6 IFLOW :: true:false -> 0':s -> nil:cons -> c7:c8 le :: 0':s -> 0':s -> true:false true :: true:false c7 :: c5:c6 -> c7:c8 false :: true:false c8 :: c5:c6 -> c7:c8 HIGH :: 0':s -> nil:cons -> c9:c10 c9 :: c9:c10 c10 :: c11:c12 -> c:c1:c2 -> c9:c10 IFHIGH :: true:false -> 0':s -> nil:cons -> c11:c12 c11 :: c9:c10 -> c11:c12 c12 :: c9:c10 -> c11:c12 QUICKSORT :: nil:cons -> c13:c14:c15 c13 :: c13:c14:c15 c14 :: c3:c4 -> c13:c14:c15 -> c5:c6 -> c13:c14:c15 quicksort :: nil:cons -> nil:cons low :: 0':s -> nil:cons -> nil:cons high :: 0':s -> nil:cons -> nil:cons c15 :: c3:c4 -> c13:c14:c15 -> c9:c10 -> c13:c14:c15 app :: nil:cons -> nil:cons -> nil:cons iflow :: true:false -> 0':s -> nil:cons -> nil:cons ifhigh :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_16 :: c:c1:c2 hole_0':s2_16 :: 0':s hole_c3:c43_16 :: c3:c4 hole_nil:cons4_16 :: nil:cons hole_c5:c65_16 :: c5:c6 hole_c7:c86_16 :: c7:c8 hole_true:false7_16 :: true:false hole_c9:c108_16 :: c9:c10 hole_c11:c129_16 :: c11:c12 hole_c13:c14:c1510_16 :: c13:c14:c15 gen_c:c1:c211_16 :: Nat -> c:c1:c2 gen_0':s12_16 :: Nat -> 0':s gen_c3:c413_16 :: Nat -> c3:c4 gen_nil:cons14_16 :: Nat -> nil:cons gen_c13:c14:c1515_16 :: Nat -> c13:c14:c15 Lemmas: LE(gen_0':s12_16(n17_16), gen_0':s12_16(n17_16)) -> gen_c:c1:c211_16(n17_16), rt in Omega(1 + n17_16) APP(gen_nil:cons14_16(n650_16), gen_nil:cons14_16(b)) -> gen_c3:c413_16(n650_16), rt in Omega(1 + n650_16) le(gen_0':s12_16(n1477_16), gen_0':s12_16(n1477_16)) -> true, rt in Omega(0) LOW(gen_0':s12_16(0), gen_nil:cons14_16(n1878_16)) -> *16_16, rt in Omega(n1878_16) HIGH(gen_0':s12_16(0), gen_nil:cons14_16(n7251_16)) -> *16_16, rt in Omega(n7251_16) low(gen_0':s12_16(0), gen_nil:cons14_16(n15532_16)) -> gen_nil:cons14_16(n15532_16), rt in Omega(0) high(gen_0':s12_16(0), gen_nil:cons14_16(n16816_16)) -> gen_nil:cons14_16(0), rt in Omega(0) app(gen_nil:cons14_16(n18030_16), gen_nil:cons14_16(b)) -> gen_nil:cons14_16(+(n18030_16, b)), rt in Omega(0) quicksort(gen_nil:cons14_16(n20145_16)) -> gen_nil:cons14_16(n20145_16), rt in Omega(0) Generator Equations: gen_c:c1:c211_16(0) <=> c gen_c:c1:c211_16(+(x, 1)) <=> c2(gen_c:c1:c211_16(x)) gen_0':s12_16(0) <=> 0' gen_0':s12_16(+(x, 1)) <=> s(gen_0':s12_16(x)) gen_c3:c413_16(0) <=> c3 gen_c3:c413_16(+(x, 1)) <=> c4(gen_c3:c413_16(x)) gen_nil:cons14_16(0) <=> nil gen_nil:cons14_16(+(x, 1)) <=> cons(0', gen_nil:cons14_16(x)) gen_c13:c14:c1515_16(0) <=> c13 gen_c13:c14:c1515_16(+(x, 1)) <=> c14(c3, gen_c13:c14:c1515_16(x), c5) The following defined symbols remain to be analysed: QUICKSORT ---------------------------------------- (33) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (34) BOUNDS(n^2, INF)