(0) Obligation:
Clauses:
max(X, Y, X) :- less(Y, X).
max(X, Y, Y) :- less(X, s(Y)).
less(0, s(X1)).
less(s(X), s(Y)) :- less(X, Y).
Queries:
max(a,a,g).
(1) PrologToDTProblemTransformerProof (SOUND transformation)
Built DT problem from termination graph.
(2) Obligation:
Triples:
less13(s(T38), s(T37)) :- less13(T38, T37).
max1(s(T23), s(T24), s(T23)) :- less13(T24, T23).
max1(T47, T46, T46) :- less13(T47, s(T46)).
max1(s(T66), T65, T65) :- less13(T66, T65).
Clauses:
lessc13(0, s(T31)).
lessc13(s(T38), s(T37)) :- lessc13(T38, T37).
Afs:
max1(x1, x2, x3) = max1(x3)
(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:
max1_in: (f,f,b)
less13_in: (f,b)
Transforming
TRIPLES into the following
Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:
MAX1_IN_AAG(s(T23), s(T24), s(T23)) → U2_AAG(T23, T24, less13_in_ag(T24, T23))
MAX1_IN_AAG(s(T23), s(T24), s(T23)) → LESS13_IN_AG(T24, T23)
LESS13_IN_AG(s(T38), s(T37)) → U1_AG(T38, T37, less13_in_ag(T38, T37))
LESS13_IN_AG(s(T38), s(T37)) → LESS13_IN_AG(T38, T37)
MAX1_IN_AAG(T47, T46, T46) → U3_AAG(T47, T46, less13_in_ag(T47, s(T46)))
MAX1_IN_AAG(T47, T46, T46) → LESS13_IN_AG(T47, s(T46))
MAX1_IN_AAG(s(T66), T65, T65) → U4_AAG(T66, T65, less13_in_ag(T66, T65))
MAX1_IN_AAG(s(T66), T65, T65) → LESS13_IN_AG(T66, T65)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
less13_in_ag(
x1,
x2) =
less13_in_ag(
x2)
MAX1_IN_AAG(
x1,
x2,
x3) =
MAX1_IN_AAG(
x3)
U2_AAG(
x1,
x2,
x3) =
U2_AAG(
x1,
x3)
LESS13_IN_AG(
x1,
x2) =
LESS13_IN_AG(
x2)
U1_AG(
x1,
x2,
x3) =
U1_AG(
x2,
x3)
U3_AAG(
x1,
x2,
x3) =
U3_AAG(
x2,
x3)
U4_AAG(
x1,
x2,
x3) =
U4_AAG(
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:
MAX1_IN_AAG(s(T23), s(T24), s(T23)) → U2_AAG(T23, T24, less13_in_ag(T24, T23))
MAX1_IN_AAG(s(T23), s(T24), s(T23)) → LESS13_IN_AG(T24, T23)
LESS13_IN_AG(s(T38), s(T37)) → U1_AG(T38, T37, less13_in_ag(T38, T37))
LESS13_IN_AG(s(T38), s(T37)) → LESS13_IN_AG(T38, T37)
MAX1_IN_AAG(T47, T46, T46) → U3_AAG(T47, T46, less13_in_ag(T47, s(T46)))
MAX1_IN_AAG(T47, T46, T46) → LESS13_IN_AG(T47, s(T46))
MAX1_IN_AAG(s(T66), T65, T65) → U4_AAG(T66, T65, less13_in_ag(T66, T65))
MAX1_IN_AAG(s(T66), T65, T65) → LESS13_IN_AG(T66, T65)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
less13_in_ag(
x1,
x2) =
less13_in_ag(
x2)
MAX1_IN_AAG(
x1,
x2,
x3) =
MAX1_IN_AAG(
x3)
U2_AAG(
x1,
x2,
x3) =
U2_AAG(
x1,
x3)
LESS13_IN_AG(
x1,
x2) =
LESS13_IN_AG(
x2)
U1_AG(
x1,
x2,
x3) =
U1_AG(
x2,
x3)
U3_AAG(
x1,
x2,
x3) =
U3_AAG(
x2,
x3)
U4_AAG(
x1,
x2,
x3) =
U4_AAG(
x2,
x3)
We have to consider all (P,R,Pi)-chains
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 7 less nodes.
(6) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
LESS13_IN_AG(s(T38), s(T37)) → LESS13_IN_AG(T38, T37)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
LESS13_IN_AG(
x1,
x2) =
LESS13_IN_AG(
x2)
We have to consider all (P,R,Pi)-chains
(7) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(8) Obligation:
Q DP problem:
The TRS P consists of the following rules:
LESS13_IN_AG(s(T37)) → LESS13_IN_AG(T37)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(9) 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:
- LESS13_IN_AG(s(T37)) → LESS13_IN_AG(T37)
The graph contains the following edges 1 > 1
(10) YES