(0) Obligation:

Clauses:

ordered([]).
ordered(.(X1, [])).
ordered(.(X, .(Y, Xs))) :- ','(less(X, s(Y)), ordered(.(Y, Xs))).
less(0, s(X2)).
less(s(X), s(Y)) :- less(X, Y).

Queries:

ordered(g).

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

less21(0, s(T32)).
less21(s(T37), s(T38)) :- less21(T37, T38).
ordered1([]).
ordered1(.(T3, [])).
ordered1(.(0, .(T15, T10))) :- ordered1(.(T15, T10)).
ordered1(.(s(T22), .(T23, T10))) :- less21(T22, T23).
ordered1(.(s(T22), .(T23, T10))) :- ','(less21(T22, T23), ordered1(.(T23, T10))).

Queries:

ordered1(g).

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
ordered1_in: (b)
less21_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

ordered1_in_g([]) → ordered1_out_g([])
ordered1_in_g(.(T3, [])) → ordered1_out_g(.(T3, []))
ordered1_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, ordered1_in_g(.(T15, T10)))
ordered1_in_g(.(s(T22), .(T23, T10))) → U3_g(T22, T23, T10, less21_in_gg(T22, T23))
less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → ordered1_out_g(.(s(T22), .(T23, T10)))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → U4_g(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U4_g(T22, T23, T10, ordered1_out_g(.(T23, T10))) → ordered1_out_g(.(s(T22), .(T23, T10)))
U2_g(T15, T10, ordered1_out_g(.(T15, T10))) → ordered1_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
ordered1_in_g(x1)  =  ordered1_in_g(x1)
[]  =  []
ordered1_out_g(x1)  =  ordered1_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

ordered1_in_g([]) → ordered1_out_g([])
ordered1_in_g(.(T3, [])) → ordered1_out_g(.(T3, []))
ordered1_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, ordered1_in_g(.(T15, T10)))
ordered1_in_g(.(s(T22), .(T23, T10))) → U3_g(T22, T23, T10, less21_in_gg(T22, T23))
less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → ordered1_out_g(.(s(T22), .(T23, T10)))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → U4_g(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U4_g(T22, T23, T10, ordered1_out_g(.(T23, T10))) → ordered1_out_g(.(s(T22), .(T23, T10)))
U2_g(T15, T10, ordered1_out_g(.(T15, T10))) → ordered1_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
ordered1_in_g(x1)  =  ordered1_in_g(x1)
[]  =  []
ordered1_out_g(x1)  =  ordered1_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

ORDERED1_IN_G(.(0, .(T15, T10))) → U2_G(T15, T10, ordered1_in_g(.(T15, T10)))
ORDERED1_IN_G(.(0, .(T15, T10))) → ORDERED1_IN_G(.(T15, T10))
ORDERED1_IN_G(.(s(T22), .(T23, T10))) → U3_G(T22, T23, T10, less21_in_gg(T22, T23))
ORDERED1_IN_G(.(s(T22), .(T23, T10))) → LESS21_IN_GG(T22, T23)
LESS21_IN_GG(s(T37), s(T38)) → U1_GG(T37, T38, less21_in_gg(T37, T38))
LESS21_IN_GG(s(T37), s(T38)) → LESS21_IN_GG(T37, T38)
U3_G(T22, T23, T10, less21_out_gg(T22, T23)) → U4_G(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U3_G(T22, T23, T10, less21_out_gg(T22, T23)) → ORDERED1_IN_G(.(T23, T10))

The TRS R consists of the following rules:

ordered1_in_g([]) → ordered1_out_g([])
ordered1_in_g(.(T3, [])) → ordered1_out_g(.(T3, []))
ordered1_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, ordered1_in_g(.(T15, T10)))
ordered1_in_g(.(s(T22), .(T23, T10))) → U3_g(T22, T23, T10, less21_in_gg(T22, T23))
less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → ordered1_out_g(.(s(T22), .(T23, T10)))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → U4_g(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U4_g(T22, T23, T10, ordered1_out_g(.(T23, T10))) → ordered1_out_g(.(s(T22), .(T23, T10)))
U2_g(T15, T10, ordered1_out_g(.(T15, T10))) → ordered1_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
ordered1_in_g(x1)  =  ordered1_in_g(x1)
[]  =  []
ordered1_out_g(x1)  =  ordered1_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
ORDERED1_IN_G(x1)  =  ORDERED1_IN_G(x1)
U2_G(x1, x2, x3)  =  U2_G(x3)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)
LESS21_IN_GG(x1, x2)  =  LESS21_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)

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

