YES Termination proof of AG_#3.48_rand.trs

(0) Obligation:

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

f(0) → true
f(1) → false
f(s(x)) → f(x)
if(true, s(x), s(y)) → s(x)
if(false, s(x), s(y)) → s(y)
g(x, c(y)) → c(g(x, y))
g(x, c(y)) → g(x, if(f(x), c(g(s(x), y)), c(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:

f(0) → true
f(1) → false
f(s(x)) → F(x)
if(true, s(x), s(y)) → s(x)
if(false, s(x), s(y)) → s(y)
g(x, c(y)) → c(G(x, y))
g(x, c(y)) → G(x, if(f(x), c(g(s(x), y)), c(y)))
g(x, c(y)) → g(x, IF(f(x), c(g(s(x), y)), c(y)))
g(x, c(y)) → g(x, if(F(x), c(g(s(x), y)), c(y)))
g(x, c(y)) → g(x, if(f(x), c(G(s(x), y)), c(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:
2 SCCs with nodes from P_abs,
0 Lassos,
Result: This relative DT problem is equivalent to 2 subproblems.

(4) Complex Obligation (AND)

(5) Obligation:

Relative ADP Problem with
absolute ADPs:

if(false, s(x), s(y)) → s(y)
f(s(x)) → F(x)
if(true, s(x), s(y)) → s(x)
g(x, c(y)) → c(g(x, y))
f(1) → false
g(x, c(y)) → g(x, if(f(x), c(g(s(x), y)), c(y)))
f(0) → true

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 = true = c_1 = if_3 = f_1 = 0 = 1 = F_1 = rand_1 = g_2 = 0, 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.
F(x1)  =  x1
s(x1)  =  s(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
false  =  false
true  =  true
g(x1, x2)  =  g
c(x1)  =  x1
f(x1)  =  f(x1)
1  =  1
0  =  0

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

if3 > [s1, g]
f1 > [true, 0]
1 > false > [s1, g]

Status:
s1: multiset
if3: multiset
false: multiset
true: multiset
g: multiset
f1: [1]
1: multiset
0: multiset

(7) Obligation:

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

F0(s0(x)) → F0(x)

The TRS R consists of the following rules:

if0(false0, s0(x), s0(y)) → s0(y)
if0(true0, s0(x), s0(y)) → s0(x)
gc0(g)
f0(10) → false0
gg
f0(00) → true0
f0(s0(x)) → f0(x)
rand0(x) → rand0(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:

if0(false0, s0(x), s0(y)) → s0(y)
if0(true0, s0(x), s0(y)) → s0(x)
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(10) = 0   
POL(F0(x1)) = x1   
POL(c0(x1)) = 2·x1   
POL(f0(x1)) = x1   
POL(false0) = 0   
POL(g) = 0   
POL(if0(x1, x2, x3)) = 2 + 2·x1 + x2 + x3   
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:

F0(s0(x)) → F0(x)

The TRS R consists of the following rules:

gc0(g)
f0(10) → false0
gg
f0(00) → true0
f0(s0(x)) → f0(x)
rand0(x) → rand0(s0(x))

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:

f0(10) → false0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(10) = 1   
POL(F0(x1)) = x1   
POL(c0(x1)) = 2·x1   
POL(f0(x1)) = 2·x1   
POL(false0) = 1   
POL(g) = 0   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   
POL(true0) = 0   

(11) Obligation:

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

F0(s0(x)) → F0(x)

The TRS R consists of the following rules:

gc0(g)
gg
f0(00) → true0
f0(s0(x)) → f0(x)
rand0(x) → rand0(s0(x))

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

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

f0(00) → true0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(F0(x1)) = x1   
POL(c0(x1)) = x1   
POL(f0(x1)) = 1 + x1   
POL(g) = 0   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   
POL(true0) = 0   

(13) Obligation:

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

F0(s0(x)) → F0(x)

The TRS R consists of the following rules:

gc0(g)
gg
f0(s0(x)) → f0(x)
rand0(x) → rand0(s0(x))

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

(14) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


F0(s0(x)) → F0(x)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
F0(x1)  =  x1
s0(x1)  =  s0(x1)
g  =  g
c0(x1)  =  x1
f0(x1)  =  f0
rand0(x1)  =  rand0

Recursive path order with status [RPO].
Quasi-Precedence:
g > f0
rand0 > s01 > f0

Status:
s01: multiset
g: multiset
f0: multiset
rand0: multiset


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

gc0(g)
gg
f0(s0(x)) → f0(x)
rand0(x) → rand0(s0(x))

(15) Obligation:

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

gc0(g)
gg
f0(s0(x)) → f0(x)
rand0(x) → rand0(s0(x))

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

(16) PisEmptyProof (EQUIVALENT transformation)

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

(17) YES

(18) Obligation:

Relative ADP Problem with
absolute ADPs:

if(false, s(x), s(y)) → s(y)
if(true, s(x), s(y)) → s(x)
g(x, c(y)) → g(x, if(f(x), c(G(s(x), y)), c(y)))
f(1) → false
g(x, c(y)) → g(x, if(f(x), c(g(s(x), y)), c(y)))
f(0) → true
f(s(x)) → f(x)
g(x, c(y)) → c(G(x, y))

and relative ADPs:

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

(19) 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 = 0 true = c_1 = G_2 = 0 if_3 = 0, 1, 2 f_1 = 0 0 = 1 = rand_1 = g_2 = 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.
G(x1, x2)  =  x2
c(x1)  =  c(x1)
s(x1)  =  s
if(x1, x2, x3)  =  if
false  =  false
true  =  true
g(x1, x2)  =  g(x1, x2)
f(x1)  =  f
1  =  1
0  =  0

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

g2 > [c1, s, if]
f > false > [c1, s, if]
f > [true, 0] > [c1, s, if]
1 > false > [c1, s, if]

Status:
c1: multiset
s: multiset
if: multiset
false: multiset
true: multiset
g2: [1,2]
f: []
1: multiset
0: multiset

(20) Obligation:

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

G(c0(y)) → G(y)

The TRS R consists of the following rules:

ifs
g0(x, c0(y)) → c0(g0(x, y))
ffalse0
g0(x, c0(y)) → g0(x, if)
ftrue0
ff
rand0(x) → rand0(s)
rand0(x) → x

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 dependency pairs:

G(c0(y)) → G(y)

Strictly oriented rules of the TRS R:

ifs
g0(x, c0(y)) → c0(g0(x, y))
ffalse0
g0(x, c0(y)) → g0(x, if)
ftrue0
rand0(x) → x

Used ordering: Knuth-Bendix order [KBO] with precedence:
g02 > c01 > if > G1 > rand01 > f > true0 > false0 > s

and weight map:

if=2
s=1
f=2
false0=1
true0=2
c0_1=1
rand0_1=1
G_1=1
g0_2=0

The variable weight is 1

(22) Obligation:

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

ff
rand0(x) → rand0(s)

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

(23) PisEmptyProof (EQUIVALENT transformation)

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

(24) YES