(0) Obligation:
Clauses:
p(.(A, [])) :- l(.(A, [])).
r(1).
l([]).
l(.(H, T)) :- ','(r(H), l(T)).
Queries:
p(a).
(1) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (f)
l_in: (b)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g(
x1)
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x2,
x3)
p_out_a(
x1) =
p_out_a(
x1)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(2) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g(
x1)
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x2,
x3)
p_out_a(
x1) =
p_out_a(
x1)
(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:
P_IN_A(.(A, [])) → U1_A(A, l_in_g(.(A, [])))
P_IN_A(.(A, [])) → L_IN_G(.(A, []))
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
L_IN_G(.(H, T)) → R_IN_A(H)
U2_G(H, T, r_out_a(H)) → U3_G(H, T, l_in_g(T))
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g(
x1)
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x2,
x3)
p_out_a(
x1) =
p_out_a(
x1)
P_IN_A(
x1) =
P_IN_A
U1_A(
x1,
x2) =
U1_A(
x2)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
x2,
x3)
R_IN_A(
x1) =
R_IN_A
U3_G(
x1,
x2,
x3) =
U3_G(
x2,
x3)
We have to consider all (P,R,Pi)-chains
(4) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
P_IN_A(.(A, [])) → U1_A(A, l_in_g(.(A, [])))
P_IN_A(.(A, [])) → L_IN_G(.(A, []))
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
L_IN_G(.(H, T)) → R_IN_A(H)
U2_G(H, T, r_out_a(H)) → U3_G(H, T, l_in_g(T))
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g(
x1)
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x2,
x3)
p_out_a(
x1) =
p_out_a(
x1)
P_IN_A(
x1) =
P_IN_A
U1_A(
x1,
x2) =
U1_A(
x2)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
x2,
x3)
R_IN_A(
x1) =
R_IN_A
U3_G(
x1,
x2,
x3) =
U3_G(
x2,
x3)
We have to consider all (P,R,Pi)-chains
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 4 less nodes.
(6) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g(
x1)
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x2,
x3)
p_out_a(
x1) =
p_out_a(
x1)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
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:
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
The TRS R consists of the following rules:
r_in_a(1) → r_out_a(1)
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x2)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
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:
U2_G(T, r_out_a(H)) → L_IN_G(T)
L_IN_G(.(T)) → U2_G(T, r_in_a)
The TRS R consists of the following rules:
r_in_a → r_out_a(1)
The set Q consists of the following terms:
r_in_a
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:
- L_IN_G(.(T)) → U2_G(T, r_in_a)
The graph contains the following edges 1 > 1
- U2_G(T, r_out_a(H)) → L_IN_G(T)
The graph contains the following edges 1 >= 1
(12) TRUE
(13) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
p_in: (f)
l_in: (b)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
p_out_a(
x1) =
p_out_a(
x1)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(14) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
p_out_a(
x1) =
p_out_a(
x1)
(15) 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:
P_IN_A(.(A, [])) → U1_A(A, l_in_g(.(A, [])))
P_IN_A(.(A, [])) → L_IN_G(.(A, []))
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
L_IN_G(.(H, T)) → R_IN_A(H)
U2_G(H, T, r_out_a(H)) → U3_G(H, T, l_in_g(T))
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
p_out_a(
x1) =
p_out_a(
x1)
P_IN_A(
x1) =
P_IN_A
U1_A(
x1,
x2) =
U1_A(
x2)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
x2,
x3)
R_IN_A(
x1) =
R_IN_A
U3_G(
x1,
x2,
x3) =
U3_G(
x3)
We have to consider all (P,R,Pi)-chains
(16) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
P_IN_A(.(A, [])) → U1_A(A, l_in_g(.(A, [])))
P_IN_A(.(A, [])) → L_IN_G(.(A, []))
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
L_IN_G(.(H, T)) → R_IN_A(H)
U2_G(H, T, r_out_a(H)) → U3_G(H, T, l_in_g(T))
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
p_out_a(
x1) =
p_out_a(
x1)
P_IN_A(
x1) =
P_IN_A
U1_A(
x1,
x2) =
U1_A(
x2)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
x2,
x3)
R_IN_A(
x1) =
R_IN_A
U3_G(
x1,
x2,
x3) =
U3_G(
x3)
We have to consider all (P,R,Pi)-chains
(17) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 4 less nodes.
(18) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
The TRS R consists of the following rules:
p_in_a(.(A, [])) → U1_a(A, l_in_g(.(A, [])))
l_in_g([]) → l_out_g([])
l_in_g(.(H, T)) → U2_g(H, T, r_in_a(H))
r_in_a(1) → r_out_a(1)
U2_g(H, T, r_out_a(H)) → U3_g(H, T, l_in_g(T))
U3_g(H, T, l_out_g(T)) → l_out_g(.(H, T))
U1_a(A, l_out_g(.(A, []))) → p_out_a(.(A, []))
The argument filtering Pi contains the following mapping:
p_in_a(
x1) =
p_in_a
U1_a(
x1,
x2) =
U1_a(
x2)
l_in_g(
x1) =
l_in_g(
x1)
.(
x1,
x2) =
.(
x2)
[] =
[]
l_out_g(
x1) =
l_out_g
U2_g(
x1,
x2,
x3) =
U2_g(
x2,
x3)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
p_out_a(
x1) =
p_out_a(
x1)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
x2,
x3)
We have to consider all (P,R,Pi)-chains
(19) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(20) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U2_G(H, T, r_out_a(H)) → L_IN_G(T)
L_IN_G(.(H, T)) → U2_G(H, T, r_in_a(H))
The TRS R consists of the following rules:
r_in_a(1) → r_out_a(1)
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x2)
r_in_a(
x1) =
r_in_a
r_out_a(
x1) =
r_out_a(
x1)
L_IN_G(
x1) =
L_IN_G(
x1)
U2_G(
x1,
x2,
x3) =
U2_G(
x2,
x3)
We have to consider all (P,R,Pi)-chains
(21) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(22) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U2_G(T, r_out_a(H)) → L_IN_G(T)
L_IN_G(.(T)) → U2_G(T, r_in_a)
The TRS R consists of the following rules:
r_in_a → r_out_a(1)
The set Q consists of the following terms:
r_in_a
We have to consider all (P,Q,R)-chains.