YES Termination proof of AG_#3.6a_rand.trs

(0) Obligation:

Relative term rewrite system:
The relative TRS consists of the following R rules:

le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
gcd(0, y) → y
gcd(s(x), 0) → s(x)
gcd(s(x), s(y)) → if_gcd(le(y, x), s(x), s(y))
if_gcd(true, s(x), s(y)) → gcd(minus(x, y), s(y))
if_gcd(false, s(x), s(y)) → gcd(minus(y, x), s(x))

The relative TRS consists of the following S rules:

rand(x) → rand(s(x))
rand(x) → x

(1) RelTRStoRelADPProof (EQUIVALENT transformation)

We upgrade the RelTRS problem to an equivalent Relative ADP Problem [IJCAR24].

(2) Obligation:

Relative ADP Problem with
absolute ADPs:

le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → LE(x, y)
minus(x, 0) → x
minus(s(x), s(y)) → MINUS(x, y)
gcd(0, y) → y
gcd(s(x), 0) → s(x)
gcd(s(x), s(y)) → IF_GCD(le(y, x), s(x), s(y))
gcd(s(x), s(y)) → if_gcd(LE(y, x), s(x), s(y))
if_gcd(true, s(x), s(y)) → GCD(minus(x, y), s(y))
if_gcd(true, s(x), s(y)) → gcd(MINUS(x, y), s(y))
if_gcd(false, s(x), s(y)) → GCD(minus(y, x), s(x))
if_gcd(false, s(x), s(y)) → gcd(MINUS(y, x), s(x))

and relative ADPs:

rand(x) → RAND(s(x))
rand(x) → x

(3) RelADPDepGraphProof (EQUIVALENT transformation)

We use the relative dependency graph processor [IJCAR24].
The approximation of the Relative Dependency Graph contains:
3 SCCs with nodes from P_abs,
0 Lassos,
Result: This relative DT problem is equivalent to 3 subproblems.

(4) Complex Obligation (AND)

(5) Obligation:

Relative ADP Problem with
absolute ADPs:

gcd(0, y) → y
gcd(s(x), s(y)) → if_gcd(le(y, x), s(x), s(y))
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false
gcd(s(x), 0) → s(x)
le(0, y) → true
minus(x, 0) → x
minus(s(x), s(y)) → MINUS(x, y)
if_gcd(true, s(x), s(y)) → gcd(minus(x, y), s(y))
if_gcd(false, s(x), s(y)) → gcd(minus(y, x), s(x))

and relative ADPs:

rand(x) → rand(s(x))
rand(x) → x

(6) RelADPCleverAfsProof (SOUND transformation)

We use the first derelatifying processor [IJCAR24].
There are no annotations in relative ADPs, so the relative ADP problem can be transformed into a non-relative DP problem.

Furthermore, We use an argument filter [LPAR04].
Filtering:s_1 = MINUS_2 = 0 true = gcd_2 = 0 = le_2 = if_gcd_3 = 0 minus_2 = 1 rand_1 = false =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
MINUS(x1, x2)  =  MINUS(x2)
s(x1)  =  s(x1)
gcd(x1, x2)  =  gcd(x1, x2)
0  =  0
if_gcd(x1, x2, x3)  =  if_gcd(x2, x3)
le(x1, x2)  =  le(x1, x2)
false  =  false
true  =  true
minus(x1, x2)  =  minus(x1)

Recursive path order with status [RPO].
Quasi-Precedence:

0 > [s1, minus1] > MINUS1 > [gcd2, ifgcd2, le2]
0 > [s1, minus1] > false > [gcd2, ifgcd2, le2]
0 > true > [gcd2, ifgcd2, le2]

Status:
MINUS1: [1]
s1: multiset
gcd2: multiset
0: multiset
ifgcd2: multiset
le2: multiset
false: multiset
true: multiset
minus1: multiset

(7) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MINUS(s0(y)) → MINUS(y)

The TRS R consists of the following rules:

gcd0(00, y) → y
gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
le0(s0(x), 00) → false0
gcd0(s0(x), 00) → s0(x)
le0(00, y) → true0
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))
rand0(x) → x

Q is empty.
We have to consider all (P,Q,R)-chains.

(8) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

gcd0(00, y) → y
le0(s0(x), 00) → false0
gcd0(s0(x), 00) → s0(x)
le0(00, y) → true0
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 1   
POL(MINUS(x1)) = x1   
POL(false0) = 0   
POL(gcd0(x1, x2)) = 2·x1 + 2·x2   
POL(if_gcd(x1, x2)) = 2·x1 + 2·x2   
POL(le0(x1, x2)) = x1 + x2   
POL(minus(x1)) = x1   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   
POL(true0) = 0   

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MINUS(s0(y)) → MINUS(y)

The TRS R consists of the following rules:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(10) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


MINUS(s0(y)) → MINUS(y)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:
POL( gcd0(x1, x2) ) = 2x1 + 2x2 + 2

