The rewrite relation of the following equational TRS is considered.
le(0,y) | → | true | (1) |
le(s(x),0) | → | false | (2) |
le(s(x),s(y)) | → | le(x,y) | (3) |
minus(x,0) | → | x | (4) |
minus(s(x),s(y)) | → | minus(x,y) | (5) |
gcd(0,y) | → | y | (6) |
gcd(s(x),0) | → | s(x) | (7) |
gcd(s(x),s(y)) | → | if_gcd(le(y,x),s(x),s(y)) | (8) |
if_gcd(true,s(x),s(y)) | → | gcd(minus(x,y),s(y)) | (9) |
if_gcd(false,s(x),s(y)) | → | gcd(minus(y,x),s(x)) | (10) |
Commutative symbols: gcd
The following set of (strict) dependency pairs is constructed for the TRS.
le#(s(x),s(y)) | → | le#(x,y) | (13) |
minus#(s(x),s(y)) | → | minus#(x,y) | (14) |
gcd#(s(x),s(y)) | → | if_gcd#(le(y,x),s(x),s(y)) | (15) |
gcd#(s(x),s(y)) | → | le#(y,x) | (16) |
if_gcd#(true,s(x),s(y)) | → | gcd#(minus(x,y),s(y)) | (17) |
if_gcd#(true,s(x),s(y)) | → | minus#(x,y) | (18) |
if_gcd#(false,s(x),s(y)) | → | gcd#(minus(y,x),s(x)) | (19) |
if_gcd#(false,s(x),s(y)) | → | minus#(y,x) | (20) |
There are no rules.
give rise to even more dependency pairs (by sharping the root symbols of each rule). Finiteness for all DPs in combination with the equational DPs is proven as follows.The dependency pairs are split into 3 components.
gcd#(s(x),s(y)) | → | if_gcd#(le(y,x),s(x),s(y)) | (15) |
if_gcd#(true,s(x),s(y)) | → | gcd#(minus(x,y),s(y)) | (17) |
gcd#(x,y) | → | gcd#(y,x) | (12) |
if_gcd#(false,s(x),s(y)) | → | gcd#(minus(y,x),s(x)) | (19) |
[if_gcd#(x1, x2, x3)] | = | 1 · x2 + 1 · x3 |
[false] | = | 0 |
[s(x1)] | = | 3 + 1 · x1 |
[gcd#(x1, x2)] | = | 3 + 1 · x1 + 1 · x2 |
[minus(x1, x2)] | = | 1 · x1 |
[le(x1, x2)] | = | 0 |
[true] | = | 0 |
[0] | = | 0 |
minus(s(x),s(y)) | → | minus(x,y) | (5) |
minus(x,0) | → | x | (4) |
gcd#(s(x),s(y)) | → | if_gcd#(le(y,x),s(x),s(y)) | (15) |
The dependency pairs are split into 1 component.
gcd#(x,y) | → | gcd#(y,x) | (12) |
le#(s(x),s(y)) | → | le#(x,y) | (13) |
[le#(x1, x2)] | = | 3 · x1 + 3 · x2 |
[s(x1)] | = | 1 · x1 |
le#(s(x),s(y)) | → | le#(x,y) | (13) |
le(0,y) | → | true | (1) |
le(s(x),0) | → | false | (2) |
le(s(x),s(y)) | → | le(x,y) | (3) |
minus(x,0) | → | x | (4) |
minus(s(x),s(y)) | → | minus(x,y) | (5) |
gcd(0,y) | → | y | (6) |
gcd(s(x),0) | → | s(x) | (7) |
gcd(s(x),s(y)) | → | if_gcd(le(y,x),s(x),s(y)) | (8) |
if_gcd(true,s(x),s(y)) | → | gcd(minus(x,y),s(y)) | (9) |
if_gcd(false,s(x),s(y)) | → | gcd(minus(y,x),s(x)) | (10) |
minus#(s(x),s(y)) | → | minus#(x,y) | (14) |
[minus#(x1, x2)] | = | 3 · x1 + 3 · x2 |
[s(x1)] | = | 1 · x1 |
minus#(s(x),s(y)) | → | minus#(x,y) | (14) |
le(0,y) | → | true | (1) |
le(s(x),0) | → | false | (2) |
le(s(x),s(y)) | → | le(x,y) | (3) |
minus(x,0) | → | x | (4) |
minus(s(x),s(y)) | → | minus(x,y) | (5) |
gcd(0,y) | → | y | (6) |
gcd(s(x),0) | → | s(x) | (7) |
gcd(s(x),s(y)) | → | if_gcd(le(y,x),s(x),s(y)) | (8) |
if_gcd(true,s(x),s(y)) | → | gcd(minus(x,y),s(y)) | (9) |
if_gcd(false,s(x),s(y)) | → | gcd(minus(y,x),s(x)) | (10) |