YES
proof of /hpcwork/ff862203/termcomp26/benchmarks/dVM7q.pl
# AProVE Commit ID: 23a904c96b029b0a549cde0d0d17dbccf967db59 jckassing 20260626 unpublished dirty


Left Termination of the query pattern

f(g,a,a)

w.r.t. the given Prolog program could successfully be proven:

(0) Prolog
(1) PrologToPiTRSProof [SOUND, 0 ms]
(2) PiTRS
(3) DependencyPairsProof [EQUIVALENT, 0 ms]
(4) PiDP
(5) DependencyGraphProof [EQUIVALENT, 0 ms]
(6) PiDP
(7) PiDPToQDPProof [SOUND, 0 ms]
(8) QDP
(9) UsableRulesReductionPairsProof [EQUIVALENT, 11 ms]
(10) QDP
(11) DependencyGraphProof [EQUIVALENT, 0 ms]
(12) TRUE


----------------------------------------

(0)
Obligation:
Clauses:

f(0, Y, 0).
f(s(X), Y, Z) :- ','(f(X, Y, U), f(U, Y, Z)).


Query: f(g,a,a)
----------------------------------------

(1) PrologToPiTRSProof (SOUND)
We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:

f_in_3: (b,f,f)

Transforming Prolog into the following Term Rewriting System:

