(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
or(true, y) → true
or(x, true) → true
or(false, false) → false
mem(x, nil) → false
mem(x, set(y)) → =(x, y)
mem(x, union(y, z)) → or(mem(x, y), mem(x, z))
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:
or(true, y) → true
or(x, true) → true
or(false, false) → false
mem(x, nil) → false
mem(x, set(y)) → ='(x, y)
mem(x, union(y, z)) → or(mem(x, y), mem(x, z))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
or(true, y) → true
or(x, true) → true
or(false, false) → false
mem(x, nil) → false
mem(x, set(y)) → ='(x, y)
mem(x, union(y, z)) → or(mem(x, y), mem(x, z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
mem
(6) Obligation:
Innermost TRS:
Rules:
or(
true,
y) →
trueor(
x,
true) →
trueor(
false,
false) →
falsemem(
x,
nil) →
falsemem(
x,
set(
y)) →
='(
x,
y)
mem(
x,
union(
y,
z)) →
or(
mem(
x,
y),
mem(
x,
z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
Generator Equations:
gen_nil:set:union5_0(0) ⇔ nil
gen_nil:set:union5_0(+(x, 1)) ⇔ union(nil, gen_nil:set:union5_0(x))
The following defined symbols remain to be analysed:
mem
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
mem(
hole_a2_0,
gen_nil:set:union5_0(
n7_0)) →
false, rt ∈ Ω(1 + n7
0)
Induction Base:
mem(hole_a2_0, gen_nil:set:union5_0(0)) →RΩ(1)
false
Induction Step:
mem(hole_a2_0, gen_nil:set:union5_0(+(n7_0, 1))) →RΩ(1)
or(mem(hole_a2_0, nil), mem(hole_a2_0, gen_nil:set:union5_0(n7_0))) →RΩ(1)
or(false, mem(hole_a2_0, gen_nil:set:union5_0(n7_0))) →IH
or(false, false) →RΩ(1)
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
or(
true,
y) →
trueor(
x,
true) →
trueor(
false,
false) →
falsemem(
x,
nil) →
falsemem(
x,
set(
y)) →
='(
x,
y)
mem(
x,
union(
y,
z)) →
or(
mem(
x,
y),
mem(
x,
z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
Lemmas:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
Generator Equations:
gen_nil:set:union5_0(0) ⇔ nil
gen_nil:set:union5_0(+(x, 1)) ⇔ union(nil, gen_nil:set:union5_0(x))
No more defined symbols left to analyse.
(10) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
(11) BOUNDS(n^1, INF)
(12) Obligation:
Innermost TRS:
Rules:
or(
true,
y) →
trueor(
x,
true) →
trueor(
false,
false) →
falsemem(
x,
nil) →
falsemem(
x,
set(
y)) →
='(
x,
y)
mem(
x,
union(
y,
z)) →
or(
mem(
x,
y),
mem(
x,
z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
Lemmas:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
Generator Equations:
gen_nil:set:union5_0(0) ⇔ nil
gen_nil:set:union5_0(+(x, 1)) ⇔ union(nil, gen_nil:set:union5_0(x))
No more defined symbols left to analyse.
(13) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
(14) BOUNDS(n^1, INF)