Table Of ContentI N F S Y S
R E S E A R C H
R E P O R T
2
0
0
2
INSTITUT FU¨R INFORMATIONSSYSTEME
n
a
J ABTEILUNG WISSENSBASIERTE SYSTEME
6
1
]
O
L
s. COMPUTING PREFERRED ANSWER SETS BY
c
[ META-INTERPRETATION IN ANSWER SET
1
v PROGRAMMING
3
1
0
1
0
2
0 ThomasEiter WolfgangFaber NicolaLeone
/
s Gerald Pfeifer
c
:
v
i
X
r
a
INFSYS RESEARCH REPORT 1843-02-01
JANUARY 2002
Institutfu¨rInformationssysteme
Abtg.WissensbasierteSysteme
TechnischeUniversita¨tWien
Favoritenstraße9-11
A-1040Wien,Austria
Tel: +43-1-58801-18405
Fax: +43-1-58801-18493
sek@kr.tuwien.ac.at
www.kr.tuwien.ac.at
INFSYS RESEARCH REPORT
INFSYS RESEARCH REPORT 1843-02-01, JANUARY 2002
COMPUTING PREFERRED ANSWER SETS BY
META-INTERPRETATION IN ANSWER SET PROGRAMMING
ThomasEiter1, WolfgangFaber1,NicolaLeone2, Gerald Pfeifer3
Abstract. Mostrecently,AnswerSetProgramming(ASP)isattractinginterestasanewparadigm
forproblemsolving.Animportantaspectwhichneedstobesupportedisthehandlingofpreferences
between rules, for which several approaches have been presented. In this paper, we consider the
problemofimplementingpreferencehandlingapproachesbymeansofmeta-interpretersinAnswer
Set Programming. In particular, we consider the preferredanswer set approachesby Brewka and
Eiter,byDelgrande,SchaubandTompits,andbyWang,ZhouandLin. We presentsuitablemeta-
interpreters for these semantics using DLV, which is an efficient engine for ASP. Moreover, we
alsopresentameta-interpreterfortheweaklypreferredanswersetapproachbyBrewkaandEiter,
which usesthe weak constraintfeatureof DLV as a toolfor expressingand solvingan underlying
optimization problem. We also consider advanced meta-interpreters, which make use of graph-
based characterizationsand often allow for more efficientcomputations. Our approachshows the
suitability of ASP in generaland of DLV in particular for fast prototyping. This can be fruitfully
exploitedforexperimentingwithnewlanguagesandknowledge-representationformalisms.
1Institutfu¨rInformationssysteme,AbteilungWissensbasierteSysteme,TechnischeUniversita¨tWien,
Favoritenstraße9-11,A-1040Vienna,Austria. E-mail:{eiter,faber}@kr.tuwien.ac.at.
2DepartmentofMathematics,UniversityofCalabria,87030Rende(CS),Italy.E-mail:leone@unical.it.
3Institutfu¨rInformationssysteme,AbteilungDatenbankenundAI,TechnischeUniversita¨tWien,
Favoritenstraße9-11,A-1040Vienna,Austria. E-mail:pfeifer@dbai.tuwien.ac.at.
Acknowledgements: TheauthorswouldliketothankourcolleaguesandtheparticipantsoftheAAAI2001
SpringSymposiumonAnswerSetProgrammingfortheircommentsonthiswork. Thisworkwassupported
bytheAustrianScienceFund(FWF)undergrantsP13871-INF,P14781-INF,andZ29-INF.
Preliminary results of this paper appeared in Alessandro Provetti and Tran Cao Son, editors, Proceedings
AAAI 2001 Spring Symposium on Answer Set Programming: Towards Efficient and Scalable Knowledge
RepresentationandReasoning,StanfordCA,March2001,AAAIPress,ISBN1-57735-129-0.
Copyright(cid:13)c 2008bytheauthors
2 INFSYS RR 1843-02-01
1 Introduction
Handling preference information plays an important role in applications of knowledge representation and
reasoning. Inthe context of logic programs and related formalisms, numerous approaches for adding pref-
erence information have been proposed, including [1, 4, 5, 8, 11, 12, 18, 22, 24, 25, 27, 29] to mention
someofthem. Theseapproacheshavebeendesignedforpurposessuchascapturingspecificityornormative
preference; seee.g.[7,11,25]forreviewsandcomparisons.
Thefollowingexampleisaclassical situation fortheuseofpreference information.
Example1(bird&penguin) Considerthefollowinglogicprogram:
(1) peng.
(2) bird.
(3) ¬flies:-notflies, peng.
(4) flies:-not¬flies, bird.
This program has two answers sets: A = {peng, bird, ¬flies} and A = {peng, bird, flies}.
1 2
Assumethatrule(i)hashigherpriority than(j)iffi < j (i.e.,rule(1)hasthehighest priority andrule(4)
the lowest). Then, A is no longer intuitive, as flies is concluded from (4), while (3) has higher priority
2
than(4),andthus¬fliesshouldbeconcluded.
However,evenifthisexampleisverysimple,thevariouspreferencesemanticsarriveatdifferentresults.
Furthermore, semantics whichcoincide onthisexamplemaywellyielddifferent resultsonotherexamples.
Sinceevaluatingasemanticsonanumberofbenchmarkexamples,eachofwhichpossiblyinvolvingseveral
rules, quickly becomes a tedious task, one would like to have a (quick) implementation of a semantics at
hand, such that experimentation with it can be done using computer support. Exploring a (large) number
of examples, which helps in assessing the behavior of a semantics, may thus be performed in significantly
shortertime,andlesserrorprone,thanbymanualevaluation.
In this paper, we address this issue and explore the implementation of preference semantics for logic
programs by the use of a powerful technique based on Answer Set Programming (ASP), which can be
seen asasort ofmeta-programming inASP.Inthis technique, agiven logic program P withpreferences is
encoded by a suitable set of facts F(P), which are added to a “meta-program” P , such that the intended
I
answer setsofP aredetermined bytheanswer setsofthelogicprogram P ∪F(P). Thesalient feature is
I
that this P is universal, i.e., it is the same for all input programs P. We recall that meta-interpretation is
I
well-established inProlog-style logicprogramming, andisnotcompletely newinASP;asimilartechnique
has been applied previously in [18] for defining the semantics of logic programming with defeasible rules
(cf.Section6).
We focus in this paper on three similar, yet different semantics for prioritized logic programs, namely
the preference semantics by Brewka and Eiter [7], Wang, Zhou and Lin [27], and Delgrande, Schaub and
Tompits [12], which we refer to as B-preferred, W-preferred, and D-preferred answer set semantics, re-
spectively. We present ASP meta-programs P , P , and P such that the answer sets of P ∪F(P),
IB IW ID IB
P ∪F(P),andP ∪F(P)correspond(moduloasimpleprojectionfunction)preciselytotheB-,W-,and
IW ID
D-preferred answer sets of P. This way, by running F(P) together with the corresponding meta-program
on the DLV system [15, 16], we compute the preferred answer sets of P in a simple and elegant way. For
B-preferred answer sets we also provide an alternate meta-program P , which implements a graph-based
Ig
algorithmthatdeterministically checkspreferredness ofananswersetandismoreefficientingeneral. Note
that, by suitable adaptions of the meta-programs, other ASP engines such as Smodels [23] can be used as
well.
INFSYS RR 1843-02-01 3
B-preferred answer setsemantics refinesprevious approaches foradding preferences todefault rules in
[4, 5]. It is defined for answer sets of extended logic programs [17] and is generalized to Reiter’s default
logic in[6]. Animportant aspect ofthisapproach isthatthedefinition ofpreferred answer setswasguided
by two general principles which, as argued, a preference semantics should satisfy. As shown in [7], B-
preferred answer sets satisfy these principles, while almost all other semantics do not. W- and D-preferred
answersetsemanticsincreasingly strengthen B-preferredanswersetsemantics [26].
Since,ingeneral, programs havingananswersetmaylackapreferred answerset,alsoarelaxed notion
of weakly preferred answer sets was defined in [7]. For implementing that semantics, we provide a meta-
program P ,whichtakesadvantage oftheweakconstraints feature[9]ofDLV.
I
weak
Theworkreportedhereisimportantinseveralrespects:
• We put forward the use of ASP for experimenting new semantics by means of a meta-interpretation
technique. The declarativity of logic programs (LPs) provides a new, elegant way of writing meta-
interpreters, whichisverydifferentfromProlog-stylemeta-interpretation. Thankstothehighexpres-
sivenessof(disjunctive) LPsandDLV’sweakconstraints, meta-interpreters canbewritteninasimple
anddeclarative fashion.
• The description of the meta-programs for implementing the various preference semantics also has a
didactic value: it is a good example for the way how meta-interpreters can be built using ASP. In
particular, wealso develop a core meta-program for plain extended logic programs under answer set
semantics, whichmaybeusedasabuilding blockintheconstruction ofothermeta-programs.
• Furthermore, the meta-interpreters provided are relevant per se, since they provide an actual imple-
mentation ofpreferred andweaklypreferred answersetsandallowforeasyexperimentation ofthese
semantics in practice. Toourknowledge, this isthe firstimplementation of weakly preferred answer
sets. An implementation of preferred answer sets (also on top of DLV) has been reported in [13], by
mapping programs into the framework of compiled preferences [10]. Our implementation, as will
be seen, is an immediate translation of the definition of preferred answer sets into DLV code. Weak
constraints make the encoding of weakly preferred answer sets extremely simple and elegant, while
thattaskwouldhavebeenmuchmorecumbersome otherwise.
Insummary, theexperience reported inthispaper confirmsthepowerofASP.Itsuggests theuseofthe
DLVsystem asahigh-level abstract machinetobeemployed alsoasapowerfultoolforexperimenting with
newsemanticsandnovelKRlanguages.
It isworthwhile noting that the meta-interpretation approach presented here does not aim at efficiency;
rather,thisapproachfosterssimpleandveryfastprototyping, whichisusefule.g.intheprocessofdesigning
andexperimenting newlanguages.
Thestructure oftheremainder ofthispaper isasfollows: Inthenext section, weprovide preliminaries
of extended logic programming and answer set semantics. We then develop in Section 3 a basic meta-
interpreter program for extended logic programs under answer set semantics. After that, we consider in
Section4meta-interpreter programsforB-preferred,W-preferred,andD-preferredansweranswersets. The
subsequent Section5isdevoted totherefinement ofpreferred answersetstoweaklypreferred answersets.
AdiscussionofrelatedworkisprovidedinSection6. ThefinalSection7summarizesourresultsanddraws
someconclusions.
4 INFSYS RR 1843-02-01
2 Preliminaries: Logic Programs
Syntax. LogicPrograms(LPs)useafunction-free first-orderlanguage. Asforterms,stringsstartingwith
uppercase (resp., lowercase) letters denote variables (resp., constants). A(positive resp. negative) classical
literal liseitheranatom aoranegatedatom ¬a,respectively; itscomplementary literal, denoted ¬l,is¬a
anda,respectively. A(positive resp.,negative) negation asfailure(NAF)literalℓisoftheformlornot l,
wherelisaclassical literal. Unlessstatedotherwise, byliteralwemeanaclassicalliteral.
Arulerisaformula
a v ··· v a :-b ,···,b , not b ,···, not b . (1)
1 n 1 k k+1 m
where all a and b are classical literals and n ≥ 0, m ≥ k ≥ 0. The part to the left of “:-” is the
i j
head, the part to the right is the body of r; we omit “:-” if m = 0. We let H(r) = {a ,..., a } be the
1 n
set of head literals and B(r)= B+(r)∪B−(r) the set of body literals, where B+(r) = {b ,..., b } and
1 k
B−(r) = {b , ..., b } are the sets of positive and negative body literals, respectively. An integrity
k+1 m
constraint isarulewheren =0.
A datalog program (LP) P is a finite set of rules. We call P positive, if P is not -free (i.e. ∀r ∈ P :
B−(r)= ∅);andnormal,ifP is v-free(i.e.∀r ∈ P : |H(r)| ≤ 1).
Aweakconstraint risanexpression oftheform
:∼ b ,···,b ,not b ,···, not b .[w :l]
1 k k+1 m
where every b isaliteral and l ≥ 1isthe priority level and w ≥ 1the weight among thelevel. Bothl and
i
w are integers and set to 1 if omitted. The sets B(r), B+(r), and B−(r) are defined by viewing r as an
integrity constraint. WC(P)denotesthesetofweakconstraints inP.
Asusual,aterm(atom,rule,...) isground, ifnovariables appearinit.
Semantics. AnswersetsforLPswithweakconstraintsaredefinedbyextendingconsistentanswersetsfor
LPsasintroduced in[17, 20]. Weproceed inthree steps: wefirstdefineanswer sets (1) ofground positive
programs, then (2) of arbitrary ground programs, and (3) finally (optimal) answer sets of ground programs
with weak constraints. As usual, the (optimal) answer sets of a non-ground program P are those of its
ground instantiation Ground(P),definedbelow.
For any program P, let U be its Herbrand universe and B be the set of all classical ground literals
P P
from predicate symbols inP overtheconstants ofU ;ifnoconstant appears inP,anarbitrary constant is
P
added toU . Foranyclause r,letGround(r)denote thesetofitsground instances. Then,Ground(P) =
P
Ground(r). Note that P is ground iff P = Ground(P). An interpretation is any set I ⊆ B of
r∈P P
ground literals. Itisconsistent, ifI ∩{¬l | l ∈ I} = ∅.
S
Inwhatfollows,letP beagroundprogram.
(1) A consistent1 interpretation I ⊆ B is called closed under a positive program P, if B(r) ⊆ I
P
impliesH(r)∩I 6= ∅foreveryr ∈ P. AsetX ⊆ B isananswersetforP ifitisaminimalset(wrt.set
P
inclusion) closedunderP.
(2) Let PI be the Gelfond-Lifschitz reduct of a program P w.r.t. I ⊆ B , i.e., the program obtained
P
fromP bydeleting
• allrulesr ∈ P suchthatB−(r)∩I 6= ∅,and
1Weonlyconsiderconsistentanswersets,whilein[20]alsothe(inconsistent)setB maybeananswerset.
P
INFSYS RR 1843-02-01 5
• allnegativebodyliteralsfromtheremaining rules.
Then, I ⊆ B is an answer set of P iff I is an answer set of PI. By AS(P) we denote the set of all
P
answersetsofP.
Example2 Theprogram
avb.
bvc.
dv¬d:-a,c.
hasthreeanswersets: {a,c,d}, {a,c,¬d}, and{b}.
(3) Given a program P with weak constraints, we are interested in the answer sets of the part without
weakconstraintswhichminimizethesumofweightsoftheviolatedconstraintsinthehighestprioritylevel,
andamongthemthosewhichminimizethesumofweightsoftheviolatedconstraintsinthenextlowerlevel,
etc. Thisisexpressedbyanobjectivefunction forP andananswersetA:
f (1) =1
P
f (n)=f (n−1)·|WC(P)|·wP +1, n> 1
P P max
HP = lmPax(f (i)· w )
A i=1 P N∈NA,P N
i
P P
where wP and lP denote the maximum weight and maximum level of a weak constraint in P, respec-
max max
A,P
tively; N denotes the set of weak constraints in level i which are violated by A, and w denotes the
i N
weight of the weak constraint N. Note that |WC(P)|·wP +1 is greater than the sum of all weights in
max
theprogram, andtherefore guaranteed tobegreater thananysumofweights ofasinglelevel. Ifweightsin
level i are multiplied by f (i), it is sufficient to calculate the sum of these updated weights, such that the
P
updatedweightofaviolated constraint ofagreaterlevelisalwaysgreaterthananysumofupdatedweights
ofviolated constraints oflowerlevels.
Then, A is an (optimal) answer set of P, if A ∈ AS(P \WC(P)) and HP is minimal over AS(P \
A
WC(P)). LetOAS(P)denotethesetofalloptimalanswersets.
Example3 Letusenhancetheprogram fromExample2bythefollowing threeweakconstraints:
:∼a,c.[2:1]
:∼¬d.[1:1]
:∼b.[3:1]
Theresulting programP hasthesingleoptimalanswersetA = {a,c,d}withweight2inlevel1.
3 3
3 Meta-Interpreting Answer Set Programs
Inthissectionweshowhowanormalpropositional answersetprogram canbeencoded forandinterpreted
byagenericmeta-interpreter basedonthefollowingidea:
Weprovidearepresentation F(P)ofanarbitrarynormalpropositionalprogramP 2asasetoffactsand
combine these facts withageneric answer setprogram P such thatAS(P) = {π(A) | A ∈ AS(F(P)∪
Ia
P )},whereπ isasimpleprojection function.
Ia
2We assume that integrity constraints :- C.are writtenasequivalent rules bad:-C,not bad.where bad isapredicate not
occurringotherwiseinP.
6 INFSYS RR 1843-02-01
3.1 Representing AnAnswer SetProgram
Firstwetranslate thepropositional answersetprogram P intoasetoffactsF(P)asfollows:
1. Foreachrule
c:-a ,...,a ,notb ,...,notb .
1 m 1 n
oftheprogram P,F(P)contains thefollowingfacts:
rule(r).head(c,r).pbl(a ,r). ... pbl(a ,r).
1 m
nbl(b ,r). ... nbl(b ,r).
1 n
wherer isauniqueruleidentifier.
2. For each pair of complementary literals ℓ,¬ℓ occurring in the program P we explicitly add a fact
compl(ℓ,¬ℓ).
Example4 The program of the bird & penguin example is represented by the following facts representing
therules:
rule(r1). head(peng,r1).
rule(r2). head(bird,r2).
rule(r3). head(neg flies,r3).
pbl(peng,r3). nbl(flies,r3).
rule(r4). head(flies,r4).
pbl(bird,r4). nbl(neg flies,r4).
andthefollowing factsrepresenting complementary literals:
compl(flies,neg flies).
3.2 BasicMeta-interpreter program
Several meta-interpreters that we will encounter in the following sections consist of two parts: a meta-
interpreter program P forrepresenting ananswer set, andanother one forchecking preferredness. Inthis
Ia
section wewillprovide thefirstpartwhichiscommontomanymeta-interpreters showninthispaper.
Representing an answer set. We define a predicate in AS(.) which is true for the literals in an answer
setofP. Aliteral isinananswer setifitoccurs inthehead ofarule whosepositive bodyisdefinitely true
andwhosenegativebodyisnotfalse.
in AS(X):-head(X,R), pos body true(R),
notneg body false(R).
Thepositivepartofabodyistrue,ifallofitsliteralsareintheanswerset. Unfortunately wecannotencode
such a universal quantification in one rule. We can identify a simple case: If there are no positive body
literals, thebodyistriviallytrue.
pos body exists(R):-pbl(X,R).
pos body true(R):-rule(R),notpos body exists(R).
INFSYS RR 1843-02-01 7
However, ifpositive body literals exist, wewillproceed iteratively. Tothis end, weuse DLV’sbuilt-in total
orderonconstants fordefiningasuccessor relationonthepositivebodyliteralsofeachrule,andtoidentify
thefirstandlastliteral, respectively, ofapositiverulebodyinthistotalorder. Technically, itissufficientto
defineauxiliary relations asfollows.
pbl inbetween(X,Y,R):-pbl(X,R),pbl(Y,R),pbl(Z,R),X < Z,Z < Y.
pbl notlast(X,R):-pbl(X,R),pbl(Y,R),X < Y.
pbl notfirst(X,R):-pbl(X,R),pbl(Y,R),Y < X.
This information can be used to define the notion of the positive body being true up to (w.r.t. the built-in
order)somepositivebodyliteral. Ifthepositivebodyistrueuptothelastliteral,thewholepositivebodyis
true.
pos body true upto(R,X):-pbl(X,R),notpbl notfirst(X,R),in AS(X).
pos body true upto(R,X):-pos body true upto(R,Y),pbl(X,R),in AS(X),
Y < X,notpbl inbetween(Y,X,R).
pos body true(R):-pos body true upto(R,X),notpbl notlast(X,R).
Thenegativepartofabodyisfalse,ifoneofitsliterals isintheanswerset.
neg body false(Y):-nbl(X,Y),in AS(X).
Each answer set needs to be consistent; we thus add an integrity constraint which rejects answer sets con-
tainingcomplementary literals.
:-compl(X,Y),in AS(X),in AS(Y).
Therulesdescribedabove(referredtoasP inthesequel)areallweneedforrepresentinganswersets. Each
Ia
answersetofP ∪F(P)representsananswersetofP. Letπ bedefinedbyπ(A) = {ℓ |in AS(ℓ) ∈ A}.
Ia
Thenwecanstatethefollowing:
Theorem1 Let P be a normal propositional program. Then, (i) if A ∈ AS(P ∪ F(P)) then π(A) ∈
Ia
AS(P),and(ii)foreachA ∈ AS(P),thereexistsasingleA′ ∈ AS(P ∪F(P))suchthatπ(A′)= A.
Ia
Proof
(i) π(A) must be a consistent set of literals from P, since for each ℓ s.t. in AS(ℓ) ∈ A, head(ℓ,r)
must hold for some rule r, which, by construction of F(P), only holds for ℓ ∈ B , and since the con-
P
straint :-compl(ℓ,¬ℓ),in AS(ℓ),in AS(¬ℓ).mustbebesatisfied byA(againbyconstruction ofF(P))
{in AS(ℓ),in AS(¬ℓ)} 6⊆ Aandhence{ℓ,¬ℓ} 6⊆ π(A)forallℓ ∈B .
P
Thus,toshowthatπ(A) ∈ AS(P),itsufficestoshowthat(α)π(A)isclosedunderPπ(A),andthat(β)
π(A) ⊆ T∞ musthold, whereT isthestandard T operator forP = Pπ(A). Let,forconvenience,
Pπ(A) Pπ(A) P
denoteQ = Ground(P ∪F(P)).
Ia
As for (α), we show that if r ∈ Pπ(A) such that B(r) ⊆ π(A), then there is a rule h ∈ Q such that
r
H(h ) = {in AS(h)} where H(r) = {h} and h is applied in A, i.e., A |= B(h ) and in AS(h) ∈ A.
r r r
Let r stem from a rule r′ ∈ P. Then, let h be the (unique) rule in Q such that H(h ) = {in AS(h)}
r r
(note that H(r) = H(r′) = {h}) and head(h,r′) ∈ B(h ). Since B(r) = B+(r′) ⊆ π(A), we have for
r
each ℓ ∈ B(r) that in AS(ℓ) ∈ A and, by construction of F(P), that pbl(ℓ,r′) ∈ A. Since < induces a
linearordering ofB+(r′),itfollowsbyaninductive argument alongitthatpos body true upto(r′,ℓ) ∈ A
holds for each ℓ ∈ B+(r′) and that pos body true(r′) ∈ A. Furthermore, since B−(r′) ∩ π(A) = ∅,
8 INFSYS RR 1843-02-01
it holds that A 6|= B(n ) for each rule n ∈ Q such that H(n ) = neg body false(r′). Therefore,
r r r
neg body false(r′) ∈/ A. Since head(h,r′) ∈ A by construction of F(P), it follows that A |= B(h ).
r
Thus,h isappliedinA,andhenceH(h )= in AS(h) ∈ A. Thisproves(α).
r r
As for (β), it suffices to show that if in AS(ℓ) ∈ Ti \Ti−1, i.e., in AS(ℓ) is added to A in the i-th
QA QA
stepoftheleastfixpointiterationforT ,i≥ 1,thenℓ ∈ T∞ holds. Additionofin AS(ℓ)impliesthat
QA Pπ(A)
ℓ = H(r) for some r ∈ P such that neg body false(r) ∈/ A and pos body true(r) ∈ A. This implies
in AS(ℓ′)∈ Ti−1foreachℓ′ ∈B+(r)andin AS(ℓ′) ∈/ Aforeachℓ′ ∈ B−(r). Byaninductiveargument,
QA
weobtainB+(r)⊆ T∞ ;therefore, ℓ ∈T∞ holds. Thisproves(β).
Pπ(A) Pπ(A)
(ii)ForanyA ∈ AS(P),letA′ bedefinedasfollows(<isthetotalorderonconstants definedinDLV):
A′ ={in AS(x) |x∈ A}∪
{pos body true upto(r,x) |x∈B+(r)∧x∈A∧∀y∈B+(r): y<x → y∈A}∪
{pos body true(r)| ∀x∈ B+(r): x∈ A}∪
−
{neg body false(r)|B (r)∩A 6= ∅}∪
{pos body exists(r)| B+(r) 6= ∅}∪
{pbl notfirst(x,r)| x∈ B+(r)∧∃y ∈ B+(r): y < x}∪
{pbl notlast(x,r)| x∈ B+(r)∧∃y ∈ B+(r) :x < y}∪
{pbl inbetween(x,y,r) | x,y ∈ B+(r)∧(∃z ∈ B+(r): x < z∧z < y)}∪
F(P).
Observethatthesetofliteralsdefinedbythelastfivelines(callitA )donotdepend onAsincethey
stat
have to occur in all answer sets of P ∪F(P). The definitions of A directly reflect the corresponding
Ia stat
rule structure in P and F(P). Since the inclusion of literals in AS(x) into A′ is determined by the
Ia
condition π(A′) = A, it is easy to see that all rules defining neg body false are satisfied; in the case of
pos body true uptoandpos body true,rulesatisfaction canbeseenbyaconstructive argumentalongthe
order<.
To see that A′ is minimal and the only answer set of P ∪F(P) s.t. π(A′) = A, an argument similar
Ia
to the one in (β) of the proof for (i) can be applied: If another answer set A′′ exists s.t. π(A′′) = A, each
in AS(x) s.t. x ∈ A must be added in some stage of Ti , and in some stage Tj of the standard least
QA′ QA′′
fixpointoperator. Butthen,byaninductiveargument, T∞ = T∞ musthold. 2
QA′ QA′′
Themeta-interpreter programP hasthebenignpropertythatastandardclassofprograms,namelythe
Ia
class ofstratified programs, whichareeasytoevaluate, isalsointerpreted efficiently through it. Recallthat
a normal propositional program P is stratified, if there is a function λ which associates with each atom a
in P an integer λ(a) ≥ 0, such that each rule r ∈ P with H(r) = {h} satisfies λ(h) ≥ λ(ℓ) for each
ℓ ∈ B+(r) and λ(h) > λ(ℓ) for each ℓ ∈ B−(r). Denote for any program P by P the set of rules in
ir
Ground(P ∪F(P)) whoserepresentation literals (i.e., literals overrule,head, bpl,nbl)aresatisfied by
Ia
F(P). Thenwehave:
Proposition 1 Let P be a stratified normal propositional program. Then, P is locally stratified (i.e.,
ir
stratified ifviewedasapropositional program).
Thiscanbeseenbyconstructing fromastratification mappingλforP asuitable stratification mapping
λ′ forP . LocallystratifiedprogramsareefficientlyhandledbyDLV.Since,byintelligentgroundingstrate-
ir
gies, P is efficiently computed in DLV, the overall evaluation of P ∪F(P) is performed efficiently by
ir Ia
DLVforstratifiedprogramsP.