(0) Obligation:

Clauses:

rev(L, R) :- rev(L, [], R).
rev([], Y, Z) :- ','(!, eq(Y, Z)).
rev(L, S, R) :- ','(head(L, X), ','(tail(L, T), rev(T, .(X, S), R))).
head([], X1).
head(.(X, X2), X).
tail([], []).
tail(.(X3, Xs), Xs).
eq(X, X).

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(.(T49, []), .(T49, [])) → revA_out_ga(.(T49, []), .(T49, []))
revA_in_ga(.(T101, .(T100, [])), .(T100, .(T101, []))) → revA_out_ga(.(T101, .(T100, [])), .(T100, .(T101, [])))
revA_in_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, [])))) → revA_out_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, []))))
revA_in_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, []))))) → revA_out_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, [])))))
revA_in_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, [])))))) → revA_out_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, []))))))
revA_in_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, []))))))) → revA_out_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, [])))))))
revA_in_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, [])))))))) → revA_out_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, []))))))))
revA_in_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_in_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608))
revB_in_ggga([], T674, T675, .(T674, T675)) → revB_out_ggga([], T674, T675, .(T674, T675))
revB_in_ggga(.(T714, T715), T689, T690, T692) → U2_ggga(T714, T715, T689, T690, T692, revB_in_ggga(T715, T714, .(T689, T690), T692))
U2_ggga(T714, T715, T689, T690, T692, revB_out_ggga(T715, T714, .(T689, T690), T692)) → revB_out_ggga(.(T714, T715), T689, T690, T692)
U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_out_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608)) → revA_out_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608)

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(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → U1_GA(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_in_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608))
REVA_IN_GA(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → REVB_IN_GGGA(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608)
REVB_IN_GGGA(.(T714, T715), T689, T690, T692) → U2_GGGA(T714, T715, T689, T690, T692, revB_in_ggga(T715, T714, .(T689, T690), T692))
REVB_IN_GGGA(.(T714, T715), T689, T690, T692) → REVB_IN_GGGA(T715, T714, .(T689, T690), T692)

The TRS R consists of the following rules:

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T49, []), .(T49, [])) → revA_out_ga(.(T49, []), .(T49, []))
revA_in_ga(.(T101, .(T100, [])), .(T100, .(T101, []))) → revA_out_ga(.(T101, .(T100, [])), .(T100, .(T101, [])))
revA_in_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, [])))) → revA_out_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, []))))
revA_in_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, []))))) → revA_out_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, [])))))
revA_in_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, [])))))) → revA_out_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, []))))))
revA_in_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, []))))))) → revA_out_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, [])))))))
revA_in_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, [])))))))) → revA_out_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, []))))))))
revA_in_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_in_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608))
revB_in_ggga([], T674, T675, .(T674, T675)) → revB_out_ggga([], T674, T675, .(T674, T675))
revB_in_ggga(.(T714, T715), T689, T690, T692) → U2_ggga(T714, T715, T689, T690, T692, revB_in_ggga(T715, T714, .(T689, T690), T692))
U2_ggga(T714, T715, T689, T690, T692, revB_out_ggga(T715, T714, .(T689, T690), T692)) → revB_out_ggga(.(T714, T715), T689, T690, T692)
U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_out_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608)) → revA_out_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608)

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(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → U1_GA(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_in_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608))
REVA_IN_GA(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → REVB_IN_GGGA(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608)
REVB_IN_GGGA(.(T714, T715), T689, T690, T692) → U2_GGGA(T714, T715, T689, T690, T692, revB_in_ggga(T715, T714, .(T689, T690), T692))
REVB_IN_GGGA(.(T714, T715), T689, T690, T692) → REVB_IN_GGGA(T715, T714, .(T689, T690), T692)

The TRS R consists of the following rules:

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T49, []), .(T49, [])) → revA_out_ga(.(T49, []), .(T49, []))
revA_in_ga(.(T101, .(T100, [])), .(T100, .(T101, []))) → revA_out_ga(.(T101, .(T100, [])), .(T100, .(T101, [])))
revA_in_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, [])))) → revA_out_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, []))))
revA_in_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, []))))) → revA_out_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, [])))))
revA_in_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, [])))))) → revA_out_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, []))))))
revA_in_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, []))))))) → revA_out_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, [])))))))
revA_in_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, [])))))))) → revA_out_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, []))))))))
revA_in_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_in_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608))
revB_in_ggga([], T674, T675, .(T674, T675)) → revB_out_ggga([], T674, T675, .(T674, T675))
revB_in_ggga(.(T714, T715), T689, T690, T692) → U2_ggga(T714, T715, T689, T690, T692, revB_in_ggga(T715, T714, .(T689, T690), T692))
U2_ggga(T714, T715, T689, T690, T692, revB_out_ggga(T715, T714, .(T689, T690), T692)) → revB_out_ggga(.(T714, T715), T689, T690, T692)
U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_out_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608)) → revA_out_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608)

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(.(T714, T715), T689, T690, T692) → REVB_IN_GGGA(T715, T714, .(T689, T690), T692)

