(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).

Query: sameleaves(g,g)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

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

sameleavesA_in_gg(leaf(T6), leaf(T6)) → sameleavesA_out_gg(leaf(T6), leaf(T6))
sameleavesA_in_gg(tree(T11, T12), tree(T13, T14)) → U1_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_ggaagga(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
pD_in_gggag(T13, T14, T23, T29, T24) → U5_gggag(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
getleaveC_in_ggga(leaf(T42), T43, T42, T43) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55, X63) → U2_ggga(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
U2_ggga(T52, T53, T54, T55, X63, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)
U5_gggag(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_gggag(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U6_gggag(T13, T14, T23, T29, T24, sameleavesA_out_gg(T24, T29)) → pD_out_gggag(T13, T14, T23, T29, T24)
U3_ggaagga(T23, T24, T13, T14, X17, pD_out_gggag(T13, T14, T23, X17, T24)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U1_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesA_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesA_in_gg(x1, x2)  =  sameleavesA_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesA_out_gg(x1, x2)  =  sameleavesA_out_gg(x1, x2)
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x1, x2, x3, x4, x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x3, x4, x6)
pD_in_gggag(x1, x2, x3, x4, x5)  =  pD_in_gggag(x1, x2, x3, x5)
U5_gggag(x1, x2, x3, x4, x5, x6)  =  U5_gggag(x1, x2, x3, x5, x6)
getleaveC_in_ggga(x1, x2, x3, x4)  =  getleaveC_in_ggga(x1, x2, x3)
getleaveC_out_ggga(x1, x2, x3, x4)  =  getleaveC_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
U6_gggag(x1, x2, x3, x4, x5, x6)  =  U6_gggag(x1, x2, x3, x4, x5, x6)
pD_out_gggag(x1, x2, x3, x4, x5)  =  pD_out_gggag(x1, x2, x3, x4, x5)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)
U4_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_ggaagga(x1, x2, x3, x6, x7, x9)

(3) DependencyPairsProof (EQUIVALENT transformation)

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

SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → U1_GG(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_GGAAGGA(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → PD_IN_GGGAG(T13, T14, T23, X17, T24)
PD_IN_GGGAG(T13, T14, T23, T29, T24) → U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
PD_IN_GGGAG(T13, T14, T23, T29, T24) → GETLEAVEC_IN_GGGA(T13, T14, T23, T29)
GETLEAVEC_IN_GGGA(tree(T52, T53), T54, T55, X63) → U2_GGGA(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
GETLEAVEC_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEC_IN_GGGA(T52, tree(T53, T54), T55, X63)
U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_GGGAG(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → SAMELEAVESA_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_GGAAGGA(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

sameleavesA_in_gg(leaf(T6), leaf(T6)) → sameleavesA_out_gg(leaf(T6), leaf(T6))
sameleavesA_in_gg(tree(T11, T12), tree(T13, T14)) → U1_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_ggaagga(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
pD_in_gggag(T13, T14, T23, T29, T24) → U5_gggag(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
getleaveC_in_ggga(leaf(T42), T43, T42, T43) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55, X63) → U2_ggga(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
U2_ggga(T52, T53, T54, T55, X63, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)
U5_gggag(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_gggag(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U6_gggag(T13, T14, T23, T29, T24, sameleavesA_out_gg(T24, T29)) → pD_out_gggag(T13, T14, T23, T29, T24)
U3_ggaagga(T23, T24, T13, T14, X17, pD_out_gggag(T13, T14, T23, X17, T24)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U1_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesA_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesA_in_gg(x1, x2)  =  sameleavesA_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesA_out_gg(x1, x2)  =  sameleavesA_out_gg(x1, x2)
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x1, x2, x3, x4, x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x3, x4, x6)
pD_in_gggag(x1, x2, x3, x4, x5)  =  pD_in_gggag(x1, x2, x3, x5)
U5_gggag(x1, x2, x3, x4, x5, x6)  =  U5_gggag(x1, x2, x3, x5, x6)
getleaveC_in_ggga(x1, x2, x3, x4)  =  getleaveC_in_ggga(x1, x2, x3)
getleaveC_out_ggga(x1, x2, x3, x4)  =  getleaveC_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
U6_gggag(x1, x2, x3, x4, x5, x6)  =  U6_gggag(x1, x2, x3, x4, x5, x6)
pD_out_gggag(x1, x2, x3, x4, x5)  =  pD_out_gggag(x1, x2, x3, x4, x5)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)
U4_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_ggaagga(x1, x2, x3, x6, x7, x9)
SAMELEAVESA_IN_GG(x1, x2)  =  SAMELEAVESA_IN_GG(x1, x2)
U1_GG(x1, x2, x3, x4, x5)  =  U1_GG(x1, x2, x3, x4, x5)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x3, x4, x6)
PD_IN_GGGAG(x1, x2, x3, x4, x5)  =  PD_IN_GGGAG(x1, x2, x3, x5)
U5_GGGAG(x1, x2, x3, x4, x5, x6)  =  U5_GGGAG(x1, x2, x3, x5, x6)
GETLEAVEC_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEC_IN_GGGA(x1, x2, x3)
U2_GGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGGA(x1, x2, x3, x4, x6)
U6_GGGAG(x1, x2, x3, x4, x5, x6)  =  U6_GGGAG(x1, x2, x3, x4, x5, x6)
U4_GGAAGGA(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_GGAAGGA(x1, x2, x3, x6, x7, x9)

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

(4) Obligation:

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

SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → U1_GG(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_GGAAGGA(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → PD_IN_GGGAG(T13, T14, T23, X17, T24)
PD_IN_GGGAG(T13, T14, T23, T29, T24) → U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
PD_IN_GGGAG(T13, T14, T23, T29, T24) → GETLEAVEC_IN_GGGA(T13, T14, T23, T29)
GETLEAVEC_IN_GGGA(tree(T52, T53), T54, T55, X63) → U2_GGGA(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
GETLEAVEC_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEC_IN_GGGA(T52, tree(T53, T54), T55, X63)
U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_GGGAG(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → SAMELEAVESA_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_GGAAGGA(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

sameleavesA_in_gg(leaf(T6), leaf(T6)) → sameleavesA_out_gg(leaf(T6), leaf(T6))
sameleavesA_in_gg(tree(T11, T12), tree(T13, T14)) → U1_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_ggaagga(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
pD_in_gggag(T13, T14, T23, T29, T24) → U5_gggag(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
getleaveC_in_ggga(leaf(T42), T43, T42, T43) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55, X63) → U2_ggga(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
U2_ggga(T52, T53, T54, T55, X63, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)
U5_gggag(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_gggag(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U6_gggag(T13, T14, T23, T29, T24, sameleavesA_out_gg(T24, T29)) → pD_out_gggag(T13, T14, T23, T29, T24)
U3_ggaagga(T23, T24, T13, T14, X17, pD_out_gggag(T13, T14, T23, X17, T24)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U1_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesA_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesA_in_gg(x1, x2)  =  sameleavesA_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesA_out_gg(x1, x2)  =  sameleavesA_out_gg(x1, x2)
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x1, x2, x3, x4, x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x3, x4, x6)
pD_in_gggag(x1, x2, x3, x4, x5)  =  pD_in_gggag(x1, x2, x3, x5)
U5_gggag(x1, x2, x3, x4, x5, x6)  =  U5_gggag(x1, x2, x3, x5, x6)
getleaveC_in_ggga(x1, x2, x3, x4)  =  getleaveC_in_ggga(x1, x2, x3)
getleaveC_out_ggga(x1, x2, x3, x4)  =  getleaveC_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
U6_gggag(x1, x2, x3, x4, x5, x6)  =  U6_gggag(x1, x2, x3, x4, x5, x6)
pD_out_gggag(x1, x2, x3, x4, x5)  =  pD_out_gggag(x1, x2, x3, x4, x5)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)
U4_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_ggaagga(x1, x2, x3, x6, x7, x9)
SAMELEAVESA_IN_GG(x1, x2)  =  SAMELEAVESA_IN_GG(x1, x2)
U1_GG(x1, x2, x3, x4, x5)  =  U1_GG(x1, x2, x3, x4, x5)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x3, x4, x6)
PD_IN_GGGAG(x1, x2, x3, x4, x5)  =  PD_IN_GGGAG(x1, x2, x3, x5)
U5_GGGAG(x1, x2, x3, x4, x5, x6)  =  U5_GGGAG(x1, x2, x3, x5, x6)
GETLEAVEC_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEC_IN_GGGA(x1, x2, x3)
U2_GGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGGA(x1, x2, x3, x4, x6)
U6_GGGAG(x1, x2, x3, x4, x5, x6)  =  U6_GGGAG(x1, x2, x3, x4, x5, x6)
U4_GGAAGGA(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_GGAAGGA(x1, x2, x3, x6, x7, x9)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

GETLEAVEC_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEC_IN_GGGA(T52, tree(T53, T54), T55, X63)

The TRS R consists of the following rules:

sameleavesA_in_gg(leaf(T6), leaf(T6)) → sameleavesA_out_gg(leaf(T6), leaf(T6))
sameleavesA_in_gg(tree(T11, T12), tree(T13, T14)) → U1_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_ggaagga(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
pD_in_gggag(T13, T14, T23, T29, T24) → U5_gggag(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
getleaveC_in_ggga(leaf(T42), T43, T42, T43) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55, X63) → U2_ggga(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
U2_ggga(T52, T53, T54, T55, X63, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)
U5_gggag(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_gggag(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U6_gggag(T13, T14, T23, T29, T24, sameleavesA_out_gg(T24, T29)) → pD_out_gggag(T13, T14, T23, T29, T24)
U3_ggaagga(T23, T24, T13, T14, X17, pD_out_gggag(T13, T14, T23, X17, T24)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U1_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesA_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesA_in_gg(x1, x2)  =  sameleavesA_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesA_out_gg(x1, x2)  =  sameleavesA_out_gg(x1, x2)
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x1, x2, x3, x4, x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x3, x4, x6)
pD_in_gggag(x1, x2, x3, x4, x5)  =  pD_in_gggag(x1, x2, x3, x5)
U5_gggag(x1, x2, x3, x4, x5, x6)  =  U5_gggag(x1, x2, x3, x5, x6)
getleaveC_in_ggga(x1, x2, x3, x4)  =  getleaveC_in_ggga(x1, x2, x3)
getleaveC_out_ggga(x1, x2, x3, x4)  =  getleaveC_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
U6_gggag(x1, x2, x3, x4, x5, x6)  =  U6_gggag(x1, x2, x3, x4, x5, x6)
pD_out_gggag(x1, x2, x3, x4, x5)  =  pD_out_gggag(x1, x2, x3, x4, x5)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)
U4_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_ggaagga(x1, x2, x3, x6, x7, x9)
GETLEAVEC_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEC_IN_GGGA(x1, x2, x3)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

GETLEAVEC_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEC_IN_GGGA(T52, tree(T53, T54), T55, X63)

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

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

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

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

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

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

(13) YES

(14) Obligation:

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

SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → PD_IN_GGGAG(T13, T14, T23, X17, T24)
PD_IN_GGGAG(T13, T14, T23, T29, T24) → U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → SAMELEAVESA_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

sameleavesA_in_gg(leaf(T6), leaf(T6)) → sameleavesA_out_gg(leaf(T6), leaf(T6))
sameleavesA_in_gg(tree(T11, T12), tree(T13, T14)) → U1_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U3_ggaagga(T23, T24, T13, T14, X17, pD_in_gggag(T13, T14, T23, X17, T24))
pD_in_gggag(T13, T14, T23, T29, T24) → U5_gggag(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
getleaveC_in_ggga(leaf(T42), T43, T42, T43) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55, X63) → U2_ggga(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
U2_ggga(T52, T53, T54, T55, X63, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)
U5_gggag(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → U6_gggag(T13, T14, T23, T29, T24, sameleavesA_in_gg(T24, T29))
U6_gggag(T13, T14, T23, T29, T24, sameleavesA_out_gg(T24, T29)) → pD_out_gggag(T13, T14, T23, T29, T24)
U3_ggaagga(T23, T24, T13, T14, X17, pD_out_gggag(T13, T14, T23, X17, T24)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U4_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U1_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesA_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesA_in_gg(x1, x2)  =  sameleavesA_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesA_out_gg(x1, x2)  =  sameleavesA_out_gg(x1, x2)
tree(x1, x2)  =  tree(x1, x2)
U1_gg(x1, x2, x3, x4, x5)  =  U1_gg(x1, x2, x3, x4, x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x3, x4, x6)
pD_in_gggag(x1, x2, x3, x4, x5)  =  pD_in_gggag(x1, x2, x3, x5)
U5_gggag(x1, x2, x3, x4, x5, x6)  =  U5_gggag(x1, x2, x3, x5, x6)
getleaveC_in_ggga(x1, x2, x3, x4)  =  getleaveC_in_ggga(x1, x2, x3)
getleaveC_out_ggga(x1, x2, x3, x4)  =  getleaveC_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
U6_gggag(x1, x2, x3, x4, x5, x6)  =  U6_gggag(x1, x2, x3, x4, x5, x6)
pD_out_gggag(x1, x2, x3, x4, x5)  =  pD_out_gggag(x1, x2, x3, x4, x5)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)
U4_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_ggaagga(x1, x2, x3, x6, x7, x9)
SAMELEAVESA_IN_GG(x1, x2)  =  SAMELEAVESA_IN_GG(x1, x2)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
PD_IN_GGGAG(x1, x2, x3, x4, x5)  =  PD_IN_GGGAG(x1, x2, x3, x5)
U5_GGGAG(x1, x2, x3, x4, x5, x6)  =  U5_GGGAG(x1, x2, x3, x5, x6)

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

(15) UsableRulesProof (EQUIVALENT transformation)

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

(16) Obligation:

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

SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → PD_IN_GGGAG(T13, T14, T23, X17, T24)
PD_IN_GGGAG(T13, T14, T23, T29, T24) → U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_in_ggga(T13, T14, T23, T29))
U5_GGGAG(T13, T14, T23, T29, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → SAMELEAVESA_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

getleaveC_in_ggga(leaf(T42), T43, T42, T43) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55, X63) → U2_ggga(T52, T53, T54, T55, X63, getleaveC_in_ggga(T52, tree(T53, T54), T55, X63))
U2_ggga(T52, T53, T54, T55, X63, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)

The argument filtering Pi contains the following mapping:
leaf(x1)  =  leaf(x1)
tree(x1, x2)  =  tree(x1, x2)
getleaveC_in_ggga(x1, x2, x3, x4)  =  getleaveC_in_ggga(x1, x2, x3)
getleaveC_out_ggga(x1, x2, x3, x4)  =  getleaveC_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
SAMELEAVESA_IN_GG(x1, x2)  =  SAMELEAVESA_IN_GG(x1, x2)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
PD_IN_GGGAG(x1, x2, x3, x4, x5)  =  PD_IN_GGGAG(x1, x2, x3, x5)
U5_GGGAG(x1, x2, x3, x4, x5, x6)  =  U5_GGGAG(x1, x2, x3, x5, x6)

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

(17) PiDPToQDPProof (SOUND transformation)

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

(18) Obligation:

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

SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, T13, T14)
PB_IN_GGAAGGA(leaf(T23), T24, T13, T14) → PD_IN_GGGAG(T13, T14, T23, T24)
PD_IN_GGGAG(T13, T14, T23, T24) → U5_GGGAG(T13, T14, T23, T24, getleaveC_in_ggga(T13, T14, T23))
U5_GGGAG(T13, T14, T23, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → SAMELEAVESA_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleaveC_in_ggga(leaf(T42), T43, T42) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55) → U2_ggga(T52, T53, T54, T55, getleaveC_in_ggga(T52, tree(T53, T54), T55))
U2_ggga(T52, T53, T54, T55, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)

The set Q consists of the following terms:

getleaveC_in_ggga(x0, x1, x2)
U2_ggga(x0, x1, x2, x3, x4)

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

(19) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


U5_GGGAG(T13, T14, T23, T24, getleaveC_out_ggga(T13, T14, T23, T29)) → SAMELEAVESA_IN_GG(T24, T29)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(PB_IN_GGAAGGA(x1, x2, x3, x4)) = x1 + x2   
POL(PD_IN_GGGAG(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(SAMELEAVESA_IN_GG(x1, x2)) = x1   
POL(U2_ggga(x1, x2, x3, x4, x5)) = 0   
POL(U5_GGGAG(x1, x2, x3, x4, x5)) = 1 + x3 + x4   
POL(getleaveC_in_ggga(x1, x2, x3)) = 0   
POL(getleaveC_out_ggga(x1, x2, x3, x4)) = 0   
POL(leaf(x1)) = 1 + x1   
POL(tree(x1, x2)) = x1 + x2   

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

(20) Obligation:

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

SAMELEAVESA_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, T13, T14)
PB_IN_GGAAGGA(leaf(T23), T24, T13, T14) → PD_IN_GGGAG(T13, T14, T23, T24)
PD_IN_GGGAG(T13, T14, T23, T24) → U5_GGGAG(T13, T14, T23, T24, getleaveC_in_ggga(T13, T14, T23))
PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleaveC_in_ggga(leaf(T42), T43, T42) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55) → U2_ggga(T52, T53, T54, T55, getleaveC_in_ggga(T52, tree(T53, T54), T55))
U2_ggga(T52, T53, T54, T55, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)

The set Q consists of the following terms:

getleaveC_in_ggga(x0, x1, x2)
U2_ggga(x0, x1, x2, x3, x4)

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

(21) DependencyGraphProof (EQUIVALENT transformation)

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

(22) Obligation:

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

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

The TRS R consists of the following rules:

getleaveC_in_ggga(leaf(T42), T43, T42) → getleaveC_out_ggga(leaf(T42), T43, T42, T43)
getleaveC_in_ggga(tree(T52, T53), T54, T55) → U2_ggga(T52, T53, T54, T55, getleaveC_in_ggga(T52, tree(T53, T54), T55))
U2_ggga(T52, T53, T54, T55, getleaveC_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveC_out_ggga(tree(T52, T53), T54, T55, X63)

The set Q consists of the following terms:

getleaveC_in_ggga(x0, x1, x2)
U2_ggga(x0, x1, x2, x3, x4)

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

(23) 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.

(24) Obligation:

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

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

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

getleaveC_in_ggga(x0, x1, x2)
U2_ggga(x0, x1, x2, x3, x4)

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

(25) 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].

getleaveC_in_ggga(x0, x1, x2)
U2_ggga(x0, x1, x2, x3, x4)

(26) Obligation:

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

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

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

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

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

(28) YES