Pi-finite rewrite system:
The TRS R consists of the following rules:

   f_in_gaa(0, Y, 0) -> f_out_gaa(0, Y, 0)
   f_in_gaa(s(X), Y, Z) -> U1_gaa(X, Y, Z, f_in_gaa(X, Y, U))
   U1_gaa(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_gaa(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U2_gaa(X, Y, Z, U, f_out_gaa(U, Y, Z)) -> f_out_gaa(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in_gaa(x1, x2, x3)  =  f_in_gaa(x1)

0  =  0

f_out_gaa(x1, x2, x3)  =  f_out_gaa(x3)

s(x1)  =  s(x1)

U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)

U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)





Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



----------------------------------------

(2)
Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:

   f_in_gaa(0, Y, 0) -> f_out_gaa(0, Y, 0)
   f_in_gaa(s(X), Y, Z) -> U1_gaa(X, Y, Z, f_in_gaa(X, Y, U))
   U1_gaa(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_gaa(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U2_gaa(X, Y, Z, U, f_out_gaa(U, Y, Z)) -> f_out_gaa(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in_gaa(x1, x2, x3)  =  f_in_gaa(x1)

0  =  0

f_out_gaa(x1, x2, x3)  =  f_out_gaa(x3)

s(x1)  =  s(x1)

U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)

U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)



----------------------------------------

(3) DependencyPairsProof (EQUIVALENT)
Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

   F_IN_GAA(s(X), Y, Z) -> U1_GAA(X, Y, Z, f_in_gaa(X, Y, U))
   F_IN_GAA(s(X), Y, Z) -> F_IN_GAA(X, Y, U)
   U1_GAA(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_GAA(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U1_GAA(X, Y, Z, f_out_gaa(X, Y, U)) -> F_IN_GAA(U, Y, Z)

The TRS R consists of the following rules:

   f_in_gaa(0, Y, 0) -> f_out_gaa(0, Y, 0)
   f_in_gaa(s(X), Y, Z) -> U1_gaa(X, Y, Z, f_in_gaa(X, Y, U))
   U1_gaa(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_gaa(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U2_gaa(X, Y, Z, U, f_out_gaa(U, Y, Z)) -> f_out_gaa(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in_gaa(x1, x2, x3)  =  f_in_gaa(x1)

0  =  0

f_out_gaa(x1, x2, x3)  =  f_out_gaa(x3)

s(x1)  =  s(x1)

U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)

U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)

F_IN_GAA(x1, x2, x3)  =  F_IN_GAA(x1)

U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)

U2_GAA(x1, x2, x3, x4, x5)  =  U2_GAA(x5)


We have to consider all (P,R,Pi)-chains
----------------------------------------

(4)
Obligation:
Pi DP problem:
The TRS P consists of the following rules:

   F_IN_GAA(s(X), Y, Z) -> U1_GAA(X, Y, Z, f_in_gaa(X, Y, U))
   F_IN_GAA(s(X), Y, Z) -> F_IN_GAA(X, Y, U)
   U1_GAA(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_GAA(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U1_GAA(X, Y, Z, f_out_gaa(X, Y, U)) -> F_IN_GAA(U, Y, Z)

The TRS R consists of the following rules:

   f_in_gaa(0, Y, 0) -> f_out_gaa(0, Y, 0)
   f_in_gaa(s(X), Y, Z) -> U1_gaa(X, Y, Z, f_in_gaa(X, Y, U))
   U1_gaa(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_gaa(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U2_gaa(X, Y, Z, U, f_out_gaa(U, Y, Z)) -> f_out_gaa(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in_gaa(x1, x2, x3)  =  f_in_gaa(x1)

0  =  0

f_out_gaa(x1, x2, x3)  =  f_out_gaa(x3)

s(x1)  =  s(x1)

U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)

U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)

F_IN_GAA(x1, x2, x3)  =  F_IN_GAA(x1)

U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)

U2_GAA(x1, x2, x3, x4, x5)  =  U2_GAA(x5)


We have to consider all (P,R,Pi)-chains
----------------------------------------

(5) DependencyGraphProof (EQUIVALENT)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 1 less node.
----------------------------------------

(6)
Obligation:
Pi DP problem:
The TRS P consists of the following rules:

   U1_GAA(X, Y, Z, f_out_gaa(X, Y, U)) -> F_IN_GAA(U, Y, Z)
   F_IN_GAA(s(X), Y, Z) -> U1_GAA(X, Y, Z, f_in_gaa(X, Y, U))
   F_IN_GAA(s(X), Y, Z) -> F_IN_GAA(X, Y, U)

The TRS R consists of the following rules:

   f_in_gaa(0, Y, 0) -> f_out_gaa(0, Y, 0)
   f_in_gaa(s(X), Y, Z) -> U1_gaa(X, Y, Z, f_in_gaa(X, Y, U))
   U1_gaa(X, Y, Z, f_out_gaa(X, Y, U)) -> U2_gaa(X, Y, Z, U, f_in_gaa(U, Y, Z))
   U2_gaa(X, Y, Z, U, f_out_gaa(U, Y, Z)) -> f_out_gaa(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in_gaa(x1, x2, x3)  =  f_in_gaa(x1)

0  =  0

f_out_gaa(x1, x2, x3)  =  f_out_gaa(x3)

s(x1)  =  s(x1)

U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)

U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)

F_IN_GAA(x1, x2, x3)  =  F_IN_GAA(x1)

U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)


We have to consider all (P,R,Pi)-chains
----------------------------------------

(7) PiDPToQDPProof (SOUND)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
----------------------------------------

(8)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   U1_GAA(f_out_gaa(U)) -> F_IN_GAA(U)
   F_IN_GAA(s(X)) -> U1_GAA(f_in_gaa(X))
   F_IN_GAA(s(X)) -> F_IN_GAA(X)

The TRS R consists of the following rules:

   f_in_gaa(0) -> f_out_gaa(0)
   f_in_gaa(s(X)) -> U1_gaa(f_in_gaa(X))
   U1_gaa(f_out_gaa(U)) -> U2_gaa(f_in_gaa(U))
   U2_gaa(f_out_gaa(Z)) -> f_out_gaa(Z)

The set Q consists of the following terms:

   f_in_gaa(x0)
   U1_gaa(x0)
   U2_gaa(x0)

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

(9) UsableRulesReductionPairsProof (EQUIVALENT)
By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

   F_IN_GAA(s(X)) -> U1_GAA(f_in_gaa(X))
   F_IN_GAA(s(X)) -> F_IN_GAA(X)
The following rules are removed from R:

   f_in_gaa(s(X)) -> U1_gaa(f_in_gaa(X))
Used ordering: POLO with Polynomial interpretation [POLO]:

   POL(0) = 0
   POL(F_IN_GAA(x_1)) = 2*x_1
   POL(U1_GAA(x_1)) = x_1
   POL(U1_gaa(x_1)) = 2*x_1
   POL(U2_gaa(x_1)) = x_1
   POL(f_in_gaa(x_1)) = 2*x_1
   POL(f_out_gaa(x_1)) = 2*x_1
   POL(s(x_1)) = 2*x_1


----------------------------------------

(10)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   U1_GAA(f_out_gaa(U)) -> F_IN_GAA(U)

The TRS R consists of the following rules:

   f_in_gaa(0) -> f_out_gaa(0)
   U1_gaa(f_out_gaa(U)) -> U2_gaa(f_in_gaa(U))
   U2_gaa(f_out_gaa(Z)) -> f_out_gaa(Z)

The set Q consists of the following terms:

   f_in_gaa(x0)
   U1_gaa(x0)
   U2_gaa(x0)

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

(11) DependencyGraphProof (EQUIVALENT)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.
----------------------------------------

(12)
TRUE
