(0) Obligation:

Clauses:

div(0, Y, 0) :- no(zero(Y)).
div(X, Y, s(Z)) :- ','(no(zero(X)), ','(no(zero(Y)), ','(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).
zero(0).
no(X) :- ','(X, ','(!, failure(a))).
no(X1).
failure(b).

Queries:

div(g,g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

minus74(s(T102), s(T103), X157) :- minus74(T102, T103, X157).
div1(s(T84), s(T85), s(T35)) :- minus74(T84, T85, X128).
div1(T47, T64, s(T35)) :- ','(minusc69(T47, T64, T71), div1(T71, T64, T35)).

Clauses:

divc1(0, T17, 0).
divc1(T47, T64, s(T35)) :- ','(minusc69(T47, T64, T71), divc1(T71, T64, T35)).
minusc74(0, T92, 0).
minusc74(T97, 0, T97).
minusc74(s(T102), s(T103), X157) :- minusc74(T102, T103, X157).
minusc69(s(T84), s(T85), X128) :- minusc74(T84, T85, X128).

Afs:

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

(3) 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)
minus74_in: (b,b,f)
minusc69_in: (b,b,f)
minusc74_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(T84), s(T85), s(T35)) → U2_GGA(T84, T85, T35, minus74_in_gga(T84, T85, X128))
DIV1_IN_GGA(s(T84), s(T85), s(T35)) → MINUS74_IN_GGA(T84, T85, X128)
MINUS74_IN_GGA(s(T102), s(T103), X157) → U1_GGA(T102, T103, X157, minus74_in_gga(T102, T103, X157))
MINUS74_IN_GGA(s(T102), s(T103), X157) → MINUS74_IN_GGA(T102, T103, X157)
DIV1_IN_GGA(T47, T64, s(T35)) → U3_GGA(T47, T64, T35, minusc69_in_gga(T47, T64, T71))
U3_GGA(T47, T64, T35, minusc69_out_gga(T47, T64, T71)) → U4_GGA(T47, T64, T35, div1_in_gga(T71, T64, T35))
U3_GGA(T47, T64, T35, minusc69_out_gga(T47, T64, T71)) → DIV1_IN_GGA(T71, T64, T35)

The TRS R consists of the following rules:

minusc69_in_gga(s(T84), s(T85), X128) → U9_gga(T84, T85, X128, minusc74_in_gga(T84, T85, X128))
minusc74_in_gga(0, T92, 0) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0, T97) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103), X157) → U8_gga(T102, T103, X157, minusc74_in_gga(T102, T103, X157))
U8_gga(T102, T103, X157, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)
U9_gga(T84, T85, X128, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)

The argument filtering Pi contains the following mapping:
div1_in_gga(x1, x2, x3)  =  div1_in_gga(x1, x2)
s(x1)  =  s(x1)
minus74_in_gga(x1, x2, x3)  =  minus74_in_gga(x1, x2)
minusc69_in_gga(x1, x2, x3)  =  minusc69_in_gga(x1, x2)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
minusc74_in_gga(x1, x2, x3)  =  minusc74_in_gga(x1, x2)
0  =  0
minusc74_out_gga(x1, x2, x3)  =  minusc74_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
minusc69_out_gga(x1, x2, x3)  =  minusc69_out_gga(x1, x2, x3)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUS74_IN_GGA(x1, x2, x3)  =  MINUS74_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

(4) Obligation:

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