(6) Obligation:

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

ORDERED1_IN_G(.(0, .(T15, T10))) → U2_G(T15, T10, ordered1_in_g(.(T15, T10)))
ORDERED1_IN_G(.(0, .(T15, T10))) → ORDERED1_IN_G(.(T15, T10))
ORDERED1_IN_G(.(s(T22), .(T23, T10))) → U3_G(T22, T23, T10, less21_in_gg(T22, T23))
ORDERED1_IN_G(.(s(T22), .(T23, T10))) → LESS21_IN_GG(T22, T23)
LESS21_IN_GG(s(T37), s(T38)) → U1_GG(T37, T38, less21_in_gg(T37, T38))
LESS21_IN_GG(s(T37), s(T38)) → LESS21_IN_GG(T37, T38)
U3_G(T22, T23, T10, less21_out_gg(T22, T23)) → U4_G(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U3_G(T22, T23, T10, less21_out_gg(T22, T23)) → ORDERED1_IN_G(.(T23, T10))

The TRS R consists of the following rules:

ordered1_in_g([]) → ordered1_out_g([])
ordered1_in_g(.(T3, [])) → ordered1_out_g(.(T3, []))
ordered1_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, ordered1_in_g(.(T15, T10)))
ordered1_in_g(.(s(T22), .(T23, T10))) → U3_g(T22, T23, T10, less21_in_gg(T22, T23))
less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → ordered1_out_g(.(s(T22), .(T23, T10)))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → U4_g(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U4_g(T22, T23, T10, ordered1_out_g(.(T23, T10))) → ordered1_out_g(.(s(T22), .(T23, T10)))
U2_g(T15, T10, ordered1_out_g(.(T15, T10))) → ordered1_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
ordered1_in_g(x1)  =  ordered1_in_g(x1)
[]  =  []
ordered1_out_g(x1)  =  ordered1_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
ORDERED1_IN_G(x1)  =  ORDERED1_IN_G(x1)
U2_G(x1, x2, x3)  =  U2_G(x3)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)
LESS21_IN_GG(x1, x2)  =  LESS21_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)

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:

LESS21_IN_GG(s(T37), s(T38)) → LESS21_IN_GG(T37, T38)

The TRS R consists of the following rules:

ordered1_in_g([]) → ordered1_out_g([])
ordered1_in_g(.(T3, [])) → ordered1_out_g(.(T3, []))
ordered1_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, ordered1_in_g(.(T15, T10)))
ordered1_in_g(.(s(T22), .(T23, T10))) → U3_g(T22, T23, T10, less21_in_gg(T22, T23))
less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → ordered1_out_g(.(s(T22), .(T23, T10)))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → U4_g(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U4_g(T22, T23, T10, ordered1_out_g(.(T23, T10))) → ordered1_out_g(.(s(T22), .(T23, T10)))
U2_g(T15, T10, ordered1_out_g(.(T15, T10))) → ordered1_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
ordered1_in_g(x1)  =  ordered1_in_g(x1)
[]  =  []
ordered1_out_g(x1)  =  ordered1_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
LESS21_IN_GG(x1, x2)  =  LESS21_IN_GG(x1, x2)

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

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

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

LESS21_IN_GG(s(T37), s(T38)) → LESS21_IN_GG(T37, T38)

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

(12) PiDPToQDPProof (EQUIVALENT transformation)

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

(13) Obligation:

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

LESS21_IN_GG(s(T37), s(T38)) → LESS21_IN_GG(T37, T38)

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

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

  • LESS21_IN_GG(s(T37), s(T38)) → LESS21_IN_GG(T37, T38)
    The graph contains the following edges 1 > 1, 2 > 2

(15) YES

(16) Obligation:

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

ORDERED1_IN_G(.(s(T22), .(T23, T10))) → U3_G(T22, T23, T10, less21_in_gg(T22, T23))
U3_G(T22, T23, T10, less21_out_gg(T22, T23)) → ORDERED1_IN_G(.(T23, T10))
ORDERED1_IN_G(.(0, .(T15, T10))) → ORDERED1_IN_G(.(T15, T10))

The TRS R consists of the following rules:

ordered1_in_g([]) → ordered1_out_g([])
ordered1_in_g(.(T3, [])) → ordered1_out_g(.(T3, []))
ordered1_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, ordered1_in_g(.(T15, T10)))
ordered1_in_g(.(s(T22), .(T23, T10))) → U3_g(T22, T23, T10, less21_in_gg(T22, T23))
less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → ordered1_out_g(.(s(T22), .(T23, T10)))
U3_g(T22, T23, T10, less21_out_gg(T22, T23)) → U4_g(T22, T23, T10, ordered1_in_g(.(T23, T10)))
U4_g(T22, T23, T10, ordered1_out_g(.(T23, T10))) → ordered1_out_g(.(s(T22), .(T23, T10)))
U2_g(T15, T10, ordered1_out_g(.(T15, T10))) → ordered1_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
ordered1_in_g(x1)  =  ordered1_in_g(x1)
[]  =  []
ordered1_out_g(x1)  =  ordered1_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
ORDERED1_IN_G(x1)  =  ORDERED1_IN_G(x1)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)

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

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

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

