(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) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

max_valued3([], T7, T7).
max_valued3(.(T15, T9), 0, T12) :- max_valued3(T9, T15, T12).
max_valued3(.(s(T18), T9), s(0), T12) :- max_valued3(T9, s(T18), T12).
max_valued3(.(s(s(T21)), T9), s(s(0)), T12) :- max_valued3(T9, s(s(T21)), T12).
max_valued3(.(s(s(s(T24))), T9), s(s(s(0))), T12) :- max_valued3(T9, s(s(s(T24))), T12).
max_valued3(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) :- max_valued3(T9, s(s(s(s(T27)))), T12).
max_valued3(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) :- max_valued3(T9, s(s(s(s(s(T30))))), T12).
max_valued3(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) :- max_valued3(T9, s(s(s(s(s(s(T33)))))), T12).
max_valued3(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) :- max_valued3(T9, s(s(s(s(s(s(s(T36))))))), T12).
max_valued3(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) :- greater64(T37, T38).
max_valued3(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) :- ','(greater64(T37, T38), max_valued3(T9, s(T39), T12)).
max_valued3(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) :- higher_valued77(T48, T43).
max_valued3(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) :- ','(higher_valued77(T48, T43), max_valued3(T44, s(T49), T47)).
max_valued3(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) :- higher_valued82(T54, T52).
max_valued3(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) :- ','(higher_valued82(T54, T52), max_valued3(T53, s(s(s(s(s(s(T54)))))), T56)).
max_valued3(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) :- higher_valued87(T61, T59).
max_valued3(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) :- ','(higher_valued87(T61, T59), max_valued3(T60, s(s(s(s(s(T61))))), T63)).
max_valued3(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) :- higher_valued92(T68, T66).
max_valued3(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) :- ','(higher_valued92(T68, T66), max_valued3(T67, s(s(s(s(T68)))), T70)).
max_valued3(.(s(s(T73)), T74), s(s(s(T75))), T77) :- higher_valued97(T75, T73).
max_valued3(.(s(s(T73)), T74), s(s(s(T75))), T77) :- ','(higher_valued97(T75, T73), max_valued3(T74, s(s(s(T75))), T77)).
max_valued3(.(s(T80), T81), s(s(T82)), T84) :- higher_valued102(T82, T80).
max_valued3(.(s(T80), T81), s(s(T82)), T84) :- ','(higher_valued102(T82, T80), max_valued3(T81, s(s(T82)), T84)).
max_valued3(.(T87, T88), s(T89), T91) :- higher_valued107(T89, T87).
max_valued3(.(T87, T88), s(T89), T91) :- ','(higher_valued107(T89, T87), max_valued3(T88, s(T89), T91)).
max_valued3(.(T94, T95), T96, T98) :- higher_valued112(T96, T94).
max_valued3(.(T94, T95), T96, T98) :- ','(higher_valued112(T96, T94), max_valued3(T95, T96, T98)).
max_valued3(.(T101, T102), T103, T105) :- higher_valued118(T103, T101).
max_valued3(.(T101, T102), T103, T105) :- ','(higher_valued118(T103, T101), max_valued3(T102, T103, T105)).
greater64(s(T40), 0).
greater64(s(T41), s(T42)) :- greater64(T41, T42).
higher_valued77(T50, T51) :- greater64(s(s(T50)), s(s(s(s(s(s(T51))))))).
higher_valued82(T57, T58) :- greater64(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))).
higher_valued87(T64, T65) :- greater64(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))).
higher_valued92(T71, T72) :- greater64(s(s(s(s(s(T71))))), s(s(s(T72)))).
higher_valued97(T78, T79) :- greater64(s(s(s(s(T78)))), s(s(T79))).
higher_valued102(T85, T86) :- greater64(s(s(s(T85))), s(T86)).
higher_valued107(T92, T93) :- greater64(s(s(T92)), T93).
higher_valued112(T99, T100) :- greater64(s(T99), T100).
higher_valued118(T106, T107) :- greater64(s(T106), T107).
max_valued1(.(T7, []), T7).
max_valued1(.(0, .(T15, T9)), T12) :- max_valued3(T9, T15, T12).
max_valued1(.(s(0), .(s(T18), T9)), T12) :- max_valued3(T9, s(T18), T12).
max_valued1(.(s(s(0)), .(s(s(T21)), T9)), T12) :- max_valued3(T9, s(s(T21)), T12).
max_valued1(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) :- max_valued3(T9, s(s(s(T24))), T12).
max_valued1(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) :- max_valued3(T9, s(s(s(s(T27)))), T12).
max_valued1(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) :- max_valued3(T9, s(s(s(s(s(T30))))), T12).
max_valued1(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) :- max_valued3(T9, s(s(s(s(s(s(T33)))))), T12).
max_valued1(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) :- max_valued3(T9, s(s(s(s(s(s(s(T36))))))), T12).
max_valued1(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) :- greater64(T37, T38).
max_valued1(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) :- ','(greater64(T37, T38), max_valued3(T9, s(T39), T12)).
max_valued1(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) :- higher_valued77(T48, T43).
max_valued1(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) :- ','(higher_valued77(T48, T43), max_valued3(T44, s(T49), T47)).
max_valued1(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) :- higher_valued82(T54, T52).
max_valued1(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) :- ','(higher_valued82(T54, T52), max_valued3(T53, s(s(s(s(s(s(T54)))))), T56)).
max_valued1(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) :- higher_valued87(T61, T59).
max_valued1(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) :- ','(higher_valued87(T61, T59), max_valued3(T60, s(s(s(s(s(T61))))), T63)).
max_valued1(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) :- higher_valued92(T68, T66).
max_valued1(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) :- ','(higher_valued92(T68, T66), max_valued3(T67, s(s(s(s(T68)))), T70)).
max_valued1(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) :- higher_valued97(T75, T73).
max_valued1(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) :- ','(higher_valued97(T75, T73), max_valued3(T74, s(s(s(T75))), T77)).
max_valued1(.(s(s(T82)), .(s(T80), T81)), T84) :- higher_valued102(T82, T80).
max_valued1(.(s(s(T82)), .(s(T80), T81)), T84) :- ','(higher_valued102(T82, T80), max_valued3(T81, s(s(T82)), T84)).
max_valued1(.(s(T89), .(T87, T88)), T91) :- higher_valued107(T89, T87).
max_valued1(.(s(T89), .(T87, T88)), T91) :- ','(higher_valued107(T89, T87), max_valued3(T88, s(T89), T91)).
max_valued1(.(T96, .(T94, T95)), T98) :- higher_valued112(T96, T94).
max_valued1(.(T96, .(T94, T95)), T98) :- ','(higher_valued112(T96, T94), max_valued3(T95, T96, T98)).
max_valued1(.(T103, .(T101, T102)), T105) :- higher_valued118(T103, T101).
max_valued1(.(T103, .(T101, T102)), T105) :- ','(higher_valued118(T103, T101), max_valued3(T102, T103, T105)).

Queries:

max_valued1(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_valued1_in: (b,f)
max_valued3_in: (b,b,f) (b,f,f)
greater64_in: (b,b) (f,b) (b,f)
higher_valued77_in: (f,b)
higher_valued82_in: (b,b) (f,b)
higher_valued87_in: (b,b) (f,b)
higher_valued92_in: (b,b) (f,b)
higher_valued97_in: (b,b) (f,b)
higher_valued102_in: (b,b) (f,b)
higher_valued107_in: (b,b) (f,b)
higher_valued112_in: (b,b) (f,b)
higher_valued118_in: (b,b) (f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)

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_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)

