Certification Problem

Input (TPDB TRS_Standard/Secret_06_TRS/addList)

The rewrite relation of the following TRS is considered.

isEmpty(cons(x,xs)) false (1)
isEmpty(nil) true (2)
isZero(0) true (3)
isZero(s(x)) false (4)
head(cons(x,xs)) x (5)
tail(cons(x,xs)) xs (6)
tail(nil) nil (7)
append(nil,x) cons(x,nil) (8)
append(cons(y,ys),x) cons(y,append(ys,x)) (9)
p(s(s(x))) s(p(s(x))) (10)
p(s(0)) 0 (11)
p(0) 0 (12)
inc(s(x)) s(inc(x)) (13)
inc(0) s(0) (14)
addLists(xs,ys,zs) if(isEmpty(xs),isEmpty(ys),isZero(head(xs)),tail(xs),tail(ys),cons(p(head(xs)),tail(xs)),cons(inc(head(ys)),tail(ys)),zs,append(zs,head(ys))) (15)
if(true,true,b,xs,ys,xs2,ys2,zs,zs2) zs (16)
if(true,false,b,xs,ys,xs2,ys2,zs,zs2) differentLengthError (17)
if(false,true,b,xs,ys,xs2,ys2,zs,zs2) differentLengthError (18)
if(false,false,false,xs,ys,xs2,ys2,zs,zs2) addLists(xs2,ys2,zs) (19)
if(false,false,true,xs,ys,xs2,ys2,zs,zs2) addLists(xs,ys,zs2) (20)
addList(xs,ys) addLists(xs,ys,nil) (21)

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) (22)
p#(s(s(x))) p#(s(x)) (23)
inc#(s(x)) inc#(x) (24)
addLists#(xs,ys,zs) if#(isEmpty(xs),isEmpty(ys),isZero(head(xs)),tail(xs),tail(ys),cons(p(head(xs)),tail(xs)),cons(inc(head(ys)),tail(ys)),zs,append(zs,head(ys))) (25)
addLists#(xs,ys,zs) isEmpty#(xs) (26)
addLists#(xs,ys,zs) isEmpty#(ys) (27)
addLists#(xs,ys,zs) isZero#(head(xs)) (28)
addLists#(xs,ys,zs) head#(xs) (29)
addLists#(xs,ys,zs) tail#(xs) (30)
addLists#(xs,ys,zs) tail#(ys) (31)
addLists#(xs,ys,zs) p#(head(xs)) (32)
addLists#(xs,ys,zs) inc#(head(ys)) (33)
addLists#(xs,ys,zs) head#(ys) (34)
addLists#(xs,ys,zs) append#(zs,head(ys)) (35)
if#(false,false,false,xs,ys,xs2,ys2,zs,zs2) addLists#(xs2,ys2,zs) (36)
if#(false,false,true,xs,ys,xs2,ys2,zs,zs2) addLists#(xs,ys,zs2) (37)
addList#(xs,ys) addLists#(xs,ys,nil) (38)

1.1.1 Dependency Graph Processor

The dependency pairs are split into 4 components.