(0) Obligation:

Clauses:

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

Queries:

div(g,g,a).

(1) PredefinedPredicateTransformerProof (SOUND transformation)

Added definitions of predefined predicates [PROLOG].

(2) Obligation:

Clauses:

div(X, 0, Z) :- ','(!, fail).
div(0, Y, Z) :- ','(!, =1(Z, 0)).
div(X, Y, s(Z)) :- ','(minus(X, Y, U), div(U, Y, Z)).
minus(0, Y, 0).
minus(X, 0, X).
minus(s(X), s(Y), Z) :- minus(X, Y, Z).
=1(X, X).
fail :- fail(b).
fail(a).

Queries:

div(g,g,a).

(3) BuiltinConflictTransformerProof (SOUND transformation)

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

(4) Obligation:

Clauses:

div(X, 0, Z) :- ','(!, user_defined_fail).
div(0, Y, Z) :- ','(!, =1(Z, 0)).
div(X, Y, s(Z)) :- ','(minus(X, Y, U), div(U, Y, Z)).
minus(0, Y, 0).
minus(X, 0, X).
minus(s(X), s(Y), Z) :- minus(X, Y, Z).
=1(X, X).
user_defined_fail :- fail(b).
fail(a).

Queries:

div(g,g,a).

(5) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(6) Obligation:

Triples:

minus24(s(T50), s(T51), X71) :- minus24(T50, T51, X71).
div1(s(T29), s(T30), s(T22)) :- minus24(T29, T30, X40).
div1(s(T29), s(T30), s(T22)) :- ','(minusc24(T29, T30, T33), div1(T33, s(T30), T22)).

Clauses:

divc1(0, T10, 0).
divc1(s(T29), s(T30), s(T22)) :- ','(minusc24(T29, T30, T33), divc1(T33, s(T30), T22)).
minusc24(0, T40, 0).
minusc24(T45, 0, T45).
minusc24(s(T50), s(T51), X71) :- minusc24(T50, T51, X71).

Afs:

div1(x1, x2, x3)  =  div1(x1, x2)

(7) TriplesToPiDPProof (SOUND transformation)

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

DIV1_IN_GGA(s(T29), s(T30), s(T22)) → U2_GGA(T29, T30, T22, minus24_in_gga(T29, T30, X40))
DIV1_IN_GGA(s(T29), s(T30), s(T22)) → MINUS24_IN_GGA(T29, T30, X40)
MINUS24_IN_GGA(s(T50), s(T51), X71) → U1_GGA(T50, T51, X71, minus24_in_gga(T50, T51, X71))
MINUS24_IN_GGA(s(T50), s(T51), X71) → MINUS24_IN_GGA(T50, T51, X71)
DIV1_IN_GGA(s(T29), s(T30), s(T22)) → U3_GGA(T29, T30, T22, minusc24_in_gga(T29, T30, T33))
U3_GGA(T29, T30, T22, minusc24_out_gga(T29, T30, T33)) → U4_GGA(T29, T30, T22, div1_in_gga(T33, s(T30), T22))
U3_GGA(T29, T30, T22, minusc24_out_gga(T29, T30, T33)) → DIV1_IN_GGA(T33, s(T30), T22)

The TRS R consists of the following rules:

minusc24_in_gga(0, T40, 0) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0, T45) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51), X71) → U8_gga(T50, T51, X71, minusc24_in_gga(T50, T51, X71))
U8_gga(T50, T51, X71, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

The argument filtering Pi contains the following mapping:
div1_in_gga(x1, x2, x3)  =  div1_in_gga(x1, x2)
s(x1)  =  s(x1)
minus24_in_gga(x1, x2, x3)  =  minus24_in_gga(x1, x2)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
0  =  0
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUS24_IN_GGA(x1, x2, x3)  =  MINUS24_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(8) Obligation:

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

DIV1_IN_GGA(s(T29), s(T30), s(T22)) → U2_GGA(T29, T30, T22, minus24_in_gga(T29, T30, X40))
DIV1_IN_GGA(s(T29), s(T30), s(T22)) → MINUS24_IN_GGA(T29, T30, X40)
MINUS24_IN_GGA(s(T50), s(T51), X71) → U1_GGA(T50, T51, X71, minus24_in_gga(T50, T51, X71))
MINUS24_IN_GGA(s(T50), s(T51), X71) → MINUS24_IN_GGA(T50, T51, X71)
DIV1_IN_GGA(s(T29), s(T30), s(T22)) → U3_GGA(T29, T30, T22, minusc24_in_gga(T29, T30, T33))
U3_GGA(T29, T30, T22, minusc24_out_gga(T29, T30, T33)) → U4_GGA(T29, T30, T22, div1_in_gga(T33, s(T30), T22))
U3_GGA(T29, T30, T22, minusc24_out_gga(T29, T30, T33)) → DIV1_IN_GGA(T33, s(T30), T22)

The TRS R consists of the following rules:

minusc24_in_gga(0, T40, 0) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0, T45) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51), X71) → U8_gga(T50, T51, X71, minusc24_in_gga(T50, T51, X71))
U8_gga(T50, T51, X71, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

The argument filtering Pi contains the following mapping:
div1_in_gga(x1, x2, x3)  =  div1_in_gga(x1, x2)
s(x1)  =  s(x1)
minus24_in_gga(x1, x2, x3)  =  minus24_in_gga(x1, x2)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
0  =  0
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUS24_IN_GGA(x1, x2, x3)  =  MINUS24_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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

(9) DependencyGraphProof (EQUIVALENT transformation)

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

(10) Complex Obligation (AND)

(11) Obligation:

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

MINUS24_IN_GGA(s(T50), s(T51), X71) → MINUS24_IN_GGA(T50, T51, X71)

The TRS R consists of the following rules:

minusc24_in_gga(0, T40, 0) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0, T45) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51), X71) → U8_gga(T50, T51, X71, minusc24_in_gga(T50, T51, X71))
U8_gga(T50, T51, X71, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
0  =  0
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
MINUS24_IN_GGA(x1, x2, x3)  =  MINUS24_IN_GGA(x1, x2)

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

(12) UsableRulesProof (EQUIVALENT transformation)

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

(13) Obligation:

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

MINUS24_IN_GGA(s(T50), s(T51), X71) → MINUS24_IN_GGA(T50, T51, X71)

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

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

(14) PiDPToQDPProof (SOUND transformation)

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

(15) Obligation:

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

MINUS24_IN_GGA(s(T50), s(T51)) → MINUS24_IN_GGA(T50, T51)

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

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

  • MINUS24_IN_GGA(s(T50), s(T51)) → MINUS24_IN_GGA(T50, T51)
    The graph contains the following edges 1 > 1, 2 > 2

(17) YES

(18) Obligation:

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

DIV1_IN_GGA(s(T29), s(T30), s(T22)) → U3_GGA(T29, T30, T22, minusc24_in_gga(T29, T30, T33))
U3_GGA(T29, T30, T22, minusc24_out_gga(T29, T30, T33)) → DIV1_IN_GGA(T33, s(T30), T22)

The TRS R consists of the following rules:

minusc24_in_gga(0, T40, 0) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0, T45) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51), X71) → U8_gga(T50, T51, X71, minusc24_in_gga(T50, T51, X71))
U8_gga(T50, T51, X71, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
0  =  0
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)

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

(19) PiDPToQDPProof (SOUND transformation)

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

(20) Obligation:

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

DIV1_IN_GGA(s(T29), s(T30)) → U3_GGA(T29, T30, minusc24_in_gga(T29, T30))
U3_GGA(T29, T30, minusc24_out_gga(T29, T30, T33)) → DIV1_IN_GGA(T33, s(T30))

The TRS R consists of the following rules:

minusc24_in_gga(0, T40) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51)) → U8_gga(T50, T51, minusc24_in_gga(T50, T51))
U8_gga(T50, T51, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

The set Q consists of the following terms:

minusc24_in_gga(x0, x1)
U8_gga(x0, x1, x2)

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

(21) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


DIV1_IN_GGA(s(T29), s(T30)) → U3_GGA(T29, T30, minusc24_in_gga(T29, T30))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(DIV1_IN_GGA(x1, x2)) = x1 + x2   
POL(U3_GGA(x1, x2, x3)) = x2 + x3   
POL(U8_gga(x1, x2, x3)) = 1 + x3   
POL(minusc24_in_gga(x1, x2)) = 1 + x1   
POL(minusc24_out_gga(x1, x2, x3)) = 1 + x3   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] were oriented:

minusc24_in_gga(0, T40) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51)) → U8_gga(T50, T51, minusc24_in_gga(T50, T51))
U8_gga(T50, T51, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

(22) Obligation:

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

U3_GGA(T29, T30, minusc24_out_gga(T29, T30, T33)) → DIV1_IN_GGA(T33, s(T30))

The TRS R consists of the following rules:

minusc24_in_gga(0, T40) → minusc24_out_gga(0, T40, 0)
minusc24_in_gga(T45, 0) → minusc24_out_gga(T45, 0, T45)
minusc24_in_gga(s(T50), s(T51)) → U8_gga(T50, T51, minusc24_in_gga(T50, T51))
U8_gga(T50, T51, minusc24_out_gga(T50, T51, X71)) → minusc24_out_gga(s(T50), s(T51), X71)

The set Q consists of the following terms:

minusc24_in_gga(x0, x1)
U8_gga(x0, x1, x2)

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

(23) DependencyGraphProof (EQUIVALENT transformation)

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

(24) TRUE