(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_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → U39_GA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → U1_GGA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → U2_GGA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GGA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GGA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GGA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GGA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GGA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GGA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GG(T37, T38)
GREATER64_IN_GG(s(T41), s(T42)) → U29_GG(T41, T42, greater64_in_gg(T41, T42))
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_GGA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → U1_GAA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
HIGHER_VALUED77_IN_AG(T50, T51) → U30_AG(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
HIGHER_VALUED77_IN_AG(T50, T51) → GREATER64_IN_AG(s(s(T50)), s(s(s(s(s(s(T51)))))))
GREATER64_IN_AG(s(T41), s(T42)) → U29_AG(T41, T42, greater64_in_ag(T41, T42))
GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GGA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → U2_GAA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
HIGHER_VALUED82_IN_GG(T57, T58) → U31_GG(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_GG(T57, T58) → GREATER64_IN_GG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_GGA(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
HIGHER_VALUED87_IN_GG(T64, T65) → U32_GG(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_GG(T64, T65) → GREATER64_IN_GG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_GGA(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
HIGHER_VALUED92_IN_GG(T71, T72) → U33_GG(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_GG(T71, T72) → GREATER64_IN_GG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_GGA(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
HIGHER_VALUED97_IN_GG(T78, T79) → U34_GG(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_GG(T78, T79) → GREATER64_IN_GG(s(s(s(s(T78)))), s(s(T79)))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_GGA(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
HIGHER_VALUED102_IN_GG(T85, T86) → U35_GG(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_GG(T85, T86) → GREATER64_IN_GG(s(s(s(T85))), s(T86))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_GGA(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
HIGHER_VALUED107_IN_GG(T92, T93) → U36_GG(T92, T93, greater64_in_gg(s(s(T92)), T93))
HIGHER_VALUED107_IN_GG(T92, T93) → GREATER64_IN_GG(s(s(T92)), T93)
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_GGA(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_GG(T96, T94)
HIGHER_VALUED112_IN_GG(T99, T100) → U37_GG(T99, T100, greater64_in_gg(s(T99), T100))
HIGHER_VALUED112_IN_GG(T99, T100) → GREATER64_IN_GG(s(T99), T100)
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_GGA(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_GG(T103, T101)
HIGHER_VALUED118_IN_GG(T106, T107) → U38_GG(T106, T107, greater64_in_gg(s(T106), T107))
HIGHER_VALUED118_IN_GG(T106, T107) → GREATER64_IN_GG(s(T106), T107)
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_GGA(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GAA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GAA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GAA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GAA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GAA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GAA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GA(T37, T38)
GREATER64_IN_GA(s(T41), s(T42)) → U29_GA(T41, T42, greater64_in_ga(T41, T42))
GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_GAA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GAA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_AG(T54, T52)
HIGHER_VALUED82_IN_AG(T57, T58) → U31_AG(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_AG(T57, T58) → GREATER64_IN_AG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_GAA(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_AG(T61, T59)
HIGHER_VALUED87_IN_AG(T64, T65) → U32_AG(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_AG(T64, T65) → GREATER64_IN_AG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_GAA(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_AG(T68, T66)
HIGHER_VALUED92_IN_AG(T71, T72) → U33_AG(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_AG(T71, T72) → GREATER64_IN_AG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_GAA(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_AG(T75, T73)
HIGHER_VALUED97_IN_AG(T78, T79) → U34_AG(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_AG(T78, T79) → GREATER64_IN_AG(s(s(s(s(T78)))), s(s(T79)))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_GAA(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_AG(T82, T80)
HIGHER_VALUED102_IN_AG(T85, T86) → U35_AG(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_AG(T85, T86) → GREATER64_IN_AG(s(s(s(T85))), s(T86))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_GAA(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_AG(T89, T87)
HIGHER_VALUED107_IN_AG(T92, T93) → U36_AG(T92, T93, greater64_in_ag(s(s(T92)), T93))
HIGHER_VALUED107_IN_AG(T92, T93) → GREATER64_IN_AG(s(s(T92)), T93)
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_GAA(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_AG(T96, T94)
HIGHER_VALUED112_IN_AG(T99, T100) → U37_AG(T99, T100, greater64_in_ag(s(T99), T100))
HIGHER_VALUED112_IN_AG(T99, T100) → GREATER64_IN_AG(s(T99), T100)
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_GAA(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_AG(T103, T101)
HIGHER_VALUED118_IN_AG(T106, T107) → U38_AG(T106, T107, greater64_in_ag(s(T106), T107))
HIGHER_VALUED118_IN_AG(T106, T107) → GREATER64_IN_AG(s(T106), T107)
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_GAA(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → U40_GA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_GA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_GA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_GA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_GA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_GA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_GA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_GA(T38, T37, T9, T12, greater64_in_gg(T37, T38))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → GREATER64_IN_GG(T37, T38)
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_GA(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_GA(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_GA(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_GA(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_GA(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_GA(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_GA(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_GA(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_GA(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_GA(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_GA(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → U59_GA(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_GA(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → U61_GA(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_GA(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → U63_GA(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → HIGHER_VALUED112_IN_GG(T96, T94)
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_GA(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → U65_GA(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → HIGHER_VALUED118_IN_GG(T103, T101)
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_GA(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)

The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)
MAX_VALUED1_IN_GA(x1, x2)  =  MAX_VALUED1_IN_GA(x1)
U39_GA(x1, x2, x3, x4)  =  U39_GA(x4)
MAX_VALUED3_IN_GGA(x1, x2, x3)  =  MAX_VALUED3_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x4)
U8_GGA(x1, x2, x3, x4)  =  U8_GGA(x4)
U9_GGA(x1, x2, x3, x4, x5)  =  U9_GGA(x2, x5)
GREATER64_IN_GG(x1, x2)  =  GREATER64_IN_GG(x1, x2)
U29_GG(x1, x2, x3)  =  U29_GG(x3)
U10_GGA(x1, x2, x3, x4, x5)  =  U10_GGA(x5)
MAX_VALUED3_IN_GAA(x1, x2, x3)  =  MAX_VALUED3_IN_GAA(x1)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
U11_GGA(x1, x2, x3, x4, x5)  =  U11_GGA(x2, x5)
HIGHER_VALUED77_IN_AG(x1, x2)  =  HIGHER_VALUED77_IN_AG(x2)
U30_AG(x1, x2, x3)  =  U30_AG(x3)
GREATER64_IN_AG(x1, x2)  =  GREATER64_IN_AG(x2)
U29_AG(x1, x2, x3)  =  U29_AG(x3)
U12_GGA(x1, x2, x3, x4, x5)  =  U12_GGA(x5)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x4)
U13_GGA(x1, x2, x3, x4, x5)  =  U13_GGA(x2, x3, x5)
HIGHER_VALUED82_IN_GG(x1, x2)  =  HIGHER_VALUED82_IN_GG(x1, x2)
U31_GG(x1, x2, x3)  =  U31_GG(x3)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(x5)
U15_GGA(x1, x2, x3, x4, x5)  =  U15_GGA(x2, x3, x5)
HIGHER_VALUED87_IN_GG(x1, x2)  =  HIGHER_VALUED87_IN_GG(x1, x2)
U32_GG(x1, x2, x3)  =  U32_GG(x3)
U16_GGA(x1, x2, x3, x4, x5)  =  U16_GGA(x5)
U17_GGA(x1, x2, x3, x4, x5)  =  U17_GGA(x2, x3, x5)
HIGHER_VALUED92_IN_GG(x1, x2)  =  HIGHER_VALUED92_IN_GG(x1, x2)
U33_GG(x1, x2, x3)  =  U33_GG(x3)
U18_GGA(x1, x2, x3, x4, x5)  =  U18_GGA(x5)
U19_GGA(x1, x2, x3, x4, x5)  =  U19_GGA(x2, x3, x5)
HIGHER_VALUED97_IN_GG(x1, x2)  =  HIGHER_VALUED97_IN_GG(x1, x2)
U34_GG(x1, x2, x3)  =  U34_GG(x3)
U20_GGA(x1, x2, x3, x4, x5)  =  U20_GGA(x5)
U21_GGA(x1, x2, x3, x4, x5)  =  U21_GGA(x2, x3, x5)
HIGHER_VALUED102_IN_GG(x1, x2)  =  HIGHER_VALUED102_IN_GG(x1, x2)
U35_GG(x1, x2, x3)  =  U35_GG(x3)
U22_GGA(x1, x2, x3, x4, x5)  =  U22_GGA(x5)
U23_GGA(x1, x2, x3, x4, x5)  =  U23_GGA(x2, x3, x5)
HIGHER_VALUED107_IN_GG(x1, x2)  =  HIGHER_VALUED107_IN_GG(x1, x2)
U36_GG(x1, x2, x3)  =  U36_GG(x3)
U24_GGA(x1, x2, x3, x4, x5)  =  U24_GGA(x5)
U25_GGA(x1, x2, x3, x4, x5)  =  U25_GGA(x2, x3, x5)
HIGHER_VALUED112_IN_GG(x1, x2)  =  HIGHER_VALUED112_IN_GG(x1, x2)
U37_GG(x1, x2, x3)  =  U37_GG(x3)
U26_GGA(x1, x2, x3, x4, x5)  =  U26_GGA(x5)
U27_GGA(x1, x2, x3, x4, x5)  =  U27_GGA(x2, x3, x5)
HIGHER_VALUED118_IN_GG(x1, x2)  =  HIGHER_VALUED118_IN_GG(x1, x2)
U38_GG(x1, x2, x3)  =  U38_GG(x3)
U28_GGA(x1, x2, x3, x4, x5)  =  U28_GGA(x5)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x4)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x4)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x4)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x4)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x4)
U8_GAA(x1, x2, x3, x4)  =  U8_GAA(x4)
U9_GAA(x1, x2, x3, x4, x5)  =  U9_GAA(x2, x5)
GREATER64_IN_GA(x1, x2)  =  GREATER64_IN_GA(x1)
U29_GA(x1, x2, x3)  =  U29_GA(x3)
U10_GAA(x1, x2, x3, x4, x5)  =  U10_GAA(x5)
U11_GAA(x1, x2, x3, x4, x5)  =  U11_GAA(x2, x5)
U12_GAA(x1, x2, x3, x4, x5)  =  U12_GAA(x5)
U13_GAA(x1, x2, x3, x4, x5)  =  U13_GAA(x2, x5)
HIGHER_VALUED82_IN_AG(x1, x2)  =  HIGHER_VALUED82_IN_AG(x2)
U31_AG(x1, x2, x3)  =  U31_AG(x3)
U14_GAA(x1, x2, x3, x4, x5)  =  U14_GAA(x5)
U15_GAA(x1, x2, x3, x4, x5)  =  U15_GAA(x2, x5)
HIGHER_VALUED87_IN_AG(x1, x2)  =  HIGHER_VALUED87_IN_AG(x2)
U32_AG(x1, x2, x3)  =  U32_AG(x3)
U16_GAA(x1, x2, x3, x4, x5)  =  U16_GAA(x5)
U17_GAA(x1, x2, x3, x4, x5)  =  U17_GAA(x2, x5)
HIGHER_VALUED92_IN_AG(x1, x2)  =  HIGHER_VALUED92_IN_AG(x2)
U33_AG(x1, x2, x3)  =  U33_AG(x3)
U18_GAA(x1, x2, x3, x4, x5)  =  U18_GAA(x5)
U19_GAA(x1, x2, x3, x4, x5)  =  U19_GAA(x2, x5)
HIGHER_VALUED97_IN_AG(x1, x2)  =  HIGHER_VALUED97_IN_AG(x2)
U34_AG(x1, x2, x3)  =  U34_AG(x3)
U20_GAA(x1, x2, x3, x4, x5)  =  U20_GAA(x5)
U21_GAA(x1, x2, x3, x4, x5)  =  U21_GAA(x2, x5)
HIGHER_VALUED102_IN_AG(x1, x2)  =  HIGHER_VALUED102_IN_AG(x2)
U35_AG(x1, x2, x3)  =  U35_AG(x3)
U22_GAA(x1, x2, x3, x4, x5)  =  U22_GAA(x5)
U23_GAA(x1, x2, x3, x4, x5)  =  U23_GAA(x2, x5)
HIGHER_VALUED107_IN_AG(x1, x2)  =  HIGHER_VALUED107_IN_AG(x2)
U36_AG(x1, x2, x3)  =  U36_AG(x3)
U24_GAA(x1, x2, x3, x4, x5)  =  U24_GAA(x5)
U25_GAA(x1, x2, x3, x4, x5)  =  U25_GAA(x2, x5)
HIGHER_VALUED112_IN_AG(x1, x2)  =  HIGHER_VALUED112_IN_AG(x2)
U37_AG(x1, x2, x3)  =  U37_AG(x3)
U26_GAA(x1, x2, x3, x4, x5)  =  U26_GAA(x5)
U27_GAA(x1, x2, x3, x4, x5)  =  U27_GAA(x2, x5)
HIGHER_VALUED118_IN_AG(x1, x2)  =  HIGHER_VALUED118_IN_AG(x2)
U38_AG(x1, x2, x3)  =  U38_AG(x3)
U28_GAA(x1, x2, x3, x4, x5)  =  U28_GAA(x5)
U40_GA(x1, x2, x3, x4)  =  U40_GA(x4)
U41_GA(x1, x2, x3, x4)  =  U41_GA(x4)
U42_GA(x1, x2, x3, x4)  =  U42_GA(x4)
U43_GA(x1, x2, x3, x4)  =  U43_GA(x4)
U44_GA(x1, x2, x3, x4)  =  U44_GA(x4)
U45_GA(x1, x2, x3, x4)  =  U45_GA(x4)
U46_GA(x1, x2, x3, x4)  =  U46_GA(x4)
U47_GA(x1, x2, x3, x4, x5)  =  U47_GA(x3, x5)
U48_GA(x1, x2, x3, x4, x5)  =  U48_GA(x5)
U49_GA(x1, x2, x3, x4, x5)  =  U49_GA(x3, x5)
U50_GA(x1, x2, x3, x4, x5)  =  U50_GA(x5)
U51_GA(x1, x2, x3, x4, x5)  =  U51_GA(x1, x3, x5)
U52_GA(x1, x2, x3, x4, x5)  =  U52_GA(x5)
U53_GA(x1, x2, x3, x4, x5)  =  U53_GA(x1, x3, x5)
U54_GA(x1, x2, x3, x4, x5)  =  U54_GA(x5)
U55_GA(x1, x2, x3, x4, x5)  =  U55_GA(x1, x3, x5)
U56_GA(x1, x2, x3, x4, x5)  =  U56_GA(x5)
U57_GA(x1, x2, x3, x4, x5)  =  U57_GA(x1, x3, x5)
U58_GA(x1, x2, x3, x4, x5)  =  U58_GA(x5)
U59_GA(x1, x2, x3, x4, x5)  =  U59_GA(x1, x3, x5)
U60_GA(x1, x2, x3, x4, x5)  =  U60_GA(x5)
U61_GA(x1, x2, x3, x4, x5)  =  U61_GA(x1, x3, x5)
U62_GA(x1, x2, x3, x4, x5)  =  U62_GA(x5)
U63_GA(x1, x2, x3, x4, x5)  =  U63_GA(x1, x3, x5)
U64_GA(x1, x2, x3, x4, x5)  =  U64_GA(x5)
U65_GA(x1, x2, x3, x4, x5)  =  U65_GA(x1, x3, x5)
U66_GA(x1, x2, x3, x4, x5)  =  U66_GA(x5)

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

(6) Obligation:

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

MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → U39_GA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → U1_GGA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → U2_GGA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GGA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GGA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GGA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GGA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GGA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GGA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GG(T37, T38)
GREATER64_IN_GG(s(T41), s(T42)) → U29_GG(T41, T42, greater64_in_gg(T41, T42))
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_GGA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → U1_GAA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
HIGHER_VALUED77_IN_AG(T50, T51) → U30_AG(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
HIGHER_VALUED77_IN_AG(T50, T51) → GREATER64_IN_AG(s(s(T50)), s(s(s(s(s(s(T51)))))))
GREATER64_IN_AG(s(T41), s(T42)) → U29_AG(T41, T42, greater64_in_ag(T41, T42))
GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GGA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → U2_GAA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
HIGHER_VALUED82_IN_GG(T57, T58) → U31_GG(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_GG(T57, T58) → GREATER64_IN_GG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_GGA(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
HIGHER_VALUED87_IN_GG(T64, T65) → U32_GG(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_GG(T64, T65) → GREATER64_IN_GG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_GGA(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
HIGHER_VALUED92_IN_GG(T71, T72) → U33_GG(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_GG(T71, T72) → GREATER64_IN_GG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_GGA(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
HIGHER_VALUED97_IN_GG(T78, T79) → U34_GG(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_GG(T78, T79) → GREATER64_IN_GG(s(s(s(s(T78)))), s(s(T79)))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_GGA(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
HIGHER_VALUED102_IN_GG(T85, T86) → U35_GG(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_GG(T85, T86) → GREATER64_IN_GG(s(s(s(T85))), s(T86))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_GGA(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
HIGHER_VALUED107_IN_GG(T92, T93) → U36_GG(T92, T93, greater64_in_gg(s(s(T92)), T93))
HIGHER_VALUED107_IN_GG(T92, T93) → GREATER64_IN_GG(s(s(T92)), T93)
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_GGA(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_GG(T96, T94)
HIGHER_VALUED112_IN_GG(T99, T100) → U37_GG(T99, T100, greater64_in_gg(s(T99), T100))
HIGHER_VALUED112_IN_GG(T99, T100) → GREATER64_IN_GG(s(T99), T100)
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_GGA(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_GG(T103, T101)
HIGHER_VALUED118_IN_GG(T106, T107) → U38_GG(T106, T107, greater64_in_gg(s(T106), T107))
HIGHER_VALUED118_IN_GG(T106, T107) → GREATER64_IN_GG(s(T106), T107)
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_GGA(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GAA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GAA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GAA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GAA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GAA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GAA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GA(T37, T38)
GREATER64_IN_GA(s(T41), s(T42)) → U29_GA(T41, T42, greater64_in_ga(T41, T42))
GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_GAA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GAA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_AG(T54, T52)
HIGHER_VALUED82_IN_AG(T57, T58) → U31_AG(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_AG(T57, T58) → GREATER64_IN_AG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_GAA(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_AG(T61, T59)
HIGHER_VALUED87_IN_AG(T64, T65) → U32_AG(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_AG(T64, T65) → GREATER64_IN_AG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_GAA(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_AG(T68, T66)
HIGHER_VALUED92_IN_AG(T71, T72) → U33_AG(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_AG(T71, T72) → GREATER64_IN_AG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_GAA(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_AG(T75, T73)
HIGHER_VALUED97_IN_AG(T78, T79) → U34_AG(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_AG(T78, T79) → GREATER64_IN_AG(s(s(s(s(T78)))), s(s(T79)))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_GAA(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_AG(T82, T80)
HIGHER_VALUED102_IN_AG(T85, T86) → U35_AG(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_AG(T85, T86) → GREATER64_IN_AG(s(s(s(T85))), s(T86))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_GAA(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_AG(T89, T87)
HIGHER_VALUED107_IN_AG(T92, T93) → U36_AG(T92, T93, greater64_in_ag(s(s(T92)), T93))
HIGHER_VALUED107_IN_AG(T92, T93) → GREATER64_IN_AG(s(s(T92)), T93)
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_GAA(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_AG(T96, T94)
HIGHER_VALUED112_IN_AG(T99, T100) → U37_AG(T99, T100, greater64_in_ag(s(T99), T100))
HIGHER_VALUED112_IN_AG(T99, T100) → GREATER64_IN_AG(s(T99), T100)
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_GAA(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_AG(T103, T101)
HIGHER_VALUED118_IN_AG(T106, T107) → U38_AG(T106, T107, greater64_in_ag(s(T106), T107))
HIGHER_VALUED118_IN_AG(T106, T107) → GREATER64_IN_AG(s(T106), T107)
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_GAA(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → U40_GA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_GA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_GA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_GA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_GA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_GA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_GA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_GA(T38, T37, T9, T12, greater64_in_gg(T37, T38))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → GREATER64_IN_GG(T37, T38)
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_GA(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_GA(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_GA(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_GA(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_GA(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_GA(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_GA(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_GA(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_GA(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_GA(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_GA(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → U59_GA(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_GA(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → U61_GA(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_GA(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → U63_GA(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → HIGHER_VALUED112_IN_GG(T96, T94)
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_GA(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → U65_GA(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → HIGHER_VALUED118_IN_GG(T103, T101)
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_GA(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)

The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)
MAX_VALUED1_IN_GA(x1, x2)  =  MAX_VALUED1_IN_GA(x1)
U39_GA(x1, x2, x3, x4)  =  U39_GA(x4)
MAX_VALUED3_IN_GGA(x1, x2, x3)  =  MAX_VALUED3_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x4)
U8_GGA(x1, x2, x3, x4)  =  U8_GGA(x4)
U9_GGA(x1, x2, x3, x4, x5)  =  U9_GGA(x2, x5)
GREATER64_IN_GG(x1, x2)  =  GREATER64_IN_GG(x1, x2)
U29_GG(x1, x2, x3)  =  U29_GG(x3)
U10_GGA(x1, x2, x3, x4, x5)  =  U10_GGA(x5)
MAX_VALUED3_IN_GAA(x1, x2, x3)  =  MAX_VALUED3_IN_GAA(x1)
U1_GAA(x1, x2, x3, x4)  =  U1_GAA(x4)
U11_GGA(x1, x2, x3, x4, x5)  =  U11_GGA(x2, x5)
HIGHER_VALUED77_IN_AG(x1, x2)  =  HIGHER_VALUED77_IN_AG(x2)
U30_AG(x1, x2, x3)  =  U30_AG(x3)
GREATER64_IN_AG(x1, x2)  =  GREATER64_IN_AG(x2)
U29_AG(x1, x2, x3)  =  U29_AG(x3)
U12_GGA(x1, x2, x3, x4, x5)  =  U12_GGA(x5)
U2_GAA(x1, x2, x3, x4)  =  U2_GAA(x4)
U13_GGA(x1, x2, x3, x4, x5)  =  U13_GGA(x2, x3, x5)
HIGHER_VALUED82_IN_GG(x1, x2)  =  HIGHER_VALUED82_IN_GG(x1, x2)
U31_GG(x1, x2, x3)  =  U31_GG(x3)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(x5)
U15_GGA(x1, x2, x3, x4, x5)  =  U15_GGA(x2, x3, x5)
HIGHER_VALUED87_IN_GG(x1, x2)  =  HIGHER_VALUED87_IN_GG(x1, x2)
U32_GG(x1, x2, x3)  =  U32_GG(x3)
U16_GGA(x1, x2, x3, x4, x5)  =  U16_GGA(x5)
U17_GGA(x1, x2, x3, x4, x5)  =  U17_GGA(x2, x3, x5)
HIGHER_VALUED92_IN_GG(x1, x2)  =  HIGHER_VALUED92_IN_GG(x1, x2)
U33_GG(x1, x2, x3)  =  U33_GG(x3)
U18_GGA(x1, x2, x3, x4, x5)  =  U18_GGA(x5)
U19_GGA(x1, x2, x3, x4, x5)  =  U19_GGA(x2, x3, x5)
HIGHER_VALUED97_IN_GG(x1, x2)  =  HIGHER_VALUED97_IN_GG(x1, x2)
U34_GG(x1, x2, x3)  =  U34_GG(x3)
U20_GGA(x1, x2, x3, x4, x5)  =  U20_GGA(x5)
U21_GGA(x1, x2, x3, x4, x5)  =  U21_GGA(x2, x3, x5)
HIGHER_VALUED102_IN_GG(x1, x2)  =  HIGHER_VALUED102_IN_GG(x1, x2)
U35_GG(x1, x2, x3)  =  U35_GG(x3)
U22_GGA(x1, x2, x3, x4, x5)  =  U22_GGA(x5)
U23_GGA(x1, x2, x3, x4, x5)  =  U23_GGA(x2, x3, x5)
HIGHER_VALUED107_IN_GG(x1, x2)  =  HIGHER_VALUED107_IN_GG(x1, x2)
U36_GG(x1, x2, x3)  =  U36_GG(x3)
U24_GGA(x1, x2, x3, x4, x5)  =  U24_GGA(x5)
U25_GGA(x1, x2, x3, x4, x5)  =  U25_GGA(x2, x3, x5)
HIGHER_VALUED112_IN_GG(x1, x2)  =  HIGHER_VALUED112_IN_GG(x1, x2)
U37_GG(x1, x2, x3)  =  U37_GG(x3)
U26_GGA(x1, x2, x3, x4, x5)  =  U26_GGA(x5)
U27_GGA(x1, x2, x3, x4, x5)  =  U27_GGA(x2, x3, x5)
HIGHER_VALUED118_IN_GG(x1, x2)  =  HIGHER_VALUED118_IN_GG(x1, x2)
U38_GG(x1, x2, x3)  =  U38_GG(x3)
U28_GGA(x1, x2, x3, x4, x5)  =  U28_GGA(x5)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x4)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x4)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x4)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x4)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x4)
U8_GAA(x1, x2, x3, x4)  =  U8_GAA(x4)
U9_GAA(x1, x2, x3, x4, x5)  =  U9_GAA(x2, x5)
GREATER64_IN_GA(x1, x2)  =  GREATER64_IN_GA(x1)
U29_GA(x1, x2, x3)  =  U29_GA(x3)
U10_GAA(x1, x2, x3, x4, x5)  =  U10_GAA(x5)
U11_GAA(x1, x2, x3, x4, x5)  =  U11_GAA(x2, x5)
U12_GAA(x1, x2, x3, x4, x5)  =  U12_GAA(x5)
U13_GAA(x1, x2, x3, x4, x5)  =  U13_GAA(x2, x5)
HIGHER_VALUED82_IN_AG(x1, x2)  =  HIGHER_VALUED82_IN_AG(x2)
U31_AG(x1, x2, x3)  =  U31_AG(x3)
U14_GAA(x1, x2, x3, x4, x5)  =  U14_GAA(x5)
U15_GAA(x1, x2, x3, x4, x5)  =  U15_GAA(x2, x5)
HIGHER_VALUED87_IN_AG(x1, x2)  =  HIGHER_VALUED87_IN_AG(x2)
U32_AG(x1, x2, x3)  =  U32_AG(x3)
U16_GAA(x1, x2, x3, x4, x5)  =  U16_GAA(x5)
U17_GAA(x1, x2, x3, x4, x5)  =  U17_GAA(x2, x5)
HIGHER_VALUED92_IN_AG(x1, x2)  =  HIGHER_VALUED92_IN_AG(x2)
U33_AG(x1, x2, x3)  =  U33_AG(x3)
U18_GAA(x1, x2, x3, x4, x5)  =  U18_GAA(x5)
U19_GAA(x1, x2, x3, x4, x5)  =  U19_GAA(x2, x5)
HIGHER_VALUED97_IN_AG(x1, x2)  =  HIGHER_VALUED97_IN_AG(x2)
U34_AG(x1, x2, x3)  =  U34_AG(x3)
U20_GAA(x1, x2, x3, x4, x5)  =  U20_GAA(x5)
U21_GAA(x1, x2, x3, x4, x5)  =  U21_GAA(x2, x5)
HIGHER_VALUED102_IN_AG(x1, x2)  =  HIGHER_VALUED102_IN_AG(x2)
U35_AG(x1, x2, x3)  =  U35_AG(x3)
U22_GAA(x1, x2, x3, x4, x5)  =  U22_GAA(x5)
U23_GAA(x1, x2, x3, x4, x5)  =  U23_GAA(x2, x5)
HIGHER_VALUED107_IN_AG(x1, x2)  =  HIGHER_VALUED107_IN_AG(x2)
U36_AG(x1, x2, x3)  =  U36_AG(x3)
U24_GAA(x1, x2, x3, x4, x5)  =  U24_GAA(x5)
U25_GAA(x1, x2, x3, x4, x5)  =  U25_GAA(x2, x5)
HIGHER_VALUED112_IN_AG(x1, x2)  =  HIGHER_VALUED112_IN_AG(x2)
U37_AG(x1, x2, x3)  =  U37_AG(x3)
U26_GAA(x1, x2, x3, x4, x5)  =  U26_GAA(x5)
U27_GAA(x1, x2, x3, x4, x5)  =  U27_GAA(x2, x5)
HIGHER_VALUED118_IN_AG(x1, x2)  =  HIGHER_VALUED118_IN_AG(x2)
U38_AG(x1, x2, x3)  =  U38_AG(x3)
U28_GAA(x1, x2, x3, x4, x5)  =  U28_GAA(x5)
U40_GA(x1, x2, x3, x4)  =  U40_GA(x4)
U41_GA(x1, x2, x3, x4)  =  U41_GA(x4)
U42_GA(x1, x2, x3, x4)  =  U42_GA(x4)
U43_GA(x1, x2, x3, x4)  =  U43_GA(x4)
U44_GA(x1, x2, x3, x4)  =  U44_GA(x4)
U45_GA(x1, x2, x3, x4)  =  U45_GA(x4)
U46_GA(x1, x2, x3, x4)  =  U46_GA(x4)
U47_GA(x1, x2, x3, x4, x5)  =  U47_GA(x3, x5)
U48_GA(x1, x2, x3, x4, x5)  =  U48_GA(x5)
U49_GA(x1, x2, x3, x4, x5)  =  U49_GA(x3, x5)
U50_GA(x1, x2, x3, x4, x5)  =  U50_GA(x5)
U51_GA(x1, x2, x3, x4, x5)  =  U51_GA(x1, x3, x5)
U52_GA(x1, x2, x3, x4, x5)  =  U52_GA(x5)
U53_GA(x1, x2, x3, x4, x5)  =  U53_GA(x1, x3, x5)
U54_GA(x1, x2, x3, x4, x5)  =  U54_GA(x5)
U55_GA(x1, x2, x3, x4, x5)  =  U55_GA(x1, x3, x5)
U56_GA(x1, x2, x3, x4, x5)  =  U56_GA(x5)
U57_GA(x1, x2, x3, x4, x5)  =  U57_GA(x1, x3, x5)
U58_GA(x1, x2, x3, x4, x5)  =  U58_GA(x5)
U59_GA(x1, x2, x3, x4, x5)  =  U59_GA(x1, x3, x5)
U60_GA(x1, x2, x3, x4, x5)  =  U60_GA(x5)
U61_GA(x1, x2, x3, x4, x5)  =  U61_GA(x1, x3, x5)
U62_GA(x1, x2, x3, x4, x5)  =  U62_GA(x5)
U63_GA(x1, x2, x3, x4, x5)  =  U63_GA(x1, x3, x5)
U64_GA(x1, x2, x3, x4, x5)  =  U64_GA(x5)
U65_GA(x1, x2, x3, x4, x5)  =  U65_GA(x1, x3, x5)
U66_GA(x1, x2, x3, x4, x5)  =  U66_GA(x5)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)

The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)
GREATER64_IN_GA(x1, x2)  =  GREATER64_IN_GA(x1)

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:

GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)

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

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

(12) PiDPToQDPProof (SOUND 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:

GREATER64_IN_GA(s(T41)) → GREATER64_IN_GA(T41)

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:

  • GREATER64_IN_GA(s(T41)) → GREATER64_IN_GA(T41)
    The graph contains the following edges 1 > 1

(15) TRUE

(16) Obligation:

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

GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)

The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)
GREATER64_IN_AG(x1, x2)  =  GREATER64_IN_AG(x2)

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:

GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)

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

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:

GREATER64_IN_AG(s(T42)) → GREATER64_IN_AG(T42)

R is empty.
Q is empty.
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:

  • GREATER64_IN_AG(s(T42)) → GREATER64_IN_AG(T42)
    The graph contains the following edges 1 > 1

(22) TRUE

(23) Obligation:

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

GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)

The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)
GREATER64_IN_GG(x1, x2)  =  GREATER64_IN_GG(x1, x2)

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

(24) UsableRulesProof (EQUIVALENT transformation)

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

(25) Obligation:

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

GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)

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

(26) PiDPToQDPProof (EQUIVALENT transformation)

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

(27) Obligation:

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

GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)

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

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

  • GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
    The graph contains the following edges 1 > 1, 2 > 2

(29) TRUE

(30) Obligation:

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

MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)

The TRS R consists of the following rules:

max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)

The argument filtering Pi contains the following mapping:
max_valued1_in_ga(x1, x2)  =  max_valued1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
[]  =  []
max_valued1_out_ga(x1, x2)  =  max_valued1_out_ga
0  =  0
U39_ga(x1, x2, x3, x4)  =  U39_ga(x4)
max_valued3_in_gga(x1, x2, x3)  =  max_valued3_in_gga(x1, x2)
max_valued3_out_gga(x1, x2, x3)  =  max_valued3_out_gga
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
s(x1)  =  s(x1)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
U5_gga(x1, x2, x3, x4)  =  U5_gga(x4)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
U7_gga(x1, x2, x3, x4)  =  U7_gga(x4)
U8_gga(x1, x2, x3, x4)  =  U8_gga(x4)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x2, x5)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
max_valued3_in_gaa(x1, x2, x3)  =  max_valued3_in_gaa(x1)
max_valued3_out_gaa(x1, x2, x3)  =  max_valued3_out_gaa
U1_gaa(x1, x2, x3, x4)  =  U1_gaa(x4)
U11_gga(x1, x2, x3, x4, x5)  =  U11_gga(x2, x5)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
U12_gga(x1, x2, x3, x4, x5)  =  U12_gga(x5)
U2_gaa(x1, x2, x3, x4)  =  U2_gaa(x4)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x2, x3, x5)
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x5)
U15_gga(x1, x2, x3, x4, x5)  =  U15_gga(x2, x3, x5)
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x5)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x2, x3, x5)
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
U18_gga(x1, x2, x3, x4, x5)  =  U18_gga(x5)
U19_gga(x1, x2, x3, x4, x5)  =  U19_gga(x2, x3, x5)
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
U20_gga(x1, x2, x3, x4, x5)  =  U20_gga(x5)
U21_gga(x1, x2, x3, x4, x5)  =  U21_gga(x2, x3, x5)
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
U22_gga(x1, x2, x3, x4, x5)  =  U22_gga(x5)
U23_gga(x1, x2, x3, x4, x5)  =  U23_gga(x2, x3, x5)
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
U24_gga(x1, x2, x3, x4, x5)  =  U24_gga(x5)
U25_gga(x1, x2, x3, x4, x5)  =  U25_gga(x2, x3, x5)
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
U26_gga(x1, x2, x3, x4, x5)  =  U26_gga(x5)
U27_gga(x1, x2, x3, x4, x5)  =  U27_gga(x2, x3, x5)
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
U28_gga(x1, x2, x3, x4, x5)  =  U28_gga(x5)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x4)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x4)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x4)
U9_gaa(x1, x2, x3, x4, x5)  =  U9_gaa(x2, x5)
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
U10_gaa(x1, x2, x3, x4, x5)  =  U10_gaa(x5)
U11_gaa(x1, x2, x3, x4, x5)  =  U11_gaa(x2, x5)
U12_gaa(x1, x2, x3, x4, x5)  =  U12_gaa(x5)
U13_gaa(x1, x2, x3, x4, x5)  =  U13_gaa(x2, x5)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x5)
U15_gaa(x1, x2, x3, x4, x5)  =  U15_gaa(x2, x5)
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x5)
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x2, x5)
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
U18_gaa(x1, x2, x3, x4, x5)  =  U18_gaa(x5)
U19_gaa(x1, x2, x3, x4, x5)  =  U19_gaa(x2, x5)
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
U20_gaa(x1, x2, x3, x4, x5)  =  U20_gaa(x5)
U21_gaa(x1, x2, x3, x4, x5)  =  U21_gaa(x2, x5)
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
U22_gaa(x1, x2, x3, x4, x5)  =  U22_gaa(x5)
U23_gaa(x1, x2, x3, x4, x5)  =  U23_gaa(x2, x5)
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
U24_gaa(x1, x2, x3, x4, x5)  =  U24_gaa(x5)
U25_gaa(x1, x2, x3, x4, x5)  =  U25_gaa(x2, x5)
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
U26_gaa(x1, x2, x3, x4, x5)  =  U26_gaa(x5)
U27_gaa(x1, x2, x3, x4, x5)  =  U27_gaa(x2, x5)
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
U28_gaa(x1, x2, x3, x4, x5)  =  U28_gaa(x5)
U40_ga(x1, x2, x3, x4)  =  U40_ga(x4)
U41_ga(x1, x2, x3, x4)  =  U41_ga(x4)
U42_ga(x1, x2, x3, x4)  =  U42_ga(x4)
U43_ga(x1, x2, x3, x4)  =  U43_ga(x4)
U44_ga(x1, x2, x3, x4)  =  U44_ga(x4)
U45_ga(x1, x2, x3, x4)  =  U45_ga(x4)
U46_ga(x1, x2, x3, x4)  =  U46_ga(x4)
U47_ga(x1, x2, x3, x4, x5)  =  U47_ga(x3, x5)
U48_ga(x1, x2, x3, x4, x5)  =  U48_ga(x5)
U49_ga(x1, x2, x3, x4, x5)  =  U49_ga(x3, x5)
U50_ga(x1, x2, x3, x4, x5)  =  U50_ga(x5)
U51_ga(x1, x2, x3, x4, x5)  =  U51_ga(x1, x3, x5)
U52_ga(x1, x2, x3, x4, x5)  =  U52_ga(x5)
U53_ga(x1, x2, x3, x4, x5)  =  U53_ga(x1, x3, x5)
U54_ga(x1, x2, x3, x4, x5)  =  U54_ga(x5)
U55_ga(x1, x2, x3, x4, x5)  =  U55_ga(x1, x3, x5)
U56_ga(x1, x2, x3, x4, x5)  =  U56_ga(x5)
U57_ga(x1, x2, x3, x4, x5)  =  U57_ga(x1, x3, x5)
U58_ga(x1, x2, x3, x4, x5)  =  U58_ga(x5)
U59_ga(x1, x2, x3, x4, x5)  =  U59_ga(x1, x3, x5)
U60_ga(x1, x2, x3, x4, x5)  =  U60_ga(x5)
U61_ga(x1, x2, x3, x4, x5)  =  U61_ga(x1, x3, x5)
U62_ga(x1, x2, x3, x4, x5)  =  U62_ga(x5)
U63_ga(x1, x2, x3, x4, x5)  =  U63_ga(x1, x3, x5)
U64_ga(x1, x2, x3, x4, x5)  =  U64_ga(x5)
U65_ga(x1, x2, x3, x4, x5)  =  U65_ga(x1, x3, x5)
U66_ga(x1, x2, x3, x4, x5)  =  U66_ga(x5)
MAX_VALUED3_IN_GGA(x1, x2, x3)  =  MAX_VALUED3_IN_GGA(x1, x2)
U9_GGA(x1, x2, x3, x4, x5)  =  U9_GGA(x2, x5)
MAX_VALUED3_IN_GAA(x1, x2, x3)  =  MAX_VALUED3_IN_GAA(x1)
U11_GGA(x1, x2, x3, x4, x5)  =  U11_GGA(x2, x5)
U13_GGA(x1, x2, x3, x4, x5)  =  U13_GGA(x2, x3, x5)
U15_GGA(x1, x2, x3, x4, x5)  =  U15_GGA(x2, x3, x5)
U17_GGA(x1, x2, x3, x4, x5)  =  U17_GGA(x2, x3, x5)
U19_GGA(x1, x2, x3, x4, x5)  =  U19_GGA(x2, x3, x5)
U21_GGA(x1, x2, x3, x4, x5)  =  U21_GGA(x2, x3, x5)
U23_GGA(x1, x2, x3, x4, x5)  =  U23_GGA(x2, x3, x5)
U25_GGA(x1, x2, x3, x4, x5)  =  U25_GGA(x2, x3, x5)
U27_GGA(x1, x2, x3, x4, x5)  =  U27_GGA(x2, x3, x5)
U9_GAA(x1, x2, x3, x4, x5)  =  U9_GAA(x2, x5)
U11_GAA(x1, x2, x3, x4, x5)  =  U11_GAA(x2, x5)
U13_GAA(x1, x2, x3, x4, x5)  =  U13_GAA(x2, x5)
U15_GAA(x1, x2, x3, x4, x5)  =  U15_GAA(x2, x5)
U17_GAA(x1, x2, x3, x4, x5)  =  U17_GAA(x2, x5)
U19_GAA(x1, x2, x3, x4, x5)  =  U19_GAA(x2, x5)
U21_GAA(x1, x2, x3, x4, x5)  =  U21_GAA(x2, x5)
U23_GAA(x1, x2, x3, x4, x5)  =  U23_GAA(x2, x5)
U25_GAA(x1, x2, x3, x4, x5)  =  U25_GAA(x2, x5)
U27_GAA(x1, x2, x3, x4, x5)  =  U27_GAA(x2, x5)

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

(31) UsableRulesProof (EQUIVALENT transformation)

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

(32) Obligation:

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

MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)

The TRS R consists of the following rules:

greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
greater64_in_gg(x1, x2)  =  greater64_in_gg(x1, x2)
greater64_out_gg(x1, x2)  =  greater64_out_gg
U29_gg(x1, x2, x3)  =  U29_gg(x3)
higher_valued77_in_ag(x1, x2)  =  higher_valued77_in_ag(x2)
U30_ag(x1, x2, x3)  =  U30_ag(x3)
greater64_in_ag(x1, x2)  =  greater64_in_ag(x2)
greater64_out_ag(x1, x2)  =  greater64_out_ag
U29_ag(x1, x2, x3)  =  U29_ag(x3)
higher_valued77_out_ag(x1, x2)  =  higher_valued77_out_ag
higher_valued82_in_gg(x1, x2)  =  higher_valued82_in_gg(x1, x2)
U31_gg(x1, x2, x3)  =  U31_gg(x3)
higher_valued82_out_gg(x1, x2)  =  higher_valued82_out_gg
higher_valued87_in_gg(x1, x2)  =  higher_valued87_in_gg(x1, x2)
U32_gg(x1, x2, x3)  =  U32_gg(x3)
higher_valued87_out_gg(x1, x2)  =  higher_valued87_out_gg
higher_valued92_in_gg(x1, x2)  =  higher_valued92_in_gg(x1, x2)
U33_gg(x1, x2, x3)  =  U33_gg(x3)
higher_valued92_out_gg(x1, x2)  =  higher_valued92_out_gg
higher_valued97_in_gg(x1, x2)  =  higher_valued97_in_gg(x1, x2)
U34_gg(x1, x2, x3)  =  U34_gg(x3)
higher_valued97_out_gg(x1, x2)  =  higher_valued97_out_gg
higher_valued102_in_gg(x1, x2)  =  higher_valued102_in_gg(x1, x2)
U35_gg(x1, x2, x3)  =  U35_gg(x3)
higher_valued102_out_gg(x1, x2)  =  higher_valued102_out_gg
higher_valued107_in_gg(x1, x2)  =  higher_valued107_in_gg(x1, x2)
U36_gg(x1, x2, x3)  =  U36_gg(x3)
higher_valued107_out_gg(x1, x2)  =  higher_valued107_out_gg
higher_valued112_in_gg(x1, x2)  =  higher_valued112_in_gg(x1, x2)
U37_gg(x1, x2, x3)  =  U37_gg(x3)
higher_valued112_out_gg(x1, x2)  =  higher_valued112_out_gg
higher_valued118_in_gg(x1, x2)  =  higher_valued118_in_gg(x1, x2)
U38_gg(x1, x2, x3)  =  U38_gg(x3)
higher_valued118_out_gg(x1, x2)  =  higher_valued118_out_gg
greater64_in_ga(x1, x2)  =  greater64_in_ga(x1)
greater64_out_ga(x1, x2)  =  greater64_out_ga(x2)
U29_ga(x1, x2, x3)  =  U29_ga(x3)
higher_valued82_in_ag(x1, x2)  =  higher_valued82_in_ag(x2)
U31_ag(x1, x2, x3)  =  U31_ag(x3)
higher_valued82_out_ag(x1, x2)  =  higher_valued82_out_ag
higher_valued87_in_ag(x1, x2)  =  higher_valued87_in_ag(x2)
U32_ag(x1, x2, x3)  =  U32_ag(x3)
higher_valued87_out_ag(x1, x2)  =  higher_valued87_out_ag
higher_valued92_in_ag(x1, x2)  =  higher_valued92_in_ag(x2)
U33_ag(x1, x2, x3)  =  U33_ag(x3)
higher_valued92_out_ag(x1, x2)  =  higher_valued92_out_ag
higher_valued97_in_ag(x1, x2)  =  higher_valued97_in_ag(x2)
U34_ag(x1, x2, x3)  =  U34_ag(x3)
higher_valued97_out_ag(x1, x2)  =  higher_valued97_out_ag
higher_valued102_in_ag(x1, x2)  =  higher_valued102_in_ag(x2)
U35_ag(x1, x2, x3)  =  U35_ag(x3)
higher_valued102_out_ag(x1, x2)  =  higher_valued102_out_ag
higher_valued107_in_ag(x1, x2)  =  higher_valued107_in_ag(x2)
U36_ag(x1, x2, x3)  =  U36_ag(x3)
higher_valued107_out_ag(x1, x2)  =  higher_valued107_out_ag
higher_valued112_in_ag(x1, x2)  =  higher_valued112_in_ag(x2)
U37_ag(x1, x2, x3)  =  U37_ag(x3)
higher_valued112_out_ag(x1, x2)  =  higher_valued112_out_ag
higher_valued118_in_ag(x1, x2)  =  higher_valued118_in_ag(x2)
U38_ag(x1, x2, x3)  =  U38_ag(x3)
higher_valued118_out_ag(x1, x2)  =  higher_valued118_out_ag
MAX_VALUED3_IN_GGA(x1, x2, x3)  =  MAX_VALUED3_IN_GGA(x1, x2)
U9_GGA(x1, x2, x3, x4, x5)  =  U9_GGA(x2, x5)
MAX_VALUED3_IN_GAA(x1, x2, x3)  =  MAX_VALUED3_IN_GAA(x1)
U11_GGA(x1, x2, x3, x4, x5)  =  U11_GGA(x2, x5)
U13_GGA(x1, x2, x3, x4, x5)  =  U13_GGA(x2, x3, x5)
U15_GGA(x1, x2, x3, x4, x5)  =  U15_GGA(x2, x3, x5)
U17_GGA(x1, x2, x3, x4, x5)  =  U17_GGA(x2, x3, x5)
U19_GGA(x1, x2, x3, x4, x5)  =  U19_GGA(x2, x3, x5)
U21_GGA(x1, x2, x3, x4, x5)  =  U21_GGA(x2, x3, x5)
U23_GGA(x1, x2, x3, x4, x5)  =  U23_GGA(x2, x3, x5)
U25_GGA(x1, x2, x3, x4, x5)  =  U25_GGA(x2, x3, x5)
U27_GGA(x1, x2, x3, x4, x5)  =  U27_GGA(x2, x3, x5)
U9_GAA(x1, x2, x3, x4, x5)  =  U9_GAA(x2, x5)
U11_GAA(x1, x2, x3, x4, x5)  =  U11_GAA(x2, x5)
U13_GAA(x1, x2, x3, x4, x5)  =  U13_GAA(x2, x5)
U15_GAA(x1, x2, x3, x4, x5)  =  U15_GAA(x2, x5)
U17_GAA(x1, x2, x3, x4, x5)  =  U17_GAA(x2, x5)
U19_GAA(x1, x2, x3, x4, x5)  =  U19_GAA(x2, x5)
U21_GAA(x1, x2, x3, x4, x5)  =  U21_GAA(x2, x5)
U23_GAA(x1, x2, x3, x4, x5)  =  U23_GAA(x2, x5)
U25_GAA(x1, x2, x3, x4, x5)  =  U25_GAA(x2, x5)
U27_GAA(x1, x2, x3, x4, x5)  =  U27_GAA(x2, x5)

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

(33) PiDPToQDPProof (SOUND transformation)

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

(34) Obligation:

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

MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0))) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0)))) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0)))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0)))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38))))))))) → U9_GGA(T9, greater64_in_gg(T37, T38))
U9_GGA(T9, greater64_out_gg) → MAX_VALUED3_IN_GAA(T9)
MAX_VALUED3_IN_GAA(.(s(T18), T9)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45)))))))) → U11_GGA(T44, higher_valued77_in_ag(T43))
U11_GGA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54))))))) → U13_GGA(T53, T54, higher_valued82_in_gg(T54, T52))
U13_GGA(T53, T54, higher_valued82_out_gg) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61)))))) → U15_GGA(T60, T61, higher_valued87_in_gg(T61, T59))
U15_GGA(T60, T61, higher_valued87_out_gg) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68))))) → U17_GGA(T67, T68, higher_valued92_in_gg(T68, T66))
U17_GGA(T67, T68, higher_valued92_out_gg) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75)))) → U19_GGA(T74, T75, higher_valued97_in_gg(T75, T73))
U19_GGA(T74, T75, higher_valued97_out_gg) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82))) → U21_GGA(T81, T82, higher_valued102_in_gg(T82, T80))
U21_GGA(T81, T82, higher_valued102_out_gg) → MAX_VALUED3_IN_GGA(T81, s(s(T82)))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89)) → U23_GGA(T88, T89, higher_valued107_in_gg(T89, T87))
U23_GGA(T88, T89, higher_valued107_out_gg) → MAX_VALUED3_IN_GGA(T88, s(T89))
MAX_VALUED3_IN_GGA(.(T94, T95), T96) → U25_GGA(T95, T96, higher_valued112_in_gg(T96, T94))
U25_GGA(T95, T96, higher_valued112_out_gg) → MAX_VALUED3_IN_GGA(T95, T96)
MAX_VALUED3_IN_GGA(.(T15, T9), 0) → MAX_VALUED3_IN_GGA(T9, T15)
MAX_VALUED3_IN_GGA(.(T101, T102), T103) → U27_GGA(T102, T103, higher_valued118_in_gg(T103, T101))
U27_GGA(T102, T103, higher_valued118_out_gg) → MAX_VALUED3_IN_GGA(T102, T103)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9)) → U9_GAA(T9, greater64_in_ga(T37))
U9_GAA(T9, greater64_out_ga(T38)) → MAX_VALUED3_IN_GAA(T9)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44)) → U11_GAA(T44, higher_valued77_in_ag(T43))
U11_GAA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53)) → U13_GAA(T53, higher_valued82_in_ag(T52))
U13_GAA(T53, higher_valued82_out_ag) → MAX_VALUED3_IN_GAA(T53)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60)) → U15_GAA(T60, higher_valued87_in_ag(T59))
U15_GAA(T60, higher_valued87_out_ag) → MAX_VALUED3_IN_GAA(T60)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67)) → U17_GAA(T67, higher_valued92_in_ag(T66))
U17_GAA(T67, higher_valued92_out_ag) → MAX_VALUED3_IN_GAA(T67)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74)) → U19_GAA(T74, higher_valued97_in_ag(T73))
U19_GAA(T74, higher_valued97_out_ag) → MAX_VALUED3_IN_GAA(T74)
MAX_VALUED3_IN_GAA(.(s(T80), T81)) → U21_GAA(T81, higher_valued102_in_ag(T80))
U21_GAA(T81, higher_valued102_out_ag) → MAX_VALUED3_IN_GAA(T81)
MAX_VALUED3_IN_GAA(.(T87, T88)) → U23_GAA(T88, higher_valued107_in_ag(T87))
U23_GAA(T88, higher_valued107_out_ag) → MAX_VALUED3_IN_GAA(T88)
MAX_VALUED3_IN_GAA(.(T94, T95)) → U25_GAA(T95, higher_valued112_in_ag(T94))
U25_GAA(T95, higher_valued112_out_ag) → MAX_VALUED3_IN_GAA(T95)
MAX_VALUED3_IN_GAA(.(T15, T9)) → MAX_VALUED3_IN_GGA(T9, T15)
MAX_VALUED3_IN_GAA(.(T101, T102)) → U27_GAA(T102, higher_valued118_in_ag(T101))
U27_GAA(T102, higher_valued118_out_ag) → MAX_VALUED3_IN_GAA(T102)

