(0) Obligation:

Clauses:

q(X, Y) :- m(X, Y, Z).
m(X, 0, X).
m(0, Y, 0) :- !.
m(X, Y, Z) :- ','(p(X, A), ','(p(Y, B), m(A, B, Z))).
p(0, 0).
p(s(X), X).

Queries:

q(g,g).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

m20(s(T28), X66) :- m20(T28, X66).
m3(s(T15), 0, X31) :- m20(T15, X31).
m3(s(T44), s(T48), X100) :- m3(T44, T48, X100).
q1(T5, T6) :- m3(T5, T6, X5).

Clauses:

mc20(T22, T22).
mc20(0, 0).
mc20(s(T28), X66) :- mc20(T28, X66).
mc3(T9, 0, T9).
mc3(0, 0, 0).
mc3(s(T15), 0, X31) :- mc20(T15, X31).
mc3(0, T35, 0).
mc3(s(T44), s(T48), X100) :- mc3(T44, T48, X100).

Afs:

q1(x1, x2)  =  q1(x1, x2)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
q1_in: (b,b)
m3_in: (b,b,f)
m20_in: (b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

Q1_IN_GG(T5, T6) → U4_GG(T5, T6, m3_in_gga(T5, T6, X5))
Q1_IN_GG(T5, T6) → M3_IN_GGA(T5, T6, X5)
M3_IN_GGA(s(T15), 0, X31) → U2_GGA(T15, X31, m20_in_ga(T15, X31))
M3_IN_GGA(s(T15), 0, X31) → M20_IN_GA(T15, X31)
M20_IN_GA(s(T28), X66) → U1_GA(T28, X66, m20_in_ga(T28, X66))
M20_IN_GA(s(T28), X66) → M20_IN_GA(T28, X66)
M3_IN_GGA(s(T44), s(T48), X100) → U3_GGA(T44, T48, X100, m3_in_gga(T44, T48, X100))
M3_IN_GGA(s(T44), s(T48), X100) → M3_IN_GGA(T44, T48, X100)

R is empty.
The argument filtering Pi contains the following mapping:
m3_in_gga(x1, x2, x3)  =  m3_in_gga(x1, x2)
s(x1)  =  s(x1)
0  =  0
m20_in_ga(x1, x2)  =  m20_in_ga(x1)
Q1_IN_GG(x1, x2)  =  Q1_IN_GG(x1, x2)
U4_GG(x1, x2, x3)  =  U4_GG(x1, x2, x3)
M3_IN_GGA(x1, x2, x3)  =  M3_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3)  =  U2_GGA(x1, x3)
M20_IN_GA(x1, x2)  =  M20_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)

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

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

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

Q1_IN_GG(T5, T6) → U4_GG(T5, T6, m3_in_gga(T5, T6, X5))
Q1_IN_GG(T5, T6) → M3_IN_GGA(T5, T6, X5)
M3_IN_GGA(s(T15), 0, X31) → U2_GGA(T15, X31, m20_in_ga(T15, X31))
M3_IN_GGA(s(T15), 0, X31) → M20_IN_GA(T15, X31)
M20_IN_GA(s(T28), X66) → U1_GA(T28, X66, m20_in_ga(T28, X66))
M20_IN_GA(s(T28), X66) → M20_IN_GA(T28, X66)
M3_IN_GGA(s(T44), s(T48), X100) → U3_GGA(T44, T48, X100, m3_in_gga(T44, T48, X100))
M3_IN_GGA(s(T44), s(T48), X100) → M3_IN_GGA(T44, T48, X100)

R is empty.
The argument filtering Pi contains the following mapping:
m3_in_gga(x1, x2, x3)  =  m3_in_gga(x1, x2)
s(x1)  =  s(x1)
0  =  0
m20_in_ga(x1, x2)  =  m20_in_ga(x1)
Q1_IN_GG(x1, x2)  =  Q1_IN_GG(x1, x2)
U4_GG(x1, x2, x3)  =  U4_GG(x1, x2, x3)
M3_IN_GGA(x1, x2, x3)  =  M3_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3)  =  U2_GGA(x1, x3)
M20_IN_GA(x1, x2)  =  M20_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 6 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

M20_IN_GA(s(T28), X66) → M20_IN_GA(T28, X66)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
M20_IN_GA(x1, x2)  =  M20_IN_GA(x1)

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

(8) PiDPToQDPProof (SOUND transformation)

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

(9) Obligation:

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

M20_IN_GA(s(T28)) → M20_IN_GA(T28)

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

(10) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • M20_IN_GA(s(T28)) → M20_IN_GA(T28)
    The graph contains the following edges 1 > 1

(11) YES

(12) Obligation:

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

M3_IN_GGA(s(T44), s(T48), X100) → M3_IN_GGA(T44, T48, X100)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
M3_IN_GGA(x1, x2, x3)  =  M3_IN_GGA(x1, x2)

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

(13) PiDPToQDPProof (SOUND transformation)

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

(14) Obligation:

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

M3_IN_GGA(s(T44), s(T48)) → M3_IN_GGA(T44, T48)

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

(15) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • M3_IN_GGA(s(T44), s(T48)) → M3_IN_GGA(T44, T48)
    The graph contains the following edges 1 > 1, 2 > 2

(16) YES