(0) Obligation:

Clauses:

balance(T, TB) :- balance55(T, XX0, XX1, [], .(','(nil, -(XX0, XX0)), XX1), [], .(','(TB, -(I, [])), X), X, I, []).
balance55(nil, C, T, T, A, B, A, B, X, X).
balance55(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(L, XX0, XX1, .(','(nil, -(XX2, XX2)), XX3), HR1, TR1, H, T, IH, .(V, IT1)), balance55(R, XX2, XX3, NT, HR, TR, HR1, TR1, IT1, IT)).
balance5(nil, C, T, T, A, B, A, B, X, X) :- balance55(nil, C, T, T, A, B, A, B, X, X).
balance5(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(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).
balance(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) :- balance5(nil, C, T, T, A, B, A, B, X, X).
balance(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(.(','(nil, -(XX0, XX0)), XX1), NT)) :- balance5(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).

Queries:

balance(g,a).

(1) PrologToPiTRSProof (SOUND transformation)

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

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag(x1, x4, x6, x10)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga(x1)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag(x1, x4, x6, x10)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga(x1)

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

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)

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag(x1, x4, x6, x10)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga(x1)
BALANCE_IN_GA(x1, x2)  =  BALANCE_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x1, x2, x3, x6, x8, x18, x19)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x1, x2, x3, x19)
U3_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAAAAAAAA(x1, x2, x3, x19)
U3_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAGAGAAAG(x1, x2, x3, x6, x8, x18, x19)

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

(4) Obligation:

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

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)

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag(x1, x4, x6, x10)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga(x1)
BALANCE_IN_GA(x1, x2)  =  BALANCE_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x1, x2, x3, x6, x8, x18, x19)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x1, x2, x3, x19)
U3_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAAAAAAAA(x1, x2, x3, x19)
U3_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAGAGAAAG(x1, x2, x3, x6, x8, x18, x19)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

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))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag(x1, x4, x6, x10)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga(x1)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x1, x2, x3, x19)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

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))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
nil  =  nil
tree(x1, x2, x3)  =  tree(x1, x2, x3)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x1, x2, x3, x19)

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

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)

The TRS R consists of the following rules:

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))

The set Q consists of the following terms:

balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1, x2, x3)
U3_gaaaaaaaaa(x0, x1, x2, x3)

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

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

  • BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → U2_GAAAAAAAAA(L, V, R, balance55_in_gaaaaaaaaa(L))
    The graph contains the following edges 1 > 1, 1 > 2, 1 > 3

  • BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → BALANCE55_IN_GAAAAAAAAA(L)
    The graph contains the following edges 1 > 1

  • U2_GAAAAAAAAA(L, V, R, balance55_out_gaaaaaaaaa(L)) → BALANCE55_IN_GAAAAAAAAA(R)
    The graph contains the following edges 3 >= 1

(13) TRUE

(14) Obligation:

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

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)))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag(x1, x4, x6, x10)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x1, x2, x3, x6, x8, x18, x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga(x1)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x1, x2, x3, x6, x8, x18, x19)

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

(15) UsableRulesProof (EQUIVALENT transformation)

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

(16) Obligation:

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

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)))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
nil  =  nil
tree(x1, x2, x3)  =  tree(x1, x2, x3)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa(x1)
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x1, x2, x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x1, x2, x3, x19)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x1, x2, x3, x6, x8, x18, x19)

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

(17) PiDPToQDPProof (SOUND transformation)

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

(18) Obligation:

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

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))

The TRS R consists of the following rules:

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))

The set Q consists of the following terms:

balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1, x2, x3)
U3_gaaaaaaaaa(x0, x1, x2, x3)

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

(19) PrologToPiTRSProof (SOUND transformation)

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

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(20) Obligation:

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

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga

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

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)

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga
BALANCE_IN_GA(x1, x2)  =  BALANCE_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x3, x6, x8, x18, x19)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x3, x19)
U3_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAAAAAAAA(x19)
U3_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAGAGAAAG(x19)

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