DIV1_IN_GGA(s(T84), s(T85), s(T35)) → U2_GGA(T84, T85, T35, minus74_in_gga(T84, T85, X128))
DIV1_IN_GGA(s(T84), s(T85), s(T35)) → MINUS74_IN_GGA(T84, T85, X128)
MINUS74_IN_GGA(s(T102), s(T103), X157) → U1_GGA(T102, T103, X157, minus74_in_gga(T102, T103, X157))
MINUS74_IN_GGA(s(T102), s(T103), X157) → MINUS74_IN_GGA(T102, T103, X157)
DIV1_IN_GGA(T47, T64, s(T35)) → U3_GGA(T47, T64, T35, minusc69_in_gga(T47, T64, T71))
U3_GGA(T47, T64, T35, minusc69_out_gga(T47, T64, T71)) → U4_GGA(T47, T64, T35, div1_in_gga(T71, T64, T35))
U3_GGA(T47, T64, T35, minusc69_out_gga(T47, T64, T71)) → DIV1_IN_GGA(T71, T64, T35)

The TRS R consists of the following rules:

minusc69_in_gga(s(T84), s(T85), X128) → U9_gga(T84, T85, X128, minusc74_in_gga(T84, T85, X128))
minusc74_in_gga(0, T92, 0) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0, T97) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103), X157) → U8_gga(T102, T103, X157, minusc74_in_gga(T102, T103, X157))
U8_gga(T102, T103, X157, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)
U9_gga(T84, T85, X128, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)

The argument filtering Pi contains the following mapping:
div1_in_gga(x1, x2, x3)  =  div1_in_gga(x1, x2)
s(x1)  =  s(x1)
minus74_in_gga(x1, x2, x3)  =  minus74_in_gga(x1, x2)
minusc69_in_gga(x1, x2, x3)  =  minusc69_in_gga(x1, x2)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
minusc74_in_gga(x1, x2, x3)  =  minusc74_in_gga(x1, x2)
0  =  0
minusc74_out_gga(x1, x2, x3)  =  minusc74_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
minusc69_out_gga(x1, x2, x3)  =  minusc69_out_gga(x1, x2, x3)
DIV1_IN_GGA(x1, x2, x3)  =  DIV1_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
MINUS74_IN_GGA(x1, x2, x3)  =  MINUS74_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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

MINUS74_IN_GGA(s(T102), s(T103), X157) → MINUS74_IN_GGA(T102, T103, X157)

The TRS R consists of the following rules:

minusc69_in_gga(s(T84), s(T85), X128) → U9_gga(T84, T85, X128, minusc74_in_gga(T84, T85, X128))
minusc74_in_gga(0, T92, 0) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0, T97) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103), X157) → U8_gga(T102, T103, X157, minusc74_in_gga(T102, T103, X157))
U8_gga(T102, T103, X157, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)
U9_gga(T84, T85, X128, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minusc69_in_gga(x1, x2, x3)  =  minusc69_in_gga(x1, x2)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
minusc74_in_gga(x1, x2, x3)  =  minusc74_in_gga(x1, x2)
0  =  0
minusc74_out_gga(x1, x2, x3)  =  minusc74_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
minusc69_out_gga(x1, x2, x3)  =  minusc69_out_gga(x1, x2, x3)
MINUS74_IN_GGA(x1, x2, x3)  =  MINUS74_IN_GGA(x1, x2)

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:

MINUS74_IN_GGA(s(T102), s(T103), X157) → MINUS74_IN_GGA(T102, T103, X157)

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

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:

MINUS74_IN_GGA(s(T102), s(T103)) → MINUS74_IN_GGA(T102, T103)

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:

  • MINUS74_IN_GGA(s(T102), s(T103)) → MINUS74_IN_GGA(T102, T103)
    The graph contains the following edges 1 > 1, 2 > 2

(13) YES

(14) Obligation:

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

DIV1_IN_GGA(T47, T64, s(T35)) → U3_GGA(T47, T64, T35, minusc69_in_gga(T47, T64, T71))
U3_GGA(T47, T64, T35, minusc69_out_gga(T47, T64, T71)) → DIV1_IN_GGA(T71, T64, T35)

The TRS R consists of the following rules:

minusc69_in_gga(s(T84), s(T85), X128) → U9_gga(T84, T85, X128, minusc74_in_gga(T84, T85, X128))
minusc74_in_gga(0, T92, 0) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0, T97) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103), X157) → U8_gga(T102, T103, X157, minusc74_in_gga(T102, T103, X157))
U8_gga(T102, T103, X157, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)
U9_gga(T84, T85, X128, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
minusc69_in_gga(x1, x2, x3)  =  minusc69_in_gga(x1, x2)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
minusc74_in_gga(x1, x2, x3)  =  minusc74_in_gga(x1, x2)
0  =  0
minusc74_out_gga(x1, x2, x3)  =  minusc74_out_gga(x1, x2, x3)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x1, x2, x4)
minusc69_out_gga(x1, x2, x3)  =  minusc69_out_gga(x1, x2, x3)
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

