The rewrite relation of the following TRS is considered.
| app(app(plus,0),y) | → | y | (1) |
| app(app(plus,app(s,x)),y) | → | app(s,app(app(plus,x),y)) | (2) |
| app(app(sumwith,f),nil) | → | nil | (3) |
| app(app(sumwith,f),app(app(cons,x),xs)) | → | app(app(plus,app(f,x)),app(app(sumwith,f),xs)) | (4) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
| plus | is mapped to | plus, | plus1(x1), | plus2(x1, x2) |
| 0 | is mapped to | 0 | ||
| s | is mapped to | s, | s1(x1) | |
| sumwith | is mapped to | sumwith, | sumwith1(x1), | sumwith2(x1, x2) |
| nil | is mapped to | nil | ||
| cons | is mapped to | cons, | cons1(x1), | cons2(x1, x2) |
| plus2(0,y) | → | y | (12) |
| plus2(s1(x),y) | → | s1(plus2(x,y)) | (13) |
| sumwith2(f,nil) | → | nil | (14) |
| sumwith2(f,cons2(x,xs)) | → | plus2(app(f,x),sumwith2(f,xs)) | (15) |
| app(plus,y1) | → | plus1(y1) | (5) |
| app(plus1(x0),y1) | → | plus2(x0,y1) | (6) |
| app(s,y1) | → | s1(y1) | (7) |
| app(sumwith,y1) | → | sumwith1(y1) | (8) |
| app(sumwith1(x0),y1) | → | sumwith2(x0,y1) | (9) |
| app(cons,y1) | → | cons1(y1) | (10) |
| app(cons1(x0),y1) | → | cons2(x0,y1) | (11) |
| prec(plus2) | = | 1 | stat(plus2) | = | mul | |
| prec(0) | = | 2 | stat(0) | = | mul | |
| prec(sumwith2) | = | 3 | stat(sumwith2) | = | lex | |
| prec(nil) | = | 4 | stat(nil) | = | mul | |
| prec(cons2) | = | 0 | stat(cons2) | = | lex | |
| prec(app) | = | 3 | stat(app) | = | lex | |
| prec(plus) | = | 0 | stat(plus) | = | mul | |
| prec(plus1) | = | 0 | stat(plus1) | = | mul | |
| prec(s) | = | 5 | stat(s) | = | mul | |
| prec(sumwith) | = | 6 | stat(sumwith) | = | mul | |
| prec(sumwith1) | = | 3 | stat(sumwith1) | = | lex | |
| prec(cons) | = | 7 | stat(cons) | = | mul | |
| prec(cons1) | = | 3 | stat(cons1) | = | lex |
| π(plus2) | = | [1,2] |
| π(0) | = | [] |
| π(s1) | = | 1 |
| π(sumwith2) | = | [2,1] |
| π(nil) | = | [] |
| π(cons2) | = | [2,1] |
| π(app) | = | [2,1] |
| π(plus) | = | [] |
| π(plus1) | = | [1] |
| π(s) | = | [] |
| π(sumwith) | = | [] |
| π(sumwith1) | = | [1] |
| π(cons) | = | [] |
| π(cons1) | = | [1] |
| plus2(0,y) | → | y | (12) |
| sumwith2(f,nil) | → | nil | (14) |
| sumwith2(f,cons2(x,xs)) | → | plus2(app(f,x),sumwith2(f,xs)) | (15) |
| app(plus,y1) | → | plus1(y1) | (5) |
| app(plus1(x0),y1) | → | plus2(x0,y1) | (6) |
| app(s,y1) | → | s1(y1) | (7) |
| app(sumwith,y1) | → | sumwith1(y1) | (8) |
| app(sumwith1(x0),y1) | → | sumwith2(x0,y1) | (9) |
| app(cons,y1) | → | cons1(y1) | (10) |
| app(cons1(x0),y1) | → | cons2(x0,y1) | (11) |
| prec(s1) | = | 0 | weight(s1) | = | 1 | ||||
| prec(plus2) | = | 1 | weight(plus2) | = | 0 |
| plus2(s1(x),y) | → | s1(plus2(x,y)) | (13) |
There are no rules in the TRS. Hence, it is terminating.