(22) Obligation:

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

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)

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga
BALANCE_IN_GA(x1, x2)  =  BALANCE_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x3, x6, x8, x18, x19)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x3, x19)
U3_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAAAAAAAA(x19)
U3_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_GAAGAGAAAG(x19)

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

(23) DependencyGraphProof (EQUIVALENT transformation)

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

(24) Complex Obligation (AND)

(25) Obligation:

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

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))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x3, x19)

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

(26) UsableRulesProof (EQUIVALENT transformation)

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

(27) Obligation:

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

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))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
nil  =  nil
tree(x1, x2, x3)  =  tree(x1, x2, x3)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
BALANCE55_IN_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAAAAAAAA(x1)
U2_GAAAAAAAAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAAAAAAAA(x3, x19)

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

(28) PiDPToQDPProof (SOUND transformation)

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

(29) Obligation:

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

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)

The TRS R consists of the following rules:

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

The set Q consists of the following terms:

balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1)
U3_gaaaaaaaaa(x0)

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

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

  • BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → U2_GAAAAAAAAA(R, balance55_in_gaaaaaaaaa(L))
    The graph contains the following edges 1 > 1

  • BALANCE55_IN_GAAAAAAAAA(tree(L, V, R)) → BALANCE55_IN_GAAAAAAAAA(L)
    The graph contains the following edges 1 > 1

  • U2_GAAAAAAAAA(R, balance55_out_gaaaaaaaaa) → BALANCE55_IN_GAAAAAAAAA(R)
    The graph contains the following edges 1 >= 1

(31) TRUE

(32) Obligation:

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

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)))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
balance_in_ga(x1, x2)  =  balance_in_ga(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
balance55_in_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaagagaaag(x1, x4, x6, x10)
nil  =  nil
balance55_out_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaagagaaag
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U2_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaagagaaag(x3, x6, x8, x18, x19)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
U3_gaagagaaag(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaagagaaag(x19)
[]  =  []
balance_out_ga(x1, x2)  =  balance_out_ga
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x3, x6, x8, x18, x19)

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

(33) UsableRulesProof (EQUIVALENT transformation)

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

(34) Obligation:

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

U2_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)))

The TRS R consists of the following rules:

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)

The argument filtering Pi contains the following mapping:
nil  =  nil
tree(x1, x2, x3)  =  tree(x1, x2, x3)
balance55_in_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_in_gaaaaaaaaa(x1)
balance55_out_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  balance55_out_gaaaaaaaaa
U2_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_gaaaaaaaaa(x3, x19)
U3_gaaaaaaaaa(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U3_gaaaaaaaaa(x19)
BALANCE55_IN_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  BALANCE55_IN_GAAGAGAAAG(x1, x4, x6, x10)
U2_GAAGAGAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)  =  U2_GAAGAGAAAG(x3, x6, x8, x18, x19)

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

(35) PiDPToQDPProof (SOUND transformation)

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

(36) Obligation:

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

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))

The TRS R consists of the following rules:

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

The set Q consists of the following terms:

balance55_in_gaaaaaaaaa(x0)
U2_gaaaaaaaaa(x0, x1)
U3_gaaaaaaaaa(x0)

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

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

  • BALANCE55_IN_GAAGAGAAAG(tree(L, V, R), NT, TR, IT) → U2_GAAGAGAAAG(R, NT, TR, IT, balance55_in_gaaaaaaaaa(L))
    The graph contains the following edges 1 > 1, 2 >= 2, 3 >= 3, 4 >= 4

  • U2_GAAGAGAAAG(R, NT, TR, IT, balance55_out_gaaaaaaaaa) → BALANCE55_IN_GAAGAGAAAG(R, NT, TR, IT)
    The graph contains the following edges 1 >= 1, 2 >= 2, 3 >= 3, 4 >= 4

(38) TRUE