(0) Obligation:

Clauses:

max_valued(.(Head, Tail), Max) :- max_valued(Tail, Head, Max).
max_valued([], Term, Term).
max_valued(.(Head, Tail), Term, Max) :- ','(higher_valued(Head, Term), ','(!, max_valued(Tail, Head, Max))).
max_valued(.(Head, Tail), Term, Max) :- ','(higher_valued(Term, Head), max_valued(Tail, Term, Max)).
higher_valued(X, Y) :- greater(s(X), Y).
greater(s(X1), 0).
greater(s(X), s(Y)) :- greater(X, Y).

Queries:

max_valued(g,a).

(1) CutEliminatorProof (SOUND transformation)

Eliminated all cuts by simply ignoring them[PROLOG].

(2) Obligation:

Clauses:

max_valued(.(Head, Tail), Max) :- max_valued(Tail, Head, Max).
max_valued([], Term, Term).
max_valued(.(Head, Tail), Term, Max) :- ','(higher_valued(Head, Term), max_valued(Tail, Head, Max)).
max_valued(.(Head, Tail), Term, Max) :- ','(higher_valued(Term, Head), max_valued(Tail, Term, Max)).
higher_valued(X, Y) :- greater(s(X), Y).
greater(s(X1), 0).
greater(s(X), s(Y)) :- greater(X, Y).

Queries:

max_valued(g,a).

(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:
max_valued_in: (b,f)
max_valued_in: (b,b,f)
higher_valued_in: (b,b)
greater_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

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

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x2)

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

MAX_VALUED_IN_GA(.(Head, Tail), Max) → U1_GA(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
MAX_VALUED_IN_GA(.(Head, Tail), Max) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Head, Term)
HIGHER_VALUED_IN_GG(X, Y) → U6_GG(X, Y, greater_in_gg(s(X), Y))
HIGHER_VALUED_IN_GG(X, Y) → GREATER_IN_GG(s(X), Y)
GREATER_IN_GG(s(X), s(Y)) → U7_GG(X, Y, greater_in_gg(X, Y))
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Term, Head)
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x2)
MAX_VALUED_IN_GA(x1, x2)  =  MAX_VALUED_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x5)
HIGHER_VALUED_IN_GG(x1, x2)  =  HIGHER_VALUED_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x3)
GREATER_IN_GG(x1, x2)  =  GREATER_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x3)
U3_GGA(x1, x2, x3, x4, x5)  =  U3_GGA(x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x2, x3, x5)
U5_GGA(x1, x2, x3, x4, x5)  =  U5_GGA(x5)

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

(6) Obligation:

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

MAX_VALUED_IN_GA(.(Head, Tail), Max) → U1_GA(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
MAX_VALUED_IN_GA(.(Head, Tail), Max) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Head, Term)
HIGHER_VALUED_IN_GG(X, Y) → U6_GG(X, Y, greater_in_gg(s(X), Y))
HIGHER_VALUED_IN_GG(X, Y) → GREATER_IN_GG(s(X), Y)
GREATER_IN_GG(s(X), s(Y)) → U7_GG(X, Y, greater_in_gg(X, Y))
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Term, Head)
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x2)
MAX_VALUED_IN_GA(x1, x2)  =  MAX_VALUED_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x5)
HIGHER_VALUED_IN_GG(x1, x2)  =  HIGHER_VALUED_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x3)
GREATER_IN_GG(x1, x2)  =  GREATER_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x3)
U3_GGA(x1, x2, x3, x4, x5)  =  U3_GGA(x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x2, x3, x5)
U5_GGA(x1, x2, x3, x4, x5)  =  U5_GGA(x5)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x2)
GREATER_IN_GG(x1, x2)  =  GREATER_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:

GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)

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:

GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)

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:

  • GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
    The graph contains the following edges 1 > 1, 2 > 2

(15) TRUE

(16) Obligation:

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

U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x2)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x2, x3, x5)

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:

U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg
U7_gg(x1, x2, x3)  =  U7_gg(x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x2, x3, x5)

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:

U2_GGA(Head, Tail, higher_valued_out_gg) → MAX_VALUED_IN_GGA(Tail, Head)
MAX_VALUED_IN_GGA(.(Head, Tail), Term) → U2_GGA(Head, Tail, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term) → U4_GGA(Tail, Term, higher_valued_in_gg(Term, Head))
U4_GGA(Tail, Term, higher_valued_out_gg) → MAX_VALUED_IN_GGA(Tail, Term)

