(0) Obligation:
Clauses:
goal(X) :- ','(s2l(X, Xs), list(Xs)).
list([]).
list(X) :- ','(no(empty(X)), ','(tail(X, T), list(T))).
s2l(0, []).
s2l(X, .(X1, Xs)) :- ','(no(zero(X)), ','(p(X, P), s2l(P, Xs))).
tail([], []).
tail(.(X2, Xs), Xs).
p(0, 0).
p(s(X), X).
empty([]).
zero(0).
no(X) :- ','(X, ','(!, failure(a))).
no(X3).
failure(b).
Query: goal(g)
(1) PrologToPrologProblemTransformerProof (SOUND transformation)
Built Prolog problem from termination graph ICLP10.
(2) Obligation:
Clauses:
s2lA(0, []).
s2lA(s(T28), .(X56, X57)) :- s2lA(T28, X57).
listB.
listC([]).
listC([]) :- listB.
listC(.(T68, T70)) :- listC(T70).
goalD(0) :- listB.
goalD(s(T15)) :- s2lA(T15, X31).
goalD(s(T15)) :- ','(s2lA(T15, T48), listC(T48)).
Query: goalD(g)
(3) PrologToPiTRSProof (SOUND transformation)
We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
goalD_in: (b)
s2lA_in: (b,f)
listC_in: (b)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
goalD_in_g(0) → U4_g(listB_in_)
listB_in_ → listB_out_
U4_g(listB_out_) → goalD_out_g(0)
goalD_in_g(s(T15)) → U5_g(T15, s2lA_in_ga(T15, X31))
s2lA_in_ga(0, []) → s2lA_out_ga(0, [])
s2lA_in_ga(s(T28), .(X56, X57)) → U1_ga(T28, X56, X57, s2lA_in_ga(T28, X57))
U1_ga(T28, X56, X57, s2lA_out_ga(T28, X57)) → s2lA_out_ga(s(T28), .(X56, X57))
U5_g(T15, s2lA_out_ga(T15, X31)) → goalD_out_g(s(T15))
goalD_in_g(s(T15)) → U6_g(T15, s2lA_in_ga(T15, T48))
U6_g(T15, s2lA_out_ga(T15, T48)) → U7_g(T15, listC_in_g(T48))
listC_in_g([]) → listC_out_g([])
listC_in_g([]) → U2_g(listB_in_)
U2_g(listB_out_) → listC_out_g([])
listC_in_g(.(T68, T70)) → U3_g(T68, T70, listC_in_g(T70))
U3_g(T68, T70, listC_out_g(T70)) → listC_out_g(.(T68, T70))
U7_g(T15, listC_out_g(T48)) → goalD_out_g(s(T15))
The argument filtering Pi contains the following mapping:
goalD_in_g(
x1) =
goalD_in_g(
x1)
0 =
0
U4_g(
x1) =
U4_g(
x1)
listB_in_ =
listB_in_
listB_out_ =
listB_out_
goalD_out_g(
x1) =
goalD_out_g
s(
x1) =
s(
x1)
U5_g(
x1,
x2) =
U5_g(
x2)
s2lA_in_ga(
x1,
x2) =
s2lA_in_ga(
x1)
s2lA_out_ga(
x1,
x2) =
s2lA_out_ga(
x2)
U1_ga(
x1,
x2,
x3,
x4) =
U1_ga(
x4)
.(
x1,
x2) =
.(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
U7_g(
x1,
x2) =
U7_g(
x2)
listC_in_g(
x1) =
listC_in_g(
x1)
[] =
[]
listC_out_g(
x1) =
listC_out_g
U2_g(
x1) =
U2_g(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(4) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
goalD_in_g(0) → U4_g(listB_in_)
listB_in_ → listB_out_
U4_g(listB_out_) → goalD_out_g(0)
goalD_in_g(s(T15)) → U5_g(T15, s2lA_in_ga(T15, X31))
s2lA_in_ga(0, []) → s2lA_out_ga(0, [])
s2lA_in_ga(s(T28), .(X56, X57)) → U1_ga(T28, X56, X57, s2lA_in_ga(T28, X57))
U1_ga(T28, X56, X57, s2lA_out_ga(T28, X57)) → s2lA_out_ga(s(T28), .(X56, X57))
U5_g(T15, s2lA_out_ga(T15, X31)) → goalD_out_g(s(T15))
goalD_in_g(s(T15)) → U6_g(T15, s2lA_in_ga(T15, T48))
U6_g(T15, s2lA_out_ga(T15, T48)) → U7_g(T15, listC_in_g(T48))
listC_in_g([]) → listC_out_g([])
listC_in_g([]) → U2_g(listB_in_)
U2_g(listB_out_) → listC_out_g([])
listC_in_g(.(T68, T70)) → U3_g(T68, T70, listC_in_g(T70))
U3_g(T68, T70, listC_out_g(T70)) → listC_out_g(.(T68, T70))
U7_g(T15, listC_out_g(T48)) → goalD_out_g(s(T15))
The argument filtering Pi contains the following mapping:
goalD_in_g(
x1) =
goalD_in_g(
x1)
0 =
0
U4_g(
x1) =
U4_g(
x1)
listB_in_ =
listB_in_
listB_out_ =
listB_out_
goalD_out_g(
x1) =
goalD_out_g
s(
x1) =
s(
x1)
U5_g(
x1,
x2) =
U5_g(
x2)
s2lA_in_ga(
x1,
x2) =
s2lA_in_ga(
x1)
s2lA_out_ga(
x1,
x2) =
s2lA_out_ga(
x2)
U1_ga(
x1,
x2,
x3,
x4) =
U1_ga(
x4)
.(
x1,
x2) =
.(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
U7_g(
x1,
x2) =
U7_g(
x2)
listC_in_g(
x1) =
listC_in_g(
x1)
[] =
[]
listC_out_g(
x1) =
listC_out_g
U2_g(
x1) =
U2_g(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
(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:
GOALD_IN_G(0) → U4_G(listB_in_)
GOALD_IN_G(0) → LISTB_IN_
GOALD_IN_G(s(T15)) → U5_G(T15, s2lA_in_ga(T15, X31))
GOALD_IN_G(s(T15)) → S2LA_IN_GA(T15, X31)
S2LA_IN_GA(s(T28), .(X56, X57)) → U1_GA(T28, X56, X57, s2lA_in_ga(T28, X57))
S2LA_IN_GA(s(T28), .(X56, X57)) → S2LA_IN_GA(T28, X57)
GOALD_IN_G(s(T15)) → U6_G(T15, s2lA_in_ga(T15, T48))
U6_G(T15, s2lA_out_ga(T15, T48)) → U7_G(T15, listC_in_g(T48))
U6_G(T15, s2lA_out_ga(T15, T48)) → LISTC_IN_G(T48)
LISTC_IN_G([]) → U2_G(listB_in_)
LISTC_IN_G([]) → LISTB_IN_
LISTC_IN_G(.(T68, T70)) → U3_G(T68, T70, listC_in_g(T70))
LISTC_IN_G(.(T68, T70)) → LISTC_IN_G(T70)
The TRS R consists of the following rules:
goalD_in_g(0) → U4_g(listB_in_)
listB_in_ → listB_out_
U4_g(listB_out_) → goalD_out_g(0)
goalD_in_g(s(T15)) → U5_g(T15, s2lA_in_ga(T15, X31))
s2lA_in_ga(0, []) → s2lA_out_ga(0, [])
s2lA_in_ga(s(T28), .(X56, X57)) → U1_ga(T28, X56, X57, s2lA_in_ga(T28, X57))
U1_ga(T28, X56, X57, s2lA_out_ga(T28, X57)) → s2lA_out_ga(s(T28), .(X56, X57))
U5_g(T15, s2lA_out_ga(T15, X31)) → goalD_out_g(s(T15))
goalD_in_g(s(T15)) → U6_g(T15, s2lA_in_ga(T15, T48))
U6_g(T15, s2lA_out_ga(T15, T48)) → U7_g(T15, listC_in_g(T48))
listC_in_g([]) → listC_out_g([])
listC_in_g([]) → U2_g(listB_in_)
U2_g(listB_out_) → listC_out_g([])
listC_in_g(.(T68, T70)) → U3_g(T68, T70, listC_in_g(T70))
U3_g(T68, T70, listC_out_g(T70)) → listC_out_g(.(T68, T70))
U7_g(T15, listC_out_g(T48)) → goalD_out_g(s(T15))
The argument filtering Pi contains the following mapping:
goalD_in_g(
x1) =
goalD_in_g(
x1)
0 =
0
U4_g(
x1) =
U4_g(
x1)
listB_in_ =
listB_in_
listB_out_ =
listB_out_
goalD_out_g(
x1) =
goalD_out_g
s(
x1) =
s(
x1)
U5_g(
x1,
x2) =
U5_g(
x2)
s2lA_in_ga(
x1,
x2) =
s2lA_in_ga(
x1)
s2lA_out_ga(
x1,
x2) =
s2lA_out_ga(
x2)
U1_ga(
x1,
x2,
x3,
x4) =
U1_ga(
x4)
.(
x1,
x2) =
.(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
U7_g(
x1,
x2) =
U7_g(
x2)
listC_in_g(
x1) =
listC_in_g(
x1)
[] =
[]
listC_out_g(
x1) =
listC_out_g
U2_g(
x1) =
U2_g(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
GOALD_IN_G(
x1) =
GOALD_IN_G(
x1)
U4_G(
x1) =
U4_G(
x1)
LISTB_IN_ =
LISTB_IN_
U5_G(
x1,
x2) =
U5_G(
x2)
S2LA_IN_GA(
x1,
x2) =
S2LA_IN_GA(
x1)
U1_GA(
x1,
x2,
x3,
x4) =
U1_GA(
x4)
U6_G(
x1,
x2) =
U6_G(
x2)
U7_G(
x1,
x2) =
U7_G(
x2)
LISTC_IN_G(
x1) =
LISTC_IN_G(
x1)
U2_G(
x1) =
U2_G(
x1)
U3_G(
x1,
x2,
x3) =
U3_G(
x3)
We have to consider all (P,R,Pi)-chains
(6) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
GOALD_IN_G(0) → U4_G(listB_in_)
GOALD_IN_G(0) → LISTB_IN_
GOALD_IN_G(s(T15)) → U5_G(T15, s2lA_in_ga(T15, X31))
GOALD_IN_G(s(T15)) → S2LA_IN_GA(T15, X31)
S2LA_IN_GA(s(T28), .(X56, X57)) → U1_GA(T28, X56, X57, s2lA_in_ga(T28, X57))
S2LA_IN_GA(s(T28), .(X56, X57)) → S2LA_IN_GA(T28, X57)
GOALD_IN_G(s(T15)) → U6_G(T15, s2lA_in_ga(T15, T48))
U6_G(T15, s2lA_out_ga(T15, T48)) → U7_G(T15, listC_in_g(T48))
U6_G(T15, s2lA_out_ga(T15, T48)) → LISTC_IN_G(T48)
LISTC_IN_G([]) → U2_G(listB_in_)
LISTC_IN_G([]) → LISTB_IN_
LISTC_IN_G(.(T68, T70)) → U3_G(T68, T70, listC_in_g(T70))
LISTC_IN_G(.(T68, T70)) → LISTC_IN_G(T70)
The TRS R consists of the following rules:
goalD_in_g(0) → U4_g(listB_in_)
listB_in_ → listB_out_
U4_g(listB_out_) → goalD_out_g(0)
goalD_in_g(s(T15)) → U5_g(T15, s2lA_in_ga(T15, X31))
s2lA_in_ga(0, []) → s2lA_out_ga(0, [])
s2lA_in_ga(s(T28), .(X56, X57)) → U1_ga(T28, X56, X57, s2lA_in_ga(T28, X57))
U1_ga(T28, X56, X57, s2lA_out_ga(T28, X57)) → s2lA_out_ga(s(T28), .(X56, X57))
U5_g(T15, s2lA_out_ga(T15, X31)) → goalD_out_g(s(T15))
goalD_in_g(s(T15)) → U6_g(T15, s2lA_in_ga(T15, T48))
U6_g(T15, s2lA_out_ga(T15, T48)) → U7_g(T15, listC_in_g(T48))
listC_in_g([]) → listC_out_g([])
listC_in_g([]) → U2_g(listB_in_)
U2_g(listB_out_) → listC_out_g([])
listC_in_g(.(T68, T70)) → U3_g(T68, T70, listC_in_g(T70))
U3_g(T68, T70, listC_out_g(T70)) → listC_out_g(.(T68, T70))
U7_g(T15, listC_out_g(T48)) → goalD_out_g(s(T15))
The argument filtering Pi contains the following mapping:
goalD_in_g(
x1) =
goalD_in_g(
x1)
0 =
0
U4_g(
x1) =
U4_g(
x1)
listB_in_ =
listB_in_
listB_out_ =
listB_out_
goalD_out_g(
x1) =
goalD_out_g
s(
x1) =
s(
x1)
U5_g(
x1,
x2) =
U5_g(
x2)
s2lA_in_ga(
x1,
x2) =
s2lA_in_ga(
x1)
s2lA_out_ga(
x1,
x2) =
s2lA_out_ga(
x2)
U1_ga(
x1,
x2,
x3,
x4) =
U1_ga(
x4)
.(
x1,
x2) =
.(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
U7_g(
x1,
x2) =
U7_g(
x2)
listC_in_g(
x1) =
listC_in_g(
x1)
[] =
[]
listC_out_g(
x1) =
listC_out_g
U2_g(
x1) =
U2_g(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
GOALD_IN_G(
x1) =
GOALD_IN_G(
x1)
U4_G(
x1) =
U4_G(
x1)
LISTB_IN_ =
LISTB_IN_
U5_G(
x1,
x2) =
U5_G(
x2)
S2LA_IN_GA(
x1,
x2) =
S2LA_IN_GA(
x1)
U1_GA(
x1,
x2,
x3,
x4) =
U1_GA(
x4)
U6_G(
x1,
x2) =
U6_G(
x2)
U7_G(
x1,
x2) =
U7_G(
x2)
LISTC_IN_G(
x1) =
LISTC_IN_G(
x1)
U2_G(
x1) =
U2_G(
x1)
U3_G(
x1,
x2,
x3) =
U3_G(
x3)
We have to consider all (P,R,Pi)-chains
(7) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 11 less nodes.
(8) Complex Obligation (AND)
(9) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
LISTC_IN_G(.(T68, T70)) → LISTC_IN_G(T70)
The TRS R consists of the following rules:
goalD_in_g(0) → U4_g(listB_in_)
listB_in_ → listB_out_
U4_g(listB_out_) → goalD_out_g(0)
goalD_in_g(s(T15)) → U5_g(T15, s2lA_in_ga(T15, X31))
s2lA_in_ga(0, []) → s2lA_out_ga(0, [])
s2lA_in_ga(s(T28), .(X56, X57)) → U1_ga(T28, X56, X57, s2lA_in_ga(T28, X57))
U1_ga(T28, X56, X57, s2lA_out_ga(T28, X57)) → s2lA_out_ga(s(T28), .(X56, X57))
U5_g(T15, s2lA_out_ga(T15, X31)) → goalD_out_g(s(T15))
goalD_in_g(s(T15)) → U6_g(T15, s2lA_in_ga(T15, T48))
U6_g(T15, s2lA_out_ga(T15, T48)) → U7_g(T15, listC_in_g(T48))
listC_in_g([]) → listC_out_g([])
listC_in_g([]) → U2_g(listB_in_)
U2_g(listB_out_) → listC_out_g([])
listC_in_g(.(T68, T70)) → U3_g(T68, T70, listC_in_g(T70))
U3_g(T68, T70, listC_out_g(T70)) → listC_out_g(.(T68, T70))
U7_g(T15, listC_out_g(T48)) → goalD_out_g(s(T15))
The argument filtering Pi contains the following mapping:
goalD_in_g(
x1) =
goalD_in_g(
x1)
0 =
0
U4_g(
x1) =
U4_g(
x1)
listB_in_ =
listB_in_
listB_out_ =
listB_out_
goalD_out_g(
x1) =
goalD_out_g
s(
x1) =
s(
x1)
U5_g(
x1,
x2) =
U5_g(
x2)
s2lA_in_ga(
x1,
x2) =
s2lA_in_ga(
x1)
s2lA_out_ga(
x1,
x2) =
s2lA_out_ga(
x2)
U1_ga(
x1,
x2,
x3,
x4) =
U1_ga(
x4)
.(
x1,
x2) =
.(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
U7_g(
x1,
x2) =
U7_g(
x2)
listC_in_g(
x1) =
listC_in_g(
x1)
[] =
[]
listC_out_g(
x1) =
listC_out_g
U2_g(
x1) =
U2_g(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
LISTC_IN_G(
x1) =
LISTC_IN_G(
x1)
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:
LISTC_IN_G(.(T68, T70)) → LISTC_IN_G(T70)
R is empty.
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x2)
LISTC_IN_G(
x1) =
LISTC_IN_G(
x1)
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:
LISTC_IN_G(.(T70)) → LISTC_IN_G(T70)
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:
- LISTC_IN_G(.(T70)) → LISTC_IN_G(T70)
The graph contains the following edges 1 > 1
(15) YES
(16) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
S2LA_IN_GA(s(T28), .(X56, X57)) → S2LA_IN_GA(T28, X57)
The TRS R consists of the following rules:
goalD_in_g(0) → U4_g(listB_in_)
listB_in_ → listB_out_
U4_g(listB_out_) → goalD_out_g(0)
goalD_in_g(s(T15)) → U5_g(T15, s2lA_in_ga(T15, X31))
s2lA_in_ga(0, []) → s2lA_out_ga(0, [])
s2lA_in_ga(s(T28), .(X56, X57)) → U1_ga(T28, X56, X57, s2lA_in_ga(T28, X57))
U1_ga(T28, X56, X57, s2lA_out_ga(T28, X57)) → s2lA_out_ga(s(T28), .(X56, X57))
U5_g(T15, s2lA_out_ga(T15, X31)) → goalD_out_g(s(T15))
goalD_in_g(s(T15)) → U6_g(T15, s2lA_in_ga(T15, T48))
U6_g(T15, s2lA_out_ga(T15, T48)) → U7_g(T15, listC_in_g(T48))
listC_in_g([]) → listC_out_g([])
listC_in_g([]) → U2_g(listB_in_)
U2_g(listB_out_) → listC_out_g([])
listC_in_g(.(T68, T70)) → U3_g(T68, T70, listC_in_g(T70))
U3_g(T68, T70, listC_out_g(T70)) → listC_out_g(.(T68, T70))
U7_g(T15, listC_out_g(T48)) → goalD_out_g(s(T15))
The argument filtering Pi contains the following mapping:
goalD_in_g(
x1) =
goalD_in_g(
x1)
0 =
0
U4_g(
x1) =
U4_g(
x1)
listB_in_ =
listB_in_
listB_out_ =
listB_out_
goalD_out_g(
x1) =
goalD_out_g
s(
x1) =
s(
x1)
U5_g(
x1,
x2) =
U5_g(
x2)
s2lA_in_ga(
x1,
x2) =
s2lA_in_ga(
x1)
s2lA_out_ga(
x1,
x2) =
s2lA_out_ga(
x2)
U1_ga(
x1,
x2,
x3,
x4) =
U1_ga(
x4)
.(
x1,
x2) =
.(
x2)
U6_g(
x1,
x2) =
U6_g(
x2)
U7_g(
x1,
x2) =
U7_g(
x2)
listC_in_g(
x1) =
listC_in_g(
x1)
[] =
[]
listC_out_g(
x1) =
listC_out_g
U2_g(
x1) =
U2_g(
x1)
U3_g(
x1,
x2,
x3) =
U3_g(
x3)
S2LA_IN_GA(
x1,
x2) =
S2LA_IN_GA(
x1)
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:
S2LA_IN_GA(s(T28), .(X56, X57)) → S2LA_IN_GA(T28, X57)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
.(
x1,
x2) =
.(
x2)
S2LA_IN_GA(
x1,
x2) =
S2LA_IN_GA(
x1)
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:
S2LA_IN_GA(s(T28)) → S2LA_IN_GA(T28)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(21) 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:
- S2LA_IN_GA(s(T28)) → S2LA_IN_GA(T28)
The graph contains the following edges 1 > 1
(22) YES