Runtime Complexity TRS:
The TRS R consists of the following rules:
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
pred(s(x)) → x
minus(x, 0) → x
minus(x, s(y)) → pred(minus(x, y))
gcd(0, y) → y
gcd(s(x), 0) → s(x)
gcd(s(x), s(y)) → if_gcd(le(y, x), s(x), s(y))
if_gcd(true, x, y) → gcd(minus(x, y), y)
if_gcd(false, x, y) → gcd(minus(y, x), x)
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
gcd'(0', y) → y
gcd'(s'(x), 0') → s'(x)
gcd'(s'(x), s'(y)) → if_gcd'(le'(y, x), s'(x), s'(y))
if_gcd'(true', x, y) → gcd'(minus'(x, y), y)
if_gcd'(false', x, y) → gcd'(minus'(y, x), x)
Infered types.
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
gcd'(0', y) → y
gcd'(s'(x), 0') → s'(x)
gcd'(s'(x), s'(y)) → if_gcd'(le'(y, x), s'(x), s'(y))
if_gcd'(true', x, y) → gcd'(minus'(x, y), y)
if_gcd'(false', x, y) → gcd'(minus'(y, x), x)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
pred' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s'
if_gcd' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
le', minus', gcd'
They will be analysed ascendingly in the following order:
le' < gcd'
minus' < gcd'
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
gcd'(0', y) → y
gcd'(s'(x), 0') → s'(x)
gcd'(s'(x), s'(y)) → if_gcd'(le'(y, x), s'(x), s'(y))
if_gcd'(true', x, y) → gcd'(minus'(x, y), y)
if_gcd'(false', x, y) → gcd'(minus'(y, x), x)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
pred' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s'
if_gcd' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_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:
le', minus', gcd'
They will be analysed ascendingly in the following order:
le' < gcd'
minus' < gcd'
Proved the following rewrite lemma:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
Induction Base:
le'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
true'
Induction Step:
le'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(_$n6, 1))) →RΩ(1)
le'(_gen_0':s'3(_$n6), _gen_0':s'3(_$n6)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
gcd'(0', y) → y
gcd'(s'(x), 0') → s'(x)
gcd'(s'(x), s'(y)) → if_gcd'(le'(y, x), s'(x), s'(y))
if_gcd'(true', x, y) → gcd'(minus'(x, y), y)
if_gcd'(false', x, y) → gcd'(minus'(y, x), x)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
pred' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s'
if_gcd' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', 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:
minus', gcd'
They will be analysed ascendingly in the following order:
minus' < gcd'
Proved the following rewrite lemma:
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n566))) → _*4, rt ∈ Ω(n566)
Induction Base:
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, 0)))
Induction Step:
minus'(_gen_0':s'3(_a1573), _gen_0':s'3(+(1, +(_$n567, 1)))) →RΩ(1)
pred'(minus'(_gen_0':s'3(_a1573), _gen_0':s'3(+(1, _$n567)))) →IH
pred'(_*4)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
gcd'(0', y) → y
gcd'(s'(x), 0') → s'(x)
gcd'(s'(x), s'(y)) → if_gcd'(le'(y, x), s'(x), s'(y))
if_gcd'(true', x, y) → gcd'(minus'(x, y), y)
if_gcd'(false', x, y) → gcd'(minus'(y, x), x)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
pred' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s'
if_gcd' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n566))) → _*4, rt ∈ Ω(n566)
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:
gcd'
Could not prove a rewrite lemma for the defined symbol gcd'.
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
gcd'(0', y) → y
gcd'(s'(x), 0') → s'(x)
gcd'(s'(x), s'(y)) → if_gcd'(le'(y, x), s'(x), s'(y))
if_gcd'(true', x, y) → gcd'(minus'(x, y), y)
if_gcd'(false', x, y) → gcd'(minus'(y, x), x)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
pred' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s'
if_gcd' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n566))) → _*4, rt ∈ Ω(n566)
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:
le'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)