The TRS R consists of the following rules:

higher_valued_in_gg(X, Y) → U6_gg(greater_in_gg(s(X), Y))
U6_gg(greater_out_gg) → higher_valued_out_gg
greater_in_gg(s(X1), 0) → greater_out_gg
greater_in_gg(s(X), s(Y)) → U7_gg(greater_in_gg(X, Y))
U7_gg(greater_out_gg) → greater_out_gg

The set Q consists of the following terms:

higher_valued_in_gg(x0, x1)
U6_gg(x0)
greater_in_gg(x0, x1)
U7_gg(x0)

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

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

  • MAX_VALUED_IN_GGA(.(Head, Tail), Term) → U2_GGA(Head, Tail, higher_valued_in_gg(Head, Term))
    The graph contains the following edges 1 > 1, 1 > 2

  • MAX_VALUED_IN_GGA(.(Head, Tail), Term) → U4_GGA(Tail, Term, higher_valued_in_gg(Term, Head))
    The graph contains the following edges 1 > 1, 2 >= 2

  • U2_GGA(Head, Tail, higher_valued_out_gg) → MAX_VALUED_IN_GGA(Tail, Head)
    The graph contains the following edges 2 >= 1, 1 >= 2

  • U4_GGA(Tail, Term, higher_valued_out_gg) → MAX_VALUED_IN_GGA(Tail, Term)
    The graph contains the following edges 1 >= 1, 2 >= 2

(22) TRUE

(23) PrologToPiTRSProof (SOUND transformation)

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

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x2, x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x3, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x1, x2, x3, x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x1, x2, x3, x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(24) Obligation:

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

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x2, x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x3, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x1, x2, x3, x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x1, x2, x3, x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x1, x2)

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

MAX_VALUED_IN_GA(.(Head, Tail), Max) → U1_GA(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
MAX_VALUED_IN_GA(.(Head, Tail), Max) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Head, Term)
HIGHER_VALUED_IN_GG(X, Y) → U6_GG(X, Y, greater_in_gg(s(X), Y))
HIGHER_VALUED_IN_GG(X, Y) → GREATER_IN_GG(s(X), Y)
GREATER_IN_GG(s(X), s(Y)) → U7_GG(X, Y, greater_in_gg(X, Y))
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Term, Head)
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x2, x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x3, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x1, x2, x3, x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x1, x2, x3, x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x1, x2)
MAX_VALUED_IN_GA(x1, x2)  =  MAX_VALUED_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x2, x4)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x3, x5)
HIGHER_VALUED_IN_GG(x1, x2)  =  HIGHER_VALUED_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x1, x2, x3)
GREATER_IN_GG(x1, x2)  =  GREATER_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x1, x2, x3)
U3_GGA(x1, x2, x3, x4, x5)  =  U3_GGA(x1, x2, x3, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U5_GGA(x1, x2, x3, x4, x5)  =  U5_GGA(x1, x2, x3, x5)

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

(26) Obligation:

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

MAX_VALUED_IN_GA(.(Head, Tail), Max) → U1_GA(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
MAX_VALUED_IN_GA(.(Head, Tail), Max) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Head, Term)
HIGHER_VALUED_IN_GG(X, Y) → U6_GG(X, Y, greater_in_gg(s(X), Y))
HIGHER_VALUED_IN_GG(X, Y) → GREATER_IN_GG(s(X), Y)
GREATER_IN_GG(s(X), s(Y)) → U7_GG(X, Y, greater_in_gg(X, Y))
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → HIGHER_VALUED_IN_GG(Term, Head)
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_GGA(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x2, x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x3, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x1, x2, x3, x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x1, x2, x3, x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x1, x2)
MAX_VALUED_IN_GA(x1, x2)  =  MAX_VALUED_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x2, x4)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x3, x5)
HIGHER_VALUED_IN_GG(x1, x2)  =  HIGHER_VALUED_IN_GG(x1, x2)
U6_GG(x1, x2, x3)  =  U6_GG(x1, x2, x3)
GREATER_IN_GG(x1, x2)  =  GREATER_IN_GG(x1, x2)
U7_GG(x1, x2, x3)  =  U7_GG(x1, x2, x3)
U3_GGA(x1, x2, x3, x4, x5)  =  U3_GGA(x1, x2, x3, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U5_GGA(x1, x2, x3, x4, x5)  =  U5_GGA(x1, x2, x3, x5)

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

(27) DependencyGraphProof (EQUIVALENT transformation)

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

(28) Complex Obligation (AND)

(29) Obligation:

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

GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x2, x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x3, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x1, x2, x3, x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x1, x2, x3, x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x1, x2)
GREATER_IN_GG(x1, x2)  =  GREATER_IN_GG(x1, x2)

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

