The rewrite relation of the following TRS is considered.
| app(app(\,x),x) | → | e | (1) |
| app(app(\,e),x) | → | x | (2) |
| app(app(\,x),app(app(.,x),y)) | → | y | (3) |
| app(app(\,app(app(/,x),y)),x) | → | y | (4) |
| app(app(/,x),x) | → | e | (5) |
| app(app(/,x),e) | → | x | (6) |
| app(app(/,app(app(.,y),x)),x) | → | y | (7) |
| app(app(/,x),app(app(\,y),x)) | → | y | (8) |
| app(app(.,e),x) | → | x | (9) |
| app(app(.,x),e) | → | x | (10) |
| app(app(.,x),app(app(\,x),y)) | → | y | (11) |
| app(app(.,app(app(/,y),x)),x) | → | y | (12) |
| app(app(map,f),nil) | → | nil | (13) |
| app(app(map,f),app(app(cons,x),xs)) | → | app(app(cons,app(f,x)),app(app(map,f),xs)) | (14) |
| app(app(filter,f),nil) | → | nil | (15) |
| app(app(filter,f),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(f,x)),f),x),xs) | (16) |
| app(app(app(app(filter2,true),f),x),xs) | → | app(app(cons,x),app(app(filter,f),xs)) | (17) |
| app(app(app(app(filter2,false),f),x),xs) | → | app(app(filter,f),xs) | (18) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
| \ | is mapped to | \, | \1(x1), | \2(x1, x2) | ||
| e | is mapped to | e | ||||
| . | is mapped to | ., | .1(x1), | .2(x1, x2) | ||
| / | is mapped to | /, | /1(x1), | /2(x1, x2) | ||
| map | is mapped to | map, | map1(x1), | map2(x1, x2) | ||
| nil | is mapped to | nil | ||||
| cons | is mapped to | cons, | cons1(x1), | cons2(x1, x2) | ||
| filter | is mapped to | filter, | filter1(x1), | filter3(x1, x2) | ||
| filter2 | is mapped to | filter2, | filter21(x1), | filter22(x1, x2), | filter23(x1, x2, x3), | filter24(x1,...,x4) |
| true | is mapped to | true | ||||
| false | is mapped to | false |
| \2(x,x) | → | e | (35) |
| \2(e,x) | → | x | (36) |
| \2(x,.2(x,y)) | → | y | (37) |
| \2(/2(x,y),x) | → | y | (38) |
| /2(x,x) | → | e | (39) |
| /2(x,e) | → | x | (40) |
| /2(.2(y,x),x) | → | y | (41) |
| /2(x,\2(y,x)) | → | y | (42) |
| .2(e,x) | → | x | (43) |
| .2(x,e) | → | x | (44) |
| .2(x,\2(x,y)) | → | y | (45) |
| .2(/2(y,x),x) | → | y | (46) |
| map2(f,nil) | → | nil | (47) |
| map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (48) |
| filter3(f,nil) | → | nil | (49) |
| filter3(f,cons2(x,xs)) | → | filter24(app(f,x),f,x,xs) | (50) |
| filter24(true,f,x,xs) | → | cons2(x,filter3(f,xs)) | (51) |
| filter24(false,f,x,xs) | → | filter3(f,xs) | (52) |
| app(\,y1) | → | \1(y1) | (19) |
| app(\1(x0),y1) | → | \2(x0,y1) | (20) |
| app(.,y1) | → | .1(y1) | (21) |
| app(.1(x0),y1) | → | .2(x0,y1) | (22) |
| app(/,y1) | → | /1(y1) | (23) |
| app(/1(x0),y1) | → | /2(x0,y1) | (24) |
| app(map,y1) | → | map1(y1) | (25) |
| app(map1(x0),y1) | → | map2(x0,y1) | (26) |
| app(cons,y1) | → | cons1(y1) | (27) |
| app(cons1(x0),y1) | → | cons2(x0,y1) | (28) |
| app(filter,y1) | → | filter1(y1) | (29) |
| app(filter1(x0),y1) | → | filter3(x0,y1) | (30) |
| app(filter2,y1) | → | filter21(y1) | (31) |
| app(filter21(x0),y1) | → | filter22(x0,y1) | (32) |
| app(filter22(x0,x1),y1) | → | filter23(x0,x1,y1) | (33) |
| app(filter23(x0,x1,x2),y1) | → | filter24(x0,x1,x2,y1) | (34) |
| prec(\2) | = | 1 | stat(\2) | = | mul | |
| prec(e) | = | 0 | stat(e) | = | mul | |
| prec(.2) | = | 2 | stat(.2) | = | lex | |
| prec(/2) | = | 3 | stat(/2) | = | lex | |
| prec(map2) | = | 11 | stat(map2) | = | lex | |
| prec(nil) | = | 12 | stat(nil) | = | mul | |
| prec(cons2) | = | 4 | stat(cons2) | = | mul | |
| prec(app) | = | 11 | stat(app) | = | lex | |
| prec(filter3) | = | 11 | stat(filter3) | = | lex | |
| prec(filter24) | = | 11 | stat(filter24) | = | lex | |
| prec(true) | = | 13 | stat(true) | = | mul | |
| prec(false) | = | 14 | stat(false) | = | mul | |
| prec(\) | = | 15 | stat(\) | = | mul | |
| prec(.) | = | 16 | stat(.) | = | mul | |
| prec(.1) | = | 11 | stat(.1) | = | lex | |
| prec(/) | = | 17 | stat(/) | = | mul | |
| prec(map) | = | 18 | stat(map) | = | mul | |
| prec(map1) | = | 5 | stat(map1) | = | lex | |
| prec(cons) | = | 19 | stat(cons) | = | mul | |
| prec(cons1) | = | 6 | stat(cons1) | = | lex | |
| prec(filter) | = | 20 | stat(filter) | = | mul | |
| prec(filter1) | = | 7 | stat(filter1) | = | lex | |
| prec(filter2) | = | 21 | stat(filter2) | = | mul | |
| prec(filter21) | = | 8 | stat(filter21) | = | lex | |
| prec(filter22) | = | 10 | stat(filter22) | = | mul | |
| prec(filter23) | = | 9 | stat(filter23) | = | lex |
| π(\2) | = | [1,2] |
| π(e) | = | [] |
| π(.2) | = | [2,1] |
| π(/2) | = | [1,2] |
| π(map2) | = | [2,1] |
| π(nil) | = | [] |
| π(cons2) | = | [1,2] |
| π(app) | = | [2,1] |
| π(filter3) | = | [2,1] |
| π(filter24) | = | [4,2,1,3] |
| π(true) | = | [] |
| π(false) | = | [] |
| π(\) | = | [] |
| π(\1) | = | 1 |
| π(.) | = | [] |
| π(.1) | = | [1] |
| π(/) | = | [] |
| π(/1) | = | 1 |
| π(map) | = | [] |
| π(map1) | = | [1] |
| π(cons) | = | [] |
| π(cons1) | = | [1] |
| π(filter) | = | [] |
| π(filter1) | = | [1] |
| π(filter2) | = | [] |
| π(filter21) | = | [1] |
| π(filter22) | = | [1,2] |
| π(filter23) | = | [3,1,2] |
| \2(x,x) | → | e | (35) |
| \2(e,x) | → | x | (36) |
| \2(x,.2(x,y)) | → | y | (37) |
| \2(/2(x,y),x) | → | y | (38) |
| /2(x,x) | → | e | (39) |
| /2(x,e) | → | x | (40) |
| /2(.2(y,x),x) | → | y | (41) |
| /2(x,\2(y,x)) | → | y | (42) |
| .2(e,x) | → | x | (43) |
| .2(x,e) | → | x | (44) |
| .2(x,\2(x,y)) | → | y | (45) |
| .2(/2(y,x),x) | → | y | (46) |
| map2(f,nil) | → | nil | (47) |
| map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (48) |
| filter3(f,nil) | → | nil | (49) |
| filter3(f,cons2(x,xs)) | → | filter24(app(f,x),f,x,xs) | (50) |
| filter24(true,f,x,xs) | → | cons2(x,filter3(f,xs)) | (51) |
| filter24(false,f,x,xs) | → | filter3(f,xs) | (52) |
| app(\,y1) | → | \1(y1) | (19) |
| app(\1(x0),y1) | → | \2(x0,y1) | (20) |
| app(.,y1) | → | .1(y1) | (21) |
| app(.1(x0),y1) | → | .2(x0,y1) | (22) |
| app(/,y1) | → | /1(y1) | (23) |
| app(/1(x0),y1) | → | /2(x0,y1) | (24) |
| app(map,y1) | → | map1(y1) | (25) |
| app(map1(x0),y1) | → | map2(x0,y1) | (26) |
| app(cons,y1) | → | cons1(y1) | (27) |
| app(cons1(x0),y1) | → | cons2(x0,y1) | (28) |
| app(filter,y1) | → | filter1(y1) | (29) |
| app(filter1(x0),y1) | → | filter3(x0,y1) | (30) |
| app(filter2,y1) | → | filter21(y1) | (31) |
| app(filter21(x0),y1) | → | filter22(x0,y1) | (32) |
| app(filter22(x0,x1),y1) | → | filter23(x0,x1,y1) | (33) |
| app(filter23(x0,x1,x2),y1) | → | filter24(x0,x1,x2,y1) | (34) |
There are no rules in the TRS. Hence, it is terminating.