(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0) → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0) → false
le(0, Y) → true
gcd(0, Y) → 0
gcd(s(X), 0) → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
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:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0') → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0') → false
le(0', Y) → true
gcd(0', Y) → 0'
gcd(s(X), 0') → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0') → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0') → false
le(0', Y) → true
gcd(0', Y) → 0'
gcd(s(X), 0') → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
minus,
le,
gcdThey will be analysed ascendingly in the following order:
minus < gcd
le < gcd
(6) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
minus, le, gcd
They will be analysed ascendingly in the following order:
minus < gcd
le < gcd
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
minus(
gen_s:0'3_0(
a),
gen_s:0'3_0(
+(
1,
n5_0))) →
*4_0, rt ∈ Ω(n5
0)
Induction Base:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, 0)))
Induction Step:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, +(n5_0, 1)))) →RΩ(1)
pred(minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0)))) →IH
pred(*4_0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
le, gcd
They will be analysed ascendingly in the following order:
le < gcd
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
le(
gen_s:0'3_0(
+(
1,
n3021_0)),
gen_s:0'3_0(
n3021_0)) →
false, rt ∈ Ω(1 + n3021
0)
Induction Base:
le(gen_s:0'3_0(+(1, 0)), gen_s:0'3_0(0)) →RΩ(1)
false
Induction Step:
le(gen_s:0'3_0(+(1, +(n3021_0, 1))), gen_s:0'3_0(+(n3021_0, 1))) →RΩ(1)
le(gen_s:0'3_0(+(1, n3021_0)), gen_s:0'3_0(n3021_0)) →IH
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
le(gen_s:0'3_0(+(1, n3021_0)), gen_s:0'3_0(n3021_0)) → false, rt ∈ Ω(1 + n30210)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
gcd
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol gcd.
(14) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
le(gen_s:0'3_0(+(1, n3021_0)), gen_s:0'3_0(n3021_0)) → false, rt ∈ Ω(1 + n30210)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
(16) BOUNDS(n^1, INF)
(17) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
le(gen_s:0'3_0(+(1, n3021_0)), gen_s:0'3_0(n3021_0)) → false, rt ∈ Ω(1 + n30210)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
(19) BOUNDS(n^1, INF)
(20) Obligation:
Innermost TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
minus(gen_s:0'3_0(a), gen_s:0'3_0(+(1, n5_0))) → *4_0, rt ∈ Ω(n50)
(22) BOUNDS(n^1, INF)