Certification Problem

Input (TPDB TRS_Standard/Secret_06_TRS/toList)

The rewrite relation of the following TRS is considered.

isEmpty(empty) true (1)
isEmpty(node(l,x,r)) false (2)
left(empty) empty (3)
left(node(l,x,r)) l (4)
right(empty) empty (5)
right(node(l,x,r)) r (6)
elem(node(l,x,r)) x (7)
append(nil,x) cons(x,nil) (8)
append(cons(y,ys),x) cons(y,append(ys,x)) (9)
listify(n,xs) if(isEmpty(n),isEmpty(left(n)),right(n),node(left(left(n)),elem(left(n)),node(right(left(n)),elem(n),right(n))),xs,append(xs,n)) (10)
if(true,b,n,m,xs,ys) xs (11)
if(false,false,n,m,xs,ys) listify(m,xs) (12)
if(false,true,n,m,xs,ys) listify(n,ys) (13)
toList(n) listify(n,nil) (14)

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by AProVE @ termCOMP 2023)

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 Dependency Pair Transformation

The following set of initial dependency pairs has been identified.
append#(cons(y,ys),x) append#(ys,x) (15)
listify#(n,xs) if#(isEmpty(n),isEmpty(left(n)),right(n),node(left(left(n)),elem(left(n)),node(right(left(n)),elem(n),right(n))),xs,append(xs,n)) (16)
listify#(n,xs) isEmpty#(n) (17)
listify#(n,xs) isEmpty#(left(n)) (18)
listify#(n,xs) left#(n) (19)
listify#(n,xs) right#(n) (20)
listify#(n,xs) left#(left(n)) (21)
listify#(n,xs) elem#(left(n)) (22)
listify#(n,xs) right#(left(n)) (23)
listify#(n,xs) elem#(n) (24)
listify#(n,xs) append#(xs,n) (25)
if#(false,false,n,m,xs,ys) listify#(m,xs) (26)
if#(false,true,n,m,xs,ys) listify#(n,ys) (27)
toList#(n) listify#(n,nil) (28)

1.1.1 Dependency Graph Processor

The dependency pairs are split into 2 components.