The TRS R consists of the following rules:

greater64_in_gg(s(T40), 0) → greater64_out_gg
greater64_in_gg(s(T41), s(T42)) → U29_gg(greater64_in_gg(T41, T42))
higher_valued77_in_ag(T51) → U30_ag(greater64_in_ag(s(s(s(s(s(s(T51))))))))
higher_valued82_in_gg(T57, T58) → U31_gg(greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_gg(T64, T65) → U32_gg(greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_gg(T71, T72) → U33_gg(greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_gg(T78, T79) → U34_gg(greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_gg(T85, T86) → U35_gg(greater64_in_gg(s(s(s(T85))), s(T86)))
higher_valued107_in_gg(T92, T93) → U36_gg(greater64_in_gg(s(s(T92)), T93))
higher_valued112_in_gg(T99, T100) → U37_gg(greater64_in_gg(s(T99), T100))
higher_valued118_in_gg(T106, T107) → U38_gg(greater64_in_gg(s(T106), T107))
greater64_in_ga(s(T40)) → greater64_out_ga(0)
greater64_in_ga(s(T41)) → U29_ga(greater64_in_ga(T41))
higher_valued82_in_ag(T58) → U31_ag(greater64_in_ag(s(s(s(s(s(T58)))))))
higher_valued87_in_ag(T65) → U32_ag(greater64_in_ag(s(s(s(s(T65))))))
higher_valued92_in_ag(T72) → U33_ag(greater64_in_ag(s(s(s(T72)))))
higher_valued97_in_ag(T79) → U34_ag(greater64_in_ag(s(s(T79))))
higher_valued102_in_ag(T86) → U35_ag(greater64_in_ag(s(T86)))
higher_valued107_in_ag(T93) → U36_ag(greater64_in_ag(T93))
higher_valued112_in_ag(T100) → U37_ag(greater64_in_ag(T100))
higher_valued118_in_ag(T107) → U38_ag(greater64_in_ag(T107))
U29_gg(greater64_out_gg) → greater64_out_gg
U30_ag(greater64_out_ag) → higher_valued77_out_ag
U31_gg(greater64_out_gg) → higher_valued82_out_gg
U32_gg(greater64_out_gg) → higher_valued87_out_gg
U33_gg(greater64_out_gg) → higher_valued92_out_gg
U34_gg(greater64_out_gg) → higher_valued97_out_gg
U35_gg(greater64_out_gg) → higher_valued102_out_gg
U36_gg(greater64_out_gg) → higher_valued107_out_gg
U37_gg(greater64_out_gg) → higher_valued112_out_gg
U38_gg(greater64_out_gg) → higher_valued118_out_gg
U29_ga(greater64_out_ga(T42)) → greater64_out_ga(s(T42))
U31_ag(greater64_out_ag) → higher_valued82_out_ag
U32_ag(greater64_out_ag) → higher_valued87_out_ag
U33_ag(greater64_out_ag) → higher_valued92_out_ag
U34_ag(greater64_out_ag) → higher_valued97_out_ag
U35_ag(greater64_out_ag) → higher_valued102_out_ag
U36_ag(greater64_out_ag) → higher_valued107_out_ag
U37_ag(greater64_out_ag) → higher_valued112_out_ag
U38_ag(greater64_out_ag) → higher_valued118_out_ag
greater64_in_ag(s(T42)) → U29_ag(greater64_in_ag(T42))
greater64_in_ag(0) → greater64_out_ag
U29_ag(greater64_out_ag) → greater64_out_ag

The set Q consists of the following terms:

greater64_in_gg(x0, x1)
higher_valued77_in_ag(x0)
higher_valued82_in_gg(x0, x1)
higher_valued87_in_gg(x0, x1)
higher_valued92_in_gg(x0, x1)
higher_valued97_in_gg(x0, x1)
higher_valued102_in_gg(x0, x1)
higher_valued107_in_gg(x0, x1)
higher_valued112_in_gg(x0, x1)
higher_valued118_in_gg(x0, x1)
greater64_in_ga(x0)
higher_valued82_in_ag(x0)
higher_valued87_in_ag(x0)
higher_valued92_in_ag(x0)
higher_valued97_in_ag(x0)
higher_valued102_in_ag(x0)
higher_valued107_in_ag(x0)
higher_valued112_in_ag(x0)
higher_valued118_in_ag(x0)
U29_gg(x0)
U30_ag(x0)
U31_gg(x0)
U32_gg(x0)
U33_gg(x0)
U34_gg(x0)
U35_gg(x0)
U36_gg(x0)
U37_gg(x0)
U38_gg(x0)
U29_ga(x0)
U31_ag(x0)
U32_ag(x0)
U33_ag(x0)
U34_ag(x0)
U35_ag(x0)
U36_ag(x0)
U37_ag(x0)
U38_ag(x0)
greater64_in_ag(x0)
U29_ag(x0)

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

(35) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0))) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0)))) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0)))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0)))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38))))))))) → U9_GGA(T9, greater64_in_gg(T37, T38))
MAX_VALUED3_IN_GAA(.(s(T18), T9)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45)))))))) → U11_GGA(T44, higher_valued77_in_ag(T43))
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54))))))) → U13_GGA(T53, T54, higher_valued82_in_gg(T54, T52))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61)))))) → U15_GGA(T60, T61, higher_valued87_in_gg(T61, T59))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68))))) → U17_GGA(T67, T68, higher_valued92_in_gg(T68, T66))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75)))) → U19_GGA(T74, T75, higher_valued97_in_gg(T75, T73))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82))) → U21_GGA(T81, T82, higher_valued102_in_gg(T82, T80))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89)) → U23_GGA(T88, T89, higher_valued107_in_gg(T89, T87))
MAX_VALUED3_IN_GGA(.(T94, T95), T96) → U25_GGA(T95, T96, higher_valued112_in_gg(T96, T94))
MAX_VALUED3_IN_GGA(.(T15, T9), 0) → MAX_VALUED3_IN_GGA(T9, T15)
U27_GGA(T102, T103, higher_valued118_out_gg) → MAX_VALUED3_IN_GGA(T102, T103)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
U9_GAA(T9, greater64_out_ga(T38)) → MAX_VALUED3_IN_GAA(T9)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44)) → U11_GAA(T44, higher_valued77_in_ag(T43))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53)) → U13_GAA(T53, higher_valued82_in_ag(T52))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60)) → U15_GAA(T60, higher_valued87_in_ag(T59))
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67)) → U17_GAA(T67, higher_valued92_in_ag(T66))
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74)) → U19_GAA(T74, higher_valued97_in_ag(T73))
MAX_VALUED3_IN_GAA(.(s(T80), T81)) → U21_GAA(T81, higher_valued102_in_ag(T80))
MAX_VALUED3_IN_GAA(.(T87, T88)) → U23_GAA(T88, higher_valued107_in_ag(T87))
MAX_VALUED3_IN_GAA(.(T94, T95)) → U25_GAA(T95, higher_valued112_in_ag(T94))
MAX_VALUED3_IN_GAA(.(T15, T9)) → MAX_VALUED3_IN_GGA(T9, T15)
MAX_VALUED3_IN_GAA(.(T101, T102)) → U27_GAA(T102, higher_valued118_in_ag(T101))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(MAX_VALUED3_IN_GAA(x1)) = x1   
POL(MAX_VALUED3_IN_GGA(x1, x2)) = x1   
POL(U11_GAA(x1, x2)) = x1   
POL(U11_GGA(x1, x2)) = x1   
POL(U13_GAA(x1, x2)) = x1   
POL(U13_GGA(x1, x2, x3)) = x1   
POL(U15_GAA(x1, x2)) = x1   
POL(U15_GGA(x1, x2, x3)) = x1   
POL(U17_GAA(x1, x2)) = x1   
POL(U17_GGA(x1, x2, x3)) = x1   
POL(U19_GAA(x1, x2)) = x1   
POL(U19_GGA(x1, x2, x3)) = x1   
POL(U21_GAA(x1, x2)) = x1   
POL(U21_GGA(x1, x2, x3)) = x1   
POL(U23_GAA(x1, x2)) = x1   
POL(U23_GGA(x1, x2, x3)) = x1   
POL(U25_GAA(x1, x2)) = x1   
POL(U25_GGA(x1, x2, x3)) = x1   
POL(U27_GAA(x1, x2)) = x1   
POL(U27_GGA(x1, x2, x3)) = 1 + x1   
POL(U29_ag(x1)) = 0   
POL(U29_ga(x1)) = 0   
POL(U29_gg(x1)) = 0   
POL(U30_ag(x1)) = 0   
POL(U31_ag(x1)) = 0   
POL(U31_gg(x1)) = 0   
POL(U32_ag(x1)) = 0   
POL(U32_gg(x1)) = 0   
POL(U33_ag(x1)) = 0   
POL(U33_gg(x1)) = 0   
POL(U34_ag(x1)) = 0   
POL(U34_gg(x1)) = 1   
POL(U35_ag(x1)) = 0   
POL(U35_gg(x1)) = 0   
POL(U36_ag(x1)) = 0   
POL(U36_gg(x1)) = 0   
POL(U37_ag(x1)) = 0   
POL(U37_gg(x1)) = 0   
POL(U38_ag(x1)) = 0   
POL(U38_gg(x1)) = 1   
POL(U9_GAA(x1, x2)) = 1 + x1   
POL(U9_GGA(x1, x2)) = x1   
POL(greater64_in_ag(x1)) = 1   
POL(greater64_in_ga(x1)) = 0   
POL(greater64_in_gg(x1, x2)) = 0   
POL(greater64_out_ag) = 0   
POL(greater64_out_ga(x1)) = 0   
POL(greater64_out_gg) = 0   
POL(higher_valued102_in_ag(x1)) = 0   
POL(higher_valued102_in_gg(x1, x2)) = 0   
POL(higher_valued102_out_ag) = 0   
POL(higher_valued102_out_gg) = 0   
POL(higher_valued107_in_ag(x1)) = x1   
POL(higher_valued107_in_gg(x1, x2)) = 0   
POL(higher_valued107_out_ag) = 0   
POL(higher_valued107_out_gg) = 0   
POL(higher_valued112_in_ag(x1)) = 0   
POL(higher_valued112_in_gg(x1, x2)) = 0   
POL(higher_valued112_out_ag) = 0   
POL(higher_valued112_out_gg) = 0   
POL(higher_valued118_in_ag(x1)) = 0   
POL(higher_valued118_in_gg(x1, x2)) = 1   
POL(higher_valued118_out_ag) = 0   
POL(higher_valued118_out_gg) = 1   
POL(higher_valued77_in_ag(x1)) = 0   
POL(higher_valued77_out_ag) = 0   
POL(higher_valued82_in_ag(x1)) = 0   
POL(higher_valued82_in_gg(x1, x2)) = 0   
POL(higher_valued82_out_ag) = 0   
POL(higher_valued82_out_gg) = 0   
POL(higher_valued87_in_ag(x1)) = 0   
POL(higher_valued87_in_gg(x1, x2)) = 1 + x2   
POL(higher_valued87_out_ag) = 0   
POL(higher_valued87_out_gg) = 0   
POL(higher_valued92_in_ag(x1)) = 0   
POL(higher_valued92_in_gg(x1, x2)) = 0   
POL(higher_valued92_out_ag) = 0   
POL(higher_valued92_out_gg) = 0   
POL(higher_valued97_in_ag(x1)) = 0   
POL(higher_valued97_in_gg(x1, x2)) = 1 + x2   
POL(higher_valued97_out_ag) = 0   
POL(higher_valued97_out_gg) = 0   
POL(s(x1)) = 0   

The following usable rules [FROCOS05] were oriented: none

(36) Obligation:

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

U9_GGA(T9, greater64_out_gg) → MAX_VALUED3_IN_GAA(T9)
U11_GGA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
U13_GGA(T53, T54, higher_valued82_out_gg) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))))
U15_GGA(T60, T61, higher_valued87_out_gg) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))))
U17_GGA(T67, T68, higher_valued92_out_gg) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))))
U19_GGA(T74, T75, higher_valued97_out_gg) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))))
U21_GGA(T81, T82, higher_valued102_out_gg) → MAX_VALUED3_IN_GGA(T81, s(s(T82)))
U23_GGA(T88, T89, higher_valued107_out_gg) → MAX_VALUED3_IN_GGA(T88, s(T89))
U25_GGA(T95, T96, higher_valued112_out_gg) → MAX_VALUED3_IN_GGA(T95, T96)
MAX_VALUED3_IN_GGA(.(T101, T102), T103) → U27_GGA(T102, T103, higher_valued118_in_gg(T103, T101))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9)) → U9_GAA(T9, greater64_in_ga(T37))
U11_GAA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
U13_GAA(T53, higher_valued82_out_ag) → MAX_VALUED3_IN_GAA(T53)
U15_GAA(T60, higher_valued87_out_ag) → MAX_VALUED3_IN_GAA(T60)
U17_GAA(T67, higher_valued92_out_ag) → MAX_VALUED3_IN_GAA(T67)
U19_GAA(T74, higher_valued97_out_ag) → MAX_VALUED3_IN_GAA(T74)
U21_GAA(T81, higher_valued102_out_ag) → MAX_VALUED3_IN_GAA(T81)
U23_GAA(T88, higher_valued107_out_ag) → MAX_VALUED3_IN_GAA(T88)
U25_GAA(T95, higher_valued112_out_ag) → MAX_VALUED3_IN_GAA(T95)
U27_GAA(T102, higher_valued118_out_ag) → MAX_VALUED3_IN_GAA(T102)