POL( s0(x1) ) = 2x1 + 1

POL( if_gcd(x1, x2) ) = 2x1 + 2x2 + 2

POL( le0(x1, x2) ) = 0

POL( minus(x1) ) = x1

POL( rand0(x1) ) = max{0, -2}

POL( MINUS(x1) ) = x1


The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

(11) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(12) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(13) YES

(14) Obligation:

Relative ADP Problem with
absolute ADPs:

gcd(0, y) → y
gcd(s(x), s(y)) → if_gcd(le(y, x), s(x), s(y))
le(s(x), 0) → false
gcd(s(x), 0) → s(x)
le(0, y) → true
minus(s(x), s(y)) → minus(x, y)
minus(x, 0) → x
if_gcd(true, s(x), s(y)) → gcd(minus(x, y), s(y))
if_gcd(false, s(x), s(y)) → gcd(minus(y, x), s(x))
le(s(x), s(y)) → LE(x, y)

and relative ADPs:

rand(x) → rand(s(x))
rand(x) → x

(15) RelADPCleverAfsProof (SOUND transformation)

We use the first derelatifying processor [IJCAR24].
There are no annotations in relative ADPs, so the relative ADP problem can be transformed into a non-relative DP problem.

Furthermore, We use an argument filter [LPAR04].
Filtering:s_1 = true = gcd_2 = LE_2 = 0 0 = le_2 = if_gcd_3 = 0 minus_2 = 1 rand_1 = false =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
LE(x1, x2)  =  LE(x2)
s(x1)  =  s(x1)
gcd(x1, x2)  =  gcd(x1, x2)
0  =  0
if_gcd(x1, x2, x3)  =  if_gcd(x2, x3)
le(x1, x2)  =  le(x1, x2)
false  =  false
true  =  true
minus(x1, x2)  =  minus(x1)

Recursive path order with status [RPO].
Quasi-Precedence:

0 > [s1, minus1] > LE1 > [gcd2, ifgcd2, le2]
0 > [s1, minus1] > false > [gcd2, ifgcd2, le2]
0 > true > [gcd2, ifgcd2, le2]

Status:
LE1: [1]
s1: multiset
gcd2: multiset
0: multiset
ifgcd2: multiset
le2: multiset
false: multiset
true: multiset
minus1: multiset

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LE(s0(y)) → LE(y)

The TRS R consists of the following rules:

gcd0(00, y) → y
gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
le0(s0(x), 00) → false0
gcd0(s0(x), 00) → s0(x)
le0(00, y) → true0
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))
rand0(x) → x

Q is empty.
We have to consider all (P,Q,R)-chains.

(17) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

gcd0(00, y) → y
le0(s0(x), 00) → false0
gcd0(s0(x), 00) → s0(x)
le0(00, y) → true0
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 1   
POL(LE(x1)) = x1   
POL(false0) = 0   
POL(gcd0(x1, x2)) = 2·x1 + 2·x2   
POL(if_gcd(x1, x2)) = 2·x1 + 2·x2   
POL(le0(x1, x2)) = x1 + x2   
POL(minus(x1)) = x1   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   
POL(true0) = 0   

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LE(s0(y)) → LE(y)

The TRS R consists of the following rules:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


LE(s0(y)) → LE(y)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
LE(x1)  =  x1
s0(x1)  =  s0(x1)
gcd0(x1, x2)  =  gcd0(x1, x2)
if_gcd(x1, x2)  =  if_gcd(x1, x2)
le0(x1, x2)  =  le0
minus(x1)  =  minus(x1)
rand0(x1)  =  rand0

Recursive path order with status [RPO].
Quasi-Precedence:
rand0 > [s01, minus1] > [gcd02, ifgcd2]

Status:
s01: multiset
gcd02: multiset
ifgcd2: multiset
le0: []
minus1: multiset
rand0: []


The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

(20) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
le0(s0(x), s0(y)) → le0(x, y)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(21) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(22) YES

(23) Obligation:

Relative ADP Problem with
absolute ADPs:

le(s(x), s(y)) → le(x, y)
gcd(s(x), s(y)) → IF_GCD(le(y, x), s(x), s(y))
le(s(x), 0) → false
gcd(s(x), 0) → s(x)
if_gcd(true, s(x), s(y)) → gcd(minus(x, y), s(y))
if_gcd(false, s(x), s(y)) → gcd(minus(y, x), s(x))
if_gcd(false, s(x), s(y)) → GCD(minus(y, x), s(x))
gcd(0, y) → y
gcd(s(x), s(y)) → if_gcd(le(y, x), s(x), s(y))
if_gcd(true, s(x), s(y)) → GCD(minus(x, y), s(y))
le(0, y) → true
minus(s(x), s(y)) → minus(x, y)
minus(x, 0) → x

and relative ADPs:

