(0) Obligation:

Clauses:

sameleaves(leaf(L), leaf(L)).
sameleaves(tree(T1, T2), tree(S1, S2)) :- ','(getleave(T1, T2, L, T), ','(getleave(S1, S2, L, S), sameleaves(T, S))).
getleave(leaf(A), C, A, C).
getleave(tree(A, B), C, L, O) :- getleave(A, tree(B, C), L, O).

Queries:

sameleaves(g,g).

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

getleave14(leaf(T42), T43, T42, T43).
getleave14(tree(T52, T53), T54, T55, X72) :- getleave14(T52, tree(T53, T54), T55, X72).
p7(leaf(T23), T24, T23, T24, T13, T14, X18) :- getleave14(T13, T14, T23, X18).
p7(leaf(T23), T24, T23, T24, T13, T14, T29) :- ','(getleave14(T13, T14, T23, T29), sameleaves1(T24, T29)).
p7(tree(T70, T71), T72, X103, X104, T13, T14, X18) :- p7(T70, tree(T71, T72), X103, X104, T13, T14, X18).
sameleaves1(leaf(T6), leaf(T6)).
sameleaves1(tree(T11, T12), tree(T13, T14)) :- p7(T11, T12, X16, X17, T13, T14, X18).

Queries:

sameleaves1(g,g).

(3) PrologToPiTRSProof (SOUND transformation)

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

sameleaves1_in_gg(leaf(T6), leaf(T6)) → sameleaves1_out_gg(leaf(T6), leaf(T6))
sameleaves1_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_ggaagga(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)
U2_ggaagga(T23, T24, T13, T14, X18, getleave14_out_ggga(T13, T14, T23, X18)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18)
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_out_gg(T24, T29)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
p7_in_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_out_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18)) → p7_out_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18)
U6_gg(T11, T12, T13, T14, p7_out_ggaagga(T11, T12, X16, X17, T13, T14, X18)) → sameleaves1_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleaves1_in_gg(x1, x2)  =  sameleaves1_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves1_out_gg(x1, x2)  =  sameleaves1_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
p7_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
p7_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

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

