(0) Obligation:

Clauses:

rev(L, R) :- rev(L, [], R).
rev([], Y, Y).
rev(L, S, R) :- ','(no(empty(L)), ','(head(L, X), ','(tail(L, T), rev(T, .(X, S), R)))).
head([], X1).
head(.(X, X2), X).
tail([], []).
tail(.(X3, Xs), Xs).
empty([]).
no(X) :- ','(X, ','(!, failure(a))).
no(X4).
failure(b).

Query: rev(g,a)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

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

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T54, []), .(T54, [])) → revA_out_ga(.(T54, []), .(T54, []))
revA_in_ga(.(T125, .(T124, [])), .(T124, .(T125, []))) → revA_out_ga(.(T125, .(T124, [])), .(T124, .(T125, [])))
revA_in_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, [])))) → revA_out_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, []))))
revA_in_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, []))))) → revA_out_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, [])))))
revA_in_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, [])))))) → revA_out_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, []))))))
revA_in_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, []))))))) → revA_out_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, [])))))))
revA_in_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, [])))))))) → revA_out_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, []))))))))
revA_in_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_in_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885))
revB_in_ggga([], T1029, T1030, .(T1029, T1030)) → revB_out_ggga([], T1029, T1030, .(T1029, T1030))
revB_in_ggga(.(T1103, T1104), T1047, T1048, T1050) → U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_in_ggga(T1104, T1103, .(T1047, T1048), T1050))
U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_out_ggga(T1104, T1103, .(T1047, T1048), T1050)) → revB_out_ggga(.(T1103, T1104), T1047, T1048, T1050)
U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_out_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885)) → revA_out_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885)

The argument filtering Pi contains the following mapping:
revA_in_ga(x1, x2)  =  revA_in_ga(x1)
[]  =  []
revA_out_ga(x1, x2)  =  revA_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)  =  U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x11)
revB_in_ggga(x1, x2, x3, x4)  =  revB_in_ggga(x1, x2, x3)
revB_out_ggga(x1, x2, x3, x4)  =  revB_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)

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

REVA_IN_GA(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → U1_GA(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_in_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885))
REVA_IN_GA(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → REVB_IN_GGGA(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885)
REVB_IN_GGGA(.(T1103, T1104), T1047, T1048, T1050) → U2_GGGA(T1103, T1104, T1047, T1048, T1050, revB_in_ggga(T1104, T1103, .(T1047, T1048), T1050))
REVB_IN_GGGA(.(T1103, T1104), T1047, T1048, T1050) → REVB_IN_GGGA(T1104, T1103, .(T1047, T1048), T1050)

The TRS R consists of the following rules:

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T54, []), .(T54, [])) → revA_out_ga(.(T54, []), .(T54, []))
revA_in_ga(.(T125, .(T124, [])), .(T124, .(T125, []))) → revA_out_ga(.(T125, .(T124, [])), .(T124, .(T125, [])))
revA_in_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, [])))) → revA_out_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, []))))
revA_in_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, []))))) → revA_out_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, [])))))
revA_in_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, [])))))) → revA_out_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, []))))))
revA_in_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, []))))))) → revA_out_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, [])))))))
revA_in_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, [])))))))) → revA_out_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, []))))))))
revA_in_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_in_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885))
revB_in_ggga([], T1029, T1030, .(T1029, T1030)) → revB_out_ggga([], T1029, T1030, .(T1029, T1030))
revB_in_ggga(.(T1103, T1104), T1047, T1048, T1050) → U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_in_ggga(T1104, T1103, .(T1047, T1048), T1050))
U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_out_ggga(T1104, T1103, .(T1047, T1048), T1050)) → revB_out_ggga(.(T1103, T1104), T1047, T1048, T1050)
U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_out_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885)) → revA_out_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885)

The argument filtering Pi contains the following mapping:
revA_in_ga(x1, x2)  =  revA_in_ga(x1)
[]  =  []
revA_out_ga(x1, x2)  =  revA_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)  =  U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x11)
revB_in_ggga(x1, x2, x3, x4)  =  revB_in_ggga(x1, x2, x3)
revB_out_ggga(x1, x2, x3, x4)  =  revB_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
REVA_IN_GA(x1, x2)  =  REVA_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)  =  U1_GA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x11)
REVB_IN_GGGA(x1, x2, x3, x4)  =  REVB_IN_GGGA(x1, x2, x3)
U2_GGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGGA(x1, x2, x3, x4, x6)

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

(4) Obligation:

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

REVA_IN_GA(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → U1_GA(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_in_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885))
REVA_IN_GA(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → REVB_IN_GGGA(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885)
REVB_IN_GGGA(.(T1103, T1104), T1047, T1048, T1050) → U2_GGGA(T1103, T1104, T1047, T1048, T1050, revB_in_ggga(T1104, T1103, .(T1047, T1048), T1050))
REVB_IN_GGGA(.(T1103, T1104), T1047, T1048, T1050) → REVB_IN_GGGA(T1104, T1103, .(T1047, T1048), T1050)

The TRS R consists of the following rules:

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T54, []), .(T54, [])) → revA_out_ga(.(T54, []), .(T54, []))
revA_in_ga(.(T125, .(T124, [])), .(T124, .(T125, []))) → revA_out_ga(.(T125, .(T124, [])), .(T124, .(T125, [])))
revA_in_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, [])))) → revA_out_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, []))))
revA_in_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, []))))) → revA_out_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, [])))))
revA_in_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, [])))))) → revA_out_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, []))))))
revA_in_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, []))))))) → revA_out_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, [])))))))
revA_in_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, [])))))))) → revA_out_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, []))))))))
revA_in_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_in_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885))
revB_in_ggga([], T1029, T1030, .(T1029, T1030)) → revB_out_ggga([], T1029, T1030, .(T1029, T1030))
revB_in_ggga(.(T1103, T1104), T1047, T1048, T1050) → U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_in_ggga(T1104, T1103, .(T1047, T1048), T1050))
U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_out_ggga(T1104, T1103, .(T1047, T1048), T1050)) → revB_out_ggga(.(T1103, T1104), T1047, T1048, T1050)
U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_out_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885)) → revA_out_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885)

