(0) Obligation:

Clauses:

p(X, g(X)).
p(X, f(Y)) :- p(X, g(Y)).

Queries:

p(g,a).

(1) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (b,f) (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x3)

(3) DependencyPairsProof (EQUIVALENT transformation)

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

P_IN_GA(X, f(Y)) → U1_GA(X, Y, p_in_gg(X, g(Y)))
P_IN_GA(X, f(Y)) → P_IN_GG(X, g(Y))
P_IN_GG(X, f(Y)) → U1_GG(X, Y, p_in_gg(X, g(Y)))
P_IN_GG(X, f(Y)) → P_IN_GG(X, g(Y))

The TRS R consists of the following rules:

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x3)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
P_IN_GG(x1, x2)  =  P_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)

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

(4) Obligation:

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

P_IN_GA(X, f(Y)) → U1_GA(X, Y, p_in_gg(X, g(Y)))
P_IN_GA(X, f(Y)) → P_IN_GG(X, g(Y))
P_IN_GG(X, f(Y)) → U1_GG(X, Y, p_in_gg(X, g(Y)))
P_IN_GG(X, f(Y)) → P_IN_GG(X, g(Y))

The TRS R consists of the following rules:

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x3)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
P_IN_GG(x1, x2)  =  P_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 0 SCCs with 4 less nodes.

(6) TRUE

(7) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (b,f) (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg(x1, x2)
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x1, x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(8) Obligation:

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

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg(x1, x2)
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x1, x3)

(9) DependencyPairsProof (EQUIVALENT transformation)

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

P_IN_GA(X, f(Y)) → U1_GA(X, Y, p_in_gg(X, g(Y)))
P_IN_GA(X, f(Y)) → P_IN_GG(X, g(Y))
P_IN_GG(X, f(Y)) → U1_GG(X, Y, p_in_gg(X, g(Y)))
P_IN_GG(X, f(Y)) → P_IN_GG(X, g(Y))

The TRS R consists of the following rules:

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg(x1, x2)
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x1, x3)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
P_IN_GG(x1, x2)  =  P_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x3)

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

(10) Obligation:

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

P_IN_GA(X, f(Y)) → U1_GA(X, Y, p_in_gg(X, g(Y)))
P_IN_GA(X, f(Y)) → P_IN_GG(X, g(Y))
P_IN_GG(X, f(Y)) → U1_GG(X, Y, p_in_gg(X, g(Y)))
P_IN_GG(X, f(Y)) → P_IN_GG(X, g(Y))

The TRS R consists of the following rules:

p_in_ga(X, g(X)) → p_out_ga(X, g(X))
p_in_ga(X, f(Y)) → U1_ga(X, Y, p_in_gg(X, g(Y)))
p_in_gg(X, g(X)) → p_out_gg(X, g(X))
p_in_gg(X, f(Y)) → U1_gg(X, Y, p_in_gg(X, g(Y)))
U1_gg(X, Y, p_out_gg(X, g(Y))) → p_out_gg(X, f(Y))
U1_ga(X, Y, p_out_gg(X, g(Y))) → p_out_ga(X, f(Y))

The argument filtering Pi contains the following mapping:
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
p_in_gg(x1, x2)  =  p_in_gg(x1, x2)
g(x1)  =  g
p_out_gg(x1, x2)  =  p_out_gg(x1, x2)
f(x1)  =  f
U1_gg(x1, x2, x3)  =  U1_gg(x1, x3)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
P_IN_GG(x1, x2)  =  P_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x3)

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