The TRS R consists of the following rules:

revA_in_ga([], []) → revA_out_ga([], [])
revA_in_ga(.(T49, []), .(T49, [])) → revA_out_ga(.(T49, []), .(T49, []))
revA_in_ga(.(T101, .(T100, [])), .(T100, .(T101, []))) → revA_out_ga(.(T101, .(T100, [])), .(T100, .(T101, [])))
revA_in_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, [])))) → revA_out_ga(.(T167, .(T166, .(T165, []))), .(T165, .(T166, .(T167, []))))
revA_in_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, []))))) → revA_out_ga(.(T247, .(T246, .(T245, .(T244, [])))), .(T244, .(T245, .(T246, .(T247, [])))))
revA_in_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, [])))))) → revA_out_ga(.(T341, .(T340, .(T339, .(T338, .(T337, []))))), .(T337, .(T338, .(T339, .(T340, .(T341, []))))))
revA_in_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, []))))))) → revA_out_ga(.(T449, .(T448, .(T447, .(T446, .(T445, .(T444, [])))))), .(T444, .(T445, .(T446, .(T447, .(T448, .(T449, [])))))))
revA_in_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, [])))))))) → revA_out_ga(.(T571, .(T570, .(T569, .(T568, .(T567, .(T566, .(T565, []))))))), .(T565, .(T566, .(T567, .(T568, .(T569, .(T570, .(T571, []))))))))
revA_in_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608) → U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_in_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608))
revB_in_ggga([], T674, T675, .(T674, T675)) → revB_out_ggga([], T674, T675, .(T674, T675))
revB_in_ggga(.(T714, T715), T689, T690, T692) → U2_ggga(T714, T715, T689, T690, T692, revB_in_ggga(T715, T714, .(T689, T690), T692))
U2_ggga(T714, T715, T689, T690, T692, revB_out_ggga(T715, T714, .(T689, T690), T692)) → revB_out_ggga(.(T714, T715), T689, T690, T692)
U1_ga(T606, T605, T604, T603, T602, T601, T600, T645, T646, T608, revB_out_ggga(T646, T645, .(T600, .(T601, .(T602, .(T603, .(T604, .(T605, .(T606, []))))))), T608)) → revA_out_ga(.(T606, .(T605, .(T604, .(T603, .(T602, .(T601, .(T600, .(T645, T646)))))))), T608)

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(.(T714, T715), T689, T690, T692) → REVB_IN_GGGA(T715, T714, .(T689, T690), T692)

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(.(T714, T715), T689, T690) → REVB_IN_GGGA(T715, T714, .(T689, T690))

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(.(T714, T715), T689, T690) → REVB_IN_GGGA(T715, T714, .(T689, T690))
    The graph contains the following edges 1 > 1, 1 > 2

(12) YES