Certification Problem

Input (TPDB TRS_Standard/Secret_05_TRS/aprove1)

The rewrite relation of the following TRS is considered.

ap(ap(map,f),xs) ap(ap(ap(if,ap(isEmpty,xs)),f),xs) (1)
ap(ap(ap(if,true),f),xs) null (2)
ap(ap(ap(if,null),f),xs) ap(ap(cons,ap(f,ap(last,xs))),ap(ap(if2,f),xs)) (3)
ap(ap(if2,f),xs) ap(ap(map,f),ap(dropLast,xs)) (4)
ap(isEmpty,null) true (5)
ap(isEmpty,ap(ap(cons,x),xs)) null (6)
ap(last,ap(ap(cons,x),null)) x (7)
ap(last,ap(ap(cons,x),ap(ap(cons,y),ys))) ap(last,ap(ap(cons,y),ys)) (8)
ap(dropLast,ap(ap(cons,x),null)) null (9)
ap(dropLast,ap(ap(cons,x),ap(ap(cons,y),ys))) ap(ap(cons,x),ap(dropLast,ap(ap(cons,y),ys))) (10)

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by AProVE @ termCOMP 2023)

1 Uncurrying

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

map is mapped to map, map1(x1), map2(x1, x2)
if is mapped to if, if1(x1), if3(x1, x2), if4(x1, x2, x3)
isEmpty is mapped to isEmpty, isEmpty1(x1)
true is mapped to true
null is mapped to null
cons is mapped to cons, cons1(x1), cons2(x1, x2)
last is mapped to last, last1(x1)
if2 is mapped to if2, if21(x1), if22(x1, x2)
dropLast is mapped to dropLast, dropLast1(x1)


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
map2(f,xs) if4(isEmpty1(xs),f,xs) (23)
if4(true,f,xs) null (24)
if4(null,f,xs) cons2(ap(f,last1(xs)),if22(f,xs)) (25)
if22(f,xs) map2(f,dropLast1(xs)) (26)
isEmpty1(null) true (27)
isEmpty1(cons2(x,xs)) null (28)
last1(cons2(x,null)) x (29)
last1(cons2(x,cons2(y,ys))) last1(cons2(y,ys)) (30)
dropLast1(cons2(x,null)) null (31)
dropLast1(cons2(x,cons2(y,ys))) cons2(x,dropLast1(cons2(y,ys))) (32)
ap(map,y1) map1(y1) (11)
ap(map1(x0),y1) map2(x0,y1) (12)
ap(if,y1) if1(y1) (13)
ap(if1(x0),y1) if3(x0,y1) (14)
ap(if3(x0,x1),y1) if4(x0,x1,y1) (15)
ap(isEmpty,y1) isEmpty1(y1) (16)
ap(cons,y1) cons1(y1) (17)
ap(cons1(x0),y1) cons2(x0,y1) (18)
ap(last,y1) last1(y1) (19)
ap(if2,y1) if21(y1) (20)
ap(if21(x0),y1) if22(x0,y1) (21)
ap(dropLast,y1) dropLast1(y1) (22)

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.
map2#(f,xs) if4#(isEmpty1(xs),f,xs) (33)
map2#(f,xs) isEmpty1#(xs) (34)
if4#(null,f,xs) ap#(f,last1(xs)) (35)
if4#(null,f,xs) last1#(xs) (36)
if4#(null,f,xs) if22#(f,xs) (37)
if22#(f,xs) map2#(f,dropLast1(xs)) (38)
if22#(f,xs) dropLast1#(xs) (39)
last1#(cons2(x,cons2(y,ys))) last1#(cons2(y,ys)) (40)
dropLast1#(cons2(x,cons2(y,ys))) dropLast1#(cons2(y,ys)) (41)
ap#(map1(x0),y1) map2#(x0,y1) (42)
ap#(if3(x0,x1),y1) if4#(x0,x1,y1) (43)
ap#(isEmpty,y1) isEmpty1#(y1) (44)
ap#(last,y1) last1#(y1) (45)
ap#(if21(x0),y1) if22#(x0,y1) (46)
ap#(dropLast,y1) dropLast1#(y1) (47)

1.1.1.1 Dependency Graph Processor

The dependency pairs are split into 3 components.