Certification Problem

Input (TPDB TRS_Innermost/Applicative_AG01_innermost/#4.36)

The rewrite relation of the following TRS is considered.

app(app(eq,0),0) true (1)
app(app(eq,0),app(s,m)) false (2)
app(app(eq,app(s,n)),0) false (3)
app(app(eq,app(s,n)),app(s,m)) app(app(eq,n),m) (4)
app(app(le,0),m) true (5)
app(app(le,app(s,n)),0) false (6)
app(app(le,app(s,n)),app(s,m)) app(app(le,n),m) (7)
app(min,app(app(cons,0),nil)) 0 (8)
app(min,app(app(cons,app(s,n)),nil)) app(s,n) (9)
app(min,app(app(cons,n),app(app(cons,m),x))) app(app(if_min,app(app(le,n),m)),app(app(cons,n),app(app(cons,m),x))) (10)
app(app(if_min,true),app(app(cons,n),app(app(cons,m),x))) app(min,app(app(cons,n),x)) (11)
app(app(if_min,false),app(app(cons,n),app(app(cons,m),x))) app(min,app(app(cons,m),x)) (12)
app(app(app(replace,n),m),nil) nil (13)
app(app(app(replace,n),m),app(app(cons,k),x)) app(app(app(app(if_replace,app(app(eq,n),k)),n),m),app(app(cons,k),x)) (14)
app(app(app(app(if_replace,true),n),m),app(app(cons,k),x)) app(app(cons,m),x) (15)
app(app(app(app(if_replace,false),n),m),app(app(cons,k),x)) app(app(cons,k),app(app(app(replace,n),m),x)) (16)
app(sort,nil) nil (17)
app(sort,app(app(cons,n),x)) app(app(cons,app(min,app(app(cons,n),x))),app(sort,app(app(app(replace,app(min,app(app(cons,n),x))),n),x))) (18)
app(app(map,f),nil) nil (19)
app(app(map,f),app(app(cons,x),xs)) app(app(cons,app(f,x)),app(app(map,f),xs)) (20)
app(app(filter,f),nil) nil (21)
app(app(filter,f),app(app(cons,x),xs)) app(app(app(app(filter2,app(f,x)),f),x),xs) (22)
app(app(app(app(filter2,true),f),x),xs) app(app(cons,x),app(app(filter,f),xs)) (23)
app(app(app(app(filter2,false),f),x),xs) app(app(filter,f),xs) (24)
The evaluation strategy is innermost.

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by AProVE @ termCOMP 2023)

1 Uncurrying

We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.

eq is mapped to eq, eq1(x1), eq2(x1, x2)
0 is mapped to 0
true is mapped to true
s is mapped to s, s1(x1)
false is mapped to false
le is mapped to le, le1(x1), le2(x1, x2)
min is mapped to min, min1(x1)
cons is mapped to cons, cons1(x1), cons2(x1, x2)
nil is mapped to nil
if_min is mapped to if_min, if_min1(x1), if_min2(x1, x2)
replace is mapped to replace, replace1(x1), replace2(x1, x2), replace3(x1, x2, x3)
if_replace is mapped to if_replace, if_replace1(x1), if_replace2(x1, x2), if_replace3(x1, x2, x3), if_replace4(x1,...,x4)
sort is mapped to sort, sort1(x1)
map is mapped to map, map1(x1), map2(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)


There are no uncurry rules.
No rules have to be added for the eta-expansion.

