0 Prolog
↳1 PrologToPiTRSProof (⇐)
↳2 PiTRS
↳3 DependencyPairsProof (⇔)
↳4 PiDP
↳5 DependencyGraphProof (⇔)
↳6 AND
↳7 PiDP
↳8 UsableRulesProof (⇔)
↳9 PiDP
↳10 PiDPToQDPProof (⇐)
↳11 QDP
↳12 QDPSizeChangeProof (⇔)
↳13 TRUE
↳14 PiDP
↳15 UsableRulesProof (⇔)
↳16 PiDP
↳17 PiDPToQDPProof (⇐)
↳18 QDP
↳19 QDPSizeChangeProof (⇔)
↳20 TRUE
↳21 PiDP
↳22 UsableRulesProof (⇔)
↳23 PiDP
↳24 PiDPToQDPProof (⇐)
↳25 QDP
↳26 Narrowing (⇐)
↳27 QDP
↳28 NonTerminationProof (⇔)
↳29 FALSE
↳30 PrologToPiTRSProof (⇐)
↳31 PiTRS
↳32 DependencyPairsProof (⇔)
↳33 PiDP
↳34 DependencyGraphProof (⇔)
↳35 AND
↳36 PiDP
↳37 UsableRulesProof (⇔)
↳38 PiDP
↳39 PiDPToQDPProof (⇐)
↳40 QDP
↳41 QDPSizeChangeProof (⇔)
↳42 TRUE
↳43 PiDP
↳44 UsableRulesProof (⇔)
↳45 PiDP
↳46 PiDPToQDPProof (⇐)
↳47 QDP
↳48 QDPSizeChangeProof (⇔)
↳49 TRUE
↳50 PiDP
↳51 UsableRulesProof (⇔)
↳52 PiDP
↳53 PiDPToQDPProof (⇐)
↳54 QDP
↳55 Narrowing (⇐)
↳56 QDP
↳57 NonTerminationProof (⇔)
↳58 FALSE
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → U1_AG(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AA(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AA(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGA(Ls, .(X, Rs), Xs)
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → U4_GGA(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AG(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AG(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGG(Ls, .(X, Rs), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → U4_GGG(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → U1_AG(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AA(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AA(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGA(Ls, .(X, Rs), Xs)
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → U4_GGA(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AG(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AG(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGG(Ls, .(X, Rs), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → U4_GGG(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
APP_IN_GGG(.(Xs), Ys, .(Zs)) → APP_IN_GGG(Xs, Ys, Zs)
From the DPs we obtained the following set of size-change graphs:
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
APP_IN_GGA(.(Xs), Ys) → APP_IN_GGA(Xs, Ys)
From the DPs we obtained the following set of size-change graphs:
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U1_AA(in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA
IN_ORDER_IN_AA → U1_AA(in_order_in_aa)
IN_ORDER_IN_AA → IN_ORDER_IN_AA
in_order_in_aa → in_order_out_aa(void, [])
in_order_in_aa → U1_aa(in_order_in_aa)
U1_aa(in_order_out_aa(Left, Ls)) → U2_aa(Left, Ls, in_order_in_aa)
U2_aa(Left, Ls, in_order_out_aa(Right, Rs)) → U3_aa(Left, Right, app_in_gga(Ls, .(Rs)))
U3_aa(Left, Right, app_out_gga(Xs)) → in_order_out_aa(tree(Left, Right), Xs)
app_in_gga([], X) → app_out_gga(X)
app_in_gga(.(Xs), Ys) → U4_gga(app_in_gga(Xs, Ys))
U4_gga(app_out_gga(Zs)) → app_out_gga(.(Zs))
in_order_in_aa
U1_aa(x0)
U2_aa(x0, x1, x2)
U3_aa(x0, x1, x2)
app_in_gga(x0, x1)
U4_gga(x0)
IN_ORDER_IN_AA → U1_AA(in_order_out_aa(void, []))
IN_ORDER_IN_AA → U1_AA(U1_aa(in_order_in_aa))
U1_AA(in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA
IN_ORDER_IN_AA → IN_ORDER_IN_AA
IN_ORDER_IN_AA → U1_AA(in_order_out_aa(void, []))
IN_ORDER_IN_AA → U1_AA(U1_aa(in_order_in_aa))
in_order_in_aa → in_order_out_aa(void, [])
in_order_in_aa → U1_aa(in_order_in_aa)
U1_aa(in_order_out_aa(Left, Ls)) → U2_aa(Left, Ls, in_order_in_aa)
U2_aa(Left, Ls, in_order_out_aa(Right, Rs)) → U3_aa(Left, Right, app_in_gga(Ls, .(Rs)))
U3_aa(Left, Right, app_out_gga(Xs)) → in_order_out_aa(tree(Left, Right), Xs)
app_in_gga([], X) → app_out_gga(X)
app_in_gga(.(Xs), Ys) → U4_gga(app_in_gga(Xs, Ys))
U4_gga(app_out_gga(Zs)) → app_out_gga(.(Zs))
in_order_in_aa
U1_aa(x0)
U2_aa(x0, x1, x2)
U3_aa(x0, x1, x2)
app_in_gga(x0, x1)
U4_gga(x0)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → U1_AG(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AA(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AA(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGA(Ls, .(X, Rs), Xs)
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → U4_GGA(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AG(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AG(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGG(Ls, .(X, Rs), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → U4_GGG(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → U1_AG(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AG(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AA(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AA(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
U2_AA(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGA(Ls, .(X, Rs), Xs)
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → U4_GGA(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_AG(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U1_AG(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_AG(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
U2_AG(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → APP_IN_GGG(Ls, .(X, Rs), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → U4_GGG(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
APP_IN_GGG(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGG(Xs, Ys, Zs)
APP_IN_GGG(.(Xs), Ys, .(Zs)) → APP_IN_GGG(Xs, Ys, Zs)
From the DPs we obtained the following set of size-change graphs:
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
APP_IN_GGA(.(X, Xs), Ys, .(X, Zs)) → APP_IN_GGA(Xs, Ys, Zs)
APP_IN_GGA(.(Xs), Ys) → APP_IN_GGA(Xs, Ys)
From the DPs we obtained the following set of size-change graphs:
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
in_order_in_ag(void, []) → in_order_out_ag(void, [])
in_order_in_ag(tree(X, Left, Right), Xs) → U1_ag(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
U1_ag(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_ag(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_ag(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_ag(X, Left, Right, Xs, app_in_ggg(Ls, .(X, Rs), Xs))
app_in_ggg([], X, X) → app_out_ggg([], X, X)
app_in_ggg(.(X, Xs), Ys, .(X, Zs)) → U4_ggg(X, Xs, Ys, Zs, app_in_ggg(Xs, Ys, Zs))
U4_ggg(X, Xs, Ys, Zs, app_out_ggg(Xs, Ys, Zs)) → app_out_ggg(.(X, Xs), Ys, .(X, Zs))
U3_ag(X, Left, Right, Xs, app_out_ggg(Ls, .(X, Rs), Xs)) → in_order_out_ag(tree(X, Left, Right), Xs)
U1_AA(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA(Right, Rs)
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → U1_AA(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
IN_ORDER_IN_AA(tree(X, Left, Right), Xs) → IN_ORDER_IN_AA(Left, Ls)
in_order_in_aa(void, []) → in_order_out_aa(void, [])
in_order_in_aa(tree(X, Left, Right), Xs) → U1_aa(X, Left, Right, Xs, in_order_in_aa(Left, Ls))
U1_aa(X, Left, Right, Xs, in_order_out_aa(Left, Ls)) → U2_aa(X, Left, Right, Xs, Ls, in_order_in_aa(Right, Rs))
U2_aa(X, Left, Right, Xs, Ls, in_order_out_aa(Right, Rs)) → U3_aa(X, Left, Right, Xs, app_in_gga(Ls, .(X, Rs), Xs))
U3_aa(X, Left, Right, Xs, app_out_gga(Ls, .(X, Rs), Xs)) → in_order_out_aa(tree(X, Left, Right), Xs)
app_in_gga([], X, X) → app_out_gga([], X, X)
app_in_gga(.(X, Xs), Ys, .(X, Zs)) → U4_gga(X, Xs, Ys, Zs, app_in_gga(Xs, Ys, Zs))
U4_gga(X, Xs, Ys, Zs, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(X, Xs), Ys, .(X, Zs))
U1_AA(in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA
IN_ORDER_IN_AA → U1_AA(in_order_in_aa)
IN_ORDER_IN_AA → IN_ORDER_IN_AA
in_order_in_aa → in_order_out_aa(void, [])
in_order_in_aa → U1_aa(in_order_in_aa)
U1_aa(in_order_out_aa(Left, Ls)) → U2_aa(Left, Ls, in_order_in_aa)
U2_aa(Left, Ls, in_order_out_aa(Right, Rs)) → U3_aa(Left, Right, app_in_gga(Ls, .(Rs)))
U3_aa(Left, Right, app_out_gga(Ls, .(Rs), Xs)) → in_order_out_aa(tree(Left, Right), Xs)
app_in_gga([], X) → app_out_gga([], X, X)
app_in_gga(.(Xs), Ys) → U4_gga(Xs, Ys, app_in_gga(Xs, Ys))
U4_gga(Xs, Ys, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(Xs), Ys, .(Zs))
in_order_in_aa
U1_aa(x0)
U2_aa(x0, x1, x2)
U3_aa(x0, x1, x2)
app_in_gga(x0, x1)
U4_gga(x0, x1, x2)
IN_ORDER_IN_AA → U1_AA(in_order_out_aa(void, []))
IN_ORDER_IN_AA → U1_AA(U1_aa(in_order_in_aa))
U1_AA(in_order_out_aa(Left, Ls)) → IN_ORDER_IN_AA
IN_ORDER_IN_AA → IN_ORDER_IN_AA
IN_ORDER_IN_AA → U1_AA(in_order_out_aa(void, []))
IN_ORDER_IN_AA → U1_AA(U1_aa(in_order_in_aa))
in_order_in_aa → in_order_out_aa(void, [])
in_order_in_aa → U1_aa(in_order_in_aa)
U1_aa(in_order_out_aa(Left, Ls)) → U2_aa(Left, Ls, in_order_in_aa)
U2_aa(Left, Ls, in_order_out_aa(Right, Rs)) → U3_aa(Left, Right, app_in_gga(Ls, .(Rs)))
U3_aa(Left, Right, app_out_gga(Ls, .(Rs), Xs)) → in_order_out_aa(tree(Left, Right), Xs)
app_in_gga([], X) → app_out_gga([], X, X)
app_in_gga(.(Xs), Ys) → U4_gga(Xs, Ys, app_in_gga(Xs, Ys))
U4_gga(Xs, Ys, app_out_gga(Xs, Ys, Zs)) → app_out_gga(.(Xs), Ys, .(Zs))
in_order_in_aa
U1_aa(x0)
U2_aa(x0, x1, x2)
U3_aa(x0, x1, x2)
app_in_gga(x0, x1)
U4_gga(x0, x1, x2)