(0) Obligation:
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))
reach(x, y, empty, h) → false
reach(x, y, edge(u, v, i), h) → if_reach_1(eq(x, u), x, y, edge(u, v, i), h)
if_reach_1(true, x, y, edge(u, v, i), h) → if_reach_2(eq(y, v), x, y, edge(u, v, i), h)
if_reach_2(true, x, y, edge(u, v, i), h) → true
if_reach_2(false, x, y, edge(u, v, i), h) → or(reach(x, y, i, h), reach(v, y, union(i, h), empty))
if_reach_1(false, x, y, edge(u, v, i), h) → reach(x, y, i, edge(u, v, h))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative 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))
reach(x, y, empty, h) → false
reach(x, y, edge(u, v, i), h) → if_reach_1(eq(x, u), x, y, edge(u, v, i), h)
if_reach_1(true, x, y, edge(u, v, i), h) → if_reach_2(eq(y, v), x, y, edge(u, v, i), h)
if_reach_2(true, x, y, edge(u, v, i), h) → true
if_reach_2(false, x, y, edge(u, v, i), h) → or(reach(x, y, i, h), reach(v, y, union(i, h), empty))
if_reach_1(false, x, y, edge(u, v, i), h) → reach(x, y, i, edge(u, v, h))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
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))
reach(x, y, empty, h) → false
reach(x, y, edge(u, v, i), h) → if_reach_1(eq(x, u), x, y, edge(u, v, i), h)
if_reach_1(true, x, y, edge(u, v, i), h) → if_reach_2(eq(y, v), x, y, edge(u, v, i), h)
if_reach_2(true, x, y, edge(u, v, i), h) → true
if_reach_2(false, x, y, edge(u, v, i), h) → or(reach(x, y, i, h), reach(v, y, union(i, h), empty))
if_reach_1(false, x, y, edge(u, v, i), h) → reach(x, y, i, edge(u, v, h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
eq,
union,
reachThey will be analysed ascendingly in the following order:
eq < reach
union < reach
(6) Obligation:
Innermost TRS:
Rules:
eq(
0',
0') →
trueeq(
0',
s(
x)) →
falseeq(
s(
x),
0') →
falseeq(
s(
x),
s(
y)) →
eq(
x,
y)
or(
true,
y) →
trueor(
false,
y) →
yunion(
empty,
h) →
hunion(
edge(
x,
y,
i),
h) →
edge(
x,
y,
union(
i,
h))
reach(
x,
y,
empty,
h) →
falsereach(
x,
y,
edge(
u,
v,
i),
h) →
if_reach_1(
eq(
x,
u),
x,
y,
edge(
u,
v,
i),
h)
if_reach_1(
true,
x,
y,
edge(
u,
v,
i),
h) →
if_reach_2(
eq(
y,
v),
x,
y,
edge(
u,
v,
i),
h)
if_reach_2(
true,
x,
y,
edge(
u,
v,
i),
h) →
trueif_reach_2(
false,
x,
y,
edge(
u,
v,
i),
h) →
or(
reach(
x,
y,
i,
h),
reach(
v,
y,
union(
i,
h),
empty))
if_reach_1(
false,
x,
y,
edge(
u,
v,
i),
h) →
reach(
x,
y,
i,
edge(
u,
v,
h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_empty:edge5_0(0) ⇔ empty
gen_empty:edge5_0(+(x, 1)) ⇔ edge(0', 0', gen_empty:edge5_0(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
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
eq(
gen_0':s4_0(
n7_0),
gen_0':s4_0(
n7_0)) →
true, rt ∈ Ω(1 + n7
0)
Induction Base:
eq(gen_0':s4_0(0), gen_0':s4_0(0)) →RΩ(1)
true
Induction Step:
eq(gen_0':s4_0(+(n7_0, 1)), gen_0':s4_0(+(n7_0, 1))) →RΩ(1)
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
eq(
0',
0') →
trueeq(
0',
s(
x)) →
falseeq(
s(
x),
0') →
falseeq(
s(
x),
s(
y)) →
eq(
x,
y)
or(
true,
y) →
trueor(
false,
y) →
yunion(
empty,
h) →
hunion(
edge(
x,
y,
i),
h) →
edge(
x,
y,
union(
i,
h))
reach(
x,
y,
empty,
h) →
falsereach(
x,
y,
edge(
u,
v,
i),
h) →
if_reach_1(
eq(
x,
u),
x,
y,
edge(
u,
v,
i),
h)
if_reach_1(
true,
x,
y,
edge(
u,
v,
i),
h) →
if_reach_2(
eq(
y,
v),
x,
y,
edge(
u,
v,
i),
h)
if_reach_2(
true,
x,
y,
edge(
u,
v,
i),
h) →
trueif_reach_2(
false,
x,
y,
edge(
u,
v,
i),
h) →
or(
reach(
x,
y,
i,
h),
reach(
v,
y,
union(
i,
h),
empty))
if_reach_1(
false,
x,
y,
edge(
u,
v,
i),
h) →
reach(
x,
y,
i,
edge(
u,
v,
h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
Lemmas:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_empty:edge5_0(0) ⇔ empty
gen_empty:edge5_0(+(x, 1)) ⇔ edge(0', 0', gen_empty:edge5_0(x))
The following defined symbols remain to be analysed:
union, reach
They will be analysed ascendingly in the following order:
union < reach
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
union(
gen_empty:edge5_0(
n540_0),
gen_empty:edge5_0(
b)) →
gen_empty:edge5_0(
+(
n540_0,
b)), rt ∈ Ω(1 + n540
0)
Induction Base:
union(gen_empty:edge5_0(0), gen_empty:edge5_0(b)) →RΩ(1)
gen_empty:edge5_0(b)
Induction Step:
union(gen_empty:edge5_0(+(n540_0, 1)), gen_empty:edge5_0(b)) →RΩ(1)
edge(0', 0', union(gen_empty:edge5_0(n540_0), gen_empty:edge5_0(b))) →IH
edge(0', 0', gen_empty:edge5_0(+(b, c541_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
eq(
0',
0') →
trueeq(
0',
s(
x)) →
falseeq(
s(
x),
0') →
falseeq(
s(
x),
s(
y)) →
eq(
x,
y)
or(
true,
y) →
trueor(
false,
y) →
yunion(
empty,
h) →
hunion(
edge(
x,
y,
i),
h) →
edge(
x,
y,
union(
i,
h))
reach(
x,
y,
empty,
h) →
falsereach(
x,
y,
edge(
u,
v,
i),
h) →
if_reach_1(
eq(
x,
u),
x,
y,
edge(
u,
v,
i),
h)
if_reach_1(
true,
x,
y,
edge(
u,
v,
i),
h) →
if_reach_2(
eq(
y,
v),
x,
y,
edge(
u,
v,
i),
h)
if_reach_2(
true,
x,
y,
edge(
u,
v,
i),
h) →
trueif_reach_2(
false,
x,
y,
edge(
u,
v,
i),
h) →
or(
reach(
x,
y,
i,
h),
reach(
v,
y,
union(
i,
h),
empty))
if_reach_1(
false,
x,
y,
edge(
u,
v,
i),
h) →
reach(
x,
y,
i,
edge(
u,
v,
h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
Lemmas:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
union(gen_empty:edge5_0(n540_0), gen_empty:edge5_0(b)) → gen_empty:edge5_0(+(n540_0, b)), rt ∈ Ω(1 + n5400)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_empty:edge5_0(0) ⇔ empty
gen_empty:edge5_0(+(x, 1)) ⇔ edge(0', 0', gen_empty:edge5_0(x))
The following defined symbols remain to be analysed:
reach
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol reach.
(14) Obligation:
Innermost TRS:
Rules:
eq(
0',
0') →
trueeq(
0',
s(
x)) →
falseeq(
s(
x),
0') →
falseeq(
s(
x),
s(
y)) →
eq(
x,
y)
or(
true,
y) →
trueor(
false,
y) →
yunion(
empty,
h) →
hunion(
edge(
x,
y,
i),
h) →
edge(
x,
y,
union(
i,
h))
reach(
x,
y,
empty,
h) →
falsereach(
x,
y,
edge(
u,
v,
i),
h) →
if_reach_1(
eq(
x,
u),
x,
y,
edge(
u,
v,
i),
h)
if_reach_1(
true,
x,
y,
edge(
u,
v,
i),
h) →
if_reach_2(
eq(
y,
v),
x,
y,
edge(
u,
v,
i),
h)
if_reach_2(
true,
x,
y,
edge(
u,
v,
i),
h) →
trueif_reach_2(
false,
x,
y,
edge(
u,
v,
i),
h) →
or(
reach(
x,
y,
i,
h),
reach(
v,
y,
union(
i,
h),
empty))
if_reach_1(
false,
x,
y,
edge(
u,
v,
i),
h) →
reach(
x,
y,
i,
edge(
u,
v,
h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
Lemmas:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
union(gen_empty:edge5_0(n540_0), gen_empty:edge5_0(b)) → gen_empty:edge5_0(+(n540_0, b)), rt ∈ Ω(1 + n5400)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_empty:edge5_0(0) ⇔ empty
gen_empty:edge5_0(+(x, 1)) ⇔ edge(0', 0', gen_empty:edge5_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
(16) BOUNDS(n^1, INF)
(17) Obligation:
Innermost TRS:
Rules:
eq(
0',
0') →
trueeq(
0',
s(
x)) →
falseeq(
s(
x),
0') →
falseeq(
s(
x),
s(
y)) →
eq(
x,
y)
or(
true,
y) →
trueor(
false,
y) →
yunion(
empty,
h) →
hunion(
edge(
x,
y,
i),
h) →
edge(
x,
y,
union(
i,
h))
reach(
x,
y,
empty,
h) →
falsereach(
x,
y,
edge(
u,
v,
i),
h) →
if_reach_1(
eq(
x,
u),
x,
y,
edge(
u,
v,
i),
h)
if_reach_1(
true,
x,
y,
edge(
u,
v,
i),
h) →
if_reach_2(
eq(
y,
v),
x,
y,
edge(
u,
v,
i),
h)
if_reach_2(
true,
x,
y,
edge(
u,
v,
i),
h) →
trueif_reach_2(
false,
x,
y,
edge(
u,
v,
i),
h) →
or(
reach(
x,
y,
i,
h),
reach(
v,
y,
union(
i,
h),
empty))
if_reach_1(
false,
x,
y,
edge(
u,
v,
i),
h) →
reach(
x,
y,
i,
edge(
u,
v,
h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
Lemmas:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
union(gen_empty:edge5_0(n540_0), gen_empty:edge5_0(b)) → gen_empty:edge5_0(+(n540_0, b)), rt ∈ Ω(1 + n5400)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_empty:edge5_0(0) ⇔ empty
gen_empty:edge5_0(+(x, 1)) ⇔ edge(0', 0', gen_empty:edge5_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
(19) BOUNDS(n^1, INF)
(20) Obligation:
Innermost TRS:
Rules:
eq(
0',
0') →
trueeq(
0',
s(
x)) →
falseeq(
s(
x),
0') →
falseeq(
s(
x),
s(
y)) →
eq(
x,
y)
or(
true,
y) →
trueor(
false,
y) →
yunion(
empty,
h) →
hunion(
edge(
x,
y,
i),
h) →
edge(
x,
y,
union(
i,
h))
reach(
x,
y,
empty,
h) →
falsereach(
x,
y,
edge(
u,
v,
i),
h) →
if_reach_1(
eq(
x,
u),
x,
y,
edge(
u,
v,
i),
h)
if_reach_1(
true,
x,
y,
edge(
u,
v,
i),
h) →
if_reach_2(
eq(
y,
v),
x,
y,
edge(
u,
v,
i),
h)
if_reach_2(
true,
x,
y,
edge(
u,
v,
i),
h) →
trueif_reach_2(
false,
x,
y,
edge(
u,
v,
i),
h) →
or(
reach(
x,
y,
i,
h),
reach(
v,
y,
union(
i,
h),
empty))
if_reach_1(
false,
x,
y,
edge(
u,
v,
i),
h) →
reach(
x,
y,
i,
edge(
u,
v,
h))
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
reach :: 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_1 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
if_reach_2 :: true:false → 0':s → 0':s → empty:edge → empty:edge → true:false
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
hole_empty:edge3_0 :: empty:edge
gen_0':s4_0 :: Nat → 0':s
gen_empty:edge5_0 :: Nat → empty:edge
Lemmas:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_empty:edge5_0(0) ⇔ empty
gen_empty:edge5_0(+(x, 1)) ⇔ edge(0', 0', gen_empty:edge5_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
eq(gen_0':s4_0(n7_0), gen_0':s4_0(n7_0)) → true, rt ∈ Ω(1 + n70)
(22) BOUNDS(n^1, INF)