0 Prolog
↳1 PrologToPiTRSProof (⇐)
↳2 PiTRS
↳3 DependencyPairsProof (⇔)
↳4 PiDP
↳5 DependencyGraphProof (⇔)
↳6 PiDP
↳7 UsableRulesProof (⇔)
↳8 PiDP
↳9 PiDPToQDPProof (⇐)
↳10 QDP
↳11 PrologToPiTRSProof (⇐)
↳12 PiTRS
↳13 DependencyPairsProof (⇔)
↳14 PiDP
↳15 DependencyGraphProof (⇔)
↳16 PiDP
↳17 UsableRulesProof (⇔)
↳18 PiDP
↳19 PiDPToQDPProof (⇐)
↳20 QDP
↳21 QDPSizeChangeProof (⇔)
↳22 TRUE
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
BALANCE_IN_GA(T, TB) → BALANCE_IN_GAAAA(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
BALANCE_IN_GA(T, TB) → BALANCE_IN_GAAAA(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U2_GAAAA(L, V, R, balance_out_gaaaa(L)) → BALANCE_IN_GAAAA(R)
BALANCE_IN_GAAAA(tree(L, V, R)) → U2_GAAAA(L, V, R, balance_in_gaaaa(L))
BALANCE_IN_GAAAA(tree(L, V, R)) → BALANCE_IN_GAAAA(L)
balance_in_gaaaa(nil) → balance_out_gaaaa(nil)
balance_in_gaaaa(tree(L, V, R)) → U2_gaaaa(L, V, R, balance_in_gaaaa(L))
U2_gaaaa(L, V, R, balance_out_gaaaa(L)) → U3_gaaaa(L, V, R, balance_in_gaaaa(R))
U3_gaaaa(L, V, R, balance_out_gaaaa(R)) → balance_out_gaaaa(tree(L, V, R))
balance_in_gaaaa(x0)
U2_gaaaa(x0, x1, x2, x3)
U3_gaaaa(x0, x1, x2, x3)
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
BALANCE_IN_GA(T, TB) → BALANCE_IN_GAAAA(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
BALANCE_IN_GA(T, TB) → BALANCE_IN_GAAAA(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
balance_in_ga(T, TB) → U1_ga(T, TB, balance_in_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1_ga(T, TB, balance_out_gaaaa(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out_ga(T, TB)
U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN_GAAAA(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_GAAAA(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN_GAAAA(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN_GAAAA(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
balance_in_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out_gaaaa(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
balance_in_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U2_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3_gaaaa(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out_gaaaa(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out_gaaaa(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U2_GAAAA(R, balance_out_gaaaa) → BALANCE_IN_GAAAA(R)
BALANCE_IN_GAAAA(tree(L, V, R)) → U2_GAAAA(R, balance_in_gaaaa(L))
BALANCE_IN_GAAAA(tree(L, V, R)) → BALANCE_IN_GAAAA(L)
balance_in_gaaaa(nil) → balance_out_gaaaa
balance_in_gaaaa(tree(L, V, R)) → U2_gaaaa(R, balance_in_gaaaa(L))
U2_gaaaa(R, balance_out_gaaaa) → U3_gaaaa(balance_in_gaaaa(R))
U3_gaaaa(balance_out_gaaaa) → balance_out_gaaaa
balance_in_gaaaa(x0)
U2_gaaaa(x0, x1)
U3_gaaaa(x0)
From the DPs we obtained the following set of size-change graphs: