(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).

Query: q(g,g,a)

(1) BuiltinConflictTransformerProof (EQUIVALENT 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).

Query: q(g,g,a)

(3) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(4) Obligation:

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

qA_in_gga(T20, 0, T20) → qA_out_gga(T20, 0, T20)
qA_in_gga(T25, 0, T26) → qA_out_gga(T25, 0, T26)
qA_in_gga(0, T31, 0) → qA_out_gga(0, T31, 0)
qA_in_gga(0, T41, T42) → qA_out_gga(0, T41, T42)
qA_in_gga(s(T66), s(T71), T62) → U1_gga(T66, T71, T62, mB_in_gga(T66, T71, T62))
mB_in_gga(T83, 0, T83) → mB_out_gga(T83, 0, T83)
mB_in_gga(0, T88, 0) → mB_out_gga(0, T88, 0)
mB_in_gga(s(T109), s(T114), T105) → U2_gga(T109, T114, T105, mB_in_gga(T109, T114, T105))
U2_gga(T109, T114, T105, mB_out_gga(T109, T114, T105)) → mB_out_gga(s(T109), s(T114), T105)
U1_gga(T66, T71, T62, mB_out_gga(T66, T71, T62)) → qA_out_gga(s(T66), s(T71), T62)
qA_in_gga(T123, T124, T125) → qA_out_gga(T123, T124, T125)

The argument filtering Pi contains the following mapping:
qA_in_gga(x1, x2, x3)  =  qA_in_gga(x1, x2)
0  =  0
qA_out_gga(x1, x2, x3)  =  qA_out_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)

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

QA_IN_GGA(s(T66), s(T71), T62) → U1_GGA(T66, T71, T62, mB_in_gga(T66, T71, T62))
QA_IN_GGA(s(T66), s(T71), T62) → MB_IN_GGA(T66, T71, T62)
MB_IN_GGA(s(T109), s(T114), T105) → U2_GGA(T109, T114, T105, mB_in_gga(T109, T114, T105))
MB_IN_GGA(s(T109), s(T114), T105) → MB_IN_GGA(T109, T114, T105)

The TRS R consists of the following rules:

qA_in_gga(T20, 0, T20) → qA_out_gga(T20, 0, T20)
qA_in_gga(T25, 0, T26) → qA_out_gga(T25, 0, T26)
qA_in_gga(0, T31, 0) → qA_out_gga(0, T31, 0)
qA_in_gga(0, T41, T42) → qA_out_gga(0, T41, T42)
qA_in_gga(s(T66), s(T71), T62) → U1_gga(T66, T71, T62, mB_in_gga(T66, T71, T62))
mB_in_gga(T83, 0, T83) → mB_out_gga(T83, 0, T83)
mB_in_gga(0, T88, 0) → mB_out_gga(0, T88, 0)
mB_in_gga(s(T109), s(T114), T105) → U2_gga(T109, T114, T105, mB_in_gga(T109, T114, T105))
U2_gga(T109, T114, T105, mB_out_gga(T109, T114, T105)) → mB_out_gga(s(T109), s(T114), T105)
U1_gga(T66, T71, T62, mB_out_gga(T66, T71, T62)) → qA_out_gga(s(T66), s(T71), T62)
qA_in_gga(T123, T124, T125) → qA_out_gga(T123, T124, T125)

The argument filtering Pi contains the following mapping:
qA_in_gga(x1, x2, x3)  =  qA_in_gga(x1, x2)
0  =  0
qA_out_gga(x1, x2, x3)  =  qA_out_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
QA_IN_GGA(x1, x2, x3)  =  QA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
MB_IN_GGA(x1, x2, x3)  =  MB_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)

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

(6) Obligation:

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

QA_IN_GGA(s(T66), s(T71), T62) → U1_GGA(T66, T71, T62, mB_in_gga(T66, T71, T62))
QA_IN_GGA(s(T66), s(T71), T62) → MB_IN_GGA(T66, T71, T62)
MB_IN_GGA(s(T109), s(T114), T105) → U2_GGA(T109, T114, T105, mB_in_gga(T109, T114, T105))
MB_IN_GGA(s(T109), s(T114), T105) → MB_IN_GGA(T109, T114, T105)

The TRS R consists of the following rules:

qA_in_gga(T20, 0, T20) → qA_out_gga(T20, 0, T20)
qA_in_gga(T25, 0, T26) → qA_out_gga(T25, 0, T26)
qA_in_gga(0, T31, 0) → qA_out_gga(0, T31, 0)
qA_in_gga(0, T41, T42) → qA_out_gga(0, T41, T42)
qA_in_gga(s(T66), s(T71), T62) → U1_gga(T66, T71, T62, mB_in_gga(T66, T71, T62))
mB_in_gga(T83, 0, T83) → mB_out_gga(T83, 0, T83)
mB_in_gga(0, T88, 0) → mB_out_gga(0, T88, 0)
mB_in_gga(s(T109), s(T114), T105) → U2_gga(T109, T114, T105, mB_in_gga(T109, T114, T105))
U2_gga(T109, T114, T105, mB_out_gga(T109, T114, T105)) → mB_out_gga(s(T109), s(T114), T105)
U1_gga(T66, T71, T62, mB_out_gga(T66, T71, T62)) → qA_out_gga(s(T66), s(T71), T62)
qA_in_gga(T123, T124, T125) → qA_out_gga(T123, T124, T125)

The argument filtering Pi contains the following mapping:
qA_in_gga(x1, x2, x3)  =  qA_in_gga(x1, x2)
0  =  0
qA_out_gga(x1, x2, x3)  =  qA_out_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
QA_IN_GGA(x1, x2, x3)  =  QA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
MB_IN_GGA(x1, x2, x3)  =  MB_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_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:

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

The TRS R consists of the following rules:

qA_in_gga(T20, 0, T20) → qA_out_gga(T20, 0, T20)
qA_in_gga(T25, 0, T26) → qA_out_gga(T25, 0, T26)
qA_in_gga(0, T31, 0) → qA_out_gga(0, T31, 0)
qA_in_gga(0, T41, T42) → qA_out_gga(0, T41, T42)
qA_in_gga(s(T66), s(T71), T62) → U1_gga(T66, T71, T62, mB_in_gga(T66, T71, T62))
mB_in_gga(T83, 0, T83) → mB_out_gga(T83, 0, T83)
mB_in_gga(0, T88, 0) → mB_out_gga(0, T88, 0)
mB_in_gga(s(T109), s(T114), T105) → U2_gga(T109, T114, T105, mB_in_gga(T109, T114, T105))
U2_gga(T109, T114, T105, mB_out_gga(T109, T114, T105)) → mB_out_gga(s(T109), s(T114), T105)
U1_gga(T66, T71, T62, mB_out_gga(T66, T71, T62)) → qA_out_gga(s(T66), s(T71), T62)
qA_in_gga(T123, T124, T125) → qA_out_gga(T123, T124, T125)

The argument filtering Pi contains the following mapping:
qA_in_gga(x1, x2, x3)  =  qA_in_gga(x1, x2)
0  =  0
qA_out_gga(x1, x2, x3)  =  qA_out_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x2, x4)
MB_IN_GGA(x1, x2, x3)  =  MB_IN_GGA(x1, x2)

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

(9) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(10) Obligation:

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

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

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

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

(11) PiDPToQDPProof (SOUND transformation)

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

(12) Obligation:

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

MB_IN_GGA(s(T109), s(T114)) → MB_IN_GGA(T109, T114)

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

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

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

(14) YES