0 Prolog
↳1 CutEliminatorProof (⇐)
↳2 Prolog
↳3 PrologToPiTRSProof (⇐)
↳4 PiTRS
↳5 DependencyPairsProof (⇔)
↳6 PiDP
↳7 DependencyGraphProof (⇔)
↳8 AND
↳9 PiDP
↳10 UsableRulesProof (⇔)
↳11 PiDP
↳12 PiDPToQDPProof (⇐)
↳13 QDP
↳14 Rewriting (⇔)
↳15 QDP
↳16 Rewriting (⇔)
↳17 QDP
↳18 Rewriting (⇔)
↳19 QDP
↳20 Rewriting (⇔)
↳21 QDP
↳22 UsableRulesProof (⇔)
↳23 QDP
↳24 QReductionProof (⇔)
↳25 QDP
↳26 Rewriting (⇔)
↳27 QDP
↳28 UsableRulesProof (⇔)
↳29 QDP
↳30 QReductionProof (⇔)
↳31 QDP
↳32 Rewriting (⇔)
↳33 QDP
↳34 UsableRulesProof (⇔)
↳35 QDP
↳36 QReductionProof (⇔)
↳37 QDP
↳38 NonTerminationProof (⇔)
↳39 FALSE
↳40 PiDP
↳41 UsableRulesProof (⇔)
↳42 PiDP
↳43 PiDPToQDPProof (⇐)
↳44 QDP
↳45 UsableRulesReductionPairsProof (⇔)
↳46 QDP
↳47 Narrowing (⇐)
↳48 QDP
↳49 Narrowing (⇐)
↳50 QDP
↳51 Narrowing (⇐)
↳52 QDP
↳53 UsableRulesProof (⇔)
↳54 QDP
↳55 QReductionProof (⇔)
↳56 QDP
↳57 Instantiation (⇔)
↳58 QDP
↳59 Instantiation (⇔)
↳60 QDP
↳61 Instantiation (⇔)
↳62 QDP
↳63 NonTerminationProof (⇔)
↳64 FALSE
↳65 PrologToPiTRSProof (⇐)
↳66 PiTRS
↳67 DependencyPairsProof (⇔)
↳68 PiDP
↳69 DependencyGraphProof (⇔)
↳70 AND
↳71 PiDP
↳72 UsableRulesProof (⇔)
↳73 PiDP
↳74 PiDPToQDPProof (⇐)
↳75 QDP
↳76 Rewriting (⇔)
↳77 QDP
↳78 Rewriting (⇔)
↳79 QDP
↳80 Rewriting (⇔)
↳81 QDP
↳82 Rewriting (⇔)
↳83 QDP
↳84 UsableRulesProof (⇔)
↳85 QDP
↳86 QReductionProof (⇔)
↳87 QDP
↳88 Rewriting (⇔)
↳89 QDP
↳90 UsableRulesProof (⇔)
↳91 QDP
↳92 QReductionProof (⇔)
↳93 QDP
↳94 Rewriting (⇔)
↳95 QDP
↳96 UsableRulesProof (⇔)
↳97 QDP
↳98 QReductionProof (⇔)
↳99 QDP
↳100 NonTerminationProof (⇔)
↳101 FALSE
↳102 PiDP
↳103 UsableRulesProof (⇔)
↳104 PiDP
↳105 PiDPToQDPProof (⇐)
↳106 QDP
↳107 Narrowing (⇐)
↳108 QDP
↳109 Narrowing (⇐)
↳110 QDP
↳111 Narrowing (⇐)
↳112 QDP
↳113 UsableRulesProof (⇔)
↳114 QDP
↳115 QReductionProof (⇔)
↳116 QDP
↳117 Instantiation (⇔)
↳118 QDP
↳119 Instantiation (⇔)
↳120 QDP
↳121 Instantiation (⇔)
↳122 QDP
↳123 DependencyGraphProof (⇔)
↳124 AND
↳125 QDP
↳126 NonTerminationProof (⇔)
↳127 FALSE
↳128 QDP
↳129 QDPSizeChangeProof (⇔)
↳130 TRUE
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
GOAL_IN_G(X) → U1_G(X, s2t_in_ga(X, T))
GOAL_IN_G(X) → S2T_IN_GA(X, T)
S2T_IN_GA(0, L) → U18_GA(L, eq_in_ag(L, nil))
S2T_IN_GA(0, L) → EQ_IN_AG(L, nil)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X3, T)) → P_IN_GA(X, P)
U19_GA(X, T, X3, p_out_ga(X, P)) → U20_GA(X, T, X3, s2t_in_ga(P, T))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
S2T_IN_GA(X, node(nil, X4, T)) → P_IN_GA(X, P)
U21_GA(X, X4, T, p_out_ga(X, P)) → U22_GA(X, X4, T, s2t_in_ga(P, T))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X5, nil)) → P_IN_GA(X, P)
U23_GA(X, T, X5, p_out_ga(X, P)) → U24_GA(X, T, X5, s2t_in_ga(P, T))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
U1_G(X, s2t_out_ga(X, T)) → U2_G(X, tappend_in_aaa(T, X1, X2))
U1_G(X, s2t_out_ga(X, T)) → TAPPEND_IN_AAA(T, X1, X2)
TAPPEND_IN_AAA(nil, Y, Z) → U3_AAA(Y, Z, eq_in_aa(Y, Z))
TAPPEND_IN_AAA(nil, Y, Z) → EQ_IN_AA(Y, Z)
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → U4_AAA(T, T1, X, T2, left_in_ag(T, nil))
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → LEFT_IN_AG(T, nil)
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → U5_AAA(T, T1, X, T2, right_in_aa(T, T2))
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → RIGHT_IN_AA(T, T2)
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → U6_AAA(T, T1, X, T2, value_in_aa(T, X))
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → U7_AAA(T, T2, T1, X, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → LEFT_IN_AA(T, T1)
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → U8_AAA(T, T2, T1, X, right_in_ag(T, nil))
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → RIGHT_IN_AG(T, nil)
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → U9_AAA(T, T2, T1, X, value_in_aa(T, X))
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → LEFT_IN_AA(T, T1)
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_AAA(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → LEFT_IN_AA(T, T1)
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → U17_AAA(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
GOAL_IN_G(X) → U1_G(X, s2t_in_ga(X, T))
GOAL_IN_G(X) → S2T_IN_GA(X, T)
S2T_IN_GA(0, L) → U18_GA(L, eq_in_ag(L, nil))
S2T_IN_GA(0, L) → EQ_IN_AG(L, nil)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X3, T)) → P_IN_GA(X, P)
U19_GA(X, T, X3, p_out_ga(X, P)) → U20_GA(X, T, X3, s2t_in_ga(P, T))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
S2T_IN_GA(X, node(nil, X4, T)) → P_IN_GA(X, P)
U21_GA(X, X4, T, p_out_ga(X, P)) → U22_GA(X, X4, T, s2t_in_ga(P, T))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X5, nil)) → P_IN_GA(X, P)
U23_GA(X, T, X5, p_out_ga(X, P)) → U24_GA(X, T, X5, s2t_in_ga(P, T))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
U1_G(X, s2t_out_ga(X, T)) → U2_G(X, tappend_in_aaa(T, X1, X2))
U1_G(X, s2t_out_ga(X, T)) → TAPPEND_IN_AAA(T, X1, X2)
TAPPEND_IN_AAA(nil, Y, Z) → U3_AAA(Y, Z, eq_in_aa(Y, Z))
TAPPEND_IN_AAA(nil, Y, Z) → EQ_IN_AA(Y, Z)
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → U4_AAA(T, T1, X, T2, left_in_ag(T, nil))
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → LEFT_IN_AG(T, nil)
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → U5_AAA(T, T1, X, T2, right_in_aa(T, T2))
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → RIGHT_IN_AA(T, T2)
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → U6_AAA(T, T1, X, T2, value_in_aa(T, X))
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → U7_AAA(T, T2, T1, X, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → LEFT_IN_AA(T, T1)
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → U8_AAA(T, T2, T1, X, right_in_ag(T, nil))
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → RIGHT_IN_AG(T, nil)
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → U9_AAA(T, T2, T1, X, value_in_aa(T, X))
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → LEFT_IN_AA(T, T1)
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_AAA(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → LEFT_IN_AA(T, T1)
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → U17_AAA(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
TAPPEND_IN_AAA → U10_AAA(left_in_aa)
U10_AAA(left_out_aa) → U11_AAA(right_in_aa)
U11_AAA(right_out_aa) → U12_AAA(value_in_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_in_aa)
U11_AAA(right_out_aa) → U12_AAA(value_in_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_in_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
value_in_aa → value_out_aa
right_in_aa → right_out_aa
left_in_aa
right_in_aa
value_in_aa
left_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
value_in_aa → value_out_aa
right_in_aa → right_out_aa
right_in_aa
value_in_aa
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
value_in_aa → value_out_aa
right_in_aa → right_out_aa
right_in_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
value_in_aa → value_out_aa
right_in_aa
value_in_aa
right_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
value_in_aa → value_out_aa
value_in_aa
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
value_in_aa → value_out_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
value_in_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
S2T_IN_GA(X) → U19_GA(p_in_ga(X))
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U21_GA(p_in_ga(X))
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(p_in_ga(X))
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
p_in_ga(0) → p_out_ga(0)
p_in_ga(s(X)) → p_out_ga(X)
p_in_ga(x0)
Used ordering: POLO with Polynomial interpretation [POLO]:
p_in_ga(s(X)) → p_out_ga(X)
POL(0) = 0
POL(S2T_IN_GA(x1)) = x1
POL(U19_GA(x1)) = x1
POL(U21_GA(x1)) = x1
POL(U23_GA(x1)) = x1
POL(p_in_ga(x1)) = x1
POL(p_out_ga(x1)) = 2·x1
POL(s(x1)) = 2 + 2·x1
S2T_IN_GA(X) → U19_GA(p_in_ga(X))
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U21_GA(p_in_ga(X))
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(p_in_ga(X))
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
p_in_ga(0) → p_out_ga(0)
p_in_ga(x0)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U21_GA(p_in_ga(X))
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(p_in_ga(X))
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
p_in_ga(0) → p_out_ga(0)
p_in_ga(x0)
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(p_in_ga(X))
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
p_in_ga(0) → p_out_ga(0)
p_in_ga(x0)
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
p_in_ga(0) → p_out_ga(0)
p_in_ga(x0)
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
p_in_ga(x0)
p_in_ga(x0)
U19_GA(p_out_ga(P)) → S2T_IN_GA(P)
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
U19_GA(p_out_ga(0)) → S2T_IN_GA(0)
U21_GA(p_out_ga(P)) → S2T_IN_GA(P)
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
U19_GA(p_out_ga(0)) → S2T_IN_GA(0)
U21_GA(p_out_ga(0)) → S2T_IN_GA(0)
U23_GA(p_out_ga(P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
U19_GA(p_out_ga(0)) → S2T_IN_GA(0)
U21_GA(p_out_ga(0)) → S2T_IN_GA(0)
U23_GA(p_out_ga(0)) → S2T_IN_GA(0)
S2T_IN_GA(0) → U19_GA(p_out_ga(0))
S2T_IN_GA(0) → U21_GA(p_out_ga(0))
S2T_IN_GA(0) → U23_GA(p_out_ga(0))
U19_GA(p_out_ga(0)) → S2T_IN_GA(0)
U21_GA(p_out_ga(0)) → S2T_IN_GA(0)
U23_GA(p_out_ga(0)) → S2T_IN_GA(0)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
GOAL_IN_G(X) → U1_G(X, s2t_in_ga(X, T))
GOAL_IN_G(X) → S2T_IN_GA(X, T)
S2T_IN_GA(0, L) → U18_GA(L, eq_in_ag(L, nil))
S2T_IN_GA(0, L) → EQ_IN_AG(L, nil)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X3, T)) → P_IN_GA(X, P)
U19_GA(X, T, X3, p_out_ga(X, P)) → U20_GA(X, T, X3, s2t_in_ga(P, T))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
S2T_IN_GA(X, node(nil, X4, T)) → P_IN_GA(X, P)
U21_GA(X, X4, T, p_out_ga(X, P)) → U22_GA(X, X4, T, s2t_in_ga(P, T))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X5, nil)) → P_IN_GA(X, P)
U23_GA(X, T, X5, p_out_ga(X, P)) → U24_GA(X, T, X5, s2t_in_ga(P, T))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
U1_G(X, s2t_out_ga(X, T)) → U2_G(X, tappend_in_aaa(T, X1, X2))
U1_G(X, s2t_out_ga(X, T)) → TAPPEND_IN_AAA(T, X1, X2)
TAPPEND_IN_AAA(nil, Y, Z) → U3_AAA(Y, Z, eq_in_aa(Y, Z))
TAPPEND_IN_AAA(nil, Y, Z) → EQ_IN_AA(Y, Z)
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → U4_AAA(T, T1, X, T2, left_in_ag(T, nil))
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → LEFT_IN_AG(T, nil)
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → U5_AAA(T, T1, X, T2, right_in_aa(T, T2))
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → RIGHT_IN_AA(T, T2)
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → U6_AAA(T, T1, X, T2, value_in_aa(T, X))
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → U7_AAA(T, T2, T1, X, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → LEFT_IN_AA(T, T1)
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → U8_AAA(T, T2, T1, X, right_in_ag(T, nil))
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → RIGHT_IN_AG(T, nil)
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → U9_AAA(T, T2, T1, X, value_in_aa(T, X))
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → LEFT_IN_AA(T, T1)
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_AAA(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → LEFT_IN_AA(T, T1)
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → U17_AAA(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
GOAL_IN_G(X) → U1_G(X, s2t_in_ga(X, T))
GOAL_IN_G(X) → S2T_IN_GA(X, T)
S2T_IN_GA(0, L) → U18_GA(L, eq_in_ag(L, nil))
S2T_IN_GA(0, L) → EQ_IN_AG(L, nil)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X3, T)) → P_IN_GA(X, P)
U19_GA(X, T, X3, p_out_ga(X, P)) → U20_GA(X, T, X3, s2t_in_ga(P, T))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
S2T_IN_GA(X, node(nil, X4, T)) → P_IN_GA(X, P)
U21_GA(X, X4, T, p_out_ga(X, P)) → U22_GA(X, X4, T, s2t_in_ga(P, T))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
S2T_IN_GA(X, node(T, X5, nil)) → P_IN_GA(X, P)
U23_GA(X, T, X5, p_out_ga(X, P)) → U24_GA(X, T, X5, s2t_in_ga(P, T))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
U1_G(X, s2t_out_ga(X, T)) → U2_G(X, tappend_in_aaa(T, X1, X2))
U1_G(X, s2t_out_ga(X, T)) → TAPPEND_IN_AAA(T, X1, X2)
TAPPEND_IN_AAA(nil, Y, Z) → U3_AAA(Y, Z, eq_in_aa(Y, Z))
TAPPEND_IN_AAA(nil, Y, Z) → EQ_IN_AA(Y, Z)
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → U4_AAA(T, T1, X, T2, left_in_ag(T, nil))
TAPPEND_IN_AAA(T, T1, node(T1, X, T2)) → LEFT_IN_AG(T, nil)
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → U5_AAA(T, T1, X, T2, right_in_aa(T, T2))
U4_AAA(T, T1, X, T2, left_out_ag(T, nil)) → RIGHT_IN_AA(T, T2)
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → U6_AAA(T, T1, X, T2, value_in_aa(T, X))
U5_AAA(T, T1, X, T2, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → U7_AAA(T, T2, T1, X, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T2, node(T1, X, T2)) → LEFT_IN_AA(T, T1)
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → U8_AAA(T, T2, T1, X, right_in_ag(T, nil))
U7_AAA(T, T2, T1, X, left_out_aa(T, T1)) → RIGHT_IN_AG(T, nil)
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → U9_AAA(T, T2, T1, X, value_in_aa(T, X))
U8_AAA(T, T2, T1, X, right_out_ag(T, nil)) → VALUE_IN_AA(T, X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → LEFT_IN_AA(T, T1)
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_AAA(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → LEFT_IN_AA(T, T1)
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → RIGHT_IN_AA(T, T2)
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → VALUE_IN_AA(T, X)
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → U17_AAA(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
TAPPEND_IN_AAA(T, T3, node(U, X, T2)) → U10_AAA(T, T3, U, X, T2, left_in_aa(T, T1))
U10_AAA(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_AAA(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_AAA(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_AAA(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_AAA(T, T3, U, X, T2, T1, value_out_aa(T, X)) → TAPPEND_IN_AAA(T1, T3, U)
TAPPEND_IN_AAA(T, T1, node(T1, X, U)) → U14_AAA(T, T1, X, U, left_in_aa(T, T1))
U14_AAA(T, T1, X, U, left_out_aa(T, T1)) → U15_AAA(T, T1, X, U, right_in_aa(T, T2))
U15_AAA(T, T1, X, U, right_out_aa(T, T2)) → U16_AAA(T, T1, X, U, T2, value_in_aa(T, X))
U16_AAA(T, T1, X, U, T2, value_out_aa(T, X)) → TAPPEND_IN_AAA(T2, T3, U)
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
TAPPEND_IN_AAA → U10_AAA(left_in_aa)
U10_AAA(left_out_aa) → U11_AAA(right_in_aa)
U11_AAA(right_out_aa) → U12_AAA(value_in_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_in_aa)
U11_AAA(right_out_aa) → U12_AAA(value_in_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_in_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U14_AAA(left_in_aa)
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
left_in_aa → left_out_aa
right_in_aa → right_out_aa
value_in_aa → value_out_aa
left_in_aa
right_in_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
value_in_aa → value_out_aa
right_in_aa → right_out_aa
left_in_aa
right_in_aa
value_in_aa
left_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U14_AAA(left_out_aa) → U15_AAA(right_in_aa)
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
value_in_aa → value_out_aa
right_in_aa → right_out_aa
right_in_aa
value_in_aa
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
value_in_aa → value_out_aa
right_in_aa → right_out_aa
right_in_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
value_in_aa → value_out_aa
right_in_aa
value_in_aa
right_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U15_AAA(right_out_aa) → U16_AAA(value_in_aa)
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
value_in_aa → value_out_aa
value_in_aa
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
value_in_aa → value_out_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
value_in_aa
value_in_aa
U12_AAA(value_out_aa) → TAPPEND_IN_AAA
U16_AAA(value_out_aa) → TAPPEND_IN_AAA
TAPPEND_IN_AAA → U10_AAA(left_out_aa)
U10_AAA(left_out_aa) → U11_AAA(right_out_aa)
U11_AAA(right_out_aa) → U12_AAA(value_out_aa)
TAPPEND_IN_AAA → U14_AAA(left_out_aa)
U14_AAA(left_out_aa) → U15_AAA(right_out_aa)
U15_AAA(right_out_aa) → U16_AAA(value_out_aa)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
goal_in_g(X) → U1_g(X, s2t_in_ga(X, T))
s2t_in_ga(0, L) → U18_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ga(L, eq_out_ag(L, nil)) → s2t_out_ga(0, L)
s2t_in_ga(X, node(T, X3, T)) → U19_ga(X, T, X3, p_in_ga(X, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U19_ga(X, T, X3, p_out_ga(X, P)) → U20_ga(X, T, X3, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X4, T)) → U21_ga(X, X4, T, p_in_ga(X, P))
U21_ga(X, X4, T, p_out_ga(X, P)) → U22_ga(X, X4, T, s2t_in_ga(P, T))
s2t_in_ga(X, node(T, X5, nil)) → U23_ga(X, T, X5, p_in_ga(X, P))
U23_ga(X, T, X5, p_out_ga(X, P)) → U24_ga(X, T, X5, s2t_in_ga(P, T))
s2t_in_ga(X, node(nil, X6, nil)) → s2t_out_ga(X, node(nil, X6, nil))
U24_ga(X, T, X5, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X5, nil))
U22_ga(X, X4, T, s2t_out_ga(P, T)) → s2t_out_ga(X, node(nil, X4, T))
U20_ga(X, T, X3, s2t_out_ga(P, T)) → s2t_out_ga(X, node(T, X3, T))
U1_g(X, s2t_out_ga(X, T)) → U2_g(X, tappend_in_aaa(T, X1, X2))
tappend_in_aaa(nil, Y, Z) → U3_aaa(Y, Z, eq_in_aa(Y, Z))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_aaa(Y, Z, eq_out_aa(Y, Z)) → tappend_out_aaa(nil, Y, Z)
tappend_in_aaa(T, T1, node(T1, X, T2)) → U4_aaa(T, T1, X, T2, left_in_ag(T, nil))
left_in_ag(nil, nil) → left_out_ag(nil, nil)
left_in_ag(node(L, X7, X8), L) → left_out_ag(node(L, X7, X8), L)
U4_aaa(T, T1, X, T2, left_out_ag(T, nil)) → U5_aaa(T, T1, X, T2, right_in_aa(T, T2))
right_in_aa(nil, nil) → right_out_aa(nil, nil)
right_in_aa(node(X9, X10, R), R) → right_out_aa(node(X9, X10, R), R)
U5_aaa(T, T1, X, T2, right_out_aa(T, T2)) → U6_aaa(T, T1, X, T2, value_in_aa(T, X))
value_in_aa(nil, nil) → value_out_aa(nil, nil)
value_in_aa(node(X11, X, X12), X) → value_out_aa(node(X11, X, X12), X)
U6_aaa(T, T1, X, T2, value_out_aa(T, X)) → tappend_out_aaa(T, T1, node(T1, X, T2))
tappend_in_aaa(T, T2, node(T1, X, T2)) → U7_aaa(T, T2, T1, X, left_in_aa(T, T1))
left_in_aa(nil, nil) → left_out_aa(nil, nil)
left_in_aa(node(L, X7, X8), L) → left_out_aa(node(L, X7, X8), L)
U7_aaa(T, T2, T1, X, left_out_aa(T, T1)) → U8_aaa(T, T2, T1, X, right_in_ag(T, nil))
right_in_ag(nil, nil) → right_out_ag(nil, nil)
right_in_ag(node(X9, X10, R), R) → right_out_ag(node(X9, X10, R), R)
U8_aaa(T, T2, T1, X, right_out_ag(T, nil)) → U9_aaa(T, T2, T1, X, value_in_aa(T, X))
U9_aaa(T, T2, T1, X, value_out_aa(T, X)) → tappend_out_aaa(T, T2, node(T1, X, T2))
tappend_in_aaa(T, T3, node(U, X, T2)) → U10_aaa(T, T3, U, X, T2, left_in_aa(T, T1))
U10_aaa(T, T3, U, X, T2, left_out_aa(T, T1)) → U11_aaa(T, T3, U, X, T2, T1, right_in_aa(T, T2))
U11_aaa(T, T3, U, X, T2, T1, right_out_aa(T, T2)) → U12_aaa(T, T3, U, X, T2, T1, value_in_aa(T, X))
U12_aaa(T, T3, U, X, T2, T1, value_out_aa(T, X)) → U13_aaa(T, T3, U, X, T2, tappend_in_aaa(T1, T3, U))
tappend_in_aaa(T, T1, node(T1, X, U)) → U14_aaa(T, T1, X, U, left_in_aa(T, T1))
U14_aaa(T, T1, X, U, left_out_aa(T, T1)) → U15_aaa(T, T1, X, U, right_in_aa(T, T2))
U15_aaa(T, T1, X, U, right_out_aa(T, T2)) → U16_aaa(T, T1, X, U, T2, value_in_aa(T, X))
U16_aaa(T, T1, X, U, T2, value_out_aa(T, X)) → U17_aaa(T, T1, X, U, tappend_in_aaa(T2, T3, U))
U17_aaa(T, T1, X, U, tappend_out_aaa(T2, T3, U)) → tappend_out_aaa(T, T1, node(T1, X, U))
U13_aaa(T, T3, U, X, T2, tappend_out_aaa(T1, T3, U)) → tappend_out_aaa(T, T3, node(U, X, T2))
U2_g(X, tappend_out_aaa(T, X1, X2)) → goal_out_g(X)
S2T_IN_GA(X, node(T, X3, T)) → U19_GA(X, T, X3, p_in_ga(X, P))
U19_GA(X, T, X3, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(nil, X4, T)) → U21_GA(X, X4, T, p_in_ga(X, P))
U21_GA(X, X4, T, p_out_ga(X, P)) → S2T_IN_GA(P, T)
S2T_IN_GA(X, node(T, X5, nil)) → U23_GA(X, T, X5, p_in_ga(X, P))
U23_GA(X, T, X5, p_out_ga(X, P)) → S2T_IN_GA(P, T)
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
S2T_IN_GA(X) → U19_GA(X, p_in_ga(X))
U19_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U21_GA(X, p_in_ga(X))
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(X, p_in_ga(X))
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_ga(x0)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U21_GA(X, p_in_ga(X))
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(X, p_in_ga(X))
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_ga(x0)
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(X) → U23_GA(X, p_in_ga(X))
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_ga(x0)
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_ga(x0)
U19_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
p_in_ga(x0)
p_in_ga(x0)
U19_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U19_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U21_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U19_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U21_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U21_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U23_GA(X, p_out_ga(X, P)) → S2T_IN_GA(P)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U19_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U21_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U21_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U23_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U23_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U19_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U21_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U21_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U23_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
U23_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
U19_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
S2T_IN_GA(0) → U19_GA(0, p_out_ga(0, 0))
S2T_IN_GA(0) → U21_GA(0, p_out_ga(0, 0))
U21_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
S2T_IN_GA(0) → U23_GA(0, p_out_ga(0, 0))
U23_GA(0, p_out_ga(0, 0)) → S2T_IN_GA(0)
S2T_IN_GA(s(x0)) → U19_GA(s(x0), p_out_ga(s(x0), x0))
U19_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
S2T_IN_GA(s(x0)) → U21_GA(s(x0), p_out_ga(s(x0), x0))
U21_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
S2T_IN_GA(s(x0)) → U23_GA(s(x0), p_out_ga(s(x0), x0))
U23_GA(s(z0), p_out_ga(s(z0), z0)) → S2T_IN_GA(z0)
From the DPs we obtained the following set of size-change graphs: