Certification Problem

Input (TPDB TRS_Standard/AProVE_06/quicksort)

The rewrite relation of the following TRS is considered.

le(0,y) true (1)
le(s(x),0) false (2)
le(s(x),s(y)) le(x,y) (3)
app(nil,y) y (4)
app(add(n,x),y) add(n,app(x,y)) (5)
low(n,nil) nil (6)
low(n,add(m,x)) if_low(le(m,n),n,add(m,x)) (7)
if_low(true,n,add(m,x)) add(m,low(n,x)) (8)
if_low(false,n,add(m,x)) low(n,x) (9)
high(n,nil) nil (10)
high(n,add(m,x)) if_high(le(m,n),n,add(m,x)) (11)
if_high(true,n,add(m,x)) high(n,x) (12)
if_high(false,n,add(m,x)) add(m,high(n,x)) (13)
head(add(n,x)) n (14)
tail(add(n,x)) x (15)
isempty(nil) true (16)
isempty(add(n,x)) false (17)
quicksort(x) if_qs(isempty(x),low(head(x),tail(x)),head(x),high(head(x),tail(x))) (18)
if_qs(true,x,n,y) nil (19)
if_qs(false,x,n,y) app(quicksort(x),add(n,quicksort(y))) (20)

Property / Task

Prove or disprove termination.

Answer / Result

Yes.

Proof (by ttt2 @ termCOMP 2023)

1 Dependency Pair Transformation

The following set of initial dependency pairs has been identified.
le#(s(x),s(y)) le#(x,y) (21)
app#(add(n,x),y) app#(x,y) (22)
low#(n,add(m,x)) le#(m,n) (23)
low#(n,add(m,x)) if_low#(le(m,n),n,add(m,x)) (24)
if_low#(true,n,add(m,x)) low#(n,x) (25)
if_low#(false,n,add(m,x)) low#(n,x) (26)
high#(n,add(m,x)) le#(m,n) (27)
high#(n,add(m,x)) if_high#(le(m,n),n,add(m,x)) (28)
if_high#(true,n,add(m,x)) high#(n,x) (29)
if_high#(false,n,add(m,x)) high#(n,x) (30)
quicksort#(x) high#(head(x),tail(x)) (31)
quicksort#(x) tail#(x) (32)
quicksort#(x) head#(x) (33)
quicksort#(x) low#(head(x),tail(x)) (34)
quicksort#(x) isempty#(x) (35)
quicksort#(x) if_qs#(isempty(x),low(head(x),tail(x)),head(x),high(head(x),tail(x))) (36)
if_qs#(false,x,n,y) quicksort#(y) (37)
if_qs#(false,x,n,y) quicksort#(x) (38)
if_qs#(false,x,n,y) app#(quicksort(x),add(n,quicksort(y))) (39)

1.1 Dependency Graph Processor

The dependency pairs are split into 5 components.