(0) Obligation:

Clauses:

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

Queries:

q(g,g,a).

(1) BuiltinConflictTransformerProof (SOUND transformation)

Renamed defined predicates conflicting with built-in predicates [PROLOG].

(2) Obligation:

Clauses:

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

Queries:

q(g,g,a).

(3) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(4) Obligation:

Triples:

m36(s(T109), s(T114), T105) :- m36(T109, T114, T105).
q1(s(T66), s(T71), T62) :- m36(T66, T71, T62).

Clauses:

mc36(T83, 0, T83).
mc36(0, T88, 0).
mc36(s(T109), s(T114), T105) :- mc36(T109, T114, T105).

Afs:

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

(5) 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,f)
m36_in: (b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

Q1_IN_GGA(s(T66), s(T71), T62) → U2_GGA(T66, T71, T62, m36_in_gga(T66, T71, T62))
Q1_IN_GGA(s(T66), s(T71), T62) → M36_IN_GGA(T66, T71, T62)
M36_IN_GGA(s(T109), s(T114), T105) → U1_GGA(T109, T114, T105, m36_in_gga(T109, T114, T105))
M36_IN_GGA(s(T109), s(T114), T105) → M36_IN_GGA(T109, T114, T105)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
m36_in_gga(x1, x2, x3)  =  m36_in_gga(x1, x2)
Q1_IN_GGA(x1, x2, x3)  =  Q1_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
M36_IN_GGA(x1, x2, x3)  =  M36_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)

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

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(6) Obligation:

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

Q1_IN_GGA(s(T66), s(T71), T62) → U2_GGA(T66, T71, T62, m36_in_gga(T66, T71, T62))
Q1_IN_GGA(s(T66), s(T71), T62) → M36_IN_GGA(T66, T71, T62)
M36_IN_GGA(s(T109), s(T114), T105) → U1_GGA(T109, T114, T105, m36_in_gga(T109, T114, T105))
M36_IN_GGA(s(T109), s(T114), T105) → M36_IN_GGA(T109, T114, T105)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
m36_in_gga(x1, x2, x3)  =  m36_in_gga(x1, x2)
Q1_IN_GGA(x1, x2, x3)  =  Q1_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
M36_IN_GGA(x1, x2, x3)  =  M36_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 3 less nodes.

(8) Obligation:

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

M36_IN_GGA(s(T109), s(T114), T105) → M36_IN_GGA(T109, T114, T105)

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

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

(9) PiDPToQDPProof (SOUND transformation)

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

(10) Obligation:

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

M36_IN_GGA(s(T109), s(T114)) → M36_IN_GGA(T109, T114)

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

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

  • M36_IN_GGA(s(T109), s(T114)) → M36_IN_GGA(T109, T114)
    The graph contains the following edges 1 > 1, 2 > 2

(12) YES