sameleaves1_in_gg(leaf(T6), leaf(T6)) → sameleaves1_out_gg(leaf(T6), leaf(T6))
sameleaves1_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_ggaagga(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)
U2_ggaagga(T23, T24, T13, T14, X18, getleave14_out_ggga(T13, T14, T23, X18)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18)
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_out_gg(T24, T29)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
p7_in_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_out_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18)) → p7_out_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18)
U6_gg(T11, T12, T13, T14, p7_out_ggaagga(T11, T12, X16, X17, T13, T14, X18)) → sameleaves1_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleaves1_in_gg(x1, x2)  =  sameleaves1_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves1_out_gg(x1, x2)  =  sameleaves1_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
p7_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
p7_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → U6_GG(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → P7_IN_GGAAGGA(T11, T12, X16, X17, T13, T14, X18)
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_GGAAGGA(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X18) → GETLEAVE14_IN_GGGA(T13, T14, T23, X18)
GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55, X72) → U1_GGGA(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55, X72) → GETLEAVE14_IN_GGGA(T52, tree(T53, T54), T55, X72)
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_GGAAGGA(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → SAMELEAVES1_IN_GG(T24, T29)
P7_IN_GGAAGGA(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_GGAAGGA(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
P7_IN_GGAAGGA(tree(T70, T71), T72, X103, X104, T13, T14, X18) → P7_IN_GGAAGGA(T70, tree(T71, T72), X103, X104, T13, T14, X18)

The TRS R consists of the following rules:

sameleaves1_in_gg(leaf(T6), leaf(T6)) → sameleaves1_out_gg(leaf(T6), leaf(T6))
sameleaves1_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_ggaagga(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)
U2_ggaagga(T23, T24, T13, T14, X18, getleave14_out_ggga(T13, T14, T23, X18)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18)
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_out_gg(T24, T29)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
p7_in_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_out_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18)) → p7_out_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18)
U6_gg(T11, T12, T13, T14, p7_out_ggaagga(T11, T12, X16, X17, T13, T14, X18)) → sameleaves1_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleaves1_in_gg(x1, x2)  =  sameleaves1_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves1_out_gg(x1, x2)  =  sameleaves1_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
p7_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
p7_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
SAMELEAVES1_IN_GG(x1, x2)  =  SAMELEAVES1_IN_GG(x1, x2)
U6_GG(x1, x2, x3, x4, x5)  =  U6_GG(x5)
P7_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  P7_IN_GGAAGGA(x1, x2, x5, x6)
U2_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGAAGGA(x1, x2, x6)
GETLEAVE14_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE14_IN_GGGA(x1, x2, x3)
U1_GGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGA(x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)
U4_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGAAGGA(x1, x2, x5, x6)
U5_GGAAGGA(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_GGAAGGA(x9)

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

(6) Obligation:

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

SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → U6_GG(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → P7_IN_GGAAGGA(T11, T12, X16, X17, T13, T14, X18)
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_GGAAGGA(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X18) → GETLEAVE14_IN_GGGA(T13, T14, T23, X18)
GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55, X72) → U1_GGGA(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55, X72) → GETLEAVE14_IN_GGGA(T52, tree(T53, T54), T55, X72)
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_GGAAGGA(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → SAMELEAVES1_IN_GG(T24, T29)
P7_IN_GGAAGGA(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_GGAAGGA(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
P7_IN_GGAAGGA(tree(T70, T71), T72, X103, X104, T13, T14, X18) → P7_IN_GGAAGGA(T70, tree(T71, T72), X103, X104, T13, T14, X18)

The TRS R consists of the following rules:

sameleaves1_in_gg(leaf(T6), leaf(T6)) → sameleaves1_out_gg(leaf(T6), leaf(T6))
sameleaves1_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_ggaagga(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)
U2_ggaagga(T23, T24, T13, T14, X18, getleave14_out_ggga(T13, T14, T23, X18)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18)
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_out_gg(T24, T29)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
p7_in_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_out_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18)) → p7_out_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18)
U6_gg(T11, T12, T13, T14, p7_out_ggaagga(T11, T12, X16, X17, T13, T14, X18)) → sameleaves1_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleaves1_in_gg(x1, x2)  =  sameleaves1_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves1_out_gg(x1, x2)  =  sameleaves1_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
p7_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
p7_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
SAMELEAVES1_IN_GG(x1, x2)  =  SAMELEAVES1_IN_GG(x1, x2)
U6_GG(x1, x2, x3, x4, x5)  =  U6_GG(x5)
P7_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  P7_IN_GGAAGGA(x1, x2, x5, x6)
U2_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGAAGGA(x1, x2, x6)
GETLEAVE14_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE14_IN_GGGA(x1, x2, x3)
U1_GGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGA(x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)
U4_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGAAGGA(x1, x2, x5, x6)
U5_GGAAGGA(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_GGAAGGA(x9)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55, X72) → GETLEAVE14_IN_GGGA(T52, tree(T53, T54), T55, X72)

The TRS R consists of the following rules:

sameleaves1_in_gg(leaf(T6), leaf(T6)) → sameleaves1_out_gg(leaf(T6), leaf(T6))
sameleaves1_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_ggaagga(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)
U2_ggaagga(T23, T24, T13, T14, X18, getleave14_out_ggga(T13, T14, T23, X18)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18)
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_out_gg(T24, T29)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
p7_in_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_out_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18)) → p7_out_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18)
U6_gg(T11, T12, T13, T14, p7_out_ggaagga(T11, T12, X16, X17, T13, T14, X18)) → sameleaves1_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleaves1_in_gg(x1, x2)  =  sameleaves1_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves1_out_gg(x1, x2)  =  sameleaves1_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
p7_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
p7_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
GETLEAVE14_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE14_IN_GGGA(x1, x2, x3)

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

