(0) Obligation:

Clauses:

rem(X, Y, R) :- ','(notZero(Y), ','(sub(X, Y, Z), rem(Z, Y, R))).
rem(X, Y, X) :- ','(notZero(Y), geq(X, Y)).
sub(s(X), s(Y), Z) :- sub(X, Y, Z).
sub(X, 0, X).
notZero(s(X)).
geq(s(X), s(Y)) :- geq(X, Y).
geq(X, 0).

Queries:

rem(g,g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

sub14(s(T41), s(T42), X68) :- sub14(T41, T42, X68).
geq34(s(T85), s(T86)) :- geq34(T85, T86).
rem1(s(T29), s(T30), T10) :- sub14(T29, T30, X41).
rem1(T7, s(T15), T10) :- ','(subc9(T7, T15, T18), rem1(T18, s(T15), T10)).
rem1(s(T73), s(T74), s(T73)) :- geq34(T73, T74).

Clauses:

remc1(T7, s(T15), T10) :- ','(subc9(T7, T15, T18), remc1(T18, s(T15), T10)).
remc1(s(T73), s(T74), s(T73)) :- geqc34(T73, T74).
subc14(s(T41), s(T42), X68) :- subc14(T41, T42, X68).
subc14(T47, 0, T47).
geqc34(s(T85), s(T86)) :- geqc34(T85, T86).
geqc34(T91, 0).
subc9(s(T29), T30, X41) :- subc14(T29, T30, X41).

Afs:

rem1(x1, x2, x3)  =  rem1(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:
rem1_in: (b,b,f)
sub14_in: (b,b,f)
subc9_in: (b,b,f)
subc14_in: (b,b,f)
geq34_in: (b,b)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

REM1_IN_GGA(s(T29), s(T30), T10) → U3_GGA(T29, T30, T10, sub14_in_gga(T29, T30, X41))
REM1_IN_GGA(s(T29), s(T30), T10) → SUB14_IN_GGA(T29, T30, X41)
SUB14_IN_GGA(s(T41), s(T42), X68) → U1_GGA(T41, T42, X68, sub14_in_gga(T41, T42, X68))
SUB14_IN_GGA(s(T41), s(T42), X68) → SUB14_IN_GGA(T41, T42, X68)
REM1_IN_GGA(T7, s(T15), T10) → U4_GGA(T7, T15, T10, subc9_in_gga(T7, T15, T18))
U4_GGA(T7, T15, T10, subc9_out_gga(T7, T15, T18)) → U5_GGA(T7, T15, T10, rem1_in_gga(T18, s(T15), T10))
U4_GGA(T7, T15, T10, subc9_out_gga(T7, T15, T18)) → REM1_IN_GGA(T18, s(T15), T10)
REM1_IN_GGA(s(T73), s(T74), s(T73)) → U6_GGA(T73, T74, geq34_in_gg(T73, T74))
REM1_IN_GGA(s(T73), s(T74), s(T73)) → GEQ34_IN_GG(T73, T74)
GEQ34_IN_GG(s(T85), s(T86)) → U2_GG(T85, T86, geq34_in_gg(T85, T86))
GEQ34_IN_GG(s(T85), s(T86)) → GEQ34_IN_GG(T85, T86)

The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30, X41) → U13_gga(T29, T30, X41, subc14_in_gga(T29, T30, X41))
subc14_in_gga(s(T41), s(T42), X68) → U11_gga(T41, T42, X68, subc14_in_gga(T41, T42, X68))
subc14_in_gga(T47, 0, T47) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, X68, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, X41, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The argument filtering Pi contains the following mapping:
rem1_in_gga(x1, x2, x3)  =  rem1_in_gga(x1, x2)
s(x1)  =  s(x1)
sub14_in_gga(x1, x2, x3)  =  sub14_in_gga(x1, x2)
subc9_in_gga(x1, x2, x3)  =  subc9_in_gga(x1, x2)
U13_gga(x1, x2, x3, x4)  =  U13_gga(x1, x2, x4)
subc14_in_gga(x1, x2, x3)  =  subc14_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
0  =  0
subc14_out_gga(x1, x2, x3)  =  subc14_out_gga(x1, x2, x3)
subc9_out_gga(x1, x2, x3)  =  subc9_out_gga(x1, x2, x3)
geq34_in_gg(x1, x2)  =  geq34_in_gg(x1, x2)
REM1_IN_GGA(x1, x2, x3)  =  REM1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
SUB14_IN_GGA(x1, x2, x3)  =  SUB14_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_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)
U6_GGA(x1, x2, x3)  =  U6_GGA(x1, x2, x3)
GEQ34_IN_GG(x1, x2)  =  GEQ34_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)

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:

REM1_IN_GGA(s(T29), s(T30), T10) → U3_GGA(T29, T30, T10, sub14_in_gga(T29, T30, X41))
REM1_IN_GGA(s(T29), s(T30), T10) → SUB14_IN_GGA(T29, T30, X41)
SUB14_IN_GGA(s(T41), s(T42), X68) → U1_GGA(T41, T42, X68, sub14_in_gga(T41, T42, X68))
SUB14_IN_GGA(s(T41), s(T42), X68) → SUB14_IN_GGA(T41, T42, X68)
REM1_IN_GGA(T7, s(T15), T10) → U4_GGA(T7, T15, T10, subc9_in_gga(T7, T15, T18))
U4_GGA(T7, T15, T10, subc9_out_gga(T7, T15, T18)) → U5_GGA(T7, T15, T10, rem1_in_gga(T18, s(T15), T10))
U4_GGA(T7, T15, T10, subc9_out_gga(T7, T15, T18)) → REM1_IN_GGA(T18, s(T15), T10)
REM1_IN_GGA(s(T73), s(T74), s(T73)) → U6_GGA(T73, T74, geq34_in_gg(T73, T74))
REM1_IN_GGA(s(T73), s(T74), s(T73)) → GEQ34_IN_GG(T73, T74)
GEQ34_IN_GG(s(T85), s(T86)) → U2_GG(T85, T86, geq34_in_gg(T85, T86))
GEQ34_IN_GG(s(T85), s(T86)) → GEQ34_IN_GG(T85, T86)

The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30, X41) → U13_gga(T29, T30, X41, subc14_in_gga(T29, T30, X41))
subc14_in_gga(s(T41), s(T42), X68) → U11_gga(T41, T42, X68, subc14_in_gga(T41, T42, X68))
subc14_in_gga(T47, 0, T47) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, X68, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, X41, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The argument filtering Pi contains the following mapping:
rem1_in_gga(x1, x2, x3)  =  rem1_in_gga(x1, x2)
s(x1)  =  s(x1)
sub14_in_gga(x1, x2, x3)  =  sub14_in_gga(x1, x2)
subc9_in_gga(x1, x2, x3)  =  subc9_in_gga(x1, x2)
U13_gga(x1, x2, x3, x4)  =  U13_gga(x1, x2, x4)
subc14_in_gga(x1, x2, x3)  =  subc14_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
0  =  0
subc14_out_gga(x1, x2, x3)  =  subc14_out_gga(x1, x2, x3)
subc9_out_gga(x1, x2, x3)  =  subc9_out_gga(x1, x2, x3)
geq34_in_gg(x1, x2)  =  geq34_in_gg(x1, x2)
REM1_IN_GGA(x1, x2, x3)  =  REM1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
SUB14_IN_GGA(x1, x2, x3)  =  SUB14_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_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)
U6_GGA(x1, x2, x3)  =  U6_GGA(x1, x2, x3)
GEQ34_IN_GG(x1, x2)  =  GEQ34_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 7 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

GEQ34_IN_GG(s(T85), s(T86)) → GEQ34_IN_GG(T85, T86)

The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30, X41) → U13_gga(T29, T30, X41, subc14_in_gga(T29, T30, X41))
subc14_in_gga(s(T41), s(T42), X68) → U11_gga(T41, T42, X68, subc14_in_gga(T41, T42, X68))
subc14_in_gga(T47, 0, T47) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, X68, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, X41, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
subc9_in_gga(x1, x2, x3)  =  subc9_in_gga(x1, x2)
U13_gga(x1, x2, x3, x4)  =  U13_gga(x1, x2, x4)
subc14_in_gga(x1, x2, x3)  =  subc14_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
0  =  0
subc14_out_gga(x1, x2, x3)  =  subc14_out_gga(x1, x2, x3)
subc9_out_gga(x1, x2, x3)  =  subc9_out_gga(x1, x2, x3)
GEQ34_IN_GG(x1, x2)  =  GEQ34_IN_GG(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:

GEQ34_IN_GG(s(T85), s(T86)) → GEQ34_IN_GG(T85, T86)

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

(10) PiDPToQDPProof (EQUIVALENT 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:

GEQ34_IN_GG(s(T85), s(T86)) → GEQ34_IN_GG(T85, T86)

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:

  • GEQ34_IN_GG(s(T85), s(T86)) → GEQ34_IN_GG(T85, T86)
    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:

SUB14_IN_GGA(s(T41), s(T42), X68) → SUB14_IN_GGA(T41, T42, X68)

The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30, X41) → U13_gga(T29, T30, X41, subc14_in_gga(T29, T30, X41))
subc14_in_gga(s(T41), s(T42), X68) → U11_gga(T41, T42, X68, subc14_in_gga(T41, T42, X68))
subc14_in_gga(T47, 0, T47) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, X68, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, X41, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
subc9_in_gga(x1, x2, x3)  =  subc9_in_gga(x1, x2)
U13_gga(x1, x2, x3, x4)  =  U13_gga(x1, x2, x4)
subc14_in_gga(x1, x2, x3)  =  subc14_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
0  =  0
subc14_out_gga(x1, x2, x3)  =  subc14_out_gga(x1, x2, x3)
subc9_out_gga(x1, x2, x3)  =  subc9_out_gga(x1, x2, x3)
SUB14_IN_GGA(x1, x2, x3)  =  SUB14_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:

SUB14_IN_GGA(s(T41), s(T42), X68) → SUB14_IN_GGA(T41, T42, X68)

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

SUB14_IN_GGA(s(T41), s(T42)) → SUB14_IN_GGA(T41, T42)

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:

  • SUB14_IN_GGA(s(T41), s(T42)) → SUB14_IN_GGA(T41, T42)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

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

REM1_IN_GGA(T7, s(T15), T10) → U4_GGA(T7, T15, T10, subc9_in_gga(T7, T15, T18))
U4_GGA(T7, T15, T10, subc9_out_gga(T7, T15, T18)) → REM1_IN_GGA(T18, s(T15), T10)

The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30, X41) → U13_gga(T29, T30, X41, subc14_in_gga(T29, T30, X41))
subc14_in_gga(s(T41), s(T42), X68) → U11_gga(T41, T42, X68, subc14_in_gga(T41, T42, X68))
subc14_in_gga(T47, 0, T47) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, X68, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, X41, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
subc9_in_gga(x1, x2, x3)  =  subc9_in_gga(x1, x2)
U13_gga(x1, x2, x3, x4)  =  U13_gga(x1, x2, x4)
subc14_in_gga(x1, x2, x3)  =  subc14_in_gga(x1, x2)
U11_gga(x1, x2, x3, x4)  =  U11_gga(x1, x2, x4)
0  =  0
subc14_out_gga(x1, x2, x3)  =  subc14_out_gga(x1, x2, x3)
subc9_out_gga(x1, x2, x3)  =  subc9_out_gga(x1, x2, x3)
REM1_IN_GGA(x1, x2, x3)  =  REM1_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)

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

