Certification Problem

Input (TPDB TRS_Standard/AProVE_06/mapHard)

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) nil (2)
ap(ap(ap(if,false),f),xs) ap(ap(cons,ap(f,ap(last,xs))),ap(ap(map,f),ap(dropLast,xs))) (3)
ap(isEmpty,nil) true (4)
ap(isEmpty,ap(ap(cons,x),xs)) false (5)
ap(last,ap(ap(cons,x),nil)) x (6)
ap(last,ap(ap(cons,x),ap(ap(cons,y),ys))) ap(last,ap(ap(cons,y),ys)) (7)
ap(dropLast,nil) nil (8)
ap(dropLast,ap(ap(cons,x),nil)) nil (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), if2(x1, x2), if3(x1, x2, x3)
isEmpty is mapped to isEmpty, isEmpty1(x1)
true is mapped to true
nil is mapped to nil
false is mapped to false
cons is mapped to cons, cons1(x1), cons2(x1, x2)
last is mapped to last, last1(x1)
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) if3(isEmpty1(xs),f,xs) (21)
if3(true,f,xs) nil (22)
if3(false,f,xs) cons2(ap(f,last1(xs)),map2(f,dropLast1(xs))) (23)
isEmpty1(nil) true (24)
isEmpty1(cons2(x,xs)) false (25)
last1(cons2(x,nil)) x (26)
last1(cons2(x,cons2(y,ys))) last1(cons2(y,ys)) (27)
dropLast1(nil) nil (28)
dropLast1(cons2(x,nil)) nil (29)
dropLast1(cons2(x,cons2(y,ys))) cons2(x,dropLast1(cons2(y,ys))) (30)
ap(map,y1) map1(y1) (11)
ap(map1(x0),y1) map2(x0,y1) (12)
ap(if,y1) if1(y1) (13)
ap(if1(x0),y1) if2(x0,y1) (14)
ap(if2(x0,x1),y1) if3(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(dropLast,y1) dropLast1(y1) (20)

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) if3#(isEmpty1(xs),f,xs) (31)
map2#(f,xs) isEmpty1#(xs) (32)
if3#(false,f,xs) ap#(f,last1(xs)) (33)
if3#(false,f,xs) last1#(xs) (34)
if3#(false,f,xs) map2#(f,dropLast1(xs)) (35)
if3#(false,f,xs) dropLast1#(xs) (36)
last1#(cons2(x,cons2(y,ys))) last1#(cons2(y,ys)) (37)
dropLast1#(cons2(x,cons2(y,ys))) dropLast1#(cons2(y,ys)) (38)
ap#(map1(x0),y1) map2#(x0,y1) (39)
ap#(if2(x0,x1),y1) if3#(x0,x1,y1) (40)
ap#(isEmpty,y1) isEmpty1#(y1) (41)
ap#(last,y1) last1#(y1) (42)
ap#(dropLast,y1) dropLast1#(y1) (43)

1.1.1.1 Dependency Graph Processor

The dependency pairs are split into 3 components.