The TRS R consists of the following rules:

greater64_in_gg(s(T40), 0) → greater64_out_gg
greater64_in_gg(s(T41), s(T42)) → U29_gg(greater64_in_gg(T41, T42))
higher_valued77_in_ag(T51) → U30_ag(greater64_in_ag(s(s(s(s(s(s(T51))))))))
higher_valued82_in_gg(T57, T58) → U31_gg(greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_gg(T64, T65) → U32_gg(greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_gg(T71, T72) → U33_gg(greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_gg(T78, T79) → U34_gg(greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_gg(T85, T86) → U35_gg(greater64_in_gg(s(s(s(T85))), s(T86)))
higher_valued107_in_gg(T92, T93) → U36_gg(greater64_in_gg(s(s(T92)), T93))
higher_valued112_in_gg(T99, T100) → U37_gg(greater64_in_gg(s(T99), T100))
higher_valued118_in_gg(T106, T107) → U38_gg(greater64_in_gg(s(T106), T107))
greater64_in_ga(s(T40)) → greater64_out_ga(0)
greater64_in_ga(s(T41)) → U29_ga(greater64_in_ga(T41))
higher_valued82_in_ag(T58) → U31_ag(greater64_in_ag(s(s(s(s(s(T58)))))))
higher_valued87_in_ag(T65) → U32_ag(greater64_in_ag(s(s(s(s(T65))))))
higher_valued92_in_ag(T72) → U33_ag(greater64_in_ag(s(s(s(T72)))))
higher_valued97_in_ag(T79) → U34_ag(greater64_in_ag(s(s(T79))))
higher_valued102_in_ag(T86) → U35_ag(greater64_in_ag(s(T86)))
higher_valued107_in_ag(T93) → U36_ag(greater64_in_ag(T93))
higher_valued112_in_ag(T100) → U37_ag(greater64_in_ag(T100))
higher_valued118_in_ag(T107) → U38_ag(greater64_in_ag(T107))
U29_gg(greater64_out_gg) → greater64_out_gg
U30_ag(greater64_out_ag) → higher_valued77_out_ag
U31_gg(greater64_out_gg) → higher_valued82_out_gg
U32_gg(greater64_out_gg) → higher_valued87_out_gg
U33_gg(greater64_out_gg) → higher_valued92_out_gg
U34_gg(greater64_out_gg) → higher_valued97_out_gg
U35_gg(greater64_out_gg) → higher_valued102_out_gg
U36_gg(greater64_out_gg) → higher_valued107_out_gg
U37_gg(greater64_out_gg) → higher_valued112_out_gg
U38_gg(greater64_out_gg) → higher_valued118_out_gg
U29_ga(greater64_out_ga(T42)) → greater64_out_ga(s(T42))
U31_ag(greater64_out_ag) → higher_valued82_out_ag
U32_ag(greater64_out_ag) → higher_valued87_out_ag
U33_ag(greater64_out_ag) → higher_valued92_out_ag
U34_ag(greater64_out_ag) → higher_valued97_out_ag
U35_ag(greater64_out_ag) → higher_valued102_out_ag
U36_ag(greater64_out_ag) → higher_valued107_out_ag
U37_ag(greater64_out_ag) → higher_valued112_out_ag
U38_ag(greater64_out_ag) → higher_valued118_out_ag
greater64_in_ag(s(T42)) → U29_ag(greater64_in_ag(T42))
greater64_in_ag(0) → greater64_out_ag
U29_ag(greater64_out_ag) → greater64_out_ag

The set Q consists of the following terms:

greater64_in_gg(x0, x1)
higher_valued77_in_ag(x0)
higher_valued82_in_gg(x0, x1)
higher_valued87_in_gg(x0, x1)
higher_valued92_in_gg(x0, x1)
higher_valued97_in_gg(x0, x1)
higher_valued102_in_gg(x0, x1)
higher_valued107_in_gg(x0, x1)
higher_valued112_in_gg(x0, x1)
higher_valued118_in_gg(x0, x1)
greater64_in_ga(x0)
higher_valued82_in_ag(x0)
higher_valued87_in_ag(x0)
higher_valued92_in_ag(x0)
higher_valued97_in_ag(x0)
higher_valued102_in_ag(x0)
higher_valued107_in_ag(x0)
higher_valued112_in_ag(x0)
higher_valued118_in_ag(x0)
U29_gg(x0)
U30_ag(x0)
U31_gg(x0)
U32_gg(x0)
U33_gg(x0)
U34_gg(x0)
U35_gg(x0)
U36_gg(x0)
U37_gg(x0)
U38_gg(x0)
U29_ga(x0)
U31_ag(x0)
U32_ag(x0)
U33_ag(x0)
U34_ag(x0)
U35_ag(x0)
U36_ag(x0)
U37_ag(x0)
U38_ag(x0)
greater64_in_ag(x0)
U29_ag(x0)

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

(37) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 20 less nodes.

(38) TRUE