The rewrite relation of the following equational TRS is considered.
| eq(0,0) | → | true | (1) |
| eq(0,s(x)) | → | false | (2) |
| eq(s(x),0) | → | false | (3) |
| eq(s(x),s(y)) | → | eq(x,y) | (4) |
| le(0,y) | → | true | (5) |
| le(s(x),0) | → | false | (6) |
| le(s(x),s(y)) | → | le(x,y) | (7) |
| app(nil,y) | → | y | (8) |
| app(add(n,x),y) | → | add(n,app(x,y)) | (9) |
| min(add(n,nil)) | → | n | (10) |
| min(add(n,add(m,x))) | → | if_min(le(n,m),add(n,add(m,x))) | (11) |
| if_min(true,add(n,add(m,x))) | → | min(add(n,x)) | (12) |
| if_min(false,add(n,add(m,x))) | → | min(add(m,x)) | (13) |
| rm(n,nil) | → | nil | (14) |
| rm(n,add(m,x)) | → | if_rm(eq(n,m),n,add(m,x)) | (15) |
| if_rm(true,n,add(m,x)) | → | rm(n,x) | (16) |
| if_rm(false,n,add(m,x)) | → | add(m,rm(n,x)) | (17) |
| minsort(nil,nil) | → | nil | (18) |
| minsort(add(n,x),y) | → | if_minsort(eq(n,min(add(n,x))),add(n,x),y) | (19) |
| if_minsort(true,add(n,x),y) | → | add(n,minsort(app(rm(n,x),y),nil)) | (20) |
| if_minsort(false,add(n,x),y) | → | minsort(x,add(n,y)) | (21) |
Commutative symbols: eq
The following set of (strict) dependency pairs is constructed for the TRS.
| eq#(s(x),s(y)) | → | eq#(x,y) | (24) |
| le#(s(x),s(y)) | → | le#(x,y) | (25) |
| app#(add(n,x),y) | → | app#(x,y) | (26) |
| min#(add(n,add(m,x))) | → | if_min#(le(n,m),add(n,add(m,x))) | (27) |
| min#(add(n,add(m,x))) | → | le#(n,m) | (28) |
| if_min#(true,add(n,add(m,x))) | → | min#(add(n,x)) | (29) |
| if_min#(false,add(n,add(m,x))) | → | min#(add(m,x)) | (30) |
| rm#(n,add(m,x)) | → | if_rm#(eq(n,m),n,add(m,x)) | (31) |
| rm#(n,add(m,x)) | → | eq#(n,m) | (32) |
| if_rm#(true,n,add(m,x)) | → | rm#(n,x) | (33) |
| if_rm#(false,n,add(m,x)) | → | rm#(n,x) | (34) |
| minsort#(add(n,x),y) | → | if_minsort#(eq(n,min(add(n,x))),add(n,x),y) | (35) |
| minsort#(add(n,x),y) | → | eq#(n,min(add(n,x))) | (36) |
| minsort#(add(n,x),y) | → | min#(add(n,x)) | (37) |
| if_minsort#(true,add(n,x),y) | → | minsort#(app(rm(n,x),y),nil) | (38) |
| if_minsort#(true,add(n,x),y) | → | app#(rm(n,x),y) | (39) |
| if_minsort#(true,add(n,x),y) | → | rm#(n,x) | (40) |
| if_minsort#(false,add(n,x),y) | → | minsort#(x,add(n,y)) | (41) |
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 6 components.
| if_minsort#(true,add(n,x),y) | → | minsort#(app(rm(n,x),y),nil) | (38) |
| minsort#(add(n,x),y) | → | if_minsort#(eq(n,min(add(n,x))),add(n,x),y) | (35) |
| if_minsort#(false,add(n,x),y) | → | minsort#(x,add(n,y)) | (41) |
| [if_minsort#(x1, x2, x3)] | = | 1 · x2 + 1 · x3 |
| [true] | = | 0 |
| [add(x1, x2)] | = | 1 + 1 · x2 |
| [minsort#(x1, x2)] | = | 1 · x1 + 1 · x2 |
| [app(x1, x2)] | = | 1 · x1 + 1 · x2 |
| [rm(x1, x2)] | = | 1 · x2 |
| [nil] | = | 0 |
| [eq(x1, x2)] | = | 0 |
| [min(x1)] | = | 0 |
| [false] | = | 0 |
| [if_min(x1, x2)] | = | 2 |
| [le(x1, x2)] | = | 0 |
| [if_rm(x1, x2, x3)] | = | 1 · x3 |
| [s(x1)] | = | 0 |
| [0] | = | 0 |
| rm(n,nil) | → | nil | (14) |
| rm(n,add(m,x)) | → | if_rm(eq(n,m),n,add(m,x)) | (15) |
| if_rm(false,n,add(m,x)) | → | add(m,rm(n,x)) | (17) |
| if_rm(true,n,add(m,x)) | → | rm(n,x) | (16) |
| app(add(n,x),y) | → | add(n,app(x,y)) | (9) |
| app(nil,y) | → | y | (8) |
| if_minsort#(true,add(n,x),y) | → | minsort#(app(rm(n,x),y),nil) | (38) |
| [minsort#(x1, x2)] | = | 1 + 3 · x1 + 1 · x2 |
| [add(x1, x2)] | = | 3 + 1 · x2 |
| [if_minsort#(x1, x2, x3)] | = | 1 + 3 · x2 + 1 · x3 |
| [eq(x1, x2)] | = | 0 |
| [min(x1)] | = | 0 |
| [false] | = | 0 |
| [if_min(x1, x2)] | = | 2 |
| [le(x1, x2)] | = | 3 · x1 |
| [nil] | = | 0 |
| [s(x1)] | = | 3 · x1 |
| [0] | = | 0 |
| [true] | = | 0 |
| if_minsort#(false,add(n,x),y) | → | minsort#(x,add(n,y)) | (41) |
The dependency pairs are split into 0 components.
| rm#(n,add(m,x)) | → | if_rm#(eq(n,m),n,add(m,x)) | (31) |
| if_rm#(true,n,add(m,x)) | → | rm#(n,x) | (33) |
| if_rm#(false,n,add(m,x)) | → | rm#(n,x) | (34) |
| [if_rm#(x1, x2, x3)] | = | 3 · x2 + 2 · x3 |
| [true] | = | 0 |
| [add(x1, x2)] | = | 2 + 1 · x2 |
| [rm#(x1, x2)] | = | 3 + 3 · x1 + 2 · x2 |
| [eq(x1, x2)] | = | 0 |
| [false] | = | 0 |
| [0] | = | 0 |
| [s(x1)] | = | 0 |
| if_rm#(true,n,add(m,x)) | → | rm#(n,x) | (33) |
| rm#(n,add(m,x)) | → | if_rm#(eq(n,m),n,add(m,x)) | (31) |
| if_rm#(false,n,add(m,x)) | → | rm#(n,x) | (34) |
| eq#(x,y) | → | eq#(y,x) | (23) |
| eq#(s(x),s(y)) | → | eq#(x,y) | (24) |
| [eq#(x1, x2)] | = | 3 · x1 + 3 · x2 |
| [s(x1)] | = | 3 · x1 |
| eq#(s(x),s(y)) | → | eq#(x,y) | (24) |
| eq(0,0) | → | true | (1) |
| eq(0,s(x)) | → | false | (2) |
| eq(s(x),0) | → | false | (3) |
| eq(s(x),s(y)) | → | eq(x,y) | (4) |
| le(0,y) | → | true | (5) |
| le(s(x),0) | → | false | (6) |
| le(s(x),s(y)) | → | le(x,y) | (7) |
| app(nil,y) | → | y | (8) |
| app(add(n,x),y) | → | add(n,app(x,y)) | (9) |
| min(add(n,nil)) | → | n | (10) |
| min(add(n,add(m,x))) | → | if_min(le(n,m),add(n,add(m,x))) | (11) |
| if_min(true,add(n,add(m,x))) | → | min(add(n,x)) | (12) |
| if_min(false,add(n,add(m,x))) | → | min(add(m,x)) | (13) |
| rm(n,nil) | → | nil | (14) |
| rm(n,add(m,x)) | → | if_rm(eq(n,m),n,add(m,x)) | (15) |
| if_rm(true,n,add(m,x)) | → | rm(n,x) | (16) |
| if_rm(false,n,add(m,x)) | → | add(m,rm(n,x)) | (17) |
| minsort(nil,nil) | → | nil | (18) |
| minsort(add(n,x),y) | → | if_minsort(eq(n,min(add(n,x))),add(n,x),y) | (19) |
| if_minsort(true,add(n,x),y) | → | add(n,minsort(app(rm(n,x),y),nil)) | (20) |
| if_minsort(false,add(n,x),y) | → | minsort(x,add(n,y)) | (21) |
| min#(add(n,add(m,x))) | → | if_min#(le(n,m),add(n,add(m,x))) | (27) |
| if_min#(true,add(n,add(m,x))) | → | min#(add(n,x)) | (29) |
| if_min#(false,add(n,add(m,x))) | → | min#(add(m,x)) | (30) |
| [if_min#(x1, x2)] | = | 2 · x2 |
| [true] | = | 0 |
| [add(x1, x2)] | = | 3 + 3 · x2 |
| [min#(x1)] | = | 3 + 3 · x1 |
| [false] | = | 0 |
| [le(x1, x2)] | = | 0 |
| [s(x1)] | = | 3 · x1 |
| [0] | = | 0 |
| if_min#(true,add(n,add(m,x))) | → | min#(add(n,x)) | (29) |
| if_min#(false,add(n,add(m,x))) | → | min#(add(m,x)) | (30) |
| min#(add(n,add(m,x))) | → | if_min#(le(n,m),add(n,add(m,x))) | (27) |
| le#(s(x),s(y)) | → | le#(x,y) | (25) |
| [le#(x1, x2)] | = | 3 · x1 + 3 · x2 |
| [s(x1)] | = | 1 · x1 |
| le#(s(x),s(y)) | → | le#(x,y) | (25) |
| eq(0,0) | → | true | (1) |
| eq(0,s(x)) | → | false | (2) |
| eq(s(x),0) | → | false | (3) |
| eq(s(x),s(y)) | → | eq(x,y) | (4) |
| le(0,y) | → | true | (5) |
| le(s(x),0) | → | false | (6) |
| le(s(x),s(y)) | → | le(x,y) | (7) |
| app(nil,y) | → | y | (8) |
| app(add(n,x),y) | → | add(n,app(x,y)) | (9) |
| min(add(n,nil)) | → | n | (10) |
| min(add(n,add(m,x))) | → | if_min(le(n,m),add(n,add(m,x))) | (11) |
| if_min(true,add(n,add(m,x))) | → | min(add(n,x)) | (12) |
| if_min(false,add(n,add(m,x))) | → | min(add(m,x)) | (13) |
| rm(n,nil) | → | nil | (14) |
| rm(n,add(m,x)) | → | if_rm(eq(n,m),n,add(m,x)) | (15) |
| if_rm(true,n,add(m,x)) | → | rm(n,x) | (16) |
| if_rm(false,n,add(m,x)) | → | add(m,rm(n,x)) | (17) |
| minsort(nil,nil) | → | nil | (18) |
| minsort(add(n,x),y) | → | if_minsort(eq(n,min(add(n,x))),add(n,x),y) | (19) |
| if_minsort(true,add(n,x),y) | → | add(n,minsort(app(rm(n,x),y),nil)) | (20) |
| if_minsort(false,add(n,x),y) | → | minsort(x,add(n,y)) | (21) |
| app#(add(n,x),y) | → | app#(x,y) | (26) |
| [app#(x1, x2)] | = | 3 · x1 + 1 · x2 |
| [add(x1, x2)] | = | 1 · x1 + 3 · x2 |
| app#(add(n,x),y) | → | app#(x,y) | (26) |
| eq(0,0) | → | true | (1) |
| eq(0,s(x)) | → | false | (2) |
| eq(s(x),0) | → | false | (3) |
| eq(s(x),s(y)) | → | eq(x,y) | (4) |
| le(0,y) | → | true | (5) |
| le(s(x),0) | → | false | (6) |
| le(s(x),s(y)) | → | le(x,y) | (7) |
| app(nil,y) | → | y | (8) |
| app(add(n,x),y) | → | add(n,app(x,y)) | (9) |
| min(add(n,nil)) | → | n | (10) |
| min(add(n,add(m,x))) | → | if_min(le(n,m),add(n,add(m,x))) | (11) |
| if_min(true,add(n,add(m,x))) | → | min(add(n,x)) | (12) |
| if_min(false,add(n,add(m,x))) | → | min(add(m,x)) | (13) |
| rm(n,nil) | → | nil | (14) |
| rm(n,add(m,x)) | → | if_rm(eq(n,m),n,add(m,x)) | (15) |
| if_rm(true,n,add(m,x)) | → | rm(n,x) | (16) |
| if_rm(false,n,add(m,x)) | → | add(m,rm(n,x)) | (17) |
| minsort(nil,nil) | → | nil | (18) |
| minsort(add(n,x),y) | → | if_minsort(eq(n,min(add(n,x))),add(n,x),y) | (19) |
| if_minsort(true,add(n,x),y) | → | add(n,minsort(app(rm(n,x),y),nil)) | (20) |
| if_minsort(false,add(n,x),y) | → | minsort(x,add(n,y)) | (21) |