Certification Problem

Input (TPDB TRS_Standard/AProVE_06/factorial2)

The rewrite relation of the following TRS is considered.

plus(0,x) x (1)
plus(s(x),y) s(plus(x,y)) (2)
times(0,y) 0 (3)
times(s(x),y) plus(y,times(x,y)) (4)
p(s(x)) x (5)
p(0) 0 (6)
minus(x,0) x (7)
minus(0,x) 0 (8)
minus(x,s(y)) p(minus(x,y)) (9)
isZero(0) true (10)
isZero(s(x)) false (11)
facIter(x,y) if(isZero(x),minus(x,s(0)),y,times(y,x)) (12)
if(true,x,y,z) y (13)
if(false,x,y,z) facIter(x,z) (14)
factorial(x) facIter(x,s(0)) (15)

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by AProVE @ termCOMP 2023)

1 Dependency Pair Transformation

The following set of initial dependency pairs has been identified.
plus#(s(x),y) plus#(x,y) (16)
times#(s(x),y) plus#(y,times(x,y)) (17)
times#(s(x),y) times#(x,y) (18)
minus#(x,s(y)) p#(minus(x,y)) (19)
minus#(x,s(y)) minus#(x,y) (20)
facIter#(x,y) if#(isZero(x),minus(x,s(0)),y,times(y,x)) (21)
facIter#(x,y) isZero#(x) (22)
facIter#(x,y) minus#(x,s(0)) (23)
facIter#(x,y) times#(y,x) (24)
if#(false,x,y,z) facIter#(x,z) (25)
factorial#(x) facIter#(x,s(0)) (26)

1.1 Dependency Graph Processor

The dependency pairs are split into 4 components.