ORDERED1_IN_G(.(s(T22), .(T23, T10))) → U3_G(T22, T23, T10, less21_in_gg(T22, T23))
U3_G(T22, T23, T10, less21_out_gg(T22, T23)) → ORDERED1_IN_G(.(T23, T10))
ORDERED1_IN_G(.(0, .(T15, T10))) → ORDERED1_IN_G(.(T15, T10))

The TRS R consists of the following rules:

less21_in_gg(0, s(T32)) → less21_out_gg(0, s(T32))
less21_in_gg(s(T37), s(T38)) → U1_gg(T37, T38, less21_in_gg(T37, T38))
U1_gg(T37, T38, less21_out_gg(T37, T38)) → less21_out_gg(s(T37), s(T38))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
less21_in_gg(x1, x2)  =  less21_in_gg(x1, x2)
less21_out_gg(x1, x2)  =  less21_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
ORDERED1_IN_G(x1)  =  ORDERED1_IN_G(x1)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, 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:

ORDERED1_IN_G(.(s(T22), .(T23, T10))) → U3_G(T23, T10, less21_in_gg(T22, T23))
U3_G(T23, T10, less21_out_gg) → ORDERED1_IN_G(.(T23, T10))
ORDERED1_IN_G(.(0, .(T15, T10))) → ORDERED1_IN_G(.(T15, T10))

The TRS R consists of the following rules:

less21_in_gg(0, s(T32)) → less21_out_gg
less21_in_gg(s(T37), s(T38)) → U1_gg(less21_in_gg(T37, T38))
U1_gg(less21_out_gg) → less21_out_gg

The set Q consists of the following terms:

less21_in_gg(x0, x1)
U1_gg(x0)

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

(21) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

ORDERED1_IN_G(.(s(T22), .(T23, T10))) → U3_G(T23, T10, less21_in_gg(T22, T23))
U3_G(T23, T10, less21_out_gg) → ORDERED1_IN_G(.(T23, T10))
ORDERED1_IN_G(.(0, .(T15, T10))) → ORDERED1_IN_G(.(T15, T10))
The following rules are removed from R:

less21_in_gg(0, s(T32)) → less21_out_gg
less21_in_gg(s(T37), s(T38)) → U1_gg(less21_in_gg(T37, T38))
U1_gg(less21_out_gg) → less21_out_gg
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 2·x1 + 2·x2   
POL(0) = 1   
POL(ORDERED1_IN_G(x1)) = x1   
POL(U1_gg(x1)) = 2·x1   
POL(U3_G(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(less21_in_gg(x1, x2)) = x1 + 2·x2   
POL(less21_out_gg) = 1   
POL(s(x1)) = 2·x1   

(22) Obligation:

Q DP problem:
P is empty.
R is empty.
The set Q consists of the following terms:

less21_in_gg(x0, x1)
U1_gg(x0)

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

(23) PisEmptyProof (EQUIVALENT transformation)

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

(24) YES