(0) Obligation:

Clauses:

minus(X, Y, Z) :- ','(=(X, 0), ','(!, =(Z, 0))).
minus(X, Y, Z) :- ','(=(Y, 0), ','(!, =(Z, X))).
minus(X, Y, Z) :- ','(=(X, s(A)), ','(=(Y, s(B)), minus(A, B, Z))).
div(X, Y, Z) :- ','(=(Y, 0), ','(!, fail)).
div(X, Y, Z) :- ','(=(X, 0), ','(!, =(Z, 0))).
div(X, Y, Z) :- ','(minus(X, Y, U), ','(div(U, Y, V), =(Z, s(V)))).
=(X, X).

Query: div(g,g,a)

(1) BuiltinConflictTransformerProof (EQUIVALENT transformation)

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

(2) Obligation:

Clauses:

minus(X, Y, Z) :- ','(user_defined_=(X, 0), ','(!, user_defined_=(Z, 0))).
minus(X, Y, Z) :- ','(user_defined_=(Y, 0), ','(!, user_defined_=(Z, X))).
minus(X, Y, Z) :- ','(user_defined_=(X, s(A)), ','(user_defined_=(Y, s(B)), minus(A, B, Z))).
div(X, Y, Z) :- ','(user_defined_=(Y, 0), ','(!, fail)).
div(X, Y, Z) :- ','(user_defined_=(X, 0), ','(!, user_defined_=(Z, 0))).
div(X, Y, Z) :- ','(minus(X, Y, U), ','(div(U, Y, V), user_defined_=(Z, s(V)))).
user_defined_=(X, X).

Query: div(g,g,a)

(3) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(4) Obligation:

Triples:

minusA(s(X1), s(X2), X3) :- minusA(X1, X2, X3).
minusB(s(X1), s(X2), X3) :- minusA(X1, X2, X3).
divC(X1, X2, X3) :- minusB(X1, X2, X4).
divC(X1, X2, X3) :- ','(minuscB(X1, X2, X4), divC(X4, X2, X5)).
divD(X1, X2, X3) :- minusB(X1, X2, X4).
divD(X1, X2, X3) :- ','(minuscB(X1, X2, X4), divC(X4, X2, X5)).

Clauses:

minuscA(0, X1, 0).
minuscA(X1, 0, X1).
minuscA(s(X1), s(X2), X3) :- minuscA(X1, X2, X3).
minuscB(s(X1), s(X2), X3) :- minuscA(X1, X2, X3).
divcC(0, X1, 0).
divcC(X1, X2, s(X3)) :- ','(minuscB(X1, X2, X4), divcC(X4, X2, X3)).

Afs:

divD(x1, x2, x3)  =  divD(x1, x2)

(5) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
divD_in: (b,b,f)
minusB_in: (b,b,f)
minusA_in: (b,b,f)
minuscB_in: (b,b,f)
minuscA_in: (b,b,f)
divC_in: (b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

DIVD_IN_GGA(X1, X2, X3) → U6_GGA(X1, X2, X3, minusB_in_gga(X1, X2, X4))
DIVD_IN_GGA(X1, X2, X3) → MINUSB_IN_GGA(X1, X2, X4)
MINUSB_IN_GGA(s(X1), s(X2), X3) → U2_GGA(X1, X2, X3, minusA_in_gga(X1, X2, X3))
MINUSB_IN_GGA(s(X1), s(X2), X3) → MINUSA_IN_GGA(X1, X2, X3)
MINUSA_IN_GGA(s(X1), s(X2), X3) → U1_GGA(X1, X2, X3, minusA_in_gga(X1, X2, X3))
MINUSA_IN_GGA(s(X1), s(X2), X3) → MINUSA_IN_GGA(X1, X2, X3)
DIVD_IN_GGA(X1, X2, X3) → U7_GGA(X1, X2, X3, minuscB_in_gga(X1, X2, X4))
U7_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → U8_GGA(X1, X2, X3, divC_in_gga(X4, X2, X5))
U7_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2, X5)
DIVC_IN_GGA(X1, X2, X3) → U3_GGA(X1, X2, X3, minusB_in_gga(X1, X2, X4))
DIVC_IN_GGA(X1, X2, X3) → MINUSB_IN_GGA(X1, X2, X4)
DIVC_IN_GGA(X1, X2, X3) → U4_GGA(X1, X2, X3, minuscB_in_gga(X1, X2, X4))
U4_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → U5_GGA(X1, X2, X3, divC_in_gga(X4, X2, X5))
U4_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2, X5)

The TRS R consists of the following rules:

minuscB_in_gga(s(X1), s(X2), X3) → U11_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
minuscA_in_gga(0, X1, 0) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0, X1) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2), X3) → U10_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
U10_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)
U11_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)

The argument filtering Pi contains the following mapping:
minusB_in_gga(x1, x2, x3)  =  minusB_in_gga(x1, x2)
s(x1)  =  s(x1)
minusA_in_gga(x1, x2, x3)  =  minusA_in_gga(x1, x2)
minuscB_in_gga(x1, x2, x3)  =  minuscB_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minuscA_in_gga(x1, x2, x3)  =  minuscA_in_gga(x1, x2)
0  =  0
minuscA_out_gga(x1, x2, x3)  =  minuscA_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minuscB_out_gga(x1, x2, x3)  =  minuscB_out_gga(x1, x2, x3)
divC_in_gga(x1, x2, x3)  =  divC_in_gga(x1, x2)
DIVD_IN_GGA(x1, x2, x3)  =  DIVD_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
MINUSB_IN_GGA(x1, x2, x3)  =  MINUSB_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUSA_IN_GGA(x1, x2, x3)  =  MINUSA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
U8_GGA(x1, x2, x3, x4)  =  U8_GGA(x1, x2, x4)
DIVC_IN_GGA(x1, x2, x3)  =  DIVC_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U5_GGA(x1, x2, x3, x4)  =  U5_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:

DIVD_IN_GGA(X1, X2, X3) → U6_GGA(X1, X2, X3, minusB_in_gga(X1, X2, X4))
DIVD_IN_GGA(X1, X2, X3) → MINUSB_IN_GGA(X1, X2, X4)
MINUSB_IN_GGA(s(X1), s(X2), X3) → U2_GGA(X1, X2, X3, minusA_in_gga(X1, X2, X3))
MINUSB_IN_GGA(s(X1), s(X2), X3) → MINUSA_IN_GGA(X1, X2, X3)
MINUSA_IN_GGA(s(X1), s(X2), X3) → U1_GGA(X1, X2, X3, minusA_in_gga(X1, X2, X3))
MINUSA_IN_GGA(s(X1), s(X2), X3) → MINUSA_IN_GGA(X1, X2, X3)
DIVD_IN_GGA(X1, X2, X3) → U7_GGA(X1, X2, X3, minuscB_in_gga(X1, X2, X4))
U7_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → U8_GGA(X1, X2, X3, divC_in_gga(X4, X2, X5))
U7_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2, X5)
DIVC_IN_GGA(X1, X2, X3) → U3_GGA(X1, X2, X3, minusB_in_gga(X1, X2, X4))
DIVC_IN_GGA(X1, X2, X3) → MINUSB_IN_GGA(X1, X2, X4)
DIVC_IN_GGA(X1, X2, X3) → U4_GGA(X1, X2, X3, minuscB_in_gga(X1, X2, X4))
U4_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → U5_GGA(X1, X2, X3, divC_in_gga(X4, X2, X5))
U4_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2, X5)

The TRS R consists of the following rules:

minuscB_in_gga(s(X1), s(X2), X3) → U11_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
minuscA_in_gga(0, X1, 0) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0, X1) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2), X3) → U10_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
U10_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)
U11_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)

The argument filtering Pi contains the following mapping:
minusB_in_gga(x1, x2, x3)  =  minusB_in_gga(x1, x2)
s(x1)  =  s(x1)
minusA_in_gga(x1, x2, x3)  =  minusA_in_gga(x1, x2)
minuscB_in_gga(x1, x2, x3)  =  minuscB_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minuscA_in_gga(x1, x2, x3)  =  minuscA_in_gga(x1, x2)
0  =  0
minuscA_out_gga(x1, x2, x3)  =  minuscA_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minuscB_out_gga(x1, x2, x3)  =  minuscB_out_gga(x1, x2, x3)
divC_in_gga(x1, x2, x3)  =  divC_in_gga(x1, x2)
DIVD_IN_GGA(x1, x2, x3)  =  DIVD_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
MINUSB_IN_GGA(x1, x2, x3)  =  MINUSB_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUSA_IN_GGA(x1, x2, x3)  =  MINUSA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)
U8_GGA(x1, x2, x3, x4)  =  U8_GGA(x1, x2, x4)
DIVC_IN_GGA(x1, x2, x3)  =  DIVC_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U5_GGA(x1, x2, x3, x4)  =  U5_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 2 SCCs with 11 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

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

MINUSA_IN_GGA(s(X1), s(X2), X3) → MINUSA_IN_GGA(X1, X2, X3)

The TRS R consists of the following rules:

minuscB_in_gga(s(X1), s(X2), X3) → U11_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
minuscA_in_gga(0, X1, 0) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0, X1) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2), X3) → U10_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
U10_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)
U11_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minuscB_in_gga(x1, x2, x3)  =  minuscB_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minuscA_in_gga(x1, x2, x3)  =  minuscA_in_gga(x1, x2)
0  =  0
minuscA_out_gga(x1, x2, x3)  =  minuscA_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minuscB_out_gga(x1, x2, x3)  =  minuscB_out_gga(x1, x2, x3)
MINUSA_IN_GGA(x1, x2, x3)  =  MINUSA_IN_GGA(x1, x2)

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

(10) UsableRulesProof (EQUIVALENT transformation)

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

(11) Obligation:

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

MINUSA_IN_GGA(s(X1), s(X2), X3) → MINUSA_IN_GGA(X1, X2, X3)

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

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

(12) PiDPToQDPProof (SOUND transformation)

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

(13) Obligation:

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

MINUSA_IN_GGA(s(X1), s(X2)) → MINUSA_IN_GGA(X1, X2)

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

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

  • MINUSA_IN_GGA(s(X1), s(X2)) → MINUSA_IN_GGA(X1, X2)
    The graph contains the following edges 1 > 1, 2 > 2

(15) YES

(16) Obligation:

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

DIVC_IN_GGA(X1, X2, X3) → U4_GGA(X1, X2, X3, minuscB_in_gga(X1, X2, X4))
U4_GGA(X1, X2, X3, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2, X5)

The TRS R consists of the following rules:

minuscB_in_gga(s(X1), s(X2), X3) → U11_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
minuscA_in_gga(0, X1, 0) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0, X1) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2), X3) → U10_gga(X1, X2, X3, minuscA_in_gga(X1, X2, X3))
U10_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)
U11_gga(X1, X2, X3, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minuscB_in_gga(x1, x2, x3)  =  minuscB_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minuscA_in_gga(x1, x2, x3)  =  minuscA_in_gga(x1, x2)
0  =  0
minuscA_out_gga(x1, x2, x3)  =  minuscA_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minuscB_out_gga(x1, x2, x3)  =  minuscB_out_gga(x1, x2, x3)
DIVC_IN_GGA(x1, x2, x3)  =  DIVC_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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:

DIVC_IN_GGA(X1, X2) → U4_GGA(X1, X2, minuscB_in_gga(X1, X2))
U4_GGA(X1, X2, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2)

The TRS R consists of the following rules:

minuscB_in_gga(s(X1), s(X2)) → U11_gga(X1, X2, minuscA_in_gga(X1, X2))
minuscA_in_gga(0, X1) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2)) → U10_gga(X1, X2, minuscA_in_gga(X1, X2))
U10_gga(X1, X2, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)
U11_gga(X1, X2, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)

The set Q consists of the following terms:

minuscB_in_gga(x0, x1)
minuscA_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U11_gga(x0, x1, x2)

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

(19) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


U4_GGA(X1, X2, minuscB_out_gga(X1, X2, X4)) → DIVC_IN_GGA(X4, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(DIVC_IN_GGA(x1, x2)) = 1 + x1   
POL(U10_gga(x1, x2, x3)) = 1 + x3   
POL(U11_gga(x1, x2, x3)) = 1 + x3   
POL(U4_GGA(x1, x2, x3)) = 1 + x3   
POL(minuscA_in_gga(x1, x2)) = x1   
POL(minuscA_out_gga(x1, x2, x3)) = x3   
POL(minuscB_in_gga(x1, x2)) = x1   
POL(minuscB_out_gga(x1, x2, x3)) = 1 + x3   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

minuscB_in_gga(s(X1), s(X2)) → U11_gga(X1, X2, minuscA_in_gga(X1, X2))
minuscA_in_gga(0, X1) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2)) → U10_gga(X1, X2, minuscA_in_gga(X1, X2))
U11_gga(X1, X2, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)
U10_gga(X1, X2, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)

(20) Obligation:

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

DIVC_IN_GGA(X1, X2) → U4_GGA(X1, X2, minuscB_in_gga(X1, X2))

The TRS R consists of the following rules:

minuscB_in_gga(s(X1), s(X2)) → U11_gga(X1, X2, minuscA_in_gga(X1, X2))
minuscA_in_gga(0, X1) → minuscA_out_gga(0, X1, 0)
minuscA_in_gga(X1, 0) → minuscA_out_gga(X1, 0, X1)
minuscA_in_gga(s(X1), s(X2)) → U10_gga(X1, X2, minuscA_in_gga(X1, X2))
U10_gga(X1, X2, minuscA_out_gga(X1, X2, X3)) → minuscA_out_gga(s(X1), s(X2), X3)
U11_gga(X1, X2, minuscA_out_gga(X1, X2, X3)) → minuscB_out_gga(s(X1), s(X2), X3)

The set Q consists of the following terms:

minuscB_in_gga(x0, x1)
minuscA_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U11_gga(x0, x1, x2)

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

(21) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(22) TRUE