(0) Obligation:

Clauses:

hbal_tree(zero, nil).
hbal_tree(s(zero), t(x, nil, nil)).
hbal_tree(s(s(X)), t(x, L, R)) :- ','(distr(s(X), X, DL, DR), ','(hbal_tree(DL, L), hbal_tree(DR, R))).
distr(D1, X1, D1, D1).
distr(D1, D2, D1, D2).
distr(D1, D2, D2, D1).

Query: hbal_tree(g,a)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

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

hbal_treeA_in_ga(zero, nil) → hbal_treeA_out_ga(zero, nil)
hbal_treeA_in_ga(s(zero), t(x, nil, nil)) → hbal_treeA_out_ga(s(zero), t(x, nil, nil))
hbal_treeA_in_ga(s(s(T15)), t(x, T9, T10)) → U1_ga(T15, T9, T10, pB_in_gaa(T15, T9, T10))
pB_in_gaa(T15, T9, T16) → U4_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
hbal_treeA_in_ga(s(s(T21)), t(x, T9, T10)) → U2_ga(T21, T9, T10, pC_in_gaa(T21, T9, T10))
pC_in_gaa(T21, T9, T22) → U6_gaa(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
hbal_treeA_in_ga(s(s(T25)), t(x, T9, T10)) → U3_ga(T25, T9, T10, pD_in_gaa(T25, T9, T10))
pD_in_gaa(T25, T9, T26) → U8_gaa(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
U8_gaa(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → U9_gaa(T25, T9, T26, hbal_treeA_in_ga(s(T25), T26))
U9_gaa(T25, T9, T26, hbal_treeA_out_ga(s(T25), T26)) → pD_out_gaa(T25, T9, T26)
U3_ga(T25, T9, T10, pD_out_gaa(T25, T9, T10)) → hbal_treeA_out_ga(s(s(T25)), t(x, T9, T10))
U6_gaa(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → U7_gaa(T21, T9, T22, hbal_treeA_in_ga(T21, T22))
U7_gaa(T21, T9, T22, hbal_treeA_out_ga(T21, T22)) → pC_out_gaa(T21, T9, T22)
U2_ga(T21, T9, T10, pC_out_gaa(T21, T9, T10)) → hbal_treeA_out_ga(s(s(T21)), t(x, T9, T10))
U4_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → U5_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T16))
U5_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T16)) → pB_out_gaa(T15, T9, T16)
U1_ga(T15, T9, T10, pB_out_gaa(T15, T9, T10)) → hbal_treeA_out_ga(s(s(T15)), t(x, T9, T10))

The argument filtering Pi contains the following mapping:
hbal_treeA_in_ga(x1, x2)  =  hbal_treeA_in_ga(x1)
zero  =  zero
hbal_treeA_out_ga(x1, x2)  =  hbal_treeA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x4)
pC_in_gaa(x1, x2, x3)  =  pC_in_gaa(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
pD_in_gaa(x1, x2, x3)  =  pD_in_gaa(x1)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x1, x4)
U9_gaa(x1, x2, x3, x4)  =  U9_gaa(x1, x2, x4)
pD_out_gaa(x1, x2, x3)  =  pD_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x2, x4)
pC_out_gaa(x1, x2, x3)  =  pC_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x

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

HBAL_TREEA_IN_GA(s(s(T15)), t(x, T9, T10)) → U1_GA(T15, T9, T10, pB_in_gaa(T15, T9, T10))
HBAL_TREEA_IN_GA(s(s(T15)), t(x, T9, T10)) → PB_IN_GAA(T15, T9, T10)
PB_IN_GAA(T15, T9, T16) → U4_GAA(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
PB_IN_GAA(T15, T9, T16) → HBAL_TREEA_IN_GA(s(T15), T9)
HBAL_TREEA_IN_GA(s(s(T21)), t(x, T9, T10)) → U2_GA(T21, T9, T10, pC_in_gaa(T21, T9, T10))
HBAL_TREEA_IN_GA(s(s(T21)), t(x, T9, T10)) → PC_IN_GAA(T21, T9, T10)
PC_IN_GAA(T21, T9, T22) → U6_GAA(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
PC_IN_GAA(T21, T9, T22) → HBAL_TREEA_IN_GA(s(T21), T9)
HBAL_TREEA_IN_GA(s(s(T25)), t(x, T9, T10)) → U3_GA(T25, T9, T10, pD_in_gaa(T25, T9, T10))
HBAL_TREEA_IN_GA(s(s(T25)), t(x, T9, T10)) → PD_IN_GAA(T25, T9, T10)
PD_IN_GAA(T25, T9, T26) → U8_GAA(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
PD_IN_GAA(T25, T9, T26) → HBAL_TREEA_IN_GA(T25, T9)
U8_GAA(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → U9_GAA(T25, T9, T26, hbal_treeA_in_ga(s(T25), T26))
U8_GAA(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → HBAL_TREEA_IN_GA(s(T25), T26)
U6_GAA(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → U7_GAA(T21, T9, T22, hbal_treeA_in_ga(T21, T22))
U6_GAA(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → HBAL_TREEA_IN_GA(T21, T22)
U4_GAA(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → U5_GAA(T15, T9, T16, hbal_treeA_in_ga(s(T15), T16))
U4_GAA(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → HBAL_TREEA_IN_GA(s(T15), T16)

The TRS R consists of the following rules:

hbal_treeA_in_ga(zero, nil) → hbal_treeA_out_ga(zero, nil)
hbal_treeA_in_ga(s(zero), t(x, nil, nil)) → hbal_treeA_out_ga(s(zero), t(x, nil, nil))
hbal_treeA_in_ga(s(s(T15)), t(x, T9, T10)) → U1_ga(T15, T9, T10, pB_in_gaa(T15, T9, T10))
pB_in_gaa(T15, T9, T16) → U4_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
hbal_treeA_in_ga(s(s(T21)), t(x, T9, T10)) → U2_ga(T21, T9, T10, pC_in_gaa(T21, T9, T10))
pC_in_gaa(T21, T9, T22) → U6_gaa(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
hbal_treeA_in_ga(s(s(T25)), t(x, T9, T10)) → U3_ga(T25, T9, T10, pD_in_gaa(T25, T9, T10))
pD_in_gaa(T25, T9, T26) → U8_gaa(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
U8_gaa(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → U9_gaa(T25, T9, T26, hbal_treeA_in_ga(s(T25), T26))
U9_gaa(T25, T9, T26, hbal_treeA_out_ga(s(T25), T26)) → pD_out_gaa(T25, T9, T26)
U3_ga(T25, T9, T10, pD_out_gaa(T25, T9, T10)) → hbal_treeA_out_ga(s(s(T25)), t(x, T9, T10))
U6_gaa(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → U7_gaa(T21, T9, T22, hbal_treeA_in_ga(T21, T22))
U7_gaa(T21, T9, T22, hbal_treeA_out_ga(T21, T22)) → pC_out_gaa(T21, T9, T22)
U2_ga(T21, T9, T10, pC_out_gaa(T21, T9, T10)) → hbal_treeA_out_ga(s(s(T21)), t(x, T9, T10))
U4_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → U5_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T16))
U5_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T16)) → pB_out_gaa(T15, T9, T16)
U1_ga(T15, T9, T10, pB_out_gaa(T15, T9, T10)) → hbal_treeA_out_ga(s(s(T15)), t(x, T9, T10))

The argument filtering Pi contains the following mapping:
hbal_treeA_in_ga(x1, x2)  =  hbal_treeA_in_ga(x1)
zero  =  zero
hbal_treeA_out_ga(x1, x2)  =  hbal_treeA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x4)
pC_in_gaa(x1, x2, x3)  =  pC_in_gaa(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
pD_in_gaa(x1, x2, x3)  =  pD_in_gaa(x1)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x1, x4)
U9_gaa(x1, x2, x3, x4)  =  U9_gaa(x1, x2, x4)
pD_out_gaa(x1, x2, x3)  =  pD_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x2, x4)
pC_out_gaa(x1, x2, x3)  =  pC_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x
HBAL_TREEA_IN_GA(x1, x2)  =  HBAL_TREEA_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x4)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x4)
PC_IN_GAA(x1, x2, x3)  =  PC_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
PD_IN_GAA(x1, x2, x3)  =  PD_IN_GAA(x1)
U8_GAA(x1, x2, x3, x4)  =  U8_GAA(x1, x4)
U9_GAA(x1, x2, x3, x4)  =  U9_GAA(x1, x2, x4)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x1, x2, x4)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x2, x4)

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

(4) Obligation:

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

HBAL_TREEA_IN_GA(s(s(T15)), t(x, T9, T10)) → U1_GA(T15, T9, T10, pB_in_gaa(T15, T9, T10))
HBAL_TREEA_IN_GA(s(s(T15)), t(x, T9, T10)) → PB_IN_GAA(T15, T9, T10)
PB_IN_GAA(T15, T9, T16) → U4_GAA(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
PB_IN_GAA(T15, T9, T16) → HBAL_TREEA_IN_GA(s(T15), T9)
HBAL_TREEA_IN_GA(s(s(T21)), t(x, T9, T10)) → U2_GA(T21, T9, T10, pC_in_gaa(T21, T9, T10))
HBAL_TREEA_IN_GA(s(s(T21)), t(x, T9, T10)) → PC_IN_GAA(T21, T9, T10)
PC_IN_GAA(T21, T9, T22) → U6_GAA(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
PC_IN_GAA(T21, T9, T22) → HBAL_TREEA_IN_GA(s(T21), T9)
HBAL_TREEA_IN_GA(s(s(T25)), t(x, T9, T10)) → U3_GA(T25, T9, T10, pD_in_gaa(T25, T9, T10))
HBAL_TREEA_IN_GA(s(s(T25)), t(x, T9, T10)) → PD_IN_GAA(T25, T9, T10)
PD_IN_GAA(T25, T9, T26) → U8_GAA(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
PD_IN_GAA(T25, T9, T26) → HBAL_TREEA_IN_GA(T25, T9)
U8_GAA(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → U9_GAA(T25, T9, T26, hbal_treeA_in_ga(s(T25), T26))
U8_GAA(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → HBAL_TREEA_IN_GA(s(T25), T26)
U6_GAA(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → U7_GAA(T21, T9, T22, hbal_treeA_in_ga(T21, T22))
U6_GAA(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → HBAL_TREEA_IN_GA(T21, T22)
U4_GAA(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → U5_GAA(T15, T9, T16, hbal_treeA_in_ga(s(T15), T16))
U4_GAA(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → HBAL_TREEA_IN_GA(s(T15), T16)

The TRS R consists of the following rules:

hbal_treeA_in_ga(zero, nil) → hbal_treeA_out_ga(zero, nil)
hbal_treeA_in_ga(s(zero), t(x, nil, nil)) → hbal_treeA_out_ga(s(zero), t(x, nil, nil))
hbal_treeA_in_ga(s(s(T15)), t(x, T9, T10)) → U1_ga(T15, T9, T10, pB_in_gaa(T15, T9, T10))
pB_in_gaa(T15, T9, T16) → U4_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
hbal_treeA_in_ga(s(s(T21)), t(x, T9, T10)) → U2_ga(T21, T9, T10, pC_in_gaa(T21, T9, T10))
pC_in_gaa(T21, T9, T22) → U6_gaa(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
hbal_treeA_in_ga(s(s(T25)), t(x, T9, T10)) → U3_ga(T25, T9, T10, pD_in_gaa(T25, T9, T10))
pD_in_gaa(T25, T9, T26) → U8_gaa(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
U8_gaa(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → U9_gaa(T25, T9, T26, hbal_treeA_in_ga(s(T25), T26))
U9_gaa(T25, T9, T26, hbal_treeA_out_ga(s(T25), T26)) → pD_out_gaa(T25, T9, T26)
U3_ga(T25, T9, T10, pD_out_gaa(T25, T9, T10)) → hbal_treeA_out_ga(s(s(T25)), t(x, T9, T10))
U6_gaa(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → U7_gaa(T21, T9, T22, hbal_treeA_in_ga(T21, T22))
U7_gaa(T21, T9, T22, hbal_treeA_out_ga(T21, T22)) → pC_out_gaa(T21, T9, T22)
U2_ga(T21, T9, T10, pC_out_gaa(T21, T9, T10)) → hbal_treeA_out_ga(s(s(T21)), t(x, T9, T10))
U4_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → U5_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T16))
U5_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T16)) → pB_out_gaa(T15, T9, T16)
U1_ga(T15, T9, T10, pB_out_gaa(T15, T9, T10)) → hbal_treeA_out_ga(s(s(T15)), t(x, T9, T10))

The argument filtering Pi contains the following mapping:
hbal_treeA_in_ga(x1, x2)  =  hbal_treeA_in_ga(x1)
zero  =  zero
hbal_treeA_out_ga(x1, x2)  =  hbal_treeA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x4)
pC_in_gaa(x1, x2, x3)  =  pC_in_gaa(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
pD_in_gaa(x1, x2, x3)  =  pD_in_gaa(x1)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x1, x4)
U9_gaa(x1, x2, x3, x4)  =  U9_gaa(x1, x2, x4)
pD_out_gaa(x1, x2, x3)  =  pD_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x2, x4)
pC_out_gaa(x1, x2, x3)  =  pC_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x
HBAL_TREEA_IN_GA(x1, x2)  =  HBAL_TREEA_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x4)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x4)
PC_IN_GAA(x1, x2, x3)  =  PC_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
PD_IN_GAA(x1, x2, x3)  =  PD_IN_GAA(x1)
U8_GAA(x1, x2, x3, x4)  =  U8_GAA(x1, x4)
U9_GAA(x1, x2, x3, x4)  =  U9_GAA(x1, x2, x4)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x1, x2, x4)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x2, x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 6 less nodes.

(6) Obligation:

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

HBAL_TREEA_IN_GA(s(s(T15)), t(x, T9, T10)) → PB_IN_GAA(T15, T9, T10)
PB_IN_GAA(T15, T9, T16) → U4_GAA(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
U4_GAA(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → HBAL_TREEA_IN_GA(s(T15), T16)
HBAL_TREEA_IN_GA(s(s(T21)), t(x, T9, T10)) → PC_IN_GAA(T21, T9, T10)
PC_IN_GAA(T21, T9, T22) → U6_GAA(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
U6_GAA(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → HBAL_TREEA_IN_GA(T21, T22)
HBAL_TREEA_IN_GA(s(s(T25)), t(x, T9, T10)) → PD_IN_GAA(T25, T9, T10)
PD_IN_GAA(T25, T9, T26) → U8_GAA(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
U8_GAA(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → HBAL_TREEA_IN_GA(s(T25), T26)
PD_IN_GAA(T25, T9, T26) → HBAL_TREEA_IN_GA(T25, T9)
PC_IN_GAA(T21, T9, T22) → HBAL_TREEA_IN_GA(s(T21), T9)
PB_IN_GAA(T15, T9, T16) → HBAL_TREEA_IN_GA(s(T15), T9)

The TRS R consists of the following rules:

hbal_treeA_in_ga(zero, nil) → hbal_treeA_out_ga(zero, nil)
hbal_treeA_in_ga(s(zero), t(x, nil, nil)) → hbal_treeA_out_ga(s(zero), t(x, nil, nil))
hbal_treeA_in_ga(s(s(T15)), t(x, T9, T10)) → U1_ga(T15, T9, T10, pB_in_gaa(T15, T9, T10))
pB_in_gaa(T15, T9, T16) → U4_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T9))
hbal_treeA_in_ga(s(s(T21)), t(x, T9, T10)) → U2_ga(T21, T9, T10, pC_in_gaa(T21, T9, T10))
pC_in_gaa(T21, T9, T22) → U6_gaa(T21, T9, T22, hbal_treeA_in_ga(s(T21), T9))
hbal_treeA_in_ga(s(s(T25)), t(x, T9, T10)) → U3_ga(T25, T9, T10, pD_in_gaa(T25, T9, T10))
pD_in_gaa(T25, T9, T26) → U8_gaa(T25, T9, T26, hbal_treeA_in_ga(T25, T9))
U8_gaa(T25, T9, T26, hbal_treeA_out_ga(T25, T9)) → U9_gaa(T25, T9, T26, hbal_treeA_in_ga(s(T25), T26))
U9_gaa(T25, T9, T26, hbal_treeA_out_ga(s(T25), T26)) → pD_out_gaa(T25, T9, T26)
U3_ga(T25, T9, T10, pD_out_gaa(T25, T9, T10)) → hbal_treeA_out_ga(s(s(T25)), t(x, T9, T10))
U6_gaa(T21, T9, T22, hbal_treeA_out_ga(s(T21), T9)) → U7_gaa(T21, T9, T22, hbal_treeA_in_ga(T21, T22))
U7_gaa(T21, T9, T22, hbal_treeA_out_ga(T21, T22)) → pC_out_gaa(T21, T9, T22)
U2_ga(T21, T9, T10, pC_out_gaa(T21, T9, T10)) → hbal_treeA_out_ga(s(s(T21)), t(x, T9, T10))
U4_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T9)) → U5_gaa(T15, T9, T16, hbal_treeA_in_ga(s(T15), T16))
U5_gaa(T15, T9, T16, hbal_treeA_out_ga(s(T15), T16)) → pB_out_gaa(T15, T9, T16)
U1_ga(T15, T9, T10, pB_out_gaa(T15, T9, T10)) → hbal_treeA_out_ga(s(s(T15)), t(x, T9, T10))

The argument filtering Pi contains the following mapping:
hbal_treeA_in_ga(x1, x2)  =  hbal_treeA_in_ga(x1)
zero  =  zero
hbal_treeA_out_ga(x1, x2)  =  hbal_treeA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x4)
pC_in_gaa(x1, x2, x3)  =  pC_in_gaa(x1)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
pD_in_gaa(x1, x2, x3)  =  pD_in_gaa(x1)
U8_gaa(x1, x2, x3, x4)  =  U8_gaa(x1, x4)
U9_gaa(x1, x2, x3, x4)  =  U9_gaa(x1, x2, x4)
pD_out_gaa(x1, x2, x3)  =  pD_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x2, x4)
pC_out_gaa(x1, x2, x3)  =  pC_out_gaa(x1, x2, x3)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x
HBAL_TREEA_IN_GA(x1, x2)  =  HBAL_TREEA_IN_GA(x1)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x4)
PC_IN_GAA(x1, x2, x3)  =  PC_IN_GAA(x1)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
PD_IN_GAA(x1, x2, x3)  =  PD_IN_GAA(x1)
U8_GAA(x1, x2, x3, x4)  =  U8_GAA(x1, x4)

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

(7) PiDPToQDPProof (SOUND transformation)

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

(8) Obligation:

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

HBAL_TREEA_IN_GA(s(s(T15))) → PB_IN_GAA(T15)
PB_IN_GAA(T15) → U4_GAA(T15, hbal_treeA_in_ga(s(T15)))
U4_GAA(T15, hbal_treeA_out_ga(s(T15), T9)) → HBAL_TREEA_IN_GA(s(T15))
HBAL_TREEA_IN_GA(s(s(T21))) → PC_IN_GAA(T21)
PC_IN_GAA(T21) → U6_GAA(T21, hbal_treeA_in_ga(s(T21)))
U6_GAA(T21, hbal_treeA_out_ga(s(T21), T9)) → HBAL_TREEA_IN_GA(T21)
HBAL_TREEA_IN_GA(s(s(T25))) → PD_IN_GAA(T25)
PD_IN_GAA(T25) → U8_GAA(T25, hbal_treeA_in_ga(T25))
U8_GAA(T25, hbal_treeA_out_ga(T25, T9)) → HBAL_TREEA_IN_GA(s(T25))
PD_IN_GAA(T25) → HBAL_TREEA_IN_GA(T25)
PC_IN_GAA(T21) → HBAL_TREEA_IN_GA(s(T21))
PB_IN_GAA(T15) → HBAL_TREEA_IN_GA(s(T15))

The TRS R consists of the following rules:

hbal_treeA_in_ga(zero) → hbal_treeA_out_ga(zero, nil)
hbal_treeA_in_ga(s(zero)) → hbal_treeA_out_ga(s(zero), t(x, nil, nil))
hbal_treeA_in_ga(s(s(T15))) → U1_ga(T15, pB_in_gaa(T15))
pB_in_gaa(T15) → U4_gaa(T15, hbal_treeA_in_ga(s(T15)))
hbal_treeA_in_ga(s(s(T21))) → U2_ga(T21, pC_in_gaa(T21))
pC_in_gaa(T21) → U6_gaa(T21, hbal_treeA_in_ga(s(T21)))
hbal_treeA_in_ga(s(s(T25))) → U3_ga(T25, pD_in_gaa(T25))
pD_in_gaa(T25) → U8_gaa(T25, hbal_treeA_in_ga(T25))
U8_gaa(T25, hbal_treeA_out_ga(T25, T9)) → U9_gaa(T25, T9, hbal_treeA_in_ga(s(T25)))
U9_gaa(T25, T9, hbal_treeA_out_ga(s(T25), T26)) → pD_out_gaa(T25, T9, T26)
U3_ga(T25, pD_out_gaa(T25, T9, T10)) → hbal_treeA_out_ga(s(s(T25)), t(x, T9, T10))
U6_gaa(T21, hbal_treeA_out_ga(s(T21), T9)) → U7_gaa(T21, T9, hbal_treeA_in_ga(T21))
U7_gaa(T21, T9, hbal_treeA_out_ga(T21, T22)) → pC_out_gaa(T21, T9, T22)
U2_ga(T21, pC_out_gaa(T21, T9, T10)) → hbal_treeA_out_ga(s(s(T21)), t(x, T9, T10))
U4_gaa(T15, hbal_treeA_out_ga(s(T15), T9)) → U5_gaa(T15, T9, hbal_treeA_in_ga(s(T15)))
U5_gaa(T15, T9, hbal_treeA_out_ga(s(T15), T16)) → pB_out_gaa(T15, T9, T16)
U1_ga(T15, pB_out_gaa(T15, T9, T10)) → hbal_treeA_out_ga(s(s(T15)), t(x, T9, T10))

The set Q consists of the following terms:

hbal_treeA_in_ga(x0)
pB_in_gaa(x0)
pC_in_gaa(x0)
pD_in_gaa(x0)
U8_gaa(x0, x1)
U9_gaa(x0, x1, x2)
U3_ga(x0, x1)
U6_gaa(x0, x1)
U7_gaa(x0, x1, x2)
U2_ga(x0, x1)
U4_gaa(x0, x1)
U5_gaa(x0, x1, x2)
U1_ga(x0, x1)

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

(9) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


HBAL_TREEA_IN_GA(s(s(T15))) → PB_IN_GAA(T15)
HBAL_TREEA_IN_GA(s(s(T21))) → PC_IN_GAA(T21)
PC_IN_GAA(T21) → U6_GAA(T21, hbal_treeA_in_ga(s(T21)))
HBAL_TREEA_IN_GA(s(s(T25))) → PD_IN_GAA(T25)
PD_IN_GAA(T25) → HBAL_TREEA_IN_GA(T25)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(HBAL_TREEA_IN_GA(x1)) = x1   
POL(PB_IN_GAA(x1)) = 1 + x1   
POL(PC_IN_GAA(x1)) = 1 + x1   
POL(PD_IN_GAA(x1)) = 1 + x1   
POL(U1_ga(x1, x2)) = 0   
POL(U2_ga(x1, x2)) = 0   
POL(U3_ga(x1, x2)) = 0   
POL(U4_GAA(x1, x2)) = 1 + x1   
POL(U4_gaa(x1, x2)) = 0   
POL(U5_gaa(x1, x2, x3)) = 0   
POL(U6_GAA(x1, x2)) = x1   
POL(U6_gaa(x1, x2)) = 0   
POL(U7_gaa(x1, x2, x3)) = 0   
POL(U8_GAA(x1, x2)) = 1 + x1   
POL(U8_gaa(x1, x2)) = 0   
POL(U9_gaa(x1, x2, x3)) = 0   
POL(hbal_treeA_in_ga(x1)) = 0   
POL(hbal_treeA_out_ga(x1, x2)) = 0   
POL(nil) = 0   
POL(pB_in_gaa(x1)) = 0   
POL(pB_out_gaa(x1, x2, x3)) = 0   
POL(pC_in_gaa(x1)) = 0   
POL(pC_out_gaa(x1, x2, x3)) = 0   
POL(pD_in_gaa(x1)) = 0   
POL(pD_out_gaa(x1, x2, x3)) = 0   
POL(s(x1)) = 1 + x1   
POL(t(x1, x2, x3)) = 0   
POL(x) = 0   
POL(zero) = 0   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
none

(10) Obligation:

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

PB_IN_GAA(T15) → U4_GAA(T15, hbal_treeA_in_ga(s(T15)))
U4_GAA(T15, hbal_treeA_out_ga(s(T15), T9)) → HBAL_TREEA_IN_GA(s(T15))
U6_GAA(T21, hbal_treeA_out_ga(s(T21), T9)) → HBAL_TREEA_IN_GA(T21)
PD_IN_GAA(T25) → U8_GAA(T25, hbal_treeA_in_ga(T25))
U8_GAA(T25, hbal_treeA_out_ga(T25, T9)) → HBAL_TREEA_IN_GA(s(T25))
PC_IN_GAA(T21) → HBAL_TREEA_IN_GA(s(T21))
PB_IN_GAA(T15) → HBAL_TREEA_IN_GA(s(T15))

The TRS R consists of the following rules:

hbal_treeA_in_ga(zero) → hbal_treeA_out_ga(zero, nil)
hbal_treeA_in_ga(s(zero)) → hbal_treeA_out_ga(s(zero), t(x, nil, nil))
hbal_treeA_in_ga(s(s(T15))) → U1_ga(T15, pB_in_gaa(T15))
pB_in_gaa(T15) → U4_gaa(T15, hbal_treeA_in_ga(s(T15)))
hbal_treeA_in_ga(s(s(T21))) → U2_ga(T21, pC_in_gaa(T21))
pC_in_gaa(T21) → U6_gaa(T21, hbal_treeA_in_ga(s(T21)))
hbal_treeA_in_ga(s(s(T25))) → U3_ga(T25, pD_in_gaa(T25))
pD_in_gaa(T25) → U8_gaa(T25, hbal_treeA_in_ga(T25))
U8_gaa(T25, hbal_treeA_out_ga(T25, T9)) → U9_gaa(T25, T9, hbal_treeA_in_ga(s(T25)))
U9_gaa(T25, T9, hbal_treeA_out_ga(s(T25), T26)) → pD_out_gaa(T25, T9, T26)
U3_ga(T25, pD_out_gaa(T25, T9, T10)) → hbal_treeA_out_ga(s(s(T25)), t(x, T9, T10))
U6_gaa(T21, hbal_treeA_out_ga(s(T21), T9)) → U7_gaa(T21, T9, hbal_treeA_in_ga(T21))
U7_gaa(T21, T9, hbal_treeA_out_ga(T21, T22)) → pC_out_gaa(T21, T9, T22)
U2_ga(T21, pC_out_gaa(T21, T9, T10)) → hbal_treeA_out_ga(s(s(T21)), t(x, T9, T10))
U4_gaa(T15, hbal_treeA_out_ga(s(T15), T9)) → U5_gaa(T15, T9, hbal_treeA_in_ga(s(T15)))
U5_gaa(T15, T9, hbal_treeA_out_ga(s(T15), T16)) → pB_out_gaa(T15, T9, T16)
U1_ga(T15, pB_out_gaa(T15, T9, T10)) → hbal_treeA_out_ga(s(s(T15)), t(x, T9, T10))

The set Q consists of the following terms:

hbal_treeA_in_ga(x0)
pB_in_gaa(x0)
pC_in_gaa(x0)
pD_in_gaa(x0)
U8_gaa(x0, x1)
U9_gaa(x0, x1, x2)
U3_ga(x0, x1)
U6_gaa(x0, x1)
U7_gaa(x0, x1, x2)
U2_ga(x0, x1)
U4_gaa(x0, x1)
U5_gaa(x0, x1, x2)
U1_ga(x0, x1)

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

(11) DependencyGraphProof (EQUIVALENT transformation)

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

(12) TRUE