The argument filtering Pi contains the following mapping:
revA_in_ga(x1, x2)  =  revA_in_ga(x1)
[]  =  []
revA_out_ga(x1, x2)  =  revA_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)  =  U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x11)
revB_in_ggga(x1, x2, x3, x4)  =  revB_in_ggga(x1, x2, x3)
revB_out_ggga(x1, x2, x3, x4)  =  revB_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
REVA_IN_GA(x1, x2)  =  REVA_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)  =  U1_GA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x11)
REVB_IN_GGGA(x1, x2, x3, x4)  =  REVB_IN_GGGA(x1, x2, x3)
U2_GGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGGA(x1, x2, x3, x4, x6)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 3 less nodes.

(6) Obligation:

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

REVB_IN_GGGA(.(T1103, T1104), T1047, T1048, T1050) → REVB_IN_GGGA(T1104, T1103, .(T1047, T1048), T1050)

The TRS R consists of the following rules:

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T54, []), .(T54, [])) → revA_out_ga(.(T54, []), .(T54, []))
revA_in_ga(.(T125, .(T124, [])), .(T124, .(T125, []))) → revA_out_ga(.(T125, .(T124, [])), .(T124, .(T125, [])))
revA_in_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, [])))) → revA_out_ga(.(T220, .(T219, .(T218, []))), .(T218, .(T219, .(T220, []))))
revA_in_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, []))))) → revA_out_ga(.(T339, .(T338, .(T337, .(T336, [])))), .(T336, .(T337, .(T338, .(T339, [])))))
revA_in_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, [])))))) → revA_out_ga(.(T482, .(T481, .(T480, .(T479, .(T478, []))))), .(T478, .(T479, .(T480, .(T481, .(T482, []))))))
revA_in_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, []))))))) → revA_out_ga(.(T649, .(T648, .(T647, .(T646, .(T645, .(T644, [])))))), .(T644, .(T645, .(T646, .(T647, .(T648, .(T649, [])))))))
revA_in_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, [])))))))) → revA_out_ga(.(T840, .(T839, .(T838, .(T837, .(T836, .(T835, .(T834, []))))))), .(T834, .(T835, .(T836, .(T837, .(T838, .(T839, .(T840, []))))))))
revA_in_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885) → U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_in_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885))
revB_in_ggga([], T1029, T1030, .(T1029, T1030)) → revB_out_ggga([], T1029, T1030, .(T1029, T1030))
revB_in_ggga(.(T1103, T1104), T1047, T1048, T1050) → U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_in_ggga(T1104, T1103, .(T1047, T1048), T1050))
U2_ggga(T1103, T1104, T1047, T1048, T1050, revB_out_ggga(T1104, T1103, .(T1047, T1048), T1050)) → revB_out_ggga(.(T1103, T1104), T1047, T1048, T1050)
U1_ga(T883, T882, T881, T880, T879, T878, T877, T998, T999, T885, revB_out_ggga(T999, T998, .(T877, .(T878, .(T879, .(T880, .(T881, .(T882, .(T883, []))))))), T885)) → revA_out_ga(.(T883, .(T882, .(T881, .(T880, .(T879, .(T878, .(T877, .(T998, T999)))))))), T885)

The argument filtering Pi contains the following mapping:
revA_in_ga(x1, x2)  =  revA_in_ga(x1)
[]  =  []
revA_out_ga(x1, x2)  =  revA_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)  =  U1_ga(x1, x2, x3, x4, x5, x6, x7, x8, x9, x11)
revB_in_ggga(x1, x2, x3, x4)  =  revB_in_ggga(x1, x2, x3)
revB_out_ggga(x1, x2, x3, x4)  =  revB_out_ggga(x1, x2, x3, x4)
U2_ggga(x1, x2, x3, x4, x5, x6)  =  U2_ggga(x1, x2, x3, x4, x6)
REVB_IN_GGGA(x1, x2, x3, x4)  =  REVB_IN_GGGA(x1, x2, x3)

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

(7) UsableRulesProof (EQUIVALENT transformation)

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

(8) Obligation:

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

REVB_IN_GGGA(.(T1103, T1104), T1047, T1048, T1050) → REVB_IN_GGGA(T1104, T1103, .(T1047, T1048), T1050)

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

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

(9) PiDPToQDPProof (SOUND transformation)

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

(10) Obligation:

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

REVB_IN_GGGA(.(T1103, T1104), T1047, T1048) → REVB_IN_GGGA(T1104, T1103, .(T1047, T1048))

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

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

  • REVB_IN_GGGA(.(T1103, T1104), T1047, T1048) → REVB_IN_GGGA(T1104, T1103, .(T1047, T1048))
    The graph contains the following edges 1 > 1, 1 > 2

(12) YES