(0) Obligation:

Clauses:

less(0, Y) :- ','(!, =(Y, s(X2))).
less(X, Y) :- ','(p(X, X1), ','(p(Y, Y1), less(X1, Y1))).
p(0, 0).
p(s(X), X).
=(X, X).

Queries:

less(g,a).

(1) BuiltinConflictTransformerProof (SOUND transformation)

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

(2) Obligation:

Clauses:

less(0, Y) :- ','(!, user_defined_=(Y, s(X2))).
less(X, Y) :- ','(p(X, X1), ','(p(Y, Y1), less(X1, Y1))).
p(0, 0).
p(s(X), X).
user_defined_=(X, X).

Queries:

less(g,a).

(3) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(4) Obligation:

Triples:

less18(s(T25)) :- less18(T25).
less1(s(T19), 0) :- less18(T19).
less1(s(T19), s(T29)) :- less1(T19, T29).

Clauses:

lessc18(s(T25)) :- lessc18(T25).
lessc1(0, s(T11)).
lessc1(s(T19), 0) :- lessc18(T19).
lessc1(s(T19), s(T29)) :- lessc1(T19, T29).

Afs:

less1(x1, x2)  =  less1(x1)

(5) TriplesToPiDPProof (SOUND transformation)

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

LESS1_IN_GA(s(T19), 0) → U2_GA(T19, less18_in_g(T19))
LESS1_IN_GA(s(T19), 0) → LESS18_IN_G(T19)
LESS18_IN_G(s(T25)) → U1_G(T25, less18_in_g(T25))
LESS18_IN_G(s(T25)) → LESS18_IN_G(T25)
LESS1_IN_GA(s(T19), s(T29)) → U3_GA(T19, T29, less1_in_ga(T19, T29))
LESS1_IN_GA(s(T19), s(T29)) → LESS1_IN_GA(T19, T29)

R is empty.
The argument filtering Pi contains the following mapping:
less1_in_ga(x1, x2)  =  less1_in_ga(x1)
s(x1)  =  s(x1)
less18_in_g(x1)  =  less18_in_g(x1)
0  =  0
LESS1_IN_GA(x1, x2)  =  LESS1_IN_GA(x1)
U2_GA(x1, x2)  =  U2_GA(x1, x2)
LESS18_IN_G(x1)  =  LESS18_IN_G(x1)
U1_G(x1, x2)  =  U1_G(x1, x2)
U3_GA(x1, x2, x3)  =  U3_GA(x1, x3)

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:

LESS1_IN_GA(s(T19), 0) → U2_GA(T19, less18_in_g(T19))
LESS1_IN_GA(s(T19), 0) → LESS18_IN_G(T19)
LESS18_IN_G(s(T25)) → U1_G(T25, less18_in_g(T25))
LESS18_IN_G(s(T25)) → LESS18_IN_G(T25)
LESS1_IN_GA(s(T19), s(T29)) → U3_GA(T19, T29, less1_in_ga(T19, T29))
LESS1_IN_GA(s(T19), s(T29)) → LESS1_IN_GA(T19, T29)

R is empty.
The argument filtering Pi contains the following mapping:
less1_in_ga(x1, x2)  =  less1_in_ga(x1)
s(x1)  =  s(x1)
less18_in_g(x1)  =  less18_in_g(x1)
0  =  0
LESS1_IN_GA(x1, x2)  =  LESS1_IN_GA(x1)
U2_GA(x1, x2)  =  U2_GA(x1, x2)
LESS18_IN_G(x1)  =  LESS18_IN_G(x1)
U1_G(x1, x2)  =  U1_G(x1, x2)
U3_GA(x1, x2, x3)  =  U3_GA(x1, x3)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

LESS18_IN_G(s(T25)) → LESS18_IN_G(T25)

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:

LESS18_IN_G(s(T25)) → LESS18_IN_G(T25)

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:

  • LESS18_IN_G(s(T25)) → LESS18_IN_G(T25)
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

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

LESS1_IN_GA(s(T19), s(T29)) → LESS1_IN_GA(T19, T29)

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

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:

LESS1_IN_GA(s(T19)) → LESS1_IN_GA(T19)

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

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

  • LESS1_IN_GA(s(T19)) → LESS1_IN_GA(T19)
    The graph contains the following edges 1 > 1

(18) YES