(15) PiDPToQDPProof (SOUND transformation)

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

(16) Obligation:

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

DIV1_IN_GGA(T47, T64) → U3_GGA(T47, T64, minusc69_in_gga(T47, T64))
U3_GGA(T47, T64, minusc69_out_gga(T47, T64, T71)) → DIV1_IN_GGA(T71, T64)

The TRS R consists of the following rules:

minusc69_in_gga(s(T84), s(T85)) → U9_gga(T84, T85, minusc74_in_gga(T84, T85))
minusc74_in_gga(0, T92) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103)) → U8_gga(T102, T103, minusc74_in_gga(T102, T103))
U8_gga(T102, T103, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)
U9_gga(T84, T85, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)

The set Q consists of the following terms:

minusc69_in_gga(x0, x1)
minusc74_in_gga(x0, x1)
U8_gga(x0, x1, x2)
U9_gga(x0, x1, x2)

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

(17) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U3_GGA(T47, T64, minusc69_out_gga(T47, T64, T71)) → DIV1_IN_GGA(T71, T64)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(DIV1_IN_GGA(x1, x2)) = 1 + x1   
POL(U3_GGA(x1, x2, x3)) = 1 + x3   
POL(U8_gga(x1, x2, x3)) = 1 + x3   
POL(U9_gga(x1, x2, x3)) = 1 + x3   
POL(minusc69_in_gga(x1, x2)) = x1   
POL(minusc69_out_gga(x1, x2, x3)) = 1 + x3   
POL(minusc74_in_gga(x1, x2)) = x1   
POL(minusc74_out_gga(x1, x2, x3)) = x3   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] were oriented:

minusc69_in_gga(s(T84), s(T85)) → U9_gga(T84, T85, minusc74_in_gga(T84, T85))
minusc74_in_gga(0, T92) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103)) → U8_gga(T102, T103, minusc74_in_gga(T102, T103))
U9_gga(T84, T85, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)
U8_gga(T102, T103, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)

(18) Obligation:

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

DIV1_IN_GGA(T47, T64) → U3_GGA(T47, T64, minusc69_in_gga(T47, T64))

The TRS R consists of the following rules:

minusc69_in_gga(s(T84), s(T85)) → U9_gga(T84, T85, minusc74_in_gga(T84, T85))
minusc74_in_gga(0, T92) → minusc74_out_gga(0, T92, 0)
minusc74_in_gga(T97, 0) → minusc74_out_gga(T97, 0, T97)
minusc74_in_gga(s(T102), s(T103)) → U8_gga(T102, T103, minusc74_in_gga(T102, T103))
U8_gga(T102, T103, minusc74_out_gga(T102, T103, X157)) → minusc74_out_gga(s(T102), s(T103), X157)
U9_gga(T84, T85, minusc74_out_gga(T84, T85, X128)) → minusc69_out_gga(s(T84), s(T85), X128)

The set Q consists of the following terms:

minusc69_in_gga(x0, x1)
minusc74_in_gga(x0, x1)
U8_gga(x0, x1, x2)
U9_gga(x0, x1, x2)

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

(19) DependencyGraphProof (EQUIVALENT transformation)

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

(20) TRUE