The rewrite relation of the following TRS is considered.
app(app(app(if,true),xs),ys) | → | xs | (1) |
app(app(app(if,false),xs),ys) | → | ys | (2) |
app(app(lt,app(s,x)),app(s,y)) | → | app(app(lt,x),y) | (3) |
app(app(lt,0),app(s,y)) | → | true | (4) |
app(app(lt,y),0) | → | false | (5) |
app(app(eq,x),x) | → | true | (6) |
app(app(eq,app(s,x)),0) | → | false | (7) |
app(app(eq,0),app(s,x)) | → | false | (8) |
app(app(merge,xs),nil) | → | xs | (9) |
app(app(merge,nil),ys) | → | ys | (10) |
app(app(merge,app(app(cons,x),xs)),app(app(cons,y),ys)) | → | app(app(app(if,app(app(lt,x),y)),app(app(cons,x),app(app(merge,xs),app(app(cons,y),ys)))),app(app(app(if,app(app(eq,x),y)),app(app(cons,x),app(app(merge,xs),ys))),app(app(cons,y),app(app(merge,app(app(cons,x),xs)),ys)))) | (11) |
app(app(map,f),nil) | → | nil | (12) |
app(app(map,f),app(app(cons,x),xs)) | → | app(app(cons,app(f,x)),app(app(map,f),xs)) | (13) |
app(app(mult,0),x) | → | 0 | (14) |
app(app(mult,app(s,x)),y) | → | app(app(plus,y),app(app(mult,x),y)) | (15) |
app(app(plus,0),x) | → | 0 | (16) |
app(app(plus,app(s,x)),y) | → | app(s,app(app(plus,x),y)) | (17) |
list1 | → | app(app(map,app(mult,app(s,app(s,0)))),hamming) | (18) |
list2 | → | app(app(map,app(mult,app(s,app(s,app(s,0))))),hamming) | (19) |
list3 | → | app(app(map,app(mult,app(s,app(s,app(s,app(s,app(s,0))))))),hamming) | (20) |
hamming | → | app(app(cons,app(s,0)),app(app(merge,list1),app(app(merge,list2),list3))) | (21) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
if | is mapped to | if, | if1(x1), | if2(x1, x2), | if3(x1, x2, x3) |
true | is mapped to | true | |||
false | is mapped to | false | |||
lt | is mapped to | lt, | lt1(x1), | lt2(x1, x2) | |
s | is mapped to | s, | s1(x1) | ||
0 | is mapped to | 0 | |||
eq | is mapped to | eq, | eq1(x1), | eq2(x1, x2) | |
merge | is mapped to | merge, | merge1(x1), | merge2(x1, x2) | |
nil | is mapped to | nil | |||
cons | is mapped to | cons, | cons1(x1), | cons2(x1, x2) | |
map | is mapped to | map, | map1(x1), | map2(x1, x2) | |
mult | is mapped to | mult, | mult1(x1), | mult2(x1, x2) | |
plus | is mapped to | plus, | plus1(x1), | plus2(x1, x2) | |
list1 | is mapped to | list1 | |||
hamming | is mapped to | hamming | |||
list2 | is mapped to | list2 | |||
list3 | is mapped to | list3 |
if3(true,xs,ys) | → | xs | (40) |
if3(false,xs,ys) | → | ys | (41) |
lt2(s1(x),s1(y)) | → | lt2(x,y) | (42) |
lt2(0,s1(y)) | → | true | (43) |
lt2(y,0) | → | false | (44) |
eq2(x,x) | → | true | (45) |
eq2(s1(x),0) | → | false | (46) |
eq2(0,s1(x)) | → | false | (47) |
merge2(xs,nil) | → | xs | (48) |
merge2(nil,ys) | → | ys | (49) |
merge2(cons2(x,xs),cons2(y,ys)) | → | if3(lt2(x,y),cons2(x,merge2(xs,cons2(y,ys))),if3(eq2(x,y),cons2(x,merge2(xs,ys)),cons2(y,merge2(cons2(x,xs),ys)))) | (50) |
map2(f,nil) | → | nil | (51) |
map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (52) |
mult2(0,x) | → | 0 | (53) |
mult2(s1(x),y) | → | plus2(y,mult2(x,y)) | (54) |
plus2(0,x) | → | 0 | (55) |
plus2(s1(x),y) | → | s1(plus2(x,y)) | (56) |
list1 | → | map2(mult1(s1(s1(0))),hamming) | (57) |
list2 | → | map2(mult1(s1(s1(s1(0)))),hamming) | (58) |
list3 | → | map2(mult1(s1(s1(s1(s1(s1(0)))))),hamming) | (59) |
hamming | → | cons2(s1(0),merge2(list1,merge2(list2,list3))) | (60) |
app(if,y1) | → | if1(y1) | (22) |
app(if1(x0),y1) | → | if2(x0,y1) | (23) |
app(if2(x0,x1),y1) | → | if3(x0,x1,y1) | (24) |
app(lt,y1) | → | lt1(y1) | (25) |
app(lt1(x0),y1) | → | lt2(x0,y1) | (26) |
app(s,y1) | → | s1(y1) | (27) |
app(eq,y1) | → | eq1(y1) | (28) |
app(eq1(x0),y1) | → | eq2(x0,y1) | (29) |
app(merge,y1) | → | merge1(y1) | (30) |
app(merge1(x0),y1) | → | merge2(x0,y1) | (31) |
app(cons,y1) | → | cons1(y1) | (32) |
app(cons1(x0),y1) | → | cons2(x0,y1) | (33) |
app(map,y1) | → | map1(y1) | (34) |
app(map1(x0),y1) | → | map2(x0,y1) | (35) |
app(mult,y1) | → | mult1(y1) | (36) |
app(mult1(x0),y1) | → | mult2(x0,y1) | (37) |
app(plus,y1) | → | plus1(y1) | (38) |
app(plus1(x0),y1) | → | plus2(x0,y1) | (39) |
if3(true,x0,x1) |
if3(false,x0,x1) |
lt2(s1(x0),s1(x1)) |
lt2(0,s1(x0)) |
lt2(x0,0) |
eq2(x0,x0) |
eq2(s1(x0),0) |
eq2(0,s1(x0)) |
merge2(x0,nil) |
merge2(nil,x0) |
merge2(cons2(x0,x1),cons2(x2,x3)) |
map2(x0,nil) |
map2(x0,cons2(x1,x2)) |
mult2(0,x0) |
mult2(s1(x0),x1) |
plus2(0,x0) |
plus2(s1(x0),x1) |
list1 |
list2 |
list3 |
hamming |
app(if,x0) |
app(if1(x0),x1) |
app(if2(x0,x1),x2) |
app(lt,x0) |
app(lt1(x0),x1) |
app(s,x0) |
app(eq,x0) |
app(eq1(x0),x1) |
app(merge,x0) |
app(merge1(x0),x1) |
app(cons,x0) |
app(cons1(x0),x1) |
app(map,x0) |
app(map1(x0),x1) |
app(mult,x0) |
app(mult1(x0),x1) |
app(plus,x0) |
app(plus1(x0),x1) |
lt2#(s1(x),s1(y)) | → | lt2#(x,y) | (61) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | if3#(lt2(x,y),cons2(x,merge2(xs,cons2(y,ys))),if3(eq2(x,y),cons2(x,merge2(xs,ys)),cons2(y,merge2(cons2(x,xs),ys)))) | (62) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | lt2#(x,y) | (63) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | merge2#(xs,cons2(y,ys)) | (64) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | if3#(eq2(x,y),cons2(x,merge2(xs,ys)),cons2(y,merge2(cons2(x,xs),ys))) | (65) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | eq2#(x,y) | (66) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | merge2#(xs,ys) | (67) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | merge2#(cons2(x,xs),ys) | (68) |
map2#(f,cons2(x,xs)) | → | app#(f,x) | (69) |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (70) |
mult2#(s1(x),y) | → | plus2#(y,mult2(x,y)) | (71) |
mult2#(s1(x),y) | → | mult2#(x,y) | (72) |
plus2#(s1(x),y) | → | plus2#(x,y) | (73) |
list1# | → | map2#(mult1(s1(s1(0))),hamming) | (74) |
list1# | → | hamming# | (75) |
list2# | → | map2#(mult1(s1(s1(s1(0)))),hamming) | (76) |
list2# | → | hamming# | (77) |
list3# | → | map2#(mult1(s1(s1(s1(s1(s1(0)))))),hamming) | (78) |
list3# | → | hamming# | (79) |
hamming# | → | merge2#(list1,merge2(list2,list3)) | (80) |
hamming# | → | list1# | (81) |
hamming# | → | merge2#(list2,list3) | (82) |
hamming# | → | list2# | (83) |
hamming# | → | list3# | (84) |
app#(if2(x0,x1),y1) | → | if3#(x0,x1,y1) | (85) |
app#(lt1(x0),y1) | → | lt2#(x0,y1) | (86) |
app#(eq1(x0),y1) | → | eq2#(x0,y1) | (87) |
app#(merge1(x0),y1) | → | merge2#(x0,y1) | (88) |
app#(map1(x0),y1) | → | map2#(x0,y1) | (89) |
app#(mult1(x0),y1) | → | mult2#(x0,y1) | (90) |
app#(plus1(x0),y1) | → | plus2#(x0,y1) | (91) |
lt2#(s1(x),s1(y)) | → | lt2#(x,y) | (61) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | if3#(lt2(x,y),cons2(x,merge2(xs,cons2(y,ys))),if3(eq2(x,y),cons2(x,merge2(xs,ys)),cons2(y,merge2(cons2(x,xs),ys)))) | (62) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | lt2#(x,y) | (63) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | merge2#(xs,cons2(y,ys)) | (64) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | if3#(eq2(x,y),cons2(x,merge2(xs,ys)),cons2(y,merge2(cons2(x,xs),ys))) | (65) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | eq2#(x,y) | (66) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | merge2#(xs,ys) | (67) |
merge2#(cons2(x,xs),cons2(y,ys)) | → | merge2#(cons2(x,xs),ys) | (68) |
map2#(f,cons2(x,xs)) | → | app#(f,x) | (69) |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (70) |
mult2#(s1(x),y) | → | plus2#(y,mult2(x,y)) | (71) |
mult2#(s1(x),y) | → | mult2#(x,y) | (72) |
plus2#(s1(x),y) | → | plus2#(x,y) | (73) |
list1# | → | map2#(mult1(s1(s1(0))),hamming) | (74) |
list2# | → | map2#(mult1(s1(s1(s1(0)))),hamming) | (76) |
list3# | → | map2#(mult1(s1(s1(s1(s1(s1(0)))))),hamming) | (78) |
hamming# | → | merge2#(list1,merge2(list2,list3)) | (80) |
hamming# | → | merge2#(list2,list3) | (82) |
app#(if2(x0,x1),y1) | → | if3#(x0,x1,y1) | (85) |
app#(lt1(x0),y1) | → | lt2#(x0,y1) | (86) |
app#(eq1(x0),y1) | → | eq2#(x0,y1) | (87) |
app#(merge1(x0),y1) | → | merge2#(x0,y1) | (88) |
app#(map1(x0),y1) | → | map2#(x0,y1) | (89) |
app#(mult1(x0),y1) | → | mult2#(x0,y1) | (90) |
app#(plus1(x0),y1) | → | plus2#(x0,y1) | (91) |
if3(true,xs,ys) | → | xs | (40) |
if3(false,xs,ys) | → | ys | (41) |
lt2(s1(x),s1(y)) | → | lt2(x,y) | (42) |
lt2(0,s1(y)) | → | true | (43) |
lt2(y,0) | → | false | (44) |
eq2(x,x) | → | true | (45) |
eq2(s1(x),0) | → | false | (46) |
eq2(0,s1(x)) | → | false | (47) |
merge2(xs,nil) | → | xs | (48) |
merge2(nil,ys) | → | ys | (49) |
merge2(cons2(x,xs),cons2(y,ys)) | → | if3(lt2(x,y),cons2(x,merge2(xs,cons2(y,ys))),if3(eq2(x,y),cons2(x,merge2(xs,ys)),cons2(y,merge2(cons2(x,xs),ys)))) | (50) |
map2(f,nil) | → | nil | (51) |
map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (52) |
mult2(0,x) | → | 0 | (53) |
mult2(s1(x),y) | → | plus2(y,mult2(x,y)) | (54) |
plus2(0,x) | → | 0 | (55) |
plus2(s1(x),y) | → | s1(plus2(x,y)) | (56) |
list1 | → | map2(mult1(s1(s1(0))),hamming) | (57) |
list2 | → | map2(mult1(s1(s1(s1(0)))),hamming) | (58) |
list3 | → | map2(mult1(s1(s1(s1(s1(s1(0)))))),hamming) | (59) |
hamming | → | cons2(s1(0),merge2(list1,merge2(list2,list3))) | (60) |
app(if,y1) | → | if1(y1) | (22) |
app(if1(x0),y1) | → | if2(x0,y1) | (23) |
app(if2(x0,x1),y1) | → | if3(x0,x1,y1) | (24) |
app(lt,y1) | → | lt1(y1) | (25) |
app(lt1(x0),y1) | → | lt2(x0,y1) | (26) |
app(s,y1) | → | s1(y1) | (27) |
app(eq,y1) | → | eq1(y1) | (28) |
app(eq1(x0),y1) | → | eq2(x0,y1) | (29) |
app(merge,y1) | → | merge1(y1) | (30) |
app(merge1(x0),y1) | → | merge2(x0,y1) | (31) |
app(cons,y1) | → | cons1(y1) | (32) |
app(cons1(x0),y1) | → | cons2(x0,y1) | (33) |
app(map,y1) | → | map1(y1) | (34) |
app(map1(x0),y1) | → | map2(x0,y1) | (35) |
app(mult,y1) | → | mult1(y1) | (36) |
app(mult1(x0),y1) | → | mult2(x0,y1) | (37) |
app(plus,y1) | → | plus1(y1) | (38) |
app(plus1(x0),y1) | → | plus2(x0,y1) | (39) |
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
t0 | = | list1# |
→P | hamming# | |
→P | list1# | |
= | t2 |