YES Termination proof of AG_#3.18_rand.trs

(0) Obligation:

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

minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → plus(x, s(y))
plus(s(x), y) → s(plus(minus(x, y), double(y)))

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:

minus(x, 0) → x
minus(s(x), s(y)) → MINUS(x, y)
double(0) → 0
double(s(x)) → s(s(DOUBLE(x)))
plus(0, y) → y
plus(s(x), y) → s(PLUS(x, y))
plus(s(x), y) → PLUS(x, s(y))
plus(s(x), y) → s(PLUS(minus(x, y), double(y)))
plus(s(x), y) → s(plus(MINUS(x, y), double(y)))
plus(s(x), y) → s(plus(minus(x, y), DOUBLE(y)))

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:

double(0) → 0
double(s(x)) → s(s(double(x)))
plus(s(x), y) → s(plus(x, y))
plus(0, y) → y
minus(x, 0) → x
minus(s(x), s(y)) → MINUS(x, y)
plus(s(x), y) → plus(x, s(y))
plus(s(x), y) → s(plus(minus(x, y), double(y)))

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 = plus_2 = 0 = minus_2 = 1 rand_1 = double_1 =
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(x1, x2)
s(x1)  =  s(x1)
double(x1)  =  double(x1)
0  =  0
plus(x1, x2)  =  plus(x1, x2)
minus(x1, x2)  =  x1

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

MINUS2 > s1
0 > s1
plus2 > double1 > s1

Status:
MINUS2: [2,1]
s1: [1]
double1: multiset
0: multiset
plus2: [1,2]

(7) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
plus0(00, y) → y
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
rand0(x) → x
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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:

rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(MINUS0(x1, x2)) = x1 + x2   
POL(double0(x1)) = x1   
POL(minus(x1)) = x1   
POL(plus0(x1, x2)) = x1 + x2   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   

(9) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
plus0(00, y) → y
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(10) 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:

plus0(00, y) → y

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(MINUS0(x1, x2)) = x1 + x2   
POL(double0(x1)) = x1   
POL(minus(x1)) = x1   
POL(plus0(x1, x2)) = 2 + x1 + 2·x2   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(11) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(12) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


MINUS0(s0(x), s0(y)) → MINUS0(x, y)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MINUS0(x1, x2)  =  MINUS0(x1)
s0(x1)  =  s0(x1)
double0(x1)  =  double0(x1)
00  =  00
plus0(x1, x2)  =  plus0(x1, x2)
minus(x1)  =  x1
rand0(x1)  =  rand0

Recursive path order with status [RPO].
Quasi-Precedence:
plus02 > double01 > s01
plus02 > double01 > 00
rand0 > s01

Status:
MINUS01: [1]
s01: multiset
double01: multiset
00: multiset
plus02: [1,2]
rand0: []


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

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

(13) Obligation:

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

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(14) PisEmptyProof (EQUIVALENT transformation)

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

(15) YES

(16) Obligation:

Relative ADP Problem with
absolute ADPs:

double(0) → 0
double(s(x)) → s(s(DOUBLE(x)))
plus(s(x), y) → s(plus(x, y))
plus(0, y) → y
minus(s(x), s(y)) → minus(x, y)
minus(x, 0) → x
plus(s(x), y) → plus(x, s(y))
plus(s(x), y) → s(plus(minus(x, y), double(y)))

and relative ADPs:

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

(17) 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 = plus_2 = 0 = minus_2 = 1 DOUBLE_1 = rand_1 = double_1 =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
DOUBLE(x1)  =  DOUBLE(x1)
s(x1)  =  s(x1)
double(x1)  =  double(x1)
0  =  0
plus(x1, x2)  =  plus(x1, x2)
minus(x1, x2)  =  x1

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

plus2 > double1 > s1 > DOUBLE1
plus2 > double1 > 0

Status:
DOUBLE1: multiset
s1: [1]
double1: multiset
0: multiset
plus2: [1,2]

(18) Obligation:

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

DOUBLE0(s0(x)) → DOUBLE0(x)

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
plus0(00, y) → y
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
rand0(x) → x
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(19) 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:

rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(DOUBLE0(x1)) = x1   
POL(double0(x1)) = x1   
POL(minus(x1)) = x1   
POL(plus0(x1, x2)) = x1 + 2·x2   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   

(20) Obligation:

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

DOUBLE0(s0(x)) → DOUBLE0(x)

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
plus0(00, y) → y
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(21) 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:

plus0(00, y) → y

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(DOUBLE0(x1)) = x1   
POL(double0(x1)) = x1   
POL(minus(x1)) = x1   
POL(plus0(x1, x2)) = 1 + x1 + x2   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(22) Obligation:

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

DOUBLE0(s0(x)) → DOUBLE0(x)

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(23) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


DOUBLE0(s0(x)) → DOUBLE0(x)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
DOUBLE0(x1)  =  x1
s0(x1)  =  s0(x1)
double0(x1)  =  double0(x1)
00  =  00
plus0(x1, x2)  =  plus0(x1)
minus(x1)  =  x1
rand0(x1)  =  rand0

Recursive path order with status [RPO].
Quasi-Precedence:
double01 > [s01, rand0]
double01 > 00
plus01 > [s01, rand0]

Status:
s01: multiset
double01: multiset
00: multiset
plus01: [1]
rand0: []


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

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

(24) Obligation:

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

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(25) PisEmptyProof (EQUIVALENT transformation)

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

(26) YES

(27) Obligation:

Relative ADP Problem with
absolute ADPs:

double(0) → 0
double(s(x)) → s(s(double(x)))
plus(s(x), y) → s(PLUS(minus(x, y), double(y)))
plus(s(x), y) → PLUS(x, s(y))
plus(s(x), y) → s(PLUS(x, y))
plus(0, y) → y
minus(s(x), s(y)) → minus(x, y)
minus(x, 0) → x
plus(s(x), y) → s(plus(minus(x, y), double(y)))

and relative ADPs:

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

(28) 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 = plus_2 = PLUS_2 = 1 0 = minus_2 = 1 rand_1 = double_1 =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
PLUS(x1, x2)  =  PLUS(x1)
s(x1)  =  s(x1)
minus(x1, x2)  =  minus(x1)
double(x1)  =  double(x1)
0  =  0
plus(x1, x2)  =  plus(x1, x2)

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

plus2 > double1 > [PLUS1, s1] > minus1
plus2 > double1 > 0

Status:
PLUS1: multiset
s1: multiset
minus1: multiset
double1: multiset
0: multiset
plus2: [1,2]

(29) Obligation:

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

PLUS(s0(x)) → PLUS(x)
PLUS(s0(x)) → PLUS(minus(x))

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
plus0(00, y) → y
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
rand0(x) → x
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(30) 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:

rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(PLUS(x1)) = x1   
POL(double0(x1)) = x1   
POL(minus(x1)) = x1   
POL(plus0(x1, x2)) = x1 + 2·x2   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   

(31) Obligation:

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

PLUS(s0(x)) → PLUS(x)
PLUS(s0(x)) → PLUS(minus(x))

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
plus0(00, y) → y
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(32) 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:

plus0(00, y) → y

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(PLUS(x1)) = x1   
POL(double0(x1)) = x1   
POL(minus(x1)) = x1   
POL(plus0(x1, x2)) = 1 + x1 + 2·x2   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(33) Obligation:

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

PLUS(s0(x)) → PLUS(x)
PLUS(s0(x)) → PLUS(minus(x))

The TRS R consists of the following rules:

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(34) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


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

POL( 00 ) = 0

POL( s0(x1) ) = x1 + 1

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

POL( minus(x1) ) = x1

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

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


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

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

(35) Obligation:

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

double0(00) → 00
double0(s0(x)) → s0(s0(double0(x)))
plus0(s0(x), y) → s0(plus0(x, y))
minus(s0(x)) → minus(x)
minus(x) → x
rand0(x) → rand0(s0(x))
plus0(s0(x), y) → plus0(x, s0(y))
plus0(s0(x), y) → s0(plus0(minus(x), double0(y)))

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

(36) PisEmptyProof (EQUIVALENT transformation)

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

(37) YES