(10) UsableRulesProof (EQUIVALENT transformation)

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

(11) Obligation:

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

GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55, X72) → GETLEAVE14_IN_GGGA(T52, tree(T53, T54), T55, X72)

R is empty.
The argument filtering Pi contains the following mapping:
tree(x1, x2)  =  tree(x1, x2)
GETLEAVE14_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVE14_IN_GGGA(x1, x2, x3)

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

(12) PiDPToQDPProof (SOUND transformation)

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

(13) Obligation:

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

GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55) → GETLEAVE14_IN_GGGA(T52, tree(T53, T54), T55)

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

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GETLEAVE14_IN_GGGA(tree(T52, T53), T54, T55) → GETLEAVE14_IN_GGGA(T52, tree(T53, T54), T55)
    The graph contains the following edges 1 > 1, 3 >= 3

(15) YES

(16) Obligation:

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

SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → P7_IN_GGAAGGA(T11, T12, X16, X17, T13, T14, X18)
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → SAMELEAVES1_IN_GG(T24, T29)
P7_IN_GGAAGGA(tree(T70, T71), T72, X103, X104, T13, T14, X18) → P7_IN_GGAAGGA(T70, tree(T71, T72), X103, X104, T13, T14, X18)

The TRS R consists of the following rules:

sameleaves1_in_gg(leaf(T6), leaf(T6)) → sameleaves1_out_gg(leaf(T6), leaf(T6))
sameleaves1_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, p7_in_ggaagga(T11, T12, X16, X17, T13, T14, X18))
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18) → U2_ggaagga(T23, T24, T13, T14, X18, getleave14_in_ggga(T13, T14, T23, X18))
getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)
U2_ggaagga(T23, T24, T13, T14, X18, getleave14_out_ggga(T13, T14, T23, X18)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X18)
p7_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleaves1_out_gg(T24, T29)) → p7_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
p7_in_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18) → U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_in_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18))
U5_ggaagga(T70, T71, T72, X103, X104, T13, T14, X18, p7_out_ggaagga(T70, tree(T71, T72), X103, X104, T13, T14, X18)) → p7_out_ggaagga(tree(T70, T71), T72, X103, X104, T13, T14, X18)
U6_gg(T11, T12, T13, T14, p7_out_ggaagga(T11, T12, X16, X17, T13, T14, X18)) → sameleaves1_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleaves1_in_gg(x1, x2)  =  sameleaves1_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleaves1_out_gg(x1, x2)  =  sameleaves1_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
p7_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
p7_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  p7_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
SAMELEAVES1_IN_GG(x1, x2)  =  SAMELEAVES1_IN_GG(x1, x2)
P7_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  P7_IN_GGAAGGA(x1, x2, x5, x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)

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

(17) UsableRulesProof (EQUIVALENT transformation)

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

(18) Obligation:

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

SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → P7_IN_GGAAGGA(T11, T12, X16, X17, T13, T14, X18)
P7_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleave14_out_ggga(T13, T14, T23, T29)) → SAMELEAVES1_IN_GG(T24, T29)
P7_IN_GGAAGGA(tree(T70, T71), T72, X103, X104, T13, T14, X18) → P7_IN_GGAAGGA(T70, tree(T71, T72), X103, X104, T13, T14, X18)

The TRS R consists of the following rules:

getleave14_in_ggga(leaf(T42), T43, T42, T43) → getleave14_out_ggga(leaf(T42), T43, T42, T43)
getleave14_in_ggga(tree(T52, T53), T54, T55, X72) → U1_ggga(T52, T53, T54, T55, X72, getleave14_in_ggga(T52, tree(T53, T54), T55, X72))
U1_ggga(T52, T53, T54, T55, X72, getleave14_out_ggga(T52, tree(T53, T54), T55, X72)) → getleave14_out_ggga(tree(T52, T53), T54, T55, X72)

