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)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))
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)
or'(true', y) → true'
or'(false', y) → y
union'(empty', h) → h
union'(edge'(x, y, i), h) → edge'(x, y, union'(i, h))
isEmpty'(empty') → true'
isEmpty'(edge'(x, y, i)) → false'
from'(edge'(x, y, i)) → x
to'(edge'(x, y, i)) → y
rest'(edge'(x, y, i)) → i
rest'(empty') → empty'
reach'(x, y, i, h) → if1'(eq'(x, y), isEmpty'(i), eq'(x, from'(i)), eq'(y, to'(i)), x, y, i, h)
if1'(true', b1, b2, b3, x, y, i, h) → true'
if1'(false', b1, b2, b3, x, y, i, h) → if2'(b1, b2, b3, x, y, i, h)
if2'(true', b2, b3, x, y, i, h) → false'
if2'(false', b2, b3, x, y, i, h) → if3'(b2, b3, x, y, i, h)
if3'(false', b3, x, y, i, h) → reach'(x, y, rest'(i), edge'(from'(i), to'(i), h))
if3'(true', b3, x, y, i, h) → if4'(b3, x, y, i, h)
if4'(true', x, y, i, h) → true'
if4'(false', x, y, i, h) → or'(reach'(x, y, rest'(i), h), reach'(to'(i), y, union'(rest'(i), h), empty'))
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)
or'(true', y) → true'
or'(false', y) → y
union'(empty', h) → h
union'(edge'(x, y, i), h) → edge'(x, y, union'(i, h))
isEmpty'(empty') → true'
isEmpty'(edge'(x, y, i)) → false'
from'(edge'(x, y, i)) → x
to'(edge'(x, y, i)) → y
rest'(edge'(x, y, i)) → i
rest'(empty') → empty'
reach'(x, y, i, h) → if1'(eq'(x, y), isEmpty'(i), eq'(x, from'(i)), eq'(y, to'(i)), x, y, i, h)
if1'(true', b1, b2, b3, x, y, i, h) → true'
if1'(false', b1, b2, b3, x, y, i, h) → if2'(b1, b2, b3, x, y, i, h)
if2'(true', b2, b3, x, y, i, h) → false'
if2'(false', b2, b3, x, y, i, h) → if3'(b2, b3, x, y, i, h)
if3'(false', b3, x, y, i, h) → reach'(x, y, rest'(i), edge'(from'(i), to'(i), h))
if3'(true', b3, x, y, i, h) → if4'(b3, x, y, i, h)
if4'(true', x, y, i, h) → true'
if4'(false', x, y, i, h) → or'(reach'(x, y, rest'(i), h), reach'(to'(i), y, union'(rest'(i), h), empty'))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
or' :: true':false' → true':false' → true':false'
union' :: empty':edge' → empty':edge' → empty':edge'
empty' :: empty':edge'
edge' :: 0':s' → 0':s' → empty':edge' → empty':edge'
isEmpty' :: empty':edge' → true':false'
from' :: empty':edge' → 0':s'
to' :: empty':edge' → 0':s'
rest' :: empty':edge' → empty':edge'
reach' :: 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if1' :: true':false' → true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if2' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if3' :: true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if4' :: true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_empty':edge'3 :: empty':edge'
_gen_0':s'4 :: Nat → 0':s'
_gen_empty':edge'5 :: Nat → empty':edge'
Heuristically decided to analyse the following defined symbols:
eq', union', reach'
They will be analysed ascendingly in the following order:
eq' < reach'
union' < reach'
Rules:
eq'(0', 0') → true'
eq'(0', s'(x)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
or'(true', y) → true'
or'(false', y) → y
union'(empty', h) → h
union'(edge'(x, y, i), h) → edge'(x, y, union'(i, h))
isEmpty'(empty') → true'
isEmpty'(edge'(x, y, i)) → false'
from'(edge'(x, y, i)) → x
to'(edge'(x, y, i)) → y
rest'(edge'(x, y, i)) → i
rest'(empty') → empty'
reach'(x, y, i, h) → if1'(eq'(x, y), isEmpty'(i), eq'(x, from'(i)), eq'(y, to'(i)), x, y, i, h)
if1'(true', b1, b2, b3, x, y, i, h) → true'
if1'(false', b1, b2, b3, x, y, i, h) → if2'(b1, b2, b3, x, y, i, h)
if2'(true', b2, b3, x, y, i, h) → false'
if2'(false', b2, b3, x, y, i, h) → if3'(b2, b3, x, y, i, h)
if3'(false', b3, x, y, i, h) → reach'(x, y, rest'(i), edge'(from'(i), to'(i), h))
if3'(true', b3, x, y, i, h) → if4'(b3, x, y, i, h)
if4'(true', x, y, i, h) → true'
if4'(false', x, y, i, h) → or'(reach'(x, y, rest'(i), h), reach'(to'(i), y, union'(rest'(i), h), empty'))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
or' :: true':false' → true':false' → true':false'
union' :: empty':edge' → empty':edge' → empty':edge'
empty' :: empty':edge'
edge' :: 0':s' → 0':s' → empty':edge' → empty':edge'
isEmpty' :: empty':edge' → true':false'
from' :: empty':edge' → 0':s'
to' :: empty':edge' → 0':s'
rest' :: empty':edge' → empty':edge'
reach' :: 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if1' :: true':false' → true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if2' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if3' :: true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if4' :: true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_empty':edge'3 :: empty':edge'
_gen_0':s'4 :: Nat → 0':s'
_gen_empty':edge'5 :: Nat → empty':edge'
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_empty':edge'5(0) ⇔ empty'
_gen_empty':edge'5(+(x, 1)) ⇔ edge'(0', 0', _gen_empty':edge'5(x))
The following defined symbols remain to be analysed:
eq', union', reach'
They will be analysed ascendingly in the following order:
eq' < reach'
union' < reach'
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)
or'(true', y) → true'
or'(false', y) → y
union'(empty', h) → h
union'(edge'(x, y, i), h) → edge'(x, y, union'(i, h))
isEmpty'(empty') → true'
isEmpty'(edge'(x, y, i)) → false'
from'(edge'(x, y, i)) → x
to'(edge'(x, y, i)) → y
rest'(edge'(x, y, i)) → i
rest'(empty') → empty'
reach'(x, y, i, h) → if1'(eq'(x, y), isEmpty'(i), eq'(x, from'(i)), eq'(y, to'(i)), x, y, i, h)
if1'(true', b1, b2, b3, x, y, i, h) → true'
if1'(false', b1, b2, b3, x, y, i, h) → if2'(b1, b2, b3, x, y, i, h)
if2'(true', b2, b3, x, y, i, h) → false'
if2'(false', b2, b3, x, y, i, h) → if3'(b2, b3, x, y, i, h)
if3'(false', b3, x, y, i, h) → reach'(x, y, rest'(i), edge'(from'(i), to'(i), h))
if3'(true', b3, x, y, i, h) → if4'(b3, x, y, i, h)
if4'(true', x, y, i, h) → true'
if4'(false', x, y, i, h) → or'(reach'(x, y, rest'(i), h), reach'(to'(i), y, union'(rest'(i), h), empty'))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
or' :: true':false' → true':false' → true':false'
union' :: empty':edge' → empty':edge' → empty':edge'
empty' :: empty':edge'
edge' :: 0':s' → 0':s' → empty':edge' → empty':edge'
isEmpty' :: empty':edge' → true':false'
from' :: empty':edge' → 0':s'
to' :: empty':edge' → 0':s'
rest' :: empty':edge' → empty':edge'
reach' :: 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if1' :: true':false' → true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if2' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if3' :: true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if4' :: true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_empty':edge'3 :: empty':edge'
_gen_0':s'4 :: Nat → 0':s'
_gen_empty':edge'5 :: Nat → empty':edge'
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_empty':edge'5(0) ⇔ empty'
_gen_empty':edge'5(+(x, 1)) ⇔ edge'(0', 0', _gen_empty':edge'5(x))
The following defined symbols remain to be analysed:
union', reach'
They will be analysed ascendingly in the following order:
union' < reach'
Proved the following rewrite lemma:
union'(_gen_empty':edge'5(_n1872), _gen_empty':edge'5(b)) → _gen_empty':edge'5(+(_n1872, b)), rt ∈ Ω(1 + n1872)
Induction Base:
union'(_gen_empty':edge'5(0), _gen_empty':edge'5(b)) →RΩ(1)
_gen_empty':edge'5(b)
Induction Step:
union'(_gen_empty':edge'5(+(_$n1873, 1)), _gen_empty':edge'5(_b2111)) →RΩ(1)
edge'(0', 0', union'(_gen_empty':edge'5(_$n1873), _gen_empty':edge'5(_b2111))) →IH
edge'(0', 0', _gen_empty':edge'5(+(_$n1873, _b2111)))
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)
or'(true', y) → true'
or'(false', y) → y
union'(empty', h) → h
union'(edge'(x, y, i), h) → edge'(x, y, union'(i, h))
isEmpty'(empty') → true'
isEmpty'(edge'(x, y, i)) → false'
from'(edge'(x, y, i)) → x
to'(edge'(x, y, i)) → y
rest'(edge'(x, y, i)) → i
rest'(empty') → empty'
reach'(x, y, i, h) → if1'(eq'(x, y), isEmpty'(i), eq'(x, from'(i)), eq'(y, to'(i)), x, y, i, h)
if1'(true', b1, b2, b3, x, y, i, h) → true'
if1'(false', b1, b2, b3, x, y, i, h) → if2'(b1, b2, b3, x, y, i, h)
if2'(true', b2, b3, x, y, i, h) → false'
if2'(false', b2, b3, x, y, i, h) → if3'(b2, b3, x, y, i, h)
if3'(false', b3, x, y, i, h) → reach'(x, y, rest'(i), edge'(from'(i), to'(i), h))
if3'(true', b3, x, y, i, h) → if4'(b3, x, y, i, h)
if4'(true', x, y, i, h) → true'
if4'(false', x, y, i, h) → or'(reach'(x, y, rest'(i), h), reach'(to'(i), y, union'(rest'(i), h), empty'))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
or' :: true':false' → true':false' → true':false'
union' :: empty':edge' → empty':edge' → empty':edge'
empty' :: empty':edge'
edge' :: 0':s' → 0':s' → empty':edge' → empty':edge'
isEmpty' :: empty':edge' → true':false'
from' :: empty':edge' → 0':s'
to' :: empty':edge' → 0':s'
rest' :: empty':edge' → empty':edge'
reach' :: 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if1' :: true':false' → true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if2' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if3' :: true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if4' :: true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_empty':edge'3 :: empty':edge'
_gen_0':s'4 :: Nat → 0':s'
_gen_empty':edge'5 :: Nat → empty':edge'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
union'(_gen_empty':edge'5(_n1872), _gen_empty':edge'5(b)) → _gen_empty':edge'5(+(_n1872, b)), rt ∈ Ω(1 + n1872)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_empty':edge'5(0) ⇔ empty'
_gen_empty':edge'5(+(x, 1)) ⇔ edge'(0', 0', _gen_empty':edge'5(x))
The following defined symbols remain to be analysed:
reach'
Could not prove a rewrite lemma for the defined symbol reach'.
Rules:
eq'(0', 0') → true'
eq'(0', s'(x)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
or'(true', y) → true'
or'(false', y) → y
union'(empty', h) → h
union'(edge'(x, y, i), h) → edge'(x, y, union'(i, h))
isEmpty'(empty') → true'
isEmpty'(edge'(x, y, i)) → false'
from'(edge'(x, y, i)) → x
to'(edge'(x, y, i)) → y
rest'(edge'(x, y, i)) → i
rest'(empty') → empty'
reach'(x, y, i, h) → if1'(eq'(x, y), isEmpty'(i), eq'(x, from'(i)), eq'(y, to'(i)), x, y, i, h)
if1'(true', b1, b2, b3, x, y, i, h) → true'
if1'(false', b1, b2, b3, x, y, i, h) → if2'(b1, b2, b3, x, y, i, h)
if2'(true', b2, b3, x, y, i, h) → false'
if2'(false', b2, b3, x, y, i, h) → if3'(b2, b3, x, y, i, h)
if3'(false', b3, x, y, i, h) → reach'(x, y, rest'(i), edge'(from'(i), to'(i), h))
if3'(true', b3, x, y, i, h) → if4'(b3, x, y, i, h)
if4'(true', x, y, i, h) → true'
if4'(false', x, y, i, h) → or'(reach'(x, y, rest'(i), h), reach'(to'(i), y, union'(rest'(i), h), empty'))
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
or' :: true':false' → true':false' → true':false'
union' :: empty':edge' → empty':edge' → empty':edge'
empty' :: empty':edge'
edge' :: 0':s' → 0':s' → empty':edge' → empty':edge'
isEmpty' :: empty':edge' → true':false'
from' :: empty':edge' → 0':s'
to' :: empty':edge' → 0':s'
rest' :: empty':edge' → empty':edge'
reach' :: 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if1' :: true':false' → true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if2' :: true':false' → true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if3' :: true':false' → true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
if4' :: true':false' → 0':s' → 0':s' → empty':edge' → empty':edge' → true':false'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_empty':edge'3 :: empty':edge'
_gen_0':s'4 :: Nat → 0':s'
_gen_empty':edge'5 :: Nat → empty':edge'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
union'(_gen_empty':edge'5(_n1872), _gen_empty':edge'5(b)) → _gen_empty':edge'5(+(_n1872, b)), rt ∈ Ω(1 + n1872)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_empty':edge'5(0) ⇔ empty'
_gen_empty':edge'5(+(x, 1)) ⇔ edge'(0', 0', _gen_empty':edge'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)