(22) PiDPToQDPProof (SOUND transformation)

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

(23) Obligation:

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

REM1_IN_GGA(T7, s(T15)) → U4_GGA(T7, T15, subc9_in_gga(T7, T15))
U4_GGA(T7, T15, subc9_out_gga(T7, T15, T18)) → REM1_IN_GGA(T18, s(T15))

The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30) → U13_gga(T29, T30, subc14_in_gga(T29, T30))
subc14_in_gga(s(T41), s(T42)) → U11_gga(T41, T42, subc14_in_gga(T41, T42))
subc14_in_gga(T47, 0) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The set Q consists of the following terms:

subc9_in_gga(x0, x1)
subc14_in_gga(x0, x1)
U11_gga(x0, x1, x2)
U13_gga(x0, x1, x2)

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

(24) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


REM1_IN_GGA(T7, s(T15)) → U4_GGA(T7, T15, subc9_in_gga(T7, T15))
U4_GGA(T7, T15, subc9_out_gga(T7, T15, T18)) → REM1_IN_GGA(T18, s(T15))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:

POL( U4_GGA(x1, ..., x3) ) = max{0, 2x3 - 1}


POL( subc9_in_gga(x1, x2) ) = x1 + 1


POL( s(x1) ) = 2x1 + 1


POL( U13_gga(x1, ..., x3) ) = 2x3


POL( subc14_in_gga(x1, x2) ) = x1 + 1


POL( U11_gga(x1, ..., x3) ) = x1 + x3


POL( 0 ) = 2


POL( subc14_out_gga(x1, ..., x3) ) = x3 + 1


POL( subc9_out_gga(x1, ..., x3) ) = x3 + 2


POL( REM1_IN_GGA(x1, x2) ) = 2x1 + 2



The following usable rules [FROCOS05] were oriented:

subc9_in_gga(s(T29), T30) → U13_gga(T29, T30, subc14_in_gga(T29, T30))
subc14_in_gga(s(T41), s(T42)) → U11_gga(T41, T42, subc14_in_gga(T41, T42))
subc14_in_gga(T47, 0) → subc14_out_gga(T47, 0, T47)
U13_gga(T29, T30, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)
U11_gga(T41, T42, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)

(25) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

subc9_in_gga(s(T29), T30) → U13_gga(T29, T30, subc14_in_gga(T29, T30))
subc14_in_gga(s(T41), s(T42)) → U11_gga(T41, T42, subc14_in_gga(T41, T42))
subc14_in_gga(T47, 0) → subc14_out_gga(T47, 0, T47)
U11_gga(T41, T42, subc14_out_gga(T41, T42, X68)) → subc14_out_gga(s(T41), s(T42), X68)
U13_gga(T29, T30, subc14_out_gga(T29, T30, X41)) → subc9_out_gga(s(T29), T30, X41)

The set Q consists of the following terms:

subc9_in_gga(x0, x1)
subc14_in_gga(x0, x1)
U11_gga(x0, x1, x2)
U13_gga(x0, x1, x2)

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

(26) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(27) YES