Runtime Complexity TRS:
The TRS R consists of the following rules:
eq(0, 0) → true
eq(0, s(X)) → false
eq(s(X), 0) → false
eq(s(X), s(Y)) → eq(X, Y)
rm(N, nil) → nil
rm(N, add(M, X)) → ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) → rm(N, X)
ifrm(false, N, add(M, X)) → add(M, rm(N, X))
purge(nil) → nil
purge(add(N, X)) → add(N, purge(rm(N, X)))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
eq'(0', 0') → true'
eq'(0', s'(X)) → false'
eq'(s'(X), 0') → false'
eq'(s'(X), s'(Y)) → eq'(X, Y)
rm'(N, nil') → nil'
rm'(N, add'(M, X)) → ifrm'(eq'(N, M), N, add'(M, X))
ifrm'(true', N, add'(M, X)) → rm'(N, X)
ifrm'(false', N, add'(M, X)) → add'(M, rm'(N, X))
purge'(nil') → nil'
purge'(add'(N, X)) → add'(N, purge'(rm'(N, X)))
Infered types.
Rules:
eq'(0', 0') → true'
eq'(0', s'(X)) → false'
eq'(s'(X), 0') → false'
eq'(s'(X), s'(Y)) → eq'(X, Y)
rm'(N, nil') → nil'
rm'(N, add'(M, X)) → ifrm'(eq'(N, M), N, add'(M, X))
ifrm'(true', N, add'(M, X)) → rm'(N, X)
ifrm'(false', N, add'(M, X)) → add'(M, rm'(N, X))
purge'(nil') → nil'
purge'(add'(N, X)) → add'(N, purge'(rm'(N, X)))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
rm' :: 0':s' → nil':add' → nil':add'
nil' :: nil':add'
add' :: 0':s' → nil':add' → nil':add'
ifrm' :: true':false' → 0':s' → nil':add' → nil':add'
purge' :: nil':add' → nil':add'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':add'3 :: nil':add'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':add'5 :: Nat → nil':add'
Heuristically decided to analyse the following defined symbols:
eq', rm', purge'
They will be analysed ascendingly in the following order:
eq' < rm'
rm' < purge'
Rules:
eq'(0', 0') → true'
eq'(0', s'(X)) → false'
eq'(s'(X), 0') → false'
eq'(s'(X), s'(Y)) → eq'(X, Y)
rm'(N, nil') → nil'
rm'(N, add'(M, X)) → ifrm'(eq'(N, M), N, add'(M, X))
ifrm'(true', N, add'(M, X)) → rm'(N, X)
ifrm'(false', N, add'(M, X)) → add'(M, rm'(N, X))
purge'(nil') → nil'
purge'(add'(N, X)) → add'(N, purge'(rm'(N, X)))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
rm' :: 0':s' → nil':add' → nil':add'
nil' :: nil':add'
add' :: 0':s' → nil':add' → nil':add'
ifrm' :: true':false' → 0':s' → nil':add' → nil':add'
purge' :: nil':add' → nil':add'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':add'3 :: nil':add'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':add'5 :: Nat → nil':add'
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':add'5(0) ⇔ nil'
_gen_nil':add'5(+(x, 1)) ⇔ add'(0', _gen_nil':add'5(x))
The following defined symbols remain to be analysed:
eq', rm', purge'
They will be analysed ascendingly in the following order:
eq' < rm'
rm' < purge'
Proved the following rewrite lemma:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
Induction Base:
eq'(_gen_0':s'4(0), _gen_0':s'4(0)) →RΩ(1)
true'
Induction Step:
eq'(_gen_0':s'4(+(_$n8, 1)), _gen_0':s'4(+(_$n8, 1))) →RΩ(1)
eq'(_gen_0':s'4(_$n8), _gen_0':s'4(_$n8)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
eq'(0', 0') → true'
eq'(0', s'(X)) → false'
eq'(s'(X), 0') → false'
eq'(s'(X), s'(Y)) → eq'(X, Y)
rm'(N, nil') → nil'
rm'(N, add'(M, X)) → ifrm'(eq'(N, M), N, add'(M, X))
ifrm'(true', N, add'(M, X)) → rm'(N, X)
ifrm'(false', N, add'(M, X)) → add'(M, rm'(N, X))
purge'(nil') → nil'
purge'(add'(N, X)) → add'(N, purge'(rm'(N, X)))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
rm' :: 0':s' → nil':add' → nil':add'
nil' :: nil':add'
add' :: 0':s' → nil':add' → nil':add'
ifrm' :: true':false' → 0':s' → nil':add' → nil':add'
purge' :: nil':add' → nil':add'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':add'3 :: nil':add'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':add'5 :: Nat → nil':add'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':add'5(0) ⇔ nil'
_gen_nil':add'5(+(x, 1)) ⇔ add'(0', _gen_nil':add'5(x))
The following defined symbols remain to be analysed:
rm', purge'
They will be analysed ascendingly in the following order:
rm' < purge'
Proved the following rewrite lemma:
rm'(_gen_0':s'4(0), _gen_nil':add'5(_n627)) → _gen_nil':add'5(0), rt ∈ Ω(1 + n627)
Induction Base:
rm'(_gen_0':s'4(0), _gen_nil':add'5(0)) →RΩ(1)
nil'
Induction Step:
rm'(_gen_0':s'4(0), _gen_nil':add'5(+(_$n628, 1))) →RΩ(1)
ifrm'(eq'(_gen_0':s'4(0), 0'), _gen_0':s'4(0), add'(0', _gen_nil':add'5(_$n628))) →LΩ(1)
ifrm'(true', _gen_0':s'4(0), add'(0', _gen_nil':add'5(_$n628))) →RΩ(1)
rm'(_gen_0':s'4(0), _gen_nil':add'5(_$n628)) →IH
_gen_nil':add'5(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
eq'(0', 0') → true'
eq'(0', s'(X)) → false'
eq'(s'(X), 0') → false'
eq'(s'(X), s'(Y)) → eq'(X, Y)
rm'(N, nil') → nil'
rm'(N, add'(M, X)) → ifrm'(eq'(N, M), N, add'(M, X))
ifrm'(true', N, add'(M, X)) → rm'(N, X)
ifrm'(false', N, add'(M, X)) → add'(M, rm'(N, X))
purge'(nil') → nil'
purge'(add'(N, X)) → add'(N, purge'(rm'(N, X)))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
rm' :: 0':s' → nil':add' → nil':add'
nil' :: nil':add'
add' :: 0':s' → nil':add' → nil':add'
ifrm' :: true':false' → 0':s' → nil':add' → nil':add'
purge' :: nil':add' → nil':add'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':add'3 :: nil':add'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':add'5 :: Nat → nil':add'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
rm'(_gen_0':s'4(0), _gen_nil':add'5(_n627)) → _gen_nil':add'5(0), rt ∈ Ω(1 + n627)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':add'5(0) ⇔ nil'
_gen_nil':add'5(+(x, 1)) ⇔ add'(0', _gen_nil':add'5(x))
The following defined symbols remain to be analysed:
purge'
Could not prove a rewrite lemma for the defined symbol purge'.
Rules:
eq'(0', 0') → true'
eq'(0', s'(X)) → false'
eq'(s'(X), 0') → false'
eq'(s'(X), s'(Y)) → eq'(X, Y)
rm'(N, nil') → nil'
rm'(N, add'(M, X)) → ifrm'(eq'(N, M), N, add'(M, X))
ifrm'(true', N, add'(M, X)) → rm'(N, X)
ifrm'(false', N, add'(M, X)) → add'(M, rm'(N, X))
purge'(nil') → nil'
purge'(add'(N, X)) → add'(N, purge'(rm'(N, X)))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
rm' :: 0':s' → nil':add' → nil':add'
nil' :: nil':add'
add' :: 0':s' → nil':add' → nil':add'
ifrm' :: true':false' → 0':s' → nil':add' → nil':add'
purge' :: nil':add' → nil':add'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':add'3 :: nil':add'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':add'5 :: Nat → nil':add'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
rm'(_gen_0':s'4(0), _gen_nil':add'5(_n627)) → _gen_nil':add'5(0), rt ∈ Ω(1 + n627)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':add'5(0) ⇔ nil'
_gen_nil':add'5(+(x, 1)) ⇔ add'(0', _gen_nil':add'5(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)