Uncurrying the rules and adding the uncurrying rules yields the new set of rules
eq2(0,0) true (51)
eq2(0,s1(m)) false (52)
eq2(s1(n),0) false (53)
eq2(s1(n),s1(m)) eq2(n,m) (54)
le2(0,m) true (55)
le2(s1(n),0) false (56)
le2(s1(n),s1(m)) le2(n,m) (57)
min1(cons2(0,nil)) 0 (58)
min1(cons2(s1(n),nil)) s1(n) (59)
min1(cons2(n,cons2(m,x))) if_min2(le2(n,m),cons2(n,cons2(m,x))) (60)
if_min2(true,cons2(n,cons2(m,x))) min1(cons2(n,x)) (61)
if_min2(false,cons2(n,cons2(m,x))) min1(cons2(m,x)) (62)
replace3(n,m,nil) nil (63)
replace3(n,m,cons2(k,x)) if_replace4(eq2(n,k),n,m,cons2(k,x)) (64)
if_replace4(true,n,m,cons2(k,x)) cons2(m,x) (65)
if_replace4(false,n,m,cons2(k,x)) cons2(k,replace3(n,m,x)) (66)
sort1(nil) nil (67)
sort1(cons2(n,x)) cons2(min1(cons2(n,x)),sort1(replace3(min1(cons2(n,x)),n,x))) (68)
map2(f,nil) nil (69)
map2(f,cons2(x,xs)) cons2(app(f,x),map2(f,xs)) (70)
filter3(f,nil) nil (71)
filter3(f,cons2(x,xs)) filter24(app(f,x),f,x,xs) (72)
filter24(true,f,x,xs) cons2(x,filter3(f,xs)) (73)
filter24(false,f,x,xs) filter3(f,xs) (74)
app(eq,y1) eq1(y1) (25)
app(eq1(x0),y1) eq2(x0,y1) (26)
app(s,y1) s1(y1) (27)
app(le,y1) le1(y1) (28)
app(le1(x0),y1) le2(x0,y1) (29)
app(min,y1) min1(y1) (30)
app(cons,y1) cons1(y1) (31)
app(cons1(x0),y1) cons2(x0,y1) (32)
app(if_min,y1) if_min1(y1) (33)
app(if_min1(x0),y1) if_min2(x0,y1) (34)
app(replace,y1) replace1(y1) (35)
app(replace1(x0),y1) replace2(x0,y1) (36)
app(replace2(x0,x1),y1) replace3(x0,x1,y1) (37)
app(if_replace,y1) if_replace1(y1) (38)
app(if_replace1(x0),y1) if_replace2(x0,y1) (39)
app(if_replace2(x0,x1),y1) if_replace3(x0,x1,y1) (40)
app(if_replace3(x0,x1,x2),y1) if_replace4(x0,x1,x2,y1) (41)
app(sort,y1) sort1(y1) (42)
app(map,y1) map1(y1) (43)
app(map1(x0),y1) map2(x0,y1) (44)
app(filter,y1) filter1(y1) (45)
app(filter1(x0),y1) filter3(x0,y1) (46)
app(filter2,y1) filter21(y1) (47)
app(filter21(x0),y1) filter22(x0,y1) (48)
app(filter22(x0,x1),y1) filter23(x0,x1,y1) (49)
app(filter23(x0,x1,x2),y1) filter24(x0,x1,x2,y1) (50)

1.1 Switch to Innermost Termination

The TRS is overlay and locally confluent:

10

Hence, it suffices to show innermost termination in the following.

1.1.1 Dependency Pair Transformation

The following set of initial dependency pairs has been identified.
eq2#(s1(n),s1(m)) eq2#(n,m) (75)
le2#(s1(n),s1(m)) le2#(n,m) (76)
min1#(cons2(n,cons2(m,x))) if_min2#(le2(n,m),cons2(n,cons2(m,x))) (77)
min1#(cons2(n,cons2(m,x))) le2#(n,m) (78)
if_min2#(true,cons2(n,cons2(m,x))) min1#(cons2(n,x)) (79)
if_min2#(false,cons2(n,cons2(m,x))) min1#(cons2(m,x)) (80)
replace3#(n,m,cons2(k,x)) if_replace4#(eq2(n,k),n,m,cons2(k,x)) (81)
replace3#(n,m,cons2(k,x)) eq2#(n,k) (82)
if_replace4#(false,n,m,cons2(k,x)) replace3#(n,m,x) (83)
sort1#(cons2(n,x)) min1#(cons2(n,x)) (84)
sort1#(cons2(n,x)) sort1#(replace3(min1(cons2(n,x)),n,x)) (85)
sort1#(cons2(n,x)) replace3#(min1(cons2(n,x)),n,x) (86)
map2#(f,cons2(x,xs)) app#(f,x) (87)
map2#(f,cons2(x,xs)) map2#(f,xs) (88)
filter3#(f,cons2(x,xs)) filter24#(app(f,x),f,x,xs) (89)
filter3#(f,cons2(x,xs)) app#(f,x) (90)
filter24#(true,f,x,xs) filter3#(f,xs) (91)
filter24#(false,f,x,xs) filter3#(f,xs) (92)
app#(eq1(x0),y1) eq2#(x0,y1) (93)
app#(le1(x0),y1) le2#(x0,y1) (94)
app#(min,y1) min1#(y1) (95)
app#(if_min1(x0),y1) if_min2#(x0,y1) (96)
app#(replace2(x0,x1),y1) replace3#(x0,x1,y1) (97)
app#(if_replace3(x0,x1,x2),y1) if_replace4#(x0,x1,x2,y1) (98)
app#(sort,y1) sort1#(y1) (99)
app#(map1(x0),y1) map2#(x0,y1) (100)
app#(filter1(x0),y1) filter3#(x0,y1) (101)
app#(filter23(x0,x1,x2),y1) filter24#(x0,x1,x2,y1) (102)

1.1.1.1 Dependency Graph Processor

The dependency pairs are split into 6 components.