Runtime Complexity TRS:
The TRS R consists of the following rules:
-(x, 0) → x
-(0, s(y)) → 0
-(s(x), s(y)) → -(x, y)
lt(x, 0) → false
lt(0, s(y)) → true
lt(s(x), s(y)) → lt(x, y)
if(true, x, y) → x
if(false, x, y) → y
div(x, 0) → 0
div(0, y) → 0
div(s(x), s(y)) → if(lt(x, y), 0, s(div(-(x, y), s(y))))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
lt'(x, 0') → false'
lt'(0', s'(y)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
div'(x, 0') → 0'
div'(0', y) → 0'
div'(s'(x), s'(y)) → if'(lt'(x, y), 0', s'(div'(-'(x, y), s'(y))))
Infered types.
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
lt'(x, 0') → false'
lt'(0', s'(y)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
div'(x, 0') → 0'
div'(0', y) → 0'
div'(s'(x), s'(y)) → if'(lt'(x, y), 0', s'(div'(-'(x, y), s'(y))))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
lt' :: 0':s' → 0':s' → false':true'
false' :: false':true'
true' :: false':true'
if' :: false':true' → 0':s' → 0':s' → 0':s'
div' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
-', lt', div'
They will be analysed ascendingly in the following order:
-' < div'
lt' < div'
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
lt'(x, 0') → false'
lt'(0', s'(y)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
div'(x, 0') → 0'
div'(0', y) → 0'
div'(s'(x), s'(y)) → if'(lt'(x, y), 0', s'(div'(-'(x, y), s'(y))))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
lt' :: 0':s' → 0':s' → false':true'
false' :: false':true'
true' :: false':true'
if' :: false':true' → 0':s' → 0':s' → 0':s'
div' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
-', lt', div'
They will be analysed ascendingly in the following order:
-' < div'
lt' < div'
Proved the following rewrite lemma:
-'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)
Induction Base:
-'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(0)
Induction Step:
-'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(_$n6, 1))) →RΩ(1)
-'(_gen_0':s'3(_$n6), _gen_0':s'3(_$n6)) →IH
_gen_0':s'3(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
lt'(x, 0') → false'
lt'(0', s'(y)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
div'(x, 0') → 0'
div'(0', y) → 0'
div'(s'(x), s'(y)) → if'(lt'(x, y), 0', s'(div'(-'(x, y), s'(y))))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
lt' :: 0':s' → 0':s' → false':true'
false' :: false':true'
true' :: false':true'
if' :: false':true' → 0':s' → 0':s' → 0':s'
div' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
-'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
lt', div'
They will be analysed ascendingly in the following order:
lt' < div'
Proved the following rewrite lemma:
lt'(_gen_0':s'3(_n743), _gen_0':s'3(_n743)) → false', rt ∈ Ω(1 + n743)
Induction Base:
lt'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
false'
Induction Step:
lt'(_gen_0':s'3(+(_$n744, 1)), _gen_0':s'3(+(_$n744, 1))) →RΩ(1)
lt'(_gen_0':s'3(_$n744), _gen_0':s'3(_$n744)) →IH
false'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
lt'(x, 0') → false'
lt'(0', s'(y)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
div'(x, 0') → 0'
div'(0', y) → 0'
div'(s'(x), s'(y)) → if'(lt'(x, y), 0', s'(div'(-'(x, y), s'(y))))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
lt' :: 0':s' → 0':s' → false':true'
false' :: false':true'
true' :: false':true'
if' :: false':true' → 0':s' → 0':s' → 0':s'
div' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
-'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)
lt'(_gen_0':s'3(_n743), _gen_0':s'3(_n743)) → false', rt ∈ Ω(1 + n743)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
div'
Could not prove a rewrite lemma for the defined symbol div'.
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
lt'(x, 0') → false'
lt'(0', s'(y)) → true'
lt'(s'(x), s'(y)) → lt'(x, y)
if'(true', x, y) → x
if'(false', x, y) → y
div'(x, 0') → 0'
div'(0', y) → 0'
div'(s'(x), s'(y)) → if'(lt'(x, y), 0', s'(div'(-'(x, y), s'(y))))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
lt' :: 0':s' → 0':s' → false':true'
false' :: false':true'
true' :: false':true'
if' :: false':true' → 0':s' → 0':s' → 0':s'
div' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
-'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)
lt'(_gen_0':s'3(_n743), _gen_0':s'3(_n743)) → false', rt ∈ Ω(1 + n743)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
-'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(0), rt ∈ Ω(1 + n5)