rand(x) → rand(s(x))
rand(x) → x

(24) RelADPCleverAfsProof (SOUND transformation)

We use the first derelatifying processor [IJCAR24].
There are no annotations in relative ADPs, so the relative ADP problem can be transformed into a non-relative DP problem.

Furthermore, We use an argument filter [LPAR04].
Filtering:s_1 = true = IF_GCD_3 = 0 gcd_2 = le_2 = 0, 1 0 = if_gcd_3 = 0 minus_2 = 1 rand_1 = false = GCD_2 =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
IF_GCD(x1, x2, x3)  =  IF_GCD(x2, x3)
false  =  false
s(x1)  =  s(x1)
GCD(x1, x2)  =  GCD(x1, x2)
minus(x1, x2)  =  x1
le(x1, x2)  =  le
true  =  true
gcd(x1, x2)  =  gcd(x1, x2)
0  =  0
if_gcd(x1, x2, x3)  =  if_gcd(x2, x3)

Recursive path order with status [RPO].
Quasi-Precedence:

le > [IFGCD2, false, GCD2] > [gcd2, ifgcd2] > s1
le > true
0 > [IFGCD2, false, GCD2] > [gcd2, ifgcd2] > s1
0 > true

Status:
IFGCD2: multiset
false: multiset
s1: [1]
GCD2: multiset
le: multiset
true: multiset
gcd2: multiset
0: multiset
ifgcd2: multiset

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

IF_GCD(s0(x), s0(y)) → GCD0(minus(y), s0(x))
GCD0(s0(x), s0(y)) → IF_GCD(s0(x), s0(y))
IF_GCD(s0(x), s0(y)) → GCD0(minus(x), s0(y))

The TRS R consists of the following rules:

gcd0(00, y) → y
gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
lele
lefalse0
gcd0(s0(x), 00) → s0(x)
letrue0
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))
rand0(x) → x

Q is empty.
We have to consider all (P,Q,R)-chains.

(26) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

letrue0
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(GCD0(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(IF_GCD(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(false0) = 2   
POL(gcd0(x1, x2)) = 2·x1 + 2·x2   
POL(if_gcd(x1, x2)) = 2·x1 + 2·x2   
POL(le) = 2   
POL(minus(x1)) = x1   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   
POL(true0) = 0   

(27) Obligation:

Q DP problem:
The TRS P consists of the following rules:

IF_GCD(s0(x), s0(y)) → GCD0(minus(y), s0(x))
GCD0(s0(x), s0(y)) → IF_GCD(s0(x), s0(y))
IF_GCD(s0(x), s0(y)) → GCD0(minus(x), s0(y))

The TRS R consists of the following rules:

gcd0(00, y) → y
gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
lele
lefalse0
gcd0(s0(x), 00) → s0(x)
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(28) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

gcd0(00, y) → y
lefalse0
gcd0(s0(x), 00) → s0(x)

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 1   
POL(GCD0(x1, x2)) = 2 + x1 + x2   
POL(IF_GCD(x1, x2)) = 2 + x1 + x2   
POL(false0) = 1   
POL(gcd0(x1, x2)) = x1 + x2   
POL(if_gcd(x1, x2)) = x1 + x2   
POL(le) = 2   
POL(minus(x1)) = x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(29) Obligation:

Q DP problem:
The TRS P consists of the following rules:

IF_GCD(s0(x), s0(y)) → GCD0(minus(y), s0(x))
GCD0(s0(x), s0(y)) → IF_GCD(s0(x), s0(y))
IF_GCD(s0(x), s0(y)) → GCD0(minus(x), s0(y))

The TRS R consists of the following rules:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
lele
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(30) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


IF_GCD(s0(x), s0(y)) → GCD0(minus(y), s0(x))
GCD0(s0(x), s0(y)) → IF_GCD(s0(x), s0(y))
IF_GCD(s0(x), s0(y)) → GCD0(minus(x), s0(y))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:
POL( gcd0(x1, x2) ) = 2x1 + 2x2

POL( s0(x1) ) = 2x1 + 2

POL( if_gcd(x1, x2) ) = max{0, 2x1 + 2x2 - 2}

POL( le ) = 0

POL( minus(x1) ) = 2x1

POL( rand0(x1) ) = 1

POL( IF_GCD(x1, x2) ) = max{0, 2x1 + 2x2 - 1}

POL( GCD0(x1, x2) ) = 2x1 + 2x2


The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
lele
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

(31) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

gcd0(s0(x), s0(y)) → if_gcd(s0(x), s0(y))
lele
minus(s0(x)) → minus(x)
minus(x) → x
if_gcd(s0(x), s0(y)) → gcd0(minus(x), s0(y))
rand0(x) → rand0(s0(x))
if_gcd(s0(x), s0(y)) → gcd0(minus(y), s0(x))

Q is empty.
We have to consider all (P,Q,R)-chains.

(32) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(33) YES