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 PrologToPiTRSProof (⇐)
↳22 PiTRS
↳23 DependencyPairsProof (⇔)
↳24 PiDP
↳25 DependencyGraphProof (⇔)
↳26 AND
↳27 PiDP
↳28 UsableRulesProof (⇔)
↳29 PiDP
↳30 PiDPToQDPProof (⇔)
↳31 QDP
↳32 QDPSizeChangeProof (⇔)
↳33 TRUE
↳34 PiDP
↳35 UsableRulesProof (⇔)
↳36 PiDP
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → U5_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_GAG(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → LESS_IN_GG(Y, X)
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_GAG(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → U5_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_GAG(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → LESS_IN_GG(Y, X)
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_GAG(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_GAG(X, Y, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left1)
INSERT_IN_GAG(X, tree(Y, Left1, Right)) → U1_GAG(X, Y, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right1, less_in_gg(Y, X))
U3_GAG(X, Y, Left, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right1)
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
less_in_gg(x0, x1)
U5_gg(x0, x1, x2)
From the DPs we obtained the following set of size-change graphs:
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → U5_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_GAG(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → LESS_IN_GG(Y, X)
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_GAG(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → U5_GG(X, Y, less_in_gg(X, Y))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_GAG(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → LESS_IN_GG(Y, X)
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_GAG(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
LESS_IN_GG(s(X), s(Y)) → LESS_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
insert_in_gag(X, void, tree(X, void, void)) → insert_out_gag(X, void, tree(X, void, void))
insert_in_gag(X, tree(X, Left, Right), tree(X, Left, Right)) → insert_out_gag(X, tree(X, Left, Right), tree(X, Left, Right))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_gag(X, Y, Left, Right, Left1, less_in_gg(X, Y))
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))
U1_gag(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → U2_gag(X, Y, Left, Right, Left1, insert_in_gag(X, Left, Left1))
insert_in_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_gag(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_gag(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → U4_gag(X, Y, Left, Right, Right1, insert_in_gag(X, Right, Right1))
U4_gag(X, Y, Left, Right, Right1, insert_out_gag(X, Right, Right1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left, Right1))
U2_gag(X, Y, Left, Right, Left1, insert_out_gag(X, Left, Left1)) → insert_out_gag(X, tree(Y, Left, Right), tree(Y, Left1, Right))
U1_GAG(X, Y, Left, Right, Left1, less_out_gg(X, Y)) → INSERT_IN_GAG(X, Left, Left1)
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left1, Right)) → U1_GAG(X, Y, Left, Right, Left1, less_in_gg(X, Y))
INSERT_IN_GAG(X, tree(Y, Left, Right), tree(Y, Left, Right1)) → U3_GAG(X, Y, Left, Right, Right1, less_in_gg(Y, X))
U3_GAG(X, Y, Left, Right, Right1, less_out_gg(Y, X)) → INSERT_IN_GAG(X, Right, Right1)
less_in_gg(0, s(X1)) → less_out_gg(0, s(X1))
less_in_gg(s(X), s(Y)) → U5_gg(X, Y, less_in_gg(X, Y))
U5_gg(X, Y, less_out_gg(X, Y)) → less_out_gg(s(X), s(Y))