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

Queries:

div(g,g,a).

(1) PredefinedPredicateTransformerProof (SOUND transformation)

Added definitions of predefined predicates [PROLOG].

(2) Obligation:

Clauses:

minus(X, Y, Z) :- ','(=1(X, 0), ','(!, =1(Z, 0))).
minus(X, Y, Z) :- ','(=1(Y, 0), ','(!, =1(Z, X))).
minus(X, Y, Z) :- ','(=1(X, s(A)), ','(=1(Y, s(B)), minus(A, B, Z))).
div(X, Y, Z) :- ','(=1(Y, 0), ','(!, fail)).
div(X, Y, Z) :- ','(=1(X, 0), ','(!, =1(Z, 0))).
div(X, Y, Z) :- ','(minus(X, Y, U), ','(div(U, Y, V), =1(Z, s(V)))).
=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:

minus(X, Y, Z) :- ','(=1(X, 0), ','(!, =1(Z, 0))).
minus(X, Y, Z) :- ','(=1(Y, 0), ','(!, =1(Z, X))).
minus(X, Y, Z) :- ','(=1(X, s(A)), ','(=1(Y, s(B)), minus(A, B, Z))).
div(X, Y, Z) :- ','(=1(Y, 0), ','(!, user_defined_fail)).
div(X, Y, Z) :- ','(=1(X, 0), ','(!, =1(Z, 0))).
div(X, Y, Z) :- ','(minus(X, Y, U), ','(div(U, Y, V), =1(Z, s(V)))).
=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:

minus40(s(T115), s(T122), X189) :- minus40(T115, T122, X189).
minus24(s(T73), s(T80), X100) :- minus40(T73, T80, X100).
div68(T152, T153, X275) :- minus24(T152, T153, X273).
div68(T152, T153, X275) :- ','(minusc24(T152, T153, T156), div68(T156, T153, X274)).
div1(T39, T40, T42) :- minus24(T39, T40, X43).
div1(T39, T40, T42) :- ','(minusc24(T39, T40, T45), div68(T45, T40, X44)).

Clauses:

minusc40(0, T88, 0).
minusc40(T103, 0, T103).
minusc40(s(T115), s(T122), X189) :- minusc40(T115, T122, X189).
minusc24(s(T73), s(T80), X100) :- minusc40(T73, T80, X100).
divc68(0, T142, 0).
divc68(T152, T153, s(T166)) :- ','(minusc24(T152, T153, T156), divc68(T156, T153, T166)).

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)
minus40_in: (b,b,f)
minusc24_in: (b,b,f)
minusc40_in: (b,b,f)
div68_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(T39, T40, T42) → U6_GGA(T39, T40, T42, minus24_in_gga(T39, T40, X43))
DIV1_IN_GGA(T39, T40, T42) → MINUS24_IN_GGA(T39, T40, X43)
MINUS24_IN_GGA(s(T73), s(T80), X100) → U2_GGA(T73, T80, X100, minus40_in_gga(T73, T80, X100))
MINUS24_IN_GGA(s(T73), s(T80), X100) → MINUS40_IN_GGA(T73, T80, X100)
MINUS40_IN_GGA(s(T115), s(T122), X189) → U1_GGA(T115, T122, X189, minus40_in_gga(T115, T122, X189))
MINUS40_IN_GGA(s(T115), s(T122), X189) → MINUS40_IN_GGA(T115, T122, X189)
DIV1_IN_GGA(T39, T40, T42) → U7_GGA(T39, T40, T42, minusc24_in_gga(T39, T40, T45))
U7_GGA(T39, T40, T42, minusc24_out_gga(T39, T40, T45)) → U8_GGA(T39, T40, T42, div68_in_gga(T45, T40, X44))
U7_GGA(T39, T40, T42, minusc24_out_gga(T39, T40, T45)) → DIV68_IN_GGA(T45, T40, X44)
DIV68_IN_GGA(T152, T153, X275) → U3_GGA(T152, T153, X275, minus24_in_gga(T152, T153, X273))
DIV68_IN_GGA(T152, T153, X275) → MINUS24_IN_GGA(T152, T153, X273)
DIV68_IN_GGA(T152, T153, X275) → U4_GGA(T152, T153, X275, minusc24_in_gga(T152, T153, T156))
U4_GGA(T152, T153, X275, minusc24_out_gga(T152, T153, T156)) → U5_GGA(T152, T153, X275, div68_in_gga(T156, T153, X274))
U4_GGA(T152, T153, X275, minusc24_out_gga(T152, T153, T156)) → DIV68_IN_GGA(T156, T153, X274)

The TRS R consists of the following rules:

minusc24_in_gga(s(T73), s(T80), X100) → U11_gga(T73, T80, X100, minusc40_in_gga(T73, T80, X100))
minusc40_in_gga(0, T88, 0) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0, T103) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122), X189) → U10_gga(T115, T122, X189, minusc40_in_gga(T115, T122, X189))
U10_gga(T115, T122, X189, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)
U11_gga(T73, T80, X100, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)

The argument filtering Pi contains the following mapping:
minus24_in_gga(x1, x2, x3)  =  minus24_in_gga(x1, x2)
s(x1)  =  s(x1)
minus40_in_gga(x1, x2, x3)  =  minus40_in_gga(x1, x2)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minusc40_in_gga(x1, x2, x3)  =  minusc40_in_gga(x1, x2)
0  =  0
minusc40_out_gga(x1, x2, x3)  =  minusc40_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
div68_in_gga(x1, x2, x3)  =  div68_in_gga(x1, x2)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
MINUS24_IN_GGA(x1, x2, x3)  =  MINUS24_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUS40_IN_GGA(x1, x2, x3)  =  MINUS40_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)
DIV68_IN_GGA(x1, x2, x3)  =  DIV68_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

(8) Obligation:

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

DIV1_IN_GGA(T39, T40, T42) → U6_GGA(T39, T40, T42, minus24_in_gga(T39, T40, X43))
DIV1_IN_GGA(T39, T40, T42) → MINUS24_IN_GGA(T39, T40, X43)
MINUS24_IN_GGA(s(T73), s(T80), X100) → U2_GGA(T73, T80, X100, minus40_in_gga(T73, T80, X100))
MINUS24_IN_GGA(s(T73), s(T80), X100) → MINUS40_IN_GGA(T73, T80, X100)
MINUS40_IN_GGA(s(T115), s(T122), X189) → U1_GGA(T115, T122, X189, minus40_in_gga(T115, T122, X189))
MINUS40_IN_GGA(s(T115), s(T122), X189) → MINUS40_IN_GGA(T115, T122, X189)
DIV1_IN_GGA(T39, T40, T42) → U7_GGA(T39, T40, T42, minusc24_in_gga(T39, T40, T45))
U7_GGA(T39, T40, T42, minusc24_out_gga(T39, T40, T45)) → U8_GGA(T39, T40, T42, div68_in_gga(T45, T40, X44))
U7_GGA(T39, T40, T42, minusc24_out_gga(T39, T40, T45)) → DIV68_IN_GGA(T45, T40, X44)
DIV68_IN_GGA(T152, T153, X275) → U3_GGA(T152, T153, X275, minus24_in_gga(T152, T153, X273))
DIV68_IN_GGA(T152, T153, X275) → MINUS24_IN_GGA(T152, T153, X273)
DIV68_IN_GGA(T152, T153, X275) → U4_GGA(T152, T153, X275, minusc24_in_gga(T152, T153, T156))
U4_GGA(T152, T153, X275, minusc24_out_gga(T152, T153, T156)) → U5_GGA(T152, T153, X275, div68_in_gga(T156, T153, X274))
U4_GGA(T152, T153, X275, minusc24_out_gga(T152, T153, T156)) → DIV68_IN_GGA(T156, T153, X274)

The TRS R consists of the following rules:

minusc24_in_gga(s(T73), s(T80), X100) → U11_gga(T73, T80, X100, minusc40_in_gga(T73, T80, X100))
minusc40_in_gga(0, T88, 0) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0, T103) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122), X189) → U10_gga(T115, T122, X189, minusc40_in_gga(T115, T122, X189))
U10_gga(T115, T122, X189, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)
U11_gga(T73, T80, X100, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)

The argument filtering Pi contains the following mapping:
minus24_in_gga(x1, x2, x3)  =  minus24_in_gga(x1, x2)
s(x1)  =  s(x1)
minus40_in_gga(x1, x2, x3)  =  minus40_in_gga(x1, x2)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minusc40_in_gga(x1, x2, x3)  =  minusc40_in_gga(x1, x2)
0  =  0
minusc40_out_gga(x1, x2, x3)  =  minusc40_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
div68_in_gga(x1, x2, x3)  =  div68_in_gga(x1, x2)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
MINUS24_IN_GGA(x1, x2, x3)  =  MINUS24_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUS40_IN_GGA(x1, x2, x3)  =  MINUS40_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)
DIV68_IN_GGA(x1, x2, x3)  =  DIV68_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

(9) DependencyGraphProof (EQUIVALENT transformation)

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

(10) Complex Obligation (AND)

(11) Obligation:

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

MINUS40_IN_GGA(s(T115), s(T122), X189) → MINUS40_IN_GGA(T115, T122, X189)

The TRS R consists of the following rules:

