0 Prolog
↳1 PrologToPiTRSProof (⇐)
↳2 PiTRS
↳3 DependencyPairsProof (⇔)
↳4 PiDP
↳5 DependencyGraphProof (⇔)
↳6 AND
↳7 PiDP
↳8 UsableRulesProof (⇔)
↳9 PiDP
↳10 PiDPToQDPProof (⇐)
↳11 QDP
↳12 QDPSizeChangeProof (⇔)
↳13 TRUE
↳14 PiDP
↳15 UsableRulesProof (⇔)
↳16 PiDP
↳17 PiDPToQDPProof (⇐)
↳18 QDP
↳19 PrologToPiTRSProof (⇐)
↳20 PiTRS
↳21 DependencyPairsProof (⇔)
↳22 PiDP
↳23 DependencyGraphProof (⇔)
↳24 AND
↳25 PiDP
↳26 UsableRulesProof (⇔)
↳27 PiDP
↳28 PiDPToQDPProof (⇐)
↳29 QDP
↳30 QDPSizeChangeProof (⇔)
↳31 TRUE
↳32 PiDP
↳33 UsableRulesProof (⇔)
↳34 PiDP
↳35 PiDPToQDPProof (⇐)
↳36 QDP
↳37 QDPSizeChangeProof (⇔)
↳38 TRUE
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
BALANCE_IN_GA(T, TB) → BALANCE55_IN_GAAGAGAAAG(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
BALANCE_IN_GA(T, TB) → BALANCE55_IN_GAAGAGAAAG(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_GAAAAAAAAA(L, V, R, balance55_out_gaaaaaaaaa(L)) → BALANCE55_IN_GAAAAAAAAA(R)
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → U2_GAAAAAAAAA(L, V, R, balance55_in_gaaaaaaaaa(L))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → BALANCE55_IN_GAAAAAAAAA(L)
balance55_in_gaaaaaaaaa(nil) → balance55_out_gaaaaaaaaa(nil)
balance55_in_gaaaaaaaaa(tree(L, V, R)) → U2_gaaaaaaaaa(L, V, R, balance55_in_gaaaaaaaaa(L))
U2_gaaaaaaaaa(L, V, R, balance55_out_gaaaaaaaaa(L)) → U3_gaaaaaaaaa(L, V, R, balance55_in_gaaaaaaaaa(R))
U3_gaaaaaaaaa(L, V, R, balance55_out_gaaaaaaaaa(R)) → balance55_out_gaaaaaaaaa(tree(L, V, R))
balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1, x2, x3)
U3_gaaaaaaaaa(x0, x1, x2, x3)
From the DPs we obtained the following set of size-change graphs:
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_GAAGAGAAAG(L, V, R, NT, TR, IT, balance55_out_gaaaaaaaaa(L)) → BALANCE55_IN_GAAGAGAAAG(R, NT, TR, IT)
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), NT, TR, IT) → U2_GAAGAGAAAG(L, V, R, NT, TR, IT, balance55_in_gaaaaaaaaa(L))
balance55_in_gaaaaaaaaa(nil) → balance55_out_gaaaaaaaaa(nil)
balance55_in_gaaaaaaaaa(tree(L, V, R)) → U2_gaaaaaaaaa(L, V, R, balance55_in_gaaaaaaaaa(L))
U2_gaaaaaaaaa(L, V, R, balance55_out_gaaaaaaaaa(L)) → U3_gaaaaaaaaa(L, V, R, balance55_in_gaaaaaaaaa(R))
U3_gaaaaaaaaa(L, V, R, balance55_out_gaaaaaaaaa(R)) → balance55_out_gaaaaaaaaa(tree(L, V, R))
balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1, x2, x3)
U3_gaaaaaaaaa(x0, x1, x2, x3)
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
BALANCE_IN_GA(T, TB) → BALANCE55_IN_GAAGAGAAAG(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
BALANCE_IN_GA(T, TB) → U1_GA(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
BALANCE_IN_GA(T, TB) → BALANCE55_IN_GAAGAGAAAG(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAAAAAAAA(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAAAAAAAA(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → BALANCE55_IN_GAAAAAAAAA(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_GAAAAAAAAA(R, balance55_out_gaaaaaaaaa) → BALANCE55_IN_GAAAAAAAAA(R)
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → U2_GAAAAAAAAA(R, balance55_in_gaaaaaaaaa(L))
BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → BALANCE55_IN_GAAAAAAAAA(L)
balance55_in_gaaaaaaaaa(nil) → balance55_out_gaaaaaaaaa
balance55_in_gaaaaaaaaa(tree(L, V, R)) → U2_gaaaaaaaaa(R, balance55_in_gaaaaaaaaa(L))
U2_gaaaaaaaaa(R, balance55_out_gaaaaaaaaa) → U3_gaaaaaaaaa(balance55_in_gaaaaaaaaa(R))
U3_gaaaaaaaaa(balance55_out_gaaaaaaaaa) → balance55_out_gaaaaaaaaa
balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1)
U3_gaaaaaaaaa(x0)
From the DPs we obtained the following set of size-change graphs:
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance_in_ga(T, TB) → U1_ga(T, TB, balance55_in_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []))
balance55_in_gaagagaaag(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaagagaaag(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaagagaaag(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaagagaaag(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaagagaaag(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U1_ga(T, TB, balance55_out_gaagagaaag(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, [])) → balance_out_ga(T, TB)
U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → BALANCE55_IN_GAAGAGAAAG(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_GAAGAGAAAG(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
balance55_in_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X) → balance55_out_gaaaaaaaaa(nil, C, T, T, A, B, A, B, X, X)
balance55_in_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT) → U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)))
U2_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1))) → U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_in_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT))
U3_gaaaaaaaaa(L, V, R, XX0, XX1, NT, HR, TR, LB, VB, RB, A, D, H, X, T, IH, IT, balance55_out_gaaaaaaaaa(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)) → balance55_out_gaaaaaaaaa(tree(L, V, R), XX0, XX1, NT, HR, TR, .(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T)), IH, IT)
U2_GAAGAGAAAG(R, NT, TR, IT, balance55_out_gaaaaaaaaa) → BALANCE55_IN_GAAGAGAAAG(R, NT, TR, IT)
BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), NT, TR, IT) → U2_GAAGAGAAAG(R, NT, TR, IT, balance55_in_gaaaaaaaaa(L))
balance55_in_gaaaaaaaaa(nil) → balance55_out_gaaaaaaaaa
balance55_in_gaaaaaaaaa(tree(L, V, R)) → U2_gaaaaaaaaa(R, balance55_in_gaaaaaaaaa(L))
U2_gaaaaaaaaa(R, balance55_out_gaaaaaaaaa) → U3_gaaaaaaaaa(balance55_in_gaaaaaaaaa(R))
U3_gaaaaaaaaa(balance55_out_gaaaaaaaaa) → balance55_out_gaaaaaaaaa
balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1)
U3_gaaaaaaaaa(x0)
From the DPs we obtained the following set of size-change graphs: