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

Query: q(g,g)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

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

qA_in_gg(T5, T6) → U1_gg(T5, T6, mB_in_gga(T5, T6, X5))
mB_in_gga(T9, 0, T9) → mB_out_gga(T9, 0, T9)
mB_in_gga(0, 0, 0) → mB_out_gga(0, 0, 0)
mB_in_gga(s(T15), 0, X29) → U3_gga(T15, X29, mC_in_ga(T15, X29))
mC_in_ga(T22, T22) → mC_out_ga(T22, T22)
mC_in_ga(0, 0) → mC_out_ga(0, 0)
mC_in_ga(s(T28), X62) → U2_ga(T28, X62, mC_in_ga(T28, X62))
U2_ga(T28, X62, mC_out_ga(T28, X62)) → mC_out_ga(s(T28), X62)
U3_gga(T15, X29, mC_out_ga(T15, X29)) → mB_out_gga(s(T15), 0, X29)
mB_in_gga(0, T35, 0) → mB_out_gga(0, T35, 0)
mB_in_gga(s(T44), s(T48), X94) → U4_gga(T44, T48, X94, mB_in_gga(T44, T48, X94))
U4_gga(T44, T48, X94, mB_out_gga(T44, T48, X94)) → mB_out_gga(s(T44), s(T48), X94)
U1_gg(T5, T6, mB_out_gga(T5, T6, X5)) → qA_out_gg(T5, T6)

The argument filtering Pi contains the following mapping:
qA_in_gg(x1, x2)  =  qA_in_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
0  =  0
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3)  =  U3_gga(x1, x3)
mC_in_ga(x1, x2)  =  mC_in_ga(x1)
mC_out_ga(x1, x2)  =  mC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
qA_out_gg(x1, x2)  =  qA_out_gg(x1, x2)

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

QA_IN_GG(T5, T6) → U1_GG(T5, T6, mB_in_gga(T5, T6, X5))
QA_IN_GG(T5, T6) → MB_IN_GGA(T5, T6, X5)
MB_IN_GGA(s(T15), 0, X29) → U3_GGA(T15, X29, mC_in_ga(T15, X29))
MB_IN_GGA(s(T15), 0, X29) → MC_IN_GA(T15, X29)
MC_IN_GA(s(T28), X62) → U2_GA(T28, X62, mC_in_ga(T28, X62))
MC_IN_GA(s(T28), X62) → MC_IN_GA(T28, X62)
MB_IN_GGA(s(T44), s(T48), X94) → U4_GGA(T44, T48, X94, mB_in_gga(T44, T48, X94))
MB_IN_GGA(s(T44), s(T48), X94) → MB_IN_GGA(T44, T48, X94)

The TRS R consists of the following rules:

qA_in_gg(T5, T6) → U1_gg(T5, T6, mB_in_gga(T5, T6, X5))
mB_in_gga(T9, 0, T9) → mB_out_gga(T9, 0, T9)
mB_in_gga(0, 0, 0) → mB_out_gga(0, 0, 0)
mB_in_gga(s(T15), 0, X29) → U3_gga(T15, X29, mC_in_ga(T15, X29))
mC_in_ga(T22, T22) → mC_out_ga(T22, T22)
mC_in_ga(0, 0) → mC_out_ga(0, 0)
mC_in_ga(s(T28), X62) → U2_ga(T28, X62, mC_in_ga(T28, X62))
U2_ga(T28, X62, mC_out_ga(T28, X62)) → mC_out_ga(s(T28), X62)
U3_gga(T15, X29, mC_out_ga(T15, X29)) → mB_out_gga(s(T15), 0, X29)
mB_in_gga(0, T35, 0) → mB_out_gga(0, T35, 0)
mB_in_gga(s(T44), s(T48), X94) → U4_gga(T44, T48, X94, mB_in_gga(T44, T48, X94))
U4_gga(T44, T48, X94, mB_out_gga(T44, T48, X94)) → mB_out_gga(s(T44), s(T48), X94)
U1_gg(T5, T6, mB_out_gga(T5, T6, X5)) → qA_out_gg(T5, T6)