(30) UsableRulesProof (EQUIVALENT transformation)

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

(31) Obligation:

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

GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)

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

(32) Obligation:

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

U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

max_valued_in_ga(.(Head, Tail), Max) → U1_ga(Head, Tail, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga([], Term, Term) → max_valued_out_gga([], Term, Term)
max_valued_in_gga(.(Head, Tail), Term, Max) → U2_gga(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
U2_gga(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → U3_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Head, Max))
max_valued_in_gga(.(Head, Tail), Term, Max) → U4_gga(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_gga(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → U5_gga(Head, Tail, Term, Max, max_valued_in_gga(Tail, Term, Max))
U5_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Term, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U3_gga(Head, Tail, Term, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_gga(.(Head, Tail), Term, Max)
U1_ga(Head, Tail, Max, max_valued_out_gga(Tail, Head, Max)) → max_valued_out_ga(.(Head, Tail), Max)

The argument filtering Pi contains the following mapping:
max_valued_in_ga(x1, x2)  =  max_valued_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x2, x4)
max_valued_in_gga(x1, x2, x3)  =  max_valued_in_gga(x1, x2)
[]  =  []
max_valued_out_gga(x1, x2, x3)  =  max_valued_out_gga(x1, x2, x3)
U2_gga(x1, x2, x3, x4, x5)  =  U2_gga(x1, x2, x3, x5)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
U3_gga(x1, x2, x3, x4, x5)  =  U3_gga(x1, x2, x3, x5)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
U5_gga(x1, x2, x3, x4, x5)  =  U5_gga(x1, x2, x3, x5)
max_valued_out_ga(x1, x2)  =  max_valued_out_ga(x1, x2)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x3, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)

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

(33) UsableRulesProof (EQUIVALENT transformation)

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

(34) Obligation:

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

U2_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Head, Term)) → MAX_VALUED_IN_GGA(Tail, Head, Max)
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U2_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Head, Term))
MAX_VALUED_IN_GGA(.(Head, Tail), Term, Max) → U4_GGA(Head, Tail, Term, Max, higher_valued_in_gg(Term, Head))
U4_GGA(Head, Tail, Term, Max, higher_valued_out_gg(Term, Head)) → MAX_VALUED_IN_GGA(Tail, Term, Max)

The TRS R consists of the following rules:

higher_valued_in_gg(X, Y) → U6_gg(X, Y, greater_in_gg(s(X), Y))
U6_gg(X, Y, greater_out_gg(s(X), Y)) → higher_valued_out_gg(X, Y)
greater_in_gg(s(X1), 0) → greater_out_gg(s(X1), 0)
greater_in_gg(s(X), s(Y)) → U7_gg(X, Y, greater_in_gg(X, Y))
U7_gg(X, Y, greater_out_gg(X, Y)) → greater_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
higher_valued_in_gg(x1, x2)  =  higher_valued_in_gg(x1, x2)
U6_gg(x1, x2, x3)  =  U6_gg(x1, x2, x3)
greater_in_gg(x1, x2)  =  greater_in_gg(x1, x2)
s(x1)  =  s(x1)
0  =  0
greater_out_gg(x1, x2)  =  greater_out_gg(x1, x2)
U7_gg(x1, x2, x3)  =  U7_gg(x1, x2, x3)
higher_valued_out_gg(x1, x2)  =  higher_valued_out_gg(x1, x2)
MAX_VALUED_IN_GGA(x1, x2, x3)  =  MAX_VALUED_IN_GGA(x1, x2)
U2_GGA(x1, x2, x3, x4, x5)  =  U2_GGA(x1, x2, x3, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)

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