minusc24_in_gga(s(T73), s(T80), X100) → U11_gga(T73, T80, X100, minusc40_in_gga(T73, T80, X100))
minusc40_in_gga(0, T88, 0) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0, T103) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122), X189) → U10_gga(T115, T122, X189, minusc40_in_gga(T115, T122, X189))
U10_gga(T115, T122, X189, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)
U11_gga(T73, T80, X100, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minusc40_in_gga(x1, x2, x3)  =  minusc40_in_gga(x1, x2)
0  =  0
minusc40_out_gga(x1, x2, x3)  =  minusc40_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
MINUS40_IN_GGA(x1, x2, x3)  =  MINUS40_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:

MINUS40_IN_GGA(s(T115), s(T122), X189) → MINUS40_IN_GGA(T115, T122, X189)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
MINUS40_IN_GGA(x1, x2, x3)  =  MINUS40_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:

MINUS40_IN_GGA(s(T115), s(T122)) → MINUS40_IN_GGA(T115, T122)

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:

  • MINUS40_IN_GGA(s(T115), s(T122)) → MINUS40_IN_GGA(T115, T122)
    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:

DIV68_IN_GGA(T152, T153, X275) → U4_GGA(T152, T153, X275, minusc24_in_gga(T152, T153, T156))
U4_GGA(T152, T153, X275, minusc24_out_gga(T152, T153, T156)) → DIV68_IN_GGA(T156, T153, X274)

The TRS R consists of the following rules:

minusc24_in_gga(s(T73), s(T80), X100) → U11_gga(T73, T80, X100, minusc40_in_gga(T73, T80, X100))
minusc40_in_gga(0, T88, 0) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0, T103) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122), X189) → U10_gga(T115, T122, X189, minusc40_in_gga(T115, T122, X189))
U10_gga(T115, T122, X189, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)
U11_gga(T73, T80, X100, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minusc24_in_gga(x1, x2, x3)  =  minusc24_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
minusc40_in_gga(x1, x2, x3)  =  minusc40_in_gga(x1, x2)
0  =  0
minusc40_out_gga(x1, x2, x3)  =  minusc40_out_gga(x1, x2, x3)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
minusc24_out_gga(x1, x2, x3)  =  minusc24_out_gga(x1, x2, x3)
DIV68_IN_GGA(x1, x2, x3)  =  DIV68_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_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:

DIV68_IN_GGA(T152, T153) → U4_GGA(T152, T153, minusc24_in_gga(T152, T153))
U4_GGA(T152, T153, minusc24_out_gga(T152, T153, T156)) → DIV68_IN_GGA(T156, T153)

The TRS R consists of the following rules:

minusc24_in_gga(s(T73), s(T80)) → U11_gga(T73, T80, minusc40_in_gga(T73, T80))
minusc40_in_gga(0, T88) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122)) → U10_gga(T115, T122, minusc40_in_gga(T115, T122))
U10_gga(T115, T122, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)
U11_gga(T73, T80, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)

The set Q consists of the following terms:

minusc24_in_gga(x0, x1)
minusc40_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U11_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.


U4_GGA(T152, T153, minusc24_out_gga(T152, T153, T156)) → DIV68_IN_GGA(T156, T153)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(DIV68_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(minusc24_in_gga(x1, x2)) = x1   
POL(minusc24_out_gga(x1, x2, x3)) = 1 + x3   
POL(minusc40_in_gga(x1, x2)) = x1   
POL(minusc40_out_gga(x1, x2, x3)) = x3   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] were oriented:

minusc24_in_gga(s(T73), s(T80)) → U11_gga(T73, T80, minusc40_in_gga(T73, T80))
minusc40_in_gga(0, T88) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122)) → U10_gga(T115, T122, minusc40_in_gga(T115, T122))
U11_gga(T73, T80, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)
U10_gga(T115, T122, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)

(22) Obligation:

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

DIV68_IN_GGA(T152, T153) → U4_GGA(T152, T153, minusc24_in_gga(T152, T153))

The TRS R consists of the following rules:

minusc24_in_gga(s(T73), s(T80)) → U11_gga(T73, T80, minusc40_in_gga(T73, T80))
minusc40_in_gga(0, T88) → minusc40_out_gga(0, T88, 0)
minusc40_in_gga(T103, 0) → minusc40_out_gga(T103, 0, T103)
minusc40_in_gga(s(T115), s(T122)) → U10_gga(T115, T122, minusc40_in_gga(T115, T122))
U10_gga(T115, T122, minusc40_out_gga(T115, T122, X189)) → minusc40_out_gga(s(T115), s(T122), X189)
U11_gga(T73, T80, minusc40_out_gga(T73, T80, X100)) → minusc24_out_gga(s(T73), s(T80), X100)

The set Q consists of the following terms:

minusc24_in_gga(x0, x1)
minusc40_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U11_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