(0) Obligation:

Clauses:

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

Queries:

p(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: (f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a

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_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a

(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_A(X) → U1_A(X, q_in_g(f(Y)))
P_IN_A(X) → Q_IN_G(f(Y))
U1_A(X, q_out_g(f(Y))) → U2_A(X, p_in_a(Y))
U1_A(X, q_out_g(f(Y))) → P_IN_A(Y)

The TRS R consists of the following rules:

p_in_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a
P_IN_A(x1)  =  P_IN_A
U1_A(x1, x2)  =  U1_A(x2)
Q_IN_G(x1)  =  Q_IN_G(x1)
U2_A(x1, x2)  =  U2_A(x2)

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

(4) Obligation:

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

P_IN_A(X) → U1_A(X, q_in_g(f(Y)))
P_IN_A(X) → Q_IN_G(f(Y))
U1_A(X, q_out_g(f(Y))) → U2_A(X, p_in_a(Y))
U1_A(X, q_out_g(f(Y))) → P_IN_A(Y)

The TRS R consists of the following rules:

p_in_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a
P_IN_A(x1)  =  P_IN_A
U1_A(x1, x2)  =  U1_A(x2)
Q_IN_G(x1)  =  Q_IN_G(x1)
U2_A(x1, x2)  =  U2_A(x2)

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: (f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

p_in_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g(x1)
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a

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_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g(x1)
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a

(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_A(X) → U1_A(X, q_in_g(f(Y)))
P_IN_A(X) → Q_IN_G(f(Y))
U1_A(X, q_out_g(f(Y))) → U2_A(X, p_in_a(Y))
U1_A(X, q_out_g(f(Y))) → P_IN_A(Y)

The TRS R consists of the following rules:

p_in_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g(x1)
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a
P_IN_A(x1)  =  P_IN_A
U1_A(x1, x2)  =  U1_A(x2)
Q_IN_G(x1)  =  Q_IN_G(x1)
U2_A(x1, x2)  =  U2_A(x2)

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

(10) Obligation:

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

P_IN_A(X) → U1_A(X, q_in_g(f(Y)))
P_IN_A(X) → Q_IN_G(f(Y))
U1_A(X, q_out_g(f(Y))) → U2_A(X, p_in_a(Y))
U1_A(X, q_out_g(f(Y))) → P_IN_A(Y)

The TRS R consists of the following rules:

p_in_a(X) → U1_a(X, q_in_g(f(Y)))
q_in_g(g(Y)) → q_out_g(g(Y))
U1_a(X, q_out_g(f(Y))) → U2_a(X, p_in_a(Y))
U2_a(X, p_out_a(Y)) → p_out_a(X)

The argument filtering Pi contains the following mapping:
p_in_a(x1)  =  p_in_a
U1_a(x1, x2)  =  U1_a(x2)
q_in_g(x1)  =  q_in_g(x1)
f(x1)  =  f
g(x1)  =  g(x1)
q_out_g(x1)  =  q_out_g(x1)
U2_a(x1, x2)  =  U2_a(x2)
p_out_a(x1)  =  p_out_a
P_IN_A(x1)  =  P_IN_A
U1_A(x1, x2)  =  U1_A(x2)
Q_IN_G(x1)  =  Q_IN_G(x1)
U2_A(x1, x2)  =  U2_A(x2)

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