0 Prolog
↳1 CutEliminatorProof (⇐)
↳2 Prolog
↳3 PrologToPiTRSProof (⇐)
↳4 PiTRS
↳5 DependencyPairsProof (⇔)
↳6 PiDP
↳7 DependencyGraphProof (⇔)
↳8 AND
↳9 PiDP
↳10 UsableRulesProof (⇔)
↳11 PiDP
↳12 PiDPToQDPProof (⇔)
↳13 QDP
↳14 QDPSizeChangeProof (⇔)
↳15 TRUE
↳16 PiDP
↳17 UsableRulesProof (⇔)
↳18 PiDP
↳19 PiDPToQDPProof (⇐)
↳20 QDP
↳21 QDPSizeChangeProof (⇔)
↳22 TRUE
↳23 PrologToPiTRSProof (⇐)
↳24 PiTRS
↳25 DependencyPairsProof (⇔)
↳26 PiDP
↳27 DependencyGraphProof (⇔)
↳28 AND
↳29 PiDP
↳30 UsableRulesProof (⇔)
↳31 PiDP
↳32 PiDP
↳33 UsableRulesProof (⇔)
↳34 PiDP
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)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
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)
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)
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)
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)
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)
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
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)
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
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)
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)
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)
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))
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)
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
higher_valued_in_gg(x0, x1)
U6_gg(x0)
greater_in_gg(x0, x1)
U7_gg(x0)
From the DPs we obtained the following set of size-change graphs:
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)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
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)
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)
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)
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)
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)
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
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)
GREATER_IN_GG(s(X), s(Y)) → GREATER_IN_GG(X, Y)
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)
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)
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)
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))