The argument filtering Pi contains the following mapping:
qA_in_gg(x1, x2)  =  qA_in_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
0  =  0
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3)  =  U3_gga(x1, x3)
mC_in_ga(x1, x2)  =  mC_in_ga(x1)
mC_out_ga(x1, x2)  =  mC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
qA_out_gg(x1, x2)  =  qA_out_gg(x1, x2)
QA_IN_GG(x1, x2)  =  QA_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
MB_IN_GGA(x1, x2, x3)  =  MB_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3)  =  U3_GGA(x1, x3)
MC_IN_GA(x1, x2)  =  MC_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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

(4) Obligation:

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

QA_IN_GG(T5, T6) → U1_GG(T5, T6, mB_in_gga(T5, T6, X5))
QA_IN_GG(T5, T6) → MB_IN_GGA(T5, T6, X5)
MB_IN_GGA(s(T15), 0, X29) → U3_GGA(T15, X29, mC_in_ga(T15, X29))
MB_IN_GGA(s(T15), 0, X29) → MC_IN_GA(T15, X29)
MC_IN_GA(s(T28), X62) → U2_GA(T28, X62, mC_in_ga(T28, X62))
MC_IN_GA(s(T28), X62) → MC_IN_GA(T28, X62)
MB_IN_GGA(s(T44), s(T48), X94) → U4_GGA(T44, T48, X94, mB_in_gga(T44, T48, X94))
MB_IN_GGA(s(T44), s(T48), X94) → MB_IN_GGA(T44, T48, X94)

The TRS R consists of the following rules:

qA_in_gg(T5, T6) → U1_gg(T5, T6, mB_in_gga(T5, T6, X5))
mB_in_gga(T9, 0, T9) → mB_out_gga(T9, 0, T9)
mB_in_gga(0, 0, 0) → mB_out_gga(0, 0, 0)
mB_in_gga(s(T15), 0, X29) → U3_gga(T15, X29, mC_in_ga(T15, X29))
mC_in_ga(T22, T22) → mC_out_ga(T22, T22)
mC_in_ga(0, 0) → mC_out_ga(0, 0)
mC_in_ga(s(T28), X62) → U2_ga(T28, X62, mC_in_ga(T28, X62))
U2_ga(T28, X62, mC_out_ga(T28, X62)) → mC_out_ga(s(T28), X62)
U3_gga(T15, X29, mC_out_ga(T15, X29)) → mB_out_gga(s(T15), 0, X29)
mB_in_gga(0, T35, 0) → mB_out_gga(0, T35, 0)
mB_in_gga(s(T44), s(T48), X94) → U4_gga(T44, T48, X94, mB_in_gga(T44, T48, X94))
U4_gga(T44, T48, X94, mB_out_gga(T44, T48, X94)) → mB_out_gga(s(T44), s(T48), X94)
U1_gg(T5, T6, mB_out_gga(T5, T6, X5)) → qA_out_gg(T5, T6)

The argument filtering Pi contains the following mapping:
qA_in_gg(x1, x2)  =  qA_in_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
0  =  0
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3)  =  U3_gga(x1, x3)
mC_in_ga(x1, x2)  =  mC_in_ga(x1)
mC_out_ga(x1, x2)  =  mC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
qA_out_gg(x1, x2)  =  qA_out_gg(x1, x2)
QA_IN_GG(x1, x2)  =  QA_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
MB_IN_GGA(x1, x2, x3)  =  MB_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3)  =  U3_GGA(x1, x3)
MC_IN_GA(x1, x2)  =  MC_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U4_GGA(x1, x2, x3, x4)  =  U4_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:

MC_IN_GA(s(T28), X62) → MC_IN_GA(T28, X62)

The TRS R consists of the following rules:

qA_in_gg(T5, T6) → U1_gg(T5, T6, mB_in_gga(T5, T6, X5))
mB_in_gga(T9, 0, T9) → mB_out_gga(T9, 0, T9)
mB_in_gga(0, 0, 0) → mB_out_gga(0, 0, 0)
mB_in_gga(s(T15), 0, X29) → U3_gga(T15, X29, mC_in_ga(T15, X29))
mC_in_ga(T22, T22) → mC_out_ga(T22, T22)
mC_in_ga(0, 0) → mC_out_ga(0, 0)
mC_in_ga(s(T28), X62) → U2_ga(T28, X62, mC_in_ga(T28, X62))
U2_ga(T28, X62, mC_out_ga(T28, X62)) → mC_out_ga(s(T28), X62)
U3_gga(T15, X29, mC_out_ga(T15, X29)) → mB_out_gga(s(T15), 0, X29)
mB_in_gga(0, T35, 0) → mB_out_gga(0, T35, 0)
mB_in_gga(s(T44), s(T48), X94) → U4_gga(T44, T48, X94, mB_in_gga(T44, T48, X94))
U4_gga(T44, T48, X94, mB_out_gga(T44, T48, X94)) → mB_out_gga(s(T44), s(T48), X94)
U1_gg(T5, T6, mB_out_gga(T5, T6, X5)) → qA_out_gg(T5, T6)

The argument filtering Pi contains the following mapping:
qA_in_gg(x1, x2)  =  qA_in_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
0  =  0
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3)  =  U3_gga(x1, x3)
mC_in_ga(x1, x2)  =  mC_in_ga(x1)
mC_out_ga(x1, x2)  =  mC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
qA_out_gg(x1, x2)  =  qA_out_gg(x1, x2)
MC_IN_GA(x1, x2)  =  MC_IN_GA(x1)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

MC_IN_GA(s(T28), X62) → MC_IN_GA(T28, X62)

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

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

MC_IN_GA(s(T28)) → MC_IN_GA(T28)

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

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

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

(13) YES

(14) Obligation:

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

MB_IN_GGA(s(T44), s(T48), X94) → MB_IN_GGA(T44, T48, X94)

The TRS R consists of the following rules:

qA_in_gg(T5, T6) → U1_gg(T5, T6, mB_in_gga(T5, T6, X5))
mB_in_gga(T9, 0, T9) → mB_out_gga(T9, 0, T9)
mB_in_gga(0, 0, 0) → mB_out_gga(0, 0, 0)
mB_in_gga(s(T15), 0, X29) → U3_gga(T15, X29, mC_in_ga(T15, X29))
mC_in_ga(T22, T22) → mC_out_ga(T22, T22)
mC_in_ga(0, 0) → mC_out_ga(0, 0)
mC_in_ga(s(T28), X62) → U2_ga(T28, X62, mC_in_ga(T28, X62))
U2_ga(T28, X62, mC_out_ga(T28, X62)) → mC_out_ga(s(T28), X62)
U3_gga(T15, X29, mC_out_ga(T15, X29)) → mB_out_gga(s(T15), 0, X29)
mB_in_gga(0, T35, 0) → mB_out_gga(0, T35, 0)
mB_in_gga(s(T44), s(T48), X94) → U4_gga(T44, T48, X94, mB_in_gga(T44, T48, X94))
U4_gga(T44, T48, X94, mB_out_gga(T44, T48, X94)) → mB_out_gga(s(T44), s(T48), X94)
U1_gg(T5, T6, mB_out_gga(T5, T6, X5)) → qA_out_gg(T5, T6)

The argument filtering Pi contains the following mapping:
qA_in_gg(x1, x2)  =  qA_in_gg(x1, x2)
U1_gg(x1, x2, x3)  =  U1_gg(x1, x2, x3)
mB_in_gga(x1, x2, x3)  =  mB_in_gga(x1, x2)
0  =  0
mB_out_gga(x1, x2, x3)  =  mB_out_gga(x1, x2, x3)
s(x1)  =  s(x1)
U3_gga(x1, x2, x3)  =  U3_gga(x1, x3)
mC_in_ga(x1, x2)  =  mC_in_ga(x1)
mC_out_ga(x1, x2)  =  mC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x1, x2, x4)
qA_out_gg(x1, x2)  =  qA_out_gg(x1, x2)
MB_IN_GGA(x1, x2, x3)  =  MB_IN_GGA(x1, x2)

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

(15) UsableRulesProof (EQUIVALENT transformation)

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

(16) Obligation:

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

MB_IN_GGA(s(T44), s(T48), X94) → MB_IN_GGA(T44, T48, X94)

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

(17) PiDPToQDPProof (SOUND transformation)

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

(18) Obligation:

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

MB_IN_GGA(s(T44), s(T48)) → MB_IN_GGA(T44, T48)

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

(19) 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(T44), s(T48)) → MB_IN_GGA(T44, T48)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES