The rewrite relation of the following TRS is considered.
| app(not,app(not,x)) | → | x | (1) |
| app(not,app(app(or,x),y)) | → | app(app(and,app(not,x)),app(not,y)) | (2) |
| app(not,app(app(and,x),y)) | → | app(app(or,app(not,x)),app(not,y)) | (3) |
| app(app(and,x),app(app(or,y),z)) | → | app(app(or,app(app(and,x),y)),app(app(and,x),z)) | (4) |
| app(app(and,app(app(or,y),z)),x) | → | app(app(or,app(app(and,x),y)),app(app(and,x),z)) | (5) |
| app(app(map,f),nil) | → | nil | (6) |
| app(app(map,f),app(app(cons,x),xs)) | → | app(app(cons,app(f,x)),app(app(map,f),xs)) | (7) |
| app(app(filter,f),nil) | → | nil | (8) |
| app(app(filter,f),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(f,x)),f),x),xs) | (9) |
| app(app(app(app(filter2,true),f),x),xs) | → | app(app(cons,x),app(app(filter,f),xs)) | (10) |
| app(app(app(app(filter2,false),f),x),xs) | → | app(app(filter,f),xs) | (11) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
| not | is mapped to | not, | not1(x1) | |||
| or | is mapped to | or, | or1(x1), | or2(x1, x2) | ||
| and | is mapped to | and, | and1(x1), | and2(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 |
| not1(not1(x)) | → | x | (27) |
| not1(or2(x,y)) | → | and2(not1(x),not1(y)) | (28) |
| not1(and2(x,y)) | → | or2(not1(x),not1(y)) | (29) |
| and2(x,or2(y,z)) | → | or2(and2(x,y),and2(x,z)) | (30) |
| and2(or2(y,z),x) | → | or2(and2(x,y),and2(x,z)) | (31) |
| map2(f,nil) | → | nil | (32) |
| map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (33) |
| filter3(f,nil) | → | nil | (34) |
| filter3(f,cons2(x,xs)) | → | filter24(app(f,x),f,x,xs) | (35) |
| filter24(true,f,x,xs) | → | cons2(x,filter3(f,xs)) | (36) |
| filter24(false,f,x,xs) | → | filter3(f,xs) | (37) |
| app(not,y1) | → | not1(y1) | (12) |
| app(or,y1) | → | or1(y1) | (13) |
| app(or1(x0),y1) | → | or2(x0,y1) | (14) |
| app(and,y1) | → | and1(y1) | (15) |
| app(and1(x0),y1) | → | and2(x0,y1) | (16) |
| app(map,y1) | → | map1(y1) | (17) |
| app(map1(x0),y1) | → | map2(x0,y1) | (18) |
| app(cons,y1) | → | cons1(y1) | (19) |
| app(cons1(x0),y1) | → | cons2(x0,y1) | (20) |
| app(filter,y1) | → | filter1(y1) | (21) |
| app(filter1(x0),y1) | → | filter3(x0,y1) | (22) |
| app(filter2,y1) | → | filter21(y1) | (23) |
| app(filter21(x0),y1) | → | filter22(x0,y1) | (24) |
| app(filter22(x0,x1),y1) | → | filter23(x0,x1,y1) | (25) |
| app(filter23(x0,x1,x2),y1) | → | filter24(x0,x1,x2,y1) | (26) |
| prec(not1) | = | 3 | stat(not1) | = | mul | |
| prec(or2) | = | 1 | stat(or2) | = | mul | |
| prec(and2) | = | 2 | stat(and2) | = | mul | |
| prec(map2) | = | 8 | stat(map2) | = | lex | |
| prec(nil) | = | 9 | stat(nil) | = | mul | |
| prec(cons2) | = | 4 | stat(cons2) | = | mul | |
| prec(app) | = | 8 | stat(app) | = | lex | |
| prec(filter3) | = | 8 | stat(filter3) | = | lex | |
| prec(filter24) | = | 8 | stat(filter24) | = | lex | |
| prec(true) | = | 10 | stat(true) | = | mul | |
| prec(false) | = | 11 | stat(false) | = | mul | |
| prec(not) | = | 12 | stat(not) | = | mul | |
| prec(or) | = | 13 | stat(or) | = | mul | |
| prec(and) | = | 14 | stat(and) | = | mul | |
| prec(map) | = | 15 | stat(map) | = | mul | |
| prec(cons) | = | 5 | stat(cons) | = | mul | |
| prec(cons1) | = | 5 | stat(cons1) | = | lex | |
| prec(filter) | = | 16 | stat(filter) | = | mul | |
| prec(filter1) | = | 6 | stat(filter1) | = | lex | |
| prec(filter2) | = | 17 | stat(filter2) | = | mul | |
| prec(filter21) | = | 7 | stat(filter21) | = | mul | |
| prec(filter22) | = | 7 | stat(filter22) | = | mul | |
| prec(filter23) | = | 0 | stat(filter23) | = | lex |
| π(not1) | = | [1] |
| π(or2) | = | [1,2] |
| π(and2) | = | [1,2] |
| π(map2) | = | [1,2] |
| π(nil) | = | [] |
| π(cons2) | = | [1,2] |
| π(app) | = | [1,2] |
| π(filter3) | = | [1,2] |
| π(filter24) | = | [2,4,3,1] |
| π(true) | = | [] |
| π(false) | = | [] |
| π(not) | = | [] |
| π(or) | = | [] |
| π(or1) | = | 1 |
| π(and) | = | [] |
| π(and1) | = | 1 |
| π(map) | = | [] |
| π(map1) | = | 1 |
| π(cons) | = | [] |
| π(cons1) | = | [1] |
| π(filter) | = | [] |
| π(filter1) | = | [1] |
| π(filter2) | = | [] |
| π(filter21) | = | [1] |
| π(filter22) | = | [1,2] |
| π(filter23) | = | [2,3,1] |
| not1(not1(x)) | → | x | (27) |
| not1(or2(x,y)) | → | and2(not1(x),not1(y)) | (28) |
| not1(and2(x,y)) | → | or2(not1(x),not1(y)) | (29) |
| and2(x,or2(y,z)) | → | or2(and2(x,y),and2(x,z)) | (30) |
| and2(or2(y,z),x) | → | or2(and2(x,y),and2(x,z)) | (31) |
| map2(f,nil) | → | nil | (32) |
| map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (33) |
| filter3(f,nil) | → | nil | (34) |
| filter3(f,cons2(x,xs)) | → | filter24(app(f,x),f,x,xs) | (35) |
| filter24(true,f,x,xs) | → | cons2(x,filter3(f,xs)) | (36) |
| filter24(false,f,x,xs) | → | filter3(f,xs) | (37) |
| app(not,y1) | → | not1(y1) | (12) |
| app(or,y1) | → | or1(y1) | (13) |
| app(or1(x0),y1) | → | or2(x0,y1) | (14) |
| app(and,y1) | → | and1(y1) | (15) |
| app(and1(x0),y1) | → | and2(x0,y1) | (16) |
| app(map,y1) | → | map1(y1) | (17) |
| app(cons,y1) | → | cons1(y1) | (19) |
| app(cons1(x0),y1) | → | cons2(x0,y1) | (20) |
| app(filter,y1) | → | filter1(y1) | (21) |
| app(filter1(x0),y1) | → | filter3(x0,y1) | (22) |
| app(filter2,y1) | → | filter21(y1) | (23) |
| app(filter21(x0),y1) | → | filter22(x0,y1) | (24) |
| app(filter22(x0,x1),y1) | → | filter23(x0,x1,y1) | (25) |
| app(filter23(x0,x1,x2),y1) | → | filter24(x0,x1,x2,y1) | (26) |
| prec(map1) | = | 0 | weight(map1) | = | 1 | ||||
| prec(app) | = | 2 | weight(app) | = | 0 | ||||
| prec(map2) | = | 1 | weight(map2) | = | 1 |
| app(map1(x0),y1) | → | map2(x0,y1) | (18) |
There are no rules in the TRS. Hence, it is terminating.