The argument filtering Pi contains the following mapping:
leaf(x1)  =  leaf(x1)
tree(x1, x2)  =  tree(x1, x2)
getleave14_in_ggga(x1, x2, x3, x4)  =  getleave14_in_ggga(x1, x2, x3)
getleave14_out_ggga(x1, x2, x3, x4)  =  getleave14_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
SAMELEAVES1_IN_GG(x1, x2)  =  SAMELEAVES1_IN_GG(x1, x2)
P7_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  P7_IN_GGAAGGA(x1, x2, x5, x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)

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

(19) PiDPToQDPProof (SOUND transformation)

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

(20) Obligation:

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

SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → P7_IN_GGAAGGA(T11, T12, T13, T14)
P7_IN_GGAAGGA(leaf(T23), T24, T13, T14) → U3_GGAAGGA(T23, T24, getleave14_in_ggga(T13, T14, T23))
U3_GGAAGGA(T23, T24, getleave14_out_ggga(T29)) → SAMELEAVES1_IN_GG(T24, T29)
P7_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → P7_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleave14_in_ggga(leaf(T42), T43, T42) → getleave14_out_ggga(T43)
getleave14_in_ggga(tree(T52, T53), T54, T55) → U1_ggga(getleave14_in_ggga(T52, tree(T53, T54), T55))
U1_ggga(getleave14_out_ggga(X72)) → getleave14_out_ggga(X72)

The set Q consists of the following terms:

getleave14_in_ggga(x0, x1, x2)
U1_ggga(x0)

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

(21) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

P7_IN_GGAAGGA(leaf(T23), T24, T13, T14) → U3_GGAAGGA(T23, T24, getleave14_in_ggga(T13, T14, T23))
U3_GGAAGGA(T23, T24, getleave14_out_ggga(T29)) → SAMELEAVES1_IN_GG(T24, T29)
The following rules are removed from R:

getleave14_in_ggga(leaf(T42), T43, T42) → getleave14_out_ggga(T43)
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(P7_IN_GGAAGGA(x1, x2, x3, x4)) = 2·x1 + 2·x2 + 2·x3 + 2·x4   
POL(SAMELEAVES1_IN_GG(x1, x2)) = 2·x1 + 2·x2   
POL(U1_ggga(x1)) = x1   
POL(U3_GGAAGGA(x1, x2, x3)) = 1 + x1 + 2·x2 + x3   
POL(getleave14_in_ggga(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(getleave14_out_ggga(x1)) = 2·x1   
POL(leaf(x1)) = 2 + 2·x1   
POL(tree(x1, x2)) = x1 + x2   

(22) Obligation:

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

SAMELEAVES1_IN_GG(tree(T11, T12), tree(T13, T14)) → P7_IN_GGAAGGA(T11, T12, T13, T14)
P7_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → P7_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleave14_in_ggga(tree(T52, T53), T54, T55) → U1_ggga(getleave14_in_ggga(T52, tree(T53, T54), T55))
U1_ggga(getleave14_out_ggga(X72)) → getleave14_out_ggga(X72)

The set Q consists of the following terms:

getleave14_in_ggga(x0, x1, x2)
U1_ggga(x0)

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

(23) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(24) Obligation:

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

P7_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → P7_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleave14_in_ggga(tree(T52, T53), T54, T55) → U1_ggga(getleave14_in_ggga(T52, tree(T53, T54), T55))
U1_ggga(getleave14_out_ggga(X72)) → getleave14_out_ggga(X72)

The set Q consists of the following terms:

getleave14_in_ggga(x0, x1, x2)
U1_ggga(x0)

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

(25) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(26) Obligation:

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

P7_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → P7_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

R is empty.
The set Q consists of the following terms:

getleave14_in_ggga(x0, x1, x2)
U1_ggga(x0)

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

(27) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

getleave14_in_ggga(x0, x1, x2)
U1_ggga(x0)

(28) Obligation:

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

P7_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → P7_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

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

(29) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • P7_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → P7_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)
    The graph contains the following edges 1 > 1, 3 >= 3, 4 >= 4

(30) YES