Professional Documents
Culture Documents
This chapter provides a brief introduction to two main semantics of logic pro-
grams with negation, the stable-model semantics of Gelfond and Lifschitz, and the
well-founded semantics of Van Gelder, Ross, and Schlipf. We present definitions,
introduce basic results, and relate the two semantics to each other. We restrict
attention to the syntax of normal logic programs and focus on classical results.
However, throughout the chapter and in concluding remarks we briefly discuss
generalizations of the syntax and extensions of the semantics, and mention several
recent developments.
Introduction
2.1 The roots of logic programming can be traced back to efforts to build resolution-
based automated theorem provers in the mid-1960s [Robinson 1965]. A realization
that resolution can turn Horn theories into programs came about in the early 1970s
and rested on the foundational work of Kowalski and Kuehner [1971] and Kowalski
[1974], as well as the implementation effort of Colmerauer and his research group,
in which the Prolog programming language was developed [Colmerauer et al. 1973].
Negation was present in Prolog from the very beginning. Its meaning was spec-
ified operationally through its implementation. However, for almost two decades,
122 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
finding a satisfactory declarative account of negation was elusive. The first signifi-
cant progress was obtained by Clark, who proposed reading programs as definitions
and formalized that reading by means of the program completion [Clark 1978]. A dif-
ferent plan of attack was developed a few years later by Apt, Blair, and Walker [1988]
and, independently, by Przymusinski [1988a, 1988b]. They introduced a large and
natural class of programs with negation, called stratified programs, and showed
that the meaning of a stratified program is captured by a certain well-motivated
Herbrand model. Przymusinski [1988a] called this model perfect. Soon thereafter,
Gelfond and Lifschitz [1988] proposed the stable-model semantics and Van Gelder
et al. [1988, 1991] the well-founded semantics. The stable-model semantics was
strongly influenced by research in knowledge representation concerned with the
notion of nonmonotonic reasoning, and built on the semantics of default logic by
Reiter [1980] and autoepistemic logic by Moore [1985]. The well-founded semantics
followed the query-evaluation paradigm of Prolog but framed it in a three-valued
setting. Both semantics were heavily influenced by the perfect-model semantics and
can be regarded as its generalizations to the class of all programs. Moreover, despite
some fundamental differences, they also show strong and interesting connections
to the completion semantics by Clark.
The stable-model and the well-founded semantics have had major implications
on the fields of logic programming and knowledge representation. Since their in-
ception, they fueled research in these two fields and gave rise to fascinating theo-
retical results, implementations of declarative programming languages, and suc-
cessful applications. In particular, the answer-set programming paradigm [Marek
and Truszczyński 1999, Niemelä 1999, Brewka et al. 2011] and its modern imple-
mentations trace their roots to the stable-model semantics [Gebser et al. 2012],
while some closely related declarative programming systems grew out of general-
izations of the well-founded semantics [Denecker 2009]. The latter underlies also
a successful Prolog descendant, the XSB system [Sagonas et al. 1994], and several
other systems we mention later on.
In this tutorial presentation, we introduce the two semantics and show that,
despite their differences, they are closely related. Our goal is to present basic prop-
erties of the stable-model and the well-founded semantics, focusing on the most
significant lines of research. After introducing the terminology and the most es-
sential preliminaries, we start our presentation with the case of Horn programs
(Section 2.3). In Section 2.4 we discuss several examples that point out problems
that arise for programs with negation, and informally suggest ways in which these
problems could be addressed. We follow up with a formal discussion of the stable-
model semantics as an extension of the least-model semantics of Horn programs to
2.2 Terminology, Notation, and Other Preliminaries 123
the case of programs with negation (Section 2.5). The key topics we discuss are strat-
ification and program splitting, supported models, completion, tight programs,
loops and the Loop Theorem, and strong equivalence of programs. We then change
gears and move into the realm of four-valued Herbrand interpretations. While
there, we define partial stable and partial supported models, and the most dis-
tinguished representatives of the two classes of “partial” models: the well-founded
and the Kripke-Kleene models, respectively (Section 2.6). We conclude with brief
closing comments.
where a and all bi ’s and cj ’s are atoms. The atom a is the head of the rule (2.1)
and the conjunction (list) b1 , . . . , bm , not c1 , . . . , not cn of literals is its body. If r
denotes a rule, we write H (r) and B(r) for the head and the body of r, respectively.
124 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
We extend this notation to programs and write H (P ) and B(P ) for the sets of heads
and bodies of rules in a program P .
We often write rules as a ← B, where a is an atom and B is a list of liter-
als. For every list B = b1 , . . . , bm , not c1 , . . . , not cn of literals we define B + =
{b1 , . . . , bm} and B − = {c1 , . . . , cn}, and we often specify a rule a ← B as a ←
B + , not B −. We note a slight abuse of the notation here. The expression in the
body, B + , not B −, is not a list but a pair of sets. Nevertheless, as all semantics of
logic programs we consider in this chapter are insensitive to the order of literals
in the bodies of rules, the notation gives all essential information about the rule it
describes.
If n = 0, rule (2.1) is a Horn rule and if m + n = 0, a fact. In the latter case, we
omit ‘←’ from the notation, that is, we write a instead of a ←. A logic program (or
just a program) is a collection of rules. A Horn program is a program consisting of
Horn rules.
A program can be considered within any language of logic programming whose
vocabulary σ contains all constant, function, and predicate symbols that occur
in the program. However, it is convenient to see a program as an element of the
minimal language within which it can be studied, the one determined by the set
of the symbols the program contains. For a program P , we denote by HU(P ) and
HB(P ) the Herbrand universe and the Herbrand base of this most economical
language, and we refer to them as the Herbrand universe and the Herbrand base
of P . We restrict attention to programs that contain at least one constant symbol
to make sure that the requirement we imposed earlier on the language of logic
programming is satisfied.
A ground instance of a rule r is any rule that can be obtained by consistently
substituting its variables with ground terms. The grounding of a program P , de-
noted by gr(P ), is the program consisting of all ground instances of rules in P .
The grounding of P is determined by the language within which we consider P .
However, unless stated otherwise, by the grounding of a program P we mean the
grounding of P in the language determined by the symbols of P . That is, we instan-
tiate variables to terms in the Herbrand universe of P , HU(P ).
To illustrate, let P be the program
even(0)
even(s 2(X)) ← even(X) (2.2)
odd(X) ← not even(X).
2.2 Terminology, Notation, and Other Preliminaries 125
The program
gr(P ) = {even(0)}
1. As usual, s i (t) stands for s(s(. . . s (t) . . .)). In particular, s 0(t) stands for t.
i
126 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
Theorem 2.1 Knaster-Tarski. Let O be a monotone operator on a complete lattice L, ≤. Then
O has a least pre-fixpoint and a least fixpoint, and the two coincide.
Proof Let us define P = {x ∈ L: O(x) ≤ x}. In other words, P is the set of all pre-fixpoints
of O. We note that P = ∅. This observation follows as a corollary from the argu-
ment below. However, it can also be seen in a more direct way. Indeed, since L is
complete, lub(L) is well defined. Clearly, O(lub(L)) ∈ L and so, O(lub(L)) ≤ lub(L).
Thus, lub(L) ∈ P .
Let p be the greatest lower bound of P (p is well-defined by the completeness of
L). For every y ∈ P , p ≤ y. Thus, by the monotonicity of O and the definition of P ,
O(p) ≤ O(y) ≤ y. It follows that O(p) is a lower bound for P . Since p is the greatest
lower bound for P , O(p) ≤ p. Thus, p ∈ P or, equivalently, p is a pre-fixpoint of O.
Consequently, p is the least pre-fixpoint of O. Moreover, using the monotonicity of
O again, we obtain O(O(p)) ≤ O(p); that is, O(p) ∈ P . Thus, p ≤ O(p). It follows
that O(p) = p. That is, p is a fixpoint of O and, since fixpoints are pre-fixpoints, the
least fixpoint of O.
The proof we presented is non-constructive. But the Knaster-Tarski theorem
has also a simple constructive proof. It makes use of ordinal numbers, transfinite
sequences, and transfinite induction. Reviewing these concepts goes beyond the
scope of this text. Instead, we refer to the monograph by Jech [2003] for an elegant
discussion (a brief overview can also be found in the classic logic programming text
by Lloyd [1984]).
In a constructive proof of the Knaster-Tarski theorem, we define a certain trans-
finite sequence of sets (a sequence that is labeled with ordinal numbers). The
sequence starts with the empty set. Each element in the sequence that is labeled
with a successor ordinal is obtained from the previous one by applying O. Each
element in the sequence that is labeled with the limit ordinal is the union of all
previous sets in the sequence. Importantly, one can show that some element in the
sequence is a fixpoint of O and, in fact, the least fixpoint (and the least pre-fixpoint).
The least ordinal that appears as the label of such a set represents the “number” of
steps in which the fixpoint is reached. We will encounter a specific example of this
construction later on.
An operator O on a complete lattice L is finitary if for every countable sequence
a0 ≤ a1 ≤ . . . of elements from L
Operators that are monotone and finitary are continuous. The operators we will
consider in this presentation are continuous. One can show that for continuous
2.2 Terminology, Notation, and Other Preliminaries 127
Theorem 2.2 Let O be an antimonotone operator on a lattice L, ≤. Then the operator O 2 on
L, ≤ is monotone.
Herbrand Interpretations
The subsets of the Herbrand base of a program P are in a one-to-one and onto cor-
respondence with the standard first-order logic Herbrand interpretations of the
vocabulary of P [Doets 1994]. It is because an Herbrand interpretation is uniquely
determined by the set of ground atoms that are true in it. In fact, that set is often
taken to stand for the corresponding Herbrand interpretation. We will follow this
convention and refer to subsets of HB(P ) as Herbrand interpretations (of the lan-
guage determined by P ). Below, we express the standard definition of the satis-
faction relation for Herbrand interpretations under the assumption that Herbrand
interpretations are sets of ground atoms, and extend it to rules and programs.
Definition 2.1 Let I be an Herbrand interpretation. The interpretation I satisfies a ground atom
a if a ∈ I , and it satisfies a ground literal not a, if a ∈ I . Furthermore, I satisfies
a conjunction B = b1 , . . . , bm , not c1 , . . . , not cn of ground literals if B + ⊆ I and
B − ∩ I = ∅.
The interpretation I satisfies a ground rule a ← B, if I does not satisfy B or
I satisfies a. Further, I satisfies a rule r, if I satisfies every ground instance of r.
Finally, I satisfies a program P , if I satisfies every rule in P or, equivalently, if I
satisfies every ground rule in gr(P ).
Instead of “satisfies” we will often say “is a model of.” We write I |= E, when I
satisfies an expression (an atom, a literal, a rule, or a program) E. Otherwise, we
write I |= E.
128 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
The set All(P ) of all Herbrand interpretations of a program P (that is, according
to our convention, the collection of all subsets of HB(P )), together with the inclu-
sion relation, forms a complete lattice. Similarly, the set All 4(P ) = All(P ) × All(P )
(we explain the notation All 4(P ) in the next paragraph) of pairs of Herbrand inter-
pretations forms a complete lattice with respect to the precision ordering ≤p defined
as follows:
It is clear from the definition that TP (I ) is indeed a subset of HB(P ), that is, that
TP is an operator on All(P ).
2. We point out that the intuition no longer applies if the comparison involves pairs (I , J ),
where I ⊆ J , as such pairs do not approximate any interpretation. Nevertheless, we use the term
“precision ordering” whenever any two pairs of interpretations are compared.
2.2 Terminology, Notation, and Other Preliminaries 129
Proof Let us assume that I is an Herbrand model of P and let a ∈ TP (I ). By the definition
of the operator TP , there is a rule a ← B ∈ gr(P ) such that I |= B. Since I |= a ← B,
a ∈ I . Hence, TP (I ) ⊆ I .
Conversely, let us suppose that TP (I ) ⊆ I and let a ← B ∈ gr(P ). If I |= B then,
by definition, a ∈ TP (I ). Thus, a ∈ I . It follows that I |= a ← B and, as a ← B is an
arbitrary rule in gr(P ), I |= P .
Theorem 2.4 If P is a Horn program, the operator TP is a monotone and finitary operator on the
lattice All(P ).
Proof Let I ⊆ I ⊆ HB(P ) and let a ∈ TP (I ). It follows that there is a rule a ← B in gr(P )
such that I |= B. Since P is a Horn program, B − = ∅. Thus, the condition I |= B is
equivalent to B + ⊆ I . By the assumption, B + ⊆ I and so, I |= B. This implies that
a ∈ TP (I ). Hence, TP (I ) ⊆ TP (I ) follows.
Next, let us consider a sequence A0 ⊆ A1 ⊆ . . . ⊆ HB(P ). If a ∈ TP ( ∞ k=0 Ak ), then
∞
there is a rule a ← B in gr(P ) such that B ⊆ k=0 Ak . Since B is finite, there is n
such that B ⊆ nk=0 Ak = Ak . Consequently, a ∈ TP (Ak ). Thus, a ∈ ∞ k=0 TP (Ak ). It
follows that TP is finitary.
and
by a rule in gr(P ) that surely applies in (I , J ) or, more formally, has all literals in its
body surely true in (I , J ) (positive atoms true, that is, in I , atoms that are negated
surely false, that is, not in J ). Similarly, we can see P (J , I ) as the set of atoms that
are derivable in one step by a rule that possibly applies in (I , J ) or, more formally,
has all literals in its body possible in (I , J ) (positive atoms in J , atoms that are
negated possibly false, that is, not in I ). Thus, the operator TP can be seen as a
four-valued counterpart to TP .
Below, we often write P (., J ) to represent an operator on All(P ) that to any
interpretation I ∈ All(P ) assigns the interpretation P (I , J ). We use the notation
P (I , .) in a similar way.
In the four-valued setting, we have several general monotonicity properties for
operators. These properties underlie all major semantics of logic programs.
Theorem 2.5 For every logic program P , the operator P (., J ) on All(P ) is monotone (with
respect to inclusion), the operator P (I , .) on All(P ) is antimonotone (with respect
to inclusion), and the operator TP on All 4(P ) is monotone (with respect to ≤p ).
P (I , J ) ⊆ P (I , J ) ⊆ P (I , J )
and
P (J , I ) ⊆ P (J , I ) ⊆ P (J , I ).
Consequently,
The need for formal semantics is obvious. Expressions in the language (programs)
must have a precise unambiguous meaning to allow analyzing them for correct-
ness, and to serve as a specification for software to compile and execute them. The
second requirement is not absolutely necessary, but it is critical if a formalism is
to be used effectively by programmers. To build programs, programmers must un-
derstand what programs mean. This meaning should be unambiguously suggested
by the informal reading of rules and programs. What this informal reading should
be has been the subject of a considerable debate in the logic programming com-
munity. Denecker and his collaborators provide a comprehensive overview of issues
involved [Denecker et al. 2001, Denecker and Ternovska 2008, Denecker et al. 2012].
They argue that programs should be viewed as representations of informal defini-
tions that serve as restrictions on (Tarskian) possible worlds, and not as epistemic
expressions on beliefs of an agent, a view that influenced Gelfond and Lifschitz
[1988] in their work that led to the stable-model semantics.
We skirt this issue here and simply suggest to read a rule (2.1) as:
We note two related difficulties with this reading. First, it is not necessarily clear
when we can assume that an atom “cannot be established.” Second, the statement
“cannot be established” is applied to a single rule but clearly depends on other rules
in the program. Hence, the meaning of program rules depends on the program,
and the meaning of programs is not derived from the meaning of its rules by any
obvious composition operator such as, for instance, conjunction. Nevertheless, the
proposed reading is useful in motivating formal semantics of logic programs and
we will refer to it below.
of that rule, even(s 2(0)) ← even(0). Since we already established even(0), based on
the informal reading of rules we can now establish even(s 2(0)). Continuing in this
way, we can establish even(s 4(0)), even(s 6(0)), etc. Thus, based on our informal
reading of rules we can establish all atoms in the set {even(0), even(s 2(0)), . . .} and
nothing else. It is worth noting that each atom we could establish is an element of
the Herbrand base, and that all derivations used rules from the grounding of the
program.
Next, let us consider the program
r(1, 2)
r(2, 3)
r(3, 4) (2.7)
tc(X, X)
tc(X, Y ) ← r(X, Z), tc(Z, Y ).
Reasoning as above, we can establish atoms r(1, 2), r(2, 3), and r(3, 4). The case of
the rule tc(X, X) requires some consideration. Establishing an atom tc(X, X), with-
out specifying what X is to be substituted with, is meaningless. Assuming that the
program describes all that is relevant to the problem at hand, the only reasonable
substitutions are those using terms from the Herbrand universe of the program,
in this case, the constants 1, 2, 3, and 4. Thus, the rule tc(X, X) allows us to es-
tablish tc(1, 1), tc(2, 2), tc(3, 3), and tc(4, 4).3 From that point on, new atoms can
only be established by means of instantiations of the last rule. Clearly, “potentially
usable” instantiations arise only when elements of the Herbrand universe, that is,
constants 1, 2, 3, and 4 are substituted for variables X, Y , and Z. Thus, we can es-
tablish tc(1, 2), since r(1, 2) and tc(2, 2) are already established, and tc(2, 3) and
tc(3, 4), by a similar reasoning. Next, we can establish tc(1, 3) and tc(2, 4) and,
finally, tc(1, 4). With that we reach a point where no new atoms can be established.
To summarize, each of the programs (2.6) and (2.7) has a clear meaning given
by a subset of its Herbrand base. That subset is constructed in a series of steps,
3. Rules such as tc(X, X) do not appear in programs arising in practice. The reason is precisely
the ambiguity concerning legal substitutions for X. Typically, instead of the rule tc(X, X) we
would have two rules tc(X, X) ← r(X, Y ) and tc(X, X) ← r(Y , X). We could now produce arbitrary
instantiations of these rules. However, the only “usable” instantiations would be those where X
and Y are replaced with values x and y such that r(x , y) or r(y , x) might possibly be true. Such
values x and y must come from the Herbrand universe of the program. In this way, we explicitly
enforce the principle that the only allowed substitutions are those by elements of the Herbrand
universe, rather than adopt it as a convention.
2.3 The Case of Horn Logic Programs 133
in which new atoms are derived based on those obtained previously by means of
ground instantiations of rules of the program. In the first case, the result represents
the concept of a non-negative even number and, in the second case, the graph given
by the relation r and its transitive closure given by the relation tc. This suggests that
Horn programs can be interpreted as definitions, an observation that underlies the
definitional reading of programs mentioned above [Denecker et al. 2001, Denecker
and Ternovska 2008, Denecker et al. 2012], as well as earlier extensive uses of Horn
programs as database queries [Ullman 1988, Ceri et al. 1990].
The derivation process used in our two examples can be defined for an arbitrary
Horn program P . Formally, we do this in terms of the one-step provability operator
TP and exploit its monotonicity (in this section we implicitly assume that all pro-
grams we consider are Horn and so Theorem 2.4 applies). Specifically, we construct
a sequence {TPk }∞k=0 of subsets of HB(P ) by setting
TP0 = ∅
Since TP0 = ∅, we clearly have TP0 ⊆ TP1. By the monotonicity of TP , we also have
TPk ⊆ TPk+1 ,
that is, every set in the sequence contains all elements belonging to the earlier ones.
It should be clear that the sequence {TPk }∞ k=0 is a formal representation of the
derivation process we described for programs (2.6) and (2.7). The identity TP0 = ∅
reflects that we start with no atoms established, and the formula TPk+1 = TP (TPk )
captures the informal reading of rules and programs: TPk+1 is the set of all atoms
that can be established by means of a single application of a rule from gr(P ) to
atoms established earlier.
In our examples we reached the limit of the process, that is, the set of atoms
from which no new atoms can be derived. It turns out that it is always possible. Let
us set
∞
TP∞ = TPk .
k=0
134 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
We will show that TP∞ is a fixpoint of the operator TP , that is, TP∞ = TP (TP∞). We
have
TP0 = ∅ ⊆ TP (TP∞), and
Thus,
∞
TP∞ = TPk ⊆ TP (TP∞).
k=0
Theorem 2.6 For every Horn program P , the one-step provability operator TP has a least pre-
fixpoint and the least fixpoint, and the two coincide. Moreover, the least (pre-
)fixpoint of TP can be reached in at most ω steps.
Proof We have already demonstrated that TP∞ is a fixpoint of TP . Let U be any pre-fixpoint
of TP . Then, for every k = 0, 1, . . . , TPk ⊆ U . Indeed, TP0 = ∅ ⊆ U and, if TPi ⊆ U , then
TPi+1 = TP (TPi ) ⊆ TP (U ) ⊆ U . Hence, the claim follows by induction. Consequently,
TP∞ ⊆ U . Since fixpoints are, in particular, pre-fixpoints, the assertion follows.
4. The discussion we presented above amounts to what we described earlier as the constructive
proof of the Knaster-Tarski theorem for the one-step provability operator TP , where P is a Horn
program. The sequence TP0 , TP1 , . . . , TPω (where we now write TPω for TP∞) is the transfinite sequence
we talked about then. We observe in passing that the proof remains almost the same for arbitrary
monotone operators on complete lattices. The key difference is that we need to use a transfinite
induction. In general, the least fixpoint of a monotone operator on a complete lattice cannot be
reached in ω steps.
2.4 Moving Beyond Horn Programs—An Informal Introduction 135
Theorem 2.7 Let P be a Horn program. The least fixpoint of the one-step provability operator TP
and the least Herbrand model of P are equal.
From now on, we write LM(P ) for the least Herbrand model of P . The existence
of the least Herbrand model (the least fixpoint of the one-step provability operator),
allows us to formalize the meaning of Horn programs. They can be seen as defini-
tions, that is, devices that define relations, with the precise meaning of what they
define given by their least Herbrand models.
Definition 2.2 A Horn program P defines a relation R ⊆ HU(P )n if there is an n-ary relation symbol
r in the language of P such that for every t1 , . . . , tn ∈ HU(P ),
Theorem 2.8 implies that Horn logic programming can be used as the foun-
dation for a Turing-complete programming language. This observation found its
implementation in Prolog [Colmerauer et al. 1973]. Prolog employs resolution pro-
cedures [Robinson 1965], in particular, the SLD (selective linear definite clause)
resolution [Kowalski and Kuehner 1971, Lloyd 1984], for finding whether a ground
atom belongs to the least Herbrand model of the program, that is, whether the
tuple of its ground terms has a property defined by the program.
a
(2.8)
c ← a, not b,
2.4 Moving Beyond Horn Programs—An Informal Introduction 137
where a, b, and c are propositional atoms. Reasoning as in the case of Horn pro-
grams, we see that a can be derived, as it is simply given as a fact, and b cannot be
established, as there is no rule with b in the head. Applying our informal reading
to the second rule, shows that it “applies” and so c can be established. It follows
that the program “computes” or “justifies” the interpretation {a, c} in a way a Horn
program “computes” or “justifies” their least model. It is clear that this interpreta-
tion is a model of the program and that no other interpretation can be computed
in this way. It can then be reasonably taken as a unique intended model of the pro-
gram. We will later extend this example in a way that yields the class of stratified
programs [Apt et al. 1988, Przymusinski 1988a, Przymusinski 1988b]. These pro-
grams may include negation but the informal reading of rules allows us to identify
for them a unique intended model, called a perfect model [Przymusinski 1988a].
However, even in this simple way of using negation, there is already a difference
from the Horn case. The intended model {a, c} of the program (2.8) is no longer
the least model of the program. It is a minimal model of the program, but the pro-
gram has yet another minimal model namely, {a, b}. Hence, the property that an
intended model is a least model cannot be preserved as we move to the setting of
programs with negation, even if the use of negation is “stratified.”
In general, the uniqueness cannot be preserved either, at least not in the setting
of two logical values true and false—an essential caveat, as we will shortly see. Let
P be a program consisting of the rules
a ← not b,
(2.9)
b ← not a.
This program has three models (over the vocabulary {a, b}): {a, b}, {a}, and {b}.
The first of these interpretations is inconsistent with our informal reading of rules.
The two rules in the program can only be applied when a and b cannot be estab-
lished. But, if it were the case, both rules would be applicable and a and b would get
established, a contradiction. On the other hand, each of the two remaining inter-
pretations is consistent with the informal reading of rules. Indeed, assuming that b
cannot be established yields a (by the first rule). With a established, the second rule
cannot be used and so, b cannot be established, just as we assumed. A symmetric
argument justifies {b}. However, the symmetry implies that there is no difference
between the interpretations {a} and {b} that could allow us to select one of them as
a unique intended model of the program (2.8). The key to having multiple intended
models in programs with negation turns out to be the existence of cyclic dependen-
cies via negation. In our example, a depends on not b (the first rule) and b depends
on not a (the second rule). Analyzing other similar programs led to understanding
138 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
how to break such dependencies, which resulted in the concept of the reduct and
in the stable-model semantics [Gelfond and Lifschitz 1988].
In the previous paragraph we restricted attention to the two-valued case. If
we allow the three-valued setting or, as we do in this chapter, the four-valued
one, the uniqueness can be preserved at a cost of completeness of the model.
Considering again the program (2.9) one might posit that it does not provide
enough information to establish the logical value of a and b and so, the correct
logical value to assign to each of them is unknown. The resulting three-value model
is a natural candidate for the intended model of the program. While in this example
it offers no information about truth or falsity of a and b, in many other cases it
assigns true or false to a vast majority of atoms, leaving only some atoms as unknown.
Allowing the unknown truth value turned out to be quite fruitful. It paved the way to
the well-founded semantics [Van Gelder et al. 1988, Van Gelder et al. 1991], a most
broadly accepted three-valued unique intended model generalization to the case
of programs with negation of the least model semantics of Horn programs and the
perfect model of programs with “stratified” negation.
We discuss the stable model and the well-founded model semantics in formal
terms in the remainder of the chapter. Along the way, we encounter two other
semantics of programs with negation, both related to the notion of Clark’s com-
pletion of the program [Clark 1978]: the two-valued supported-model semantics
[Clark 1978, Apt et al. 1988], and the three-valued Kripke-Kleene semantics [Fitting
1985]. Clark’s completion is a formalization of an intuition that programs are def-
initions, with all rules with the same atom, say p in the head, being the definition
of p.
Let us consider a program
a←b
a ← not c (2.10)
b ← d.
This program can be seen as defining a, b, and c by listing all cases when these
atoms are true and implicitly assuming that these are the only cases when they can
be. In our case, the program defines a to hold precisely when b is true or when c is
false. In all other cases, a must be false. The program defines b to be true precisely
when d is true and, as there are no rules defining c and d, the program defines c
and d as false. This is the same set of constraints we would obtain in classical logic
by means of the theory consisting of formulas obtained from the program by first
collecting together rules with the same head leading (with some abuse of notation)
to rules:
2.4 Moving Beyond Horn Programs—An Informal Introduction 139
a ← b ∨ not c
(2.11)
b←d
and then replacing the rule connective ← with the if and only if connective ↔ of
classical logic:
a ↔ b ∨ ¬c
(2.12)
b ↔ d.
We changed in this last step the program connective not to ¬ as we want to see the
result as a theory in the standard language of logic. That theory is known as Clark’s
completion of a program and models of Clark’s completion are known as supported.
In our example, there is only one supported model: {a} (as already noted c and d are
false, b is false because of the formula b ↔ d, and a is true because of the formula
a ↔ b ∨ ¬c). It is worth noting that this model also arises from our adopted informal
reading of programs. As there are no rules for c and d, neither can be established
and so, they are false. Since d cannot be established, b cannot be established either
(the rule b ← d is the only rule that has b in its head). Last, a can be established
via the rule a ← not c. Since c cannot be established, a can! This program has
no dependency cycles involving only non-negated occurrences of atoms (positive
dependency cycles) and this is crucial. For such programs, supported models and
stable models coincide. In general, any supported model is stable but, in general,
the converse does not hold.
As positive dependency cycles are the main reason for the difference, let us
consider an example of a program where such dependencies are present:
a←b
(2.13)
b ← a.
According to our informal reading of programs, this program has one intended
model, ∅. It turns out to be the unique stable model of this program and the least
model of this program (the program is a Horn one). On the other hand, the Clark’s
completion of this program is the theory {a ↔ b} and this theory has two models:
∅ and {a, b}. The program has then two supported models, only one of which is a
stable model.
So far, we considered two-valued models of Clark’s completion. If we change
the setting to the three-valued one, the Clark’s completion of the program (2.13)
will have one more model in which both a and b are unknown. It turns out we
can associate with every program with negation a single “least informative” three-
valued model. This model is known as the Kripke-Kleene model. We note that it is
different than the well-founded model of this program which, as it will be clear later
140 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
when we give formal definitions, turns out to make both a and b false. However,
we also note that the Kripke-Kleene model of the program (2.10) coincides with
the well-founded model. Thus, the relation between Kripke-Kleene and the well-
founded semantics follows a similar pattern to that between the supported-model
and the stable-model semantics.
The point of this discussion was to show informally complexities that arise when
we go beyond the class of Horn programs, and to build some intuitions. In the
remainder of this chapter, we offer a formal discussion of the concepts alluded to
above.
Definition 2.3 Let P be a program over a set At of atoms and let M ⊆ At be an interpretation of At.
The reduct of P with respect to M, denoted by P M , is the program obtained from
P by eliminating every rule r such that M ∩ B − = ∅ and replacing each remaining
rule a ← B + , not B − with a ← B +.
Proof Let a ∈ TP (M). It follows that there is a rule a ← B in P such that M |= B. For that
rule we have a ← B + ∈ P M and M |= B +. Thus, a ∈ TP M (M).
Conversely, if a ∈ TP M (M), there is a rule a ← C in P M such that M |= C. Since
a ← C belongs to P M , there is a rule a ← B in P such that M |= not b, for every
b ∈ B −, and also B + = C. Clearly, M |= B and so, a ∈ TP (M).
With the notion of the reduct in hand, we are now ready to define stable models
of a program.
This definition relies on the fact that a reduct of a program is a Horn program
and so, it has a least model. Directly from the definition it follows that for Horn
programs the stable-model semantics reduces to the least-model semantics we
discussed in the previous section. This is an important and desirable property,
as the least-model semantics of Horn programs is universally accepted as the
right one.
Proposition 2.2 Let P be a Horn program over a set At of propositional atoms. Then the least model
of P is the only stable model of P .
Also directly from the definition, it follows that stable models are subsets of the
set of atoms that appear in the program and, even more, of the set of atoms that
142 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
appear as the heads of rules of the program. (We recall that we write H (P ) for the
set of atoms in the heads of rules of P .)
Remark 2.1 In view of Proposition 2.3, from now on whenever we discuss stable models of a
program P , we restrict attention to interpretations contained in At(P ).
Coming back to our example program P given by the rules (2.14), let us consider
the interpretation M = {a, b}. Since it is obtained from M = {a, b, d} by dropping
d, which does not appear in the program P , P M is also given by the rules (2.15).
Clearly, the least model of P M is {a, b}. Thus, M = {a, b} is a stable model of P .
There is another stable model, M = {b, c}. Indeed, P M consists of the rules
b←
(2.16)
c←b
and the least model of this program is {b, c}. On the other hand, the interpretation
{a, c} is not a stable model of P . The reduct of P with respect to {a, c} is empty and
so, its least model is ∅ and not {a, c}. Checking all subsets of At(P ) = {a, b, c} shows
that M = {a, b} and M = {b, c} are the only stable models of P .
We also note that not every program has a stable model. We will provide two
examples here. First, let P = {a ← not a}. Since At(P ) = {a}, there are only two
candidates for a stable model: M1 = ∅ and M2 = {a}. It is easy to see that P M1 = {a}
and so, LM(P M1) = {a} = M1. Similarly, P M2 = ∅ and so, LM(P M2 ) = ∅ = M2. For the
next example, let P consist of the rules
a←b
(2.17)
b ← not a.
There are now four candidates for a stable model as At(P ) = {a, b}. However, if
a is in a stable model, then b is not (the second rule does not contribute to the
2.5 The Stable Model Semantics 143
reduct; thus, b is not in the least model of the reduct). Consequently, a is not in the
stable model either, a contradiction (to use the first rule to derive a, we must have
b, first). On the other hand, if a is not in a stable model, then b is, but then so is a,
a contradiction again.
We have been using the term stable model. But are stable models models of a
program? The next result shows that it is indeed the case.
Proposition 2.4 Let P be a program and M ⊆ At(P ) a stable model of P . Then, M is a model of P .
Proof Since M is a stable model of P , M is the least model of the reduct P M . In particular,
M is a model of P M . By Theorem 2.3, TP M (M) ⊆ M. By Proposition 2.1, TP M (M) =
TP (M). Thus, TP (M) ⊆ M and, again by Theorem 2.3, M is a model of P .
P (M) = LM(P M ).
Theorem 2.9 Let P be a program. An interpretation M ⊆ At(P ) is a stable model of P if and only
if M = P (M).
Theorem 2.9, Corollary 2.1, and Proposition 2.5 imply one of the most important
properties of stable models from the perspective of knowledge representation,
namely, that they are minimal models.
model of P , Theorem 2.9 implies that M = P (M). Putting these identities together
we have
M = P (M) ⊆ P (M ) ⊆ M ⊆ M.
Theorem 2.11 Dowling and Gallier [1984]. The unique stable model (equivalently, the least
model) of a finite propositional Horn logic program P can be computed in time
linear in the size of P .
Proof (Sketch) To compute the least model of P , we start by setting X = ∅. We then arrange
all atoms that are heads of rules with the empty body into a queue. We repeatedly
take the front atom off the queue and add it to X. We also add to the end of the
queue all atoms that are heads of rules whose bodies are contained in X. When the
queue is empty, X contains the least model of P .
The task of adding atoms to the queue can be facilitated by keeping for each
atom the list of rules whose bodies contain it, and by keeping for each rule a counter
initially set to the number of atoms in its body. When an atom, say a, is taken off
the queue, we visit each rule that contains a in the body (we have a list of those
rules) and decrease the counter by 1. If the counter becomes 0, the head of the rule
is placed on the queue. With this arrangement, the algorithm works in linear time.
Theorem 2.12 Marek and Truszczyński [1991]. The following problem is NP-complete: given a
propositional logic program P , decide whether P has a stable model.
Proof (Sketch) The membership of the problem in the class NP is evident. Once we guess
a set M ⊆ At(P ) of atoms, we can compute the reduct P M , the least model of the
reduct and verify that M and this least model coincide. All these tasks can be
accomplished in time linear in the size of P .
2.5 The Stable Model Semantics 145
C = a1 ∨ . . . ∨ ak ∨ ¬b1 ∨ . . . ∨ ¬bm ,
a ← not b. (2.18)
Proposition 2.6 Let P be a program such that no atom appearing negated in P is the head of a rule
in P . Then, for every set A of atoms the program P ∪ A has a unique stable model.
Definition 2.5 Let P be a propositional logic program, α an ordinal (possibly transfinite). A se-
quence {Pβ }β<α of non-empty subsets of P is called a stratification of P in type
α if
1. β<α Pβ = P ; and
2. for every ordinal β < α, and for every propositional atom p that appears in
the head of a rule in Pβ :
1. p has no occurrences in γ <β Pγ , and
2. p has no negated occurrences in Pβ .
The sets (programs) Pβ are called strata.
2.5 The Stable Model Semantics 147
The idea is simple. By the condition (2a), atoms in the heads of rules in the
program Pβ , that is, atoms defined by Pβ are not “redefined” by any later stratum.
Thus, their logical values are determined by the program P≤β = γ ≤β Pγ . Moreover,
atoms defined in the stratum β have no effect on atoms defined in earlier strata.
Thus, to determine the values of the atoms defined by the stratum Pβ , we first
establish the values of the atoms defined by the program P<β = γ <β Pγ . We then
use these values to simplify the program Pβ , that is, we eliminate rules whose
bodies contain literals evaluated in P<β to false and, from the remaining rules of
Pβ , we remove literals evaluated in P<β to true. Due to the condition (2b), the truth
values of all atoms that appear negated in the bodies of rules of Pβ are determined
by P<β . Thus, the result of this simplification is a Horn program, and its least
model specifies the logical values for atoms defined in Pβ . Applying this reasoning
according to the order of strata yields a model of the program. We will soon show
that this model is in fact the unique stable model of the program.
Let P consist of the rules
a ← not b
d ← a, e
(2.19)
e ← d , not b
c ← a, not d.
Theorem 2.13 Let P be a stratified propositional logic program. Then P has a unique stable model.
The proof of this result depends on the Splitting Lemma, a result due to Lifschitz
and Turner [1994], also discovered independently by Eiter et al. [1994, 1997].
Definition 2.6 Let P be a propositional logic program. A pair (Q, R) of programs is a splitting of P
if Q and R are non-empty, P = Q ∪ R, and no atom appearing in the head of rules
in R appears in Q.
Lemma 2.1 Splitting Lemma. Let P be a program with a splitting (Q, R). Then an interpreta-
tion M is a stable model of P if and only if M ∩ At(Q) is a stable model of Q and M
is a stable model of R ∪ (M ∩ At(Q)).
5. Even though we only defined splitting into two strata, extensions to the case of finite splittings
and splittings into an arbitrary ordinal type are straightforward.
2.5 The Stable Model Semantics 149
The Splitting Lemma has some fundamental implications. First, it is the basis
for the development of modular logic programs, where each next module intro-
duces new concepts defined in terms of those defined already. In particular, split-
ting underlies the generate-define-test methodology proposed by Lifschitz [2002],
which is now broadly used in answer-set programming [Brewka et al. 2011].
Second, splitting supports “stratum-by-stratum” computation of stable models.
Consequently, at each stage stable-model finding algorithms can limit the search
space of interpretations to those restricted to the language of the stratum at hand,
which improves performance.
150 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
To make this last observation clear, let us assume that (Q, R) is a splitting of
a program P . For every N ⊆ At(Q), we write R|N for the simplification of R with
respect to N , that is, the program obtained by
Proof of Theorem 2.13 Let us assume that {Pβ }β<α is a stratification of P in type α. We recall that we write
P<β for γ <β Pγ . In particular, P<α = P . We will prove by transfinite induction that
for every β ≤ α, P<β has a unique stable model, say Mβ , and that for every γ < β,
Mγ ⊆ Mβ and no atom in Mβ \ Mγ appears in P<γ .
The claim holds for β = 0. Indeed, we have P<0 = ∅ and so, P<0 has a unique
stable model M0 = ∅. The second part of the claim holds vacuously. Let us consider
an ordinal β, 0 < β ≤ α and assume the claim holds for every ordinal γ such that
γ < β. We will prove the claim for β.
First, let us assume that for some ordinal β we have β = β + 1. Clearly, P<β =
P<β ∪ Pβ . By stratification, it follows that (P<β , Pβ ) is a splitting of P<β . By the in-
duction hypothesis, P<β has a unique stable model Mβ . Moreover, by the Splitting
Lemma and Proposition 2.6, P<β has a unique stable model, say Mβ , Mβ ⊆ Mβ and
no atom in Mβ \ Mβ appears in P<β .
To complete an argument in this case, it remains to show that for every γ < β ,
Mγ ⊆ Mβ and that no atom in Mβ \ Mγ appears in P<γ . By the induction hypothesis,
Mγ ⊆ Mβ and no atom in Mβ \ Mγ appears in P<γ . Since Mβ ⊆ Mβ , we have Mγ ⊆
Mβ . Moreover, since Mγ ⊆ Mβ ⊆ Mβ , Mβ \ Mγ = (Mβ \ Mβ ) ∪ (Mβ \ Mγ ). Thus, no
atom in Mβ \ Mγ appears in P<γ (atoms in Mβ \ Mβ do not appear in P<β and so,
they do not appear in P<γ ).
Second, let us assume that β is a limit ordinal. It follows that P<β = γ <β P<γ .
Indeed, for every δ < β, Pδ ⊆ P<δ+1. Since β is a limit ordinal, δ + 1 < β and so,
Pδ ⊆ γ <β P<γ . Consequently, P<β ⊆ γ <β P<γ . The converse inclusion is evident.
2.5 The Stable Model Semantics 151
Let Mβ = γ <β Mγ . Using the induction hypothesis, we can show that for every
γ < β, Mγ ⊆ Mβ and no atom in Mβ \ Mγ appears in P<γ . We can also show that
Mβ is a model of P<β . Indeed, let r be a rule in P<β . Then, there is γ < β such that
r ∈ P<γ . Since Mγ is a stable model of P<γ (by the induction hypothesis), Mγ ⊆ Mβ ,
and Mβ \ Mγ has no atoms from P<γ (as noted above), Mβ is a model of r.
M M
By Corollary 2.1, Mβ is a model of P<ββ . Let M ⊆ Mβ be a model of P<ββ . Then,
M
for every γ < β, M is a model of P<γβ . Consequently, Mγ = M ∩ At(P<γ ) is a model
M M M M
of P<γβ . Since P<γβ = P<γγ , Mγ is a model of P<γγ . By the induction hypothesis, for
M
every γ < β, Mγ ⊆ Mγ and so, Mβ ⊆ M . It follows that Mβ is a least model of P<ββ
and so, a stable model of P<β .
Let M be another stable model of P<β . By the definition of stratification, for
every γ < β, (P<γ , P ), where P = P<β \ P<γ , is a splitting of P<β . By the Splitting
Lemma, M ∩ At(P<γ ) is a stable model of P<γ . By the induction hypothesis, for
every γ < β, M ∩ At(P<γ ) = Mγ . Thus, M = M.
Extension to Programs with Variables. Unlike in most other cases, there are at
least two ways in which the notion of stratification can be extended to the case of
programs with variables. First, we can adapt the idea of stratification to the general
case by restricting the way relation symbols can occur in a program. We recall that
programs with variables are assumed to be finite. Thus, there is no need to consider
infinite stratifications.
Definition 2.7 Let P be a logic program over a first-order vocabulary. A sequence P0 , P1 , . . . , Pn
of non-empty subsets of P is a stratification of P if
1. ni=0 Pi = P ; and
2. for every i, 0 ≤ i ≤ n, and for every relation symbol r that appears in the head
of a rule in Pi :
152 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
1. r has no occurrences in j <i Pj , and
2. r has no negated occurrences in Pi .
Programs that have a stratification are stratified.
Corollary 2.2 Let P be a program over a first-order vocabulary. If P is stratified, then P has a
unique stable model.
The program (2.2) is stratified. Indeed, if we define P0 to consist of the first two
rules of the program and P1 of the third rule, then P0 , P1 is a stratification of P .
The second way to generalize the notion of stratification to programs with vari-
ables is motivated by an observation that some such programs are not stratified but
their groundings are. For instance, let P be a program consisting of the following
three rules (this program defines even and odd non-negative integers, but does it
differently from the program (2.2) we considered before):
even(0)
even(s(X)) ← not odd(X) (2.21)
odd(s(X)) ← not even(X).
This program is not stratified in the sense of Definition 2.7. Indeed, the last two
rules cannot belong to the same stratum. Moreover, neither of the two rules can
appear in a stratum preceding the stratum containing the other. However, the
grounding of the program is stratified in the sense of Definition 2.5.
Definition 2.8 Let P be a logic program over a first-order vocabulary. Then, P is locally stratified
if gr(P ) is stratified.
The following result follows directly from the corresponding definitions and
from Theorem 2.13.
They are of interest as they can be viewed as a bridge between programs with the
stable-model semantics and classical propositional theories.
Proof From the definition it follows that supported models are pre-fixpoints of the oper-
ator TP (in fact, even fixpoints). Thus, the assertion follows from Theorem 2.3.
The converse does not hold. There is an obvious reason why not. Namely, if
M is a model of a program, extending M by any atom not in H (P ) is a model
of P , too. However, by Proposition 2.7, that model cannot be supported. More
interestingly, the implication in Proposition 2.8 cannot be reversed even when we
restrict attention to models that consist of atoms that occur as heads of rules of
the program. For instance, let P = {p ← not p}. This program has no supported
models. Indeed, there are only two candidates for a supported model here, M1 = ∅
and M2 = {p}. However, TP (M1) = M2 and TP (M2) = M1. Thus, neither M1 nor M2
is supported. On the other hand, M2 is a model of P .
Finally, supported models of a program are also supported models of the reducts
they determine. Speaking precisely, we have the following result.
Proof Let M be a supported model of P . Then, M = TP (M) and so, by Proposition 2.1,
M = TP M (M). In other words, M is a supported model of P M .
154 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
Theorem 2.15 Let P be a logic program and M a stable model of P . Then, M is a supported model
of P .
Again, the converse does not hold. Let P = {p ← p}. This program has two
supported models: M1 = ∅ and M2 = {p}. Indeed, it is easy to verify that TP (M1) = M1
and TP (M2) = M2. On the other hand, M2 is not a stable model of P (P is a Horn
program and its least model, M1, is the only stable model of P ). We note that p in
M2 is self-supported. This is the reason why M2 is not stable (all atoms must have
non-circular support). This example also shows that supported models do not need
to be minimal.
Remark 2.2 We saw that stable models are both supported and minimal. It is then natural to
ask whether supportedness and minimality together characterize stable models.
The answer is no. Let us assume that P = {p ← p, p ← not p}. It is clear that {p}
is both a supported model of P and a minimal model of P . However, it is equally
clear that it is not stable.
Definition 2.10 A propositional program P is tight if there is a function (labeling) λ from atoms to
ordinals such that for every rule a ← B in P and every b ∈ B +, λ(a) > λ(b). We call
each labeling λ satisfying this condition a tight labeling of P .
We note that there are tight programs that require transfinite ordinals in each
of their tight labelings. For instance, let us consider a program given by rules:
pi+1 ← pi , i = 0, 1, . . .
(2.22)
q ← pi , i = 0, 1, . . . .
2.5 The Stable Model Semantics 155
In every tight labeling of this program, the label of pi+1 must be strictly larger than
the label of pi . Moreover, the label of q must be strictly larger than the label of every
atom pi . Thus, no tight labeling in the set {0, 1, . . .} is possible. On the other hand,
the labeling λ, where λ(pi ) = i and λ(q) = ω, is tight. Of course, for every finite tight
program, there is a tight labeling that uses only integers.
The intuition behind tightness is clear. Supported models are those models
that can be “self-justified” by means of the one-step provability operator. Such
self-justification may, in general, involve self-justification of individual atoms. For
instance, if P = {p ← p}, then {p} is self-justified by means of TP (formally, {p} =
TP ({p})) and so, it is a supported model of P . For this program, the only way to
justify p is on the basis of p itself, and this self-dependence of p is the reason
why {p} is not a stable model of P . The tightness condition eliminates a possibility
for positive self-dependence of individual atoms. For instance, the program {p ←
not q; q ← not p} is tight. Setting λ(p) = λ(q) = 1 yields a tight labeling of this
program. Similarly, the program {a ← b, c; b ← d; d} is tight, too (set λ(c) = λ(d) = 1,
λ(b) = 2 and λ(a) = 3). Clearly, there are no positive self-dependencies of atoms in
these programs and it is easy to verify that their supported models are also stable.
These considerations can be made formal to show that tightness of a program
is indeed a sufficient condition for supported models to be stable, as discovered by
Fages [1994].
Theorem 2.16 Fages Lemma. Let P be a tight logic program. Then every supported model of P
is a stable model of P .
Proof Let M be a supported model of P . It follows that M is a model of P and so, a model
of the reduct P M (cf. Corollary 2.1). Let N be a model of P M . We will show that
M ⊆ N . In this way, we will show that M = LM(P M ), that is, that M is stable.
Let us consider a tight labeling λ for P . To show the inclusion, we prove by
transfinite induction that for every ordinal α, if a ∈ M and λ(a) = α, then a ∈ N . For
α = 0, the property holds trivially. Indeed, since M is a supported model of P , M =
TP (M) and so, there is a rule a ← B in P such that M |= B. Clearly, a ← B + belongs
to P M . Consequently, N |= a ← B +. Moreover, for every b ∈ B +, 0 = λ(a) > λ(b) ≥ 0.
Thus, B + = ∅ and so, N |= B +. It follows then that N |= a, that is, a ∈ N .
Let us then consider an ordinal α > 0 and assume that the claim holds for
every ordinal that is less than α. Let a ∈ M satisfy λ(a) = α. Since M is a supported
model of P , M = TP (M) and so, there is a rule a ← B in P such that B + ⊆ M and
B − ∩ M = ∅. By the definition of tightness, for every b ∈ B +, λ(b) < α. Since B + ⊆ M,
the induction hypothesis yields b ∈ N . Hence, B + ⊆ N . By the definition of the
reduct, the rule a ← B + belongs to P M . Since N is a model of P M , a ∈ N . Thus,
156 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
the claim follows for α and, by induction, it holds for every ordinal. Consequently,
the claim implies that M ⊆ N , as needed.
Definition 2.11 A program P is tight on a set X ⊆ At(P ) if the program consisting of those rules
a ← B in P that satisfy B + ⊆ X is tight.
Corollary 2.3 Relativized Fages Lemma [Erdem and Lifschitz 2003]. If a program P is tight on a
set X ⊆ At(P ) and M is a supported model of P such that M ⊆ X, then M is a stable
model of P .
Proof Let Q be the program consisting of all rules a ← B in P such that B + ⊆ X. Since
Q ⊆ P , TQ(M) ⊆ TP (M). Moreover, since M ⊆ X, TP (M) ⊆ TQ(M). It follows that
TQ(M) = TP (M). Since M is a supported model of P , M = TP (M). This implies
M = TQ(M), that is, M is a supported model of Q. By Fages Lemma, M is a stable
model of Q. That is, M = LM(QM ). Since M is a model of P , M is a model of P M .
Moreover, QM ⊆ P M implies LM(QM ) ⊆ LM(P M ). Thus, we have that M is a model
of P M and M ⊆ LM(P M ). It follows that M = LM(P M ) and so, M is a stable model
of P .
To see the value of the generalization, let us consider the program consisting of
the following rules:
p ← q , not s
r ← p, not q , not s
s ← not q (2.23)
q ← not s
p ← r.
This program has two supported models: M1 = {p, q} and M2 = {s}. However, this
program is not tight. The second rule imposes on any tight labeling λ of the program
a constraint λ(r) > λ(p), while the last rule requires that λ(p) > λ(r). Thus, we
cannot apply Fages Lemma to conclude that these supported models are stable. It
is easy to check that while not tight, P is tight on M1 and on M2. Thus, by Corollary
2.3, both supported models are in fact stable models of P .
Supported models can be characterized in terms of classical models of proposi-
tional theories obtained from programs by means of the so-called Clark’s completion
2.5 The Stable Model Semantics 157
[Clark 1978]. In the case of arbitrary (possibly infinite) propositional programs, the
completion of a program is, in general, a formula in propositional logic with in-
finitary conjunctions and disjunctions. Thus, from now on in this section, we allow
formulas with infinitary disjunctions and infinitary conjunctions. Since the seman-
tics of such formulas is a straightforward generalization from the finite case and
since we only rely on semantic arguments below, it is not a problem.6 Moreover,
throughout the remainder of this section, given a possibly infinite set X of formu-
las we will often write X ∧ and X ∨ for the (infinitary) conjunction and disjunction
of formulas in X, respectively.
For a rule r = a ← b1 , . . . , bm , not c1 , . . . , not cn, we define
That is, def P (a) is the disjunction (in general, infinitary) of all conditions of rules
that “define” a in P .
Definition 2.12 Let P be a logic program over a propositional vocabulary At. We set
The formula cmpl ←(P ) can be viewed as a propositional counterpart to the pro-
gram. Its models are precisely the models of the program. The formula cmpl →(P )
captures the idea that if a holds, at least one of its defining conditions holds. Thus,
6. Those readers that are not comfortable with infinitary propositional logic may simply restrict
the scope of the discussion to programs that are finite.
7. Here is the standard symbol from the language of propositional logic that is always interpreted
as true.
158 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
models of cmpl(P ) are precisely those models of P whose elements are justified
in the sense captured by the formula cmpl →(P ). This notion of justification is pre-
cisely that of “support” in supported models. That is, models of the completion of
a program are precisely the supported models of the program.
Proof (⇒) Since M is a supported model of P , M = TP (M). Let us consider any atom a ∈ At.
If a ∈ M, there is a rule r = a ← B in P , such that B + ⊆ M and M ∩ B − = ∅. Clearly,
M |= body∧(r) and so, M |= def P (a). Thus, M |= def P (a) ↔ a. If a ∈ M, then for every
rule a ← B in P , we have B + ⊆ M or M ∩ B − = ∅. It follows that M |= def P (a) and
so, M |= def P (a) ↔ a. Consequently, M |= cmpl(P ).
(⇒) Let M |= cmpl(P ). It follows that M is a model of cmpl ←(P ) and so, M is a
model of P . This implies that TP (M) ⊆ M. Moreover, since M |= cmpl →(P ), we have
that for every a ∈ At, M |= a → def P (a). In particular, if a ∈ M, M |= def P (a). That is,
there is a rule r = a ← B in P such that M |= body∧(r). It follows that B + ⊆ M and
M ∩ B − = ∅, that is, a ∈ TP (M). Thus, M ⊆ TP (M) and, consequently, M = TP (M),
that is, M is a supported model of P .
It follows that in all those cases when supported and stable models coincide,
stable models are models of the completion. Thus, we have the following corollary
to our earlier results.
Corollary 2.4 Let P be a tight program. Then an interpretation M is a stable model of P if and
only if M is a model of the completion of P .
8. Programs computing stable models are commonly called answer-set solvers. It is because they
typically handle programs in an extended language (allowing, among other things, disjunctions
in the heads of rules, two types of negation: constraint atoms and aggregates), in which the term
answer set is used instead of stable model.
9. http://www.cs.utexas.edu/users/tag/cmodels.html
2.5 The Stable Model Semantics 159
Definition 2.13 Let P be a logic program and Y a nonempty set of atoms. The external support
formula for Y , written esP (Y ), is the disjunction of all formulas body∧(r), where r is
a rule in P such that H (r) ∈ Y and B(r)+ ∩ Y = ∅.
We note that for every atom a we have esP ({a}) |= def P (a). Indeed, def P (a) =
esP ({a}) ∨ F , where F is the disjunction of formulas body∧(r), for every rule r = a ←
B such that a ∈ B +. Such rules are evidently circular and can be removed without
affecting the class of stable models (such removals may affect the class of supported
models, though). Thus, “reasonable” programs do not contain such rules, and for
those programs we even have esP ({a}) = def P (a). Let us define formulas
and let us call them the conjunctive and the disjunctive external support formulas,
respectively. The following two properties follow from the observation above:
Thus, we have
The strengthening of the formula cmpl ←(P ) with es∧(P ) (or es∨(P )), rather then
with cmpl →(P ), is what is needed to translate logic programs under the stable-
model semantics into (infinitary, in the general case) propositional theories. The
following theorem, in the form we present it, is due to Ferraris et al. [2006]. How-
ever, as they state in their paper, the theorem can essentially be attributed to Saccà
and Zaniolo [1990], who provided a semantic characterization of stable models
in terms of unfounded sets, the concept we will encounter later in the chapter.
Since the intuitions behind unfounded sets and external support are closely related,
160 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
the result of Saccà and Zaniolo can be directly reformulated in terms of external
support.10
Theorem 2.18 Let P be a logic program. The following conditions are equivalent.
1. X is a stable model of P .
2. X is a model of cmpl ←(P ) ∧ es∨(P ).
3. X is a model of cmpl ←(P ) ∧ es∧(P ).
Proof (1) ⇒ (2). Let X be a stable model of P . It follows that X is a model of P . Conse-
quently, X is a model of cmpl ←(P ). Let us consider Y ⊆ At(P ) such that Y = ∅ and
let us assume that X |= Y ∨. It follows that X ∩ Y = ∅. Since X = LM(P X ), let a be
the first element of X ∩ Y derived in the bottom-up computation of LM(P X ). Let
a ← B be the rule in P such that X ∩ B − = ∅ and a ← B + ∈ P X is used in the der-
ivation. It follows that X |= B + and, so, since X ∩ B − = ∅, also X |= B ∧. Moreover,
by the choice of a, B + ∩ Y = ∅. Thus, B ∧ is a disjunct of esP (Y ) and, consequently,
X |= esP (Y ).
(2) ⇒ (3). This implication follows from the fact that es ∨(P ) entails es∧(P ).
Indeed, let us consider an interpretation M ⊆ At such that M |= es ∨(P ). Let Y be a
non-empty subset of At(P ) such that M |= Y ∧. Then, M |= Y ∨ and so, M |= esP (Y ).
Thus, M |= es ∧(P ).
(3) ⇒ (1). Let us assume that X |= cmpl ←(P ) ∪ es∧(P ). Since X |= cmpl ←(P ),
X |= P and, consequently, X |= P X . Let X = LM(P X ). Clearly, X ⊆ X. Let Y = X \ X
and let us assume that Y = ∅.
Since X |= es∧(P ), X |= Y ∧ → esP (Y ). Moreover, we have Y ⊆ X and so, X |= Y ∧.
Thus, X |= esP (Y ). It follows that there is a rule a ← B in P such that a ∈ Y , B + ∩ Y =
∅, and X |= B ∧. The last property implies that a ← B + belongs to P X and B + ⊆ X.
Let z ∈ B +. Since B + ∩ Y = ∅, z ∈ Y . Thus, z ∈ X (as we have B + ⊆ X). This shows
that B + ⊆ X . Since X is a model of P X , it is a model of a ← B +. Thus, a ∈ X , a
contradiction. It follows that X = X, that is X = LM(P X ). Hence, X is a stable model
of P .
10. The result by Saccà and Zaniolo was generalized by Leone et al. [1997] to the so-called disjunc-
tive logic programs, that is, programs with disjunctions of atoms as rule heads). Ferraris et al.
[2006] also considered the disjunctive programs in their study.
2.5 The Stable Model Semantics 161
respectively.
For finite programs, Theorem 2.18 could be used as the basis of an algorithm
for computing stable models, as it reduces the problem to that of finding models
of propositional theories and allows one to use satisfiability solvers for the task.
We discussed a similar application of the completion construction on tight pro-
grams earlier, where we mentioned an answer-set programming solver cmodels. The
problem here is that the theories es∧(P ) and es∨(P ) can be large, in the worst case
exponential in the size of the program. However, their size can be restricted, thanks
to the concept of a loop formula proposed by Lin and Zhao [2002] and an important
characterization of stable models they discovered.
Definition 2.14 A positive dependency graph of a finite propositional program P , denoted by G+(P ),
has atoms of P as its nodes and there is an edge from an atom a to an atom b in
G+(P ) if P has a rule a ← B such that b ∈ B +. A set X ⊆ At(P ) is a loop in P if the
subgraph of G+(P ) induced by X is strongly connected. We write L(P ) for the set
of loops of P .
We note that all subgraphs of G+(P ) induced by single vertices are trivially
strongly connected (each vertex can be reached from itself by a path of length 0).
Therefore, all singleton subsets of At(P ) are loops.
Let us define formulas
lp∧(P ) = {Y ∧ → esP (Y ): Y ∈ L(P )}∧ , and
lp∨(P ) = {Y ∨ → esP (Y ): Y ∈ L(P )}∧ ,
and let us call them the conjunctive and disjunctive loop formulas, respectively.
Clearly, es∧(P ) |= lp∧(P ) and es∨(P ) |= lp∨(P ). Moreover, in general, the entailment
relation cannot be reversed (the conjunctive and disjunctive loop formulas are
weaker than the corresponding external support formulas). However, for finite
graphs, the formulas lp∧(P ) and lp∨(P ) can be used in place of es∧(P ) and es∨(P ),
respectively.
Theorem 2.19 Let P be a finite logic program. The following conditions are equivalent.
1. X is a stable model of P .
2. X is a model of cmpl ←(P ) ∧ lp∨(P ).
3. X is a model of cmpl ←(P ) ∧ lp∧(P ).
162 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
Proof (1) ⇒ (2). This implication follows from the entailment es∨(P ) |= lp∨(P ) and Theo-
rem 2.18.
(2) ⇒ (3). The argument used in the proof of the implication (2) ⇒ (3) of Theorem
2.18 can be used here without any change.
(3) ⇒ (1). Let us assume that X |= cmpl ←(P ) ∧ lp∧(P )}. Since X |= cmpl ←(P ),
X |= P and, consequently, X |= P X . Let X = LM(P X ). Clearly, X ⊆ X. Let us assume
that X \ X = ∅. Let H be the subgraph of G+(P ) induced by X \ X and let Y be the
set of nodes in a terminal strongly connected component in that graph (a strongly
component is terminal if no edge starts in that component and ends in another).
Clearly, Y ∈ L(P ) and so, X |= Y ∧ → esP (Y ).
Since Y ⊆ X, X |= Y ∧ and, consequently, X |= esP (Y ). Thus, there is a rule a ← B
in P such that a ∈ Y , B + ∩ Y = ∅, and X |= B ∧. It follows that a ← B + belongs to
P X and B + ⊆ X.
Let z ∈ B +. Then the dependency graph G+(P ) contains an edge (a, z). We
observe that a ∈ X \ X (because a ∈ Y ). If z ∈ X \ X then both a and z are nodes
of H and so, the edge (a, z) is an edge of H . Since Y is a set of nodes of a terminal
strongly connected component in H and a ∈ Y , z ∈ Y . However, we have Y ∩ B + = ∅,
a contradiction. Thus, z ∈ X \ X . Since B + ⊆ X and z ∈ B +, we have z ∈ X. Thus,
z ∈ X.
It follows that B + ⊆ X and, since X = LM(P X ), a ∈ X . This is a contradiction.
It follows that X = X, that is X = LM(P X ). Hence, X is a stable model of P .
bodies of rules by the bodies of rules that define them, and by eliminating rules
that cannot be reduced in this way to rules with only negative literals in the bodies,
Brass and Dix construct the so called residual program for a program P . It has the
same stable models as P . Since it is tight (it only contains rules that have empty
positive body), the models of its completion are precisely the stable models of P .
Definition 2.15 Two logic programs P and Q are strongly equivalent if for every program R, the
programs P ∪ R and Q ∪ R have the same stable models.
Definition 2.16 Let At be a propositional vocabulary and let X and Y be subsets of At. A pair (X, Y )
is an se-model of a program P over At if
1. X ⊆ Y ,
2. Y |= P , and
3. X |= P Y .
We denote the set of all se-models of P by SE(P ).
Theorem 2.20 Logic programs P and Q are strongly equivalent if and only if SE(P ) = SE(Q), that
is, they have the same se-models.
(⇐). Let us assume that SE(P ) = SE(Q). By (2.24), for every program R,
a
b←c
(2.25)
d ← not e, not b
e ← a, not d.
This program has two stable models: {a, d} and {a, e}. Considering the stable
models of P as representations of two possible ways how things may be, P entails
a, ¬b and ¬c. However, P entails neither d nor ¬d, and neither e nor ¬e. These
properties of P are captured by a three-valued interpretation of At = {a, b, c, d , e},
in which a is true, b and c are false and d and e are unknown. The problem we
study in this section is how to derive this three-valued interpretation or, at least,
approximate it, without having to compute all stable models. In this example, it
seems possible. The program clearly makes a true. Since there is no way to derive c,
the program makes c false. But now, there is no way to derive b. Thus, b is false, too.
Simplifying the program with respect to these truth values results in the program
d ← not e
(2.26)
e ← not d.
At this point, we see that no further derivations are possible and, so, d and e are
unknown.
In the remainder of this section, we study methods to approximate truth values
forced by a program on its atoms. To this end, we will consider three- and four-
valued interpretations on sets of propositional atoms, most often on the set At(P )
of atoms of a program P . We recall (cf. Section 2.2) that we represent a four-
valued interpretation of At(P ) by a pair (I , J ) of interpretations (subsets) of At(P )
and that we write All(P ) and All 4(P ) for the lattices of two-valued and four-valued
interpretations, respectively, the former with the inclusion and the latter with the
precision ordering. We recall that both lattices are complete.
Given a four-valued interpretation (I , J ), atoms in I can be thought of as certain,
and those not in J as impossible. Because of the latter, atoms in J will often be
referred to as possible. In the four-valued setting, an atom is true if it is certain and
possible, false if it is not certain and not possible, unknown if it is possible but
not certain, and inconsistent if it is certain and impossible (cf. Section 2.2). We are
primarily interested in the space of three-valued interpretations, that is, four-valued
interpretations (I , J ) such that I ⊆ J (they do not use the inconsistent truth value).
We call such interpretations consistent. However, for the sake of elegance and
simplicity of technical arguments, it is convenient not to impose any restrictions
on the class of four-valued interpretations and consider the entire lattice All 4(P ).
168 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
The mappings P : All 4(P ) → All(P ) and TP : All 4(P ) → All(P ) play the central
role in our discussion. We recall that
If (I , J ) is an approximation of the set of atoms that are true under P , then all atoms
in P (I , J ) can be regarded as true under P , too. Indeed they can be derived by rules
whose positive body contains only atoms that are certain and whose negative body
consists of atoms that are impossible. Similarly, P (J , I ) can be regarded as the
set of atoms that are possible. Indeed it contains those atoms that can be derived
by means of a rule that possibly might “fire” (atoms that appear in the body of the
rule non-negated are possible and those that appear negated are not certain and
so, might possibly be false). Consequently, the pair (P (I , J ), P (J , I )) can also
be viewed as an approximation to the set of atoms that are true under the program.
This is the intuition that motivated the four-valued one-step provability operator
TP which, we recall, is given by
TP (I , J ) = (P (I , J ), P (J , I )).
fixpoint. We call the least partial supported model of TP the Kripke-Kleene model of
P and denote it by KK(P ). The Kripke-Kleene model of P is three-valued.
Proposition 2.12 Let P be a propositional logic program and let KK(P ) = (I , J ). Then, I ⊆ J , that is,
KK(P ) is three-valued.
P (I , J ) ⊆ P (I , I ) ⊆ P (J , I ).
Thus, KK(P ) = (∅, {a, b}) and it gives us no information about the truth values of the
atoms. At the same time, {a} is the only supported model of P and the construction
of the Kripke-Kleene model fails to inform us about it.
While the Kripke-Kleene construction offers an approximation to two-valued
supported models (albeit often a poor one, as the last example demonstrated), we
170 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
are primarily interested in approximating stable models. Since stable models are
supported models, we can use the Kripke-Kleene model as an approximation to
stable models (when they exist). However, the Kripke-Kleene model often fails to
provide a good approximation even for Horn programs. Let P = {p ← p}. It is easy
to verify that KK(P ) = (∅, {p}) while P has a unique stable model in which p is
false. The Kripke-Kleene process fails to discover that. The problem is that p is
self-supported.
To obtain more information about the truth values of atoms under a program,
we need a stronger approximation revision method. Let (I , J ) be an approximation.
The assumption that all atoms not in J are false implies that every rule in P with
each negative literal in its body having the form not a, where a ∈ J , can be used
when deriving atoms from P . The reduct P J is the set of all such rules with their
negative literals simplified away. Thus, any atom we can derive from P J can be
taken as true under P (as long as every atom not in J is false), and the set of all
those atoms can be taken as the lower bound on the revised approximation. That is,
we can revise the lower bound of the approximation to LM(P J ) = P (J ). Similarly,
using the fact that all atoms not in I are possibly false, we are justified in using the
rules of the reduct P I to establish atoms that are possibly true under P (given an
approximation (I , J )). That is, we can revise the upper bound of the approximation
to LM(P I ) = P (I ). This motivates the following approximation revision operator:
SP (I , J ) = (P (J ), P (I )).
Theorem 2.21 For every logic program P , SP is monotone with respect to the precision operator
and for every interpretations I and J of At(P ) such that I ⊆ J , P (J ) ⊆ P (I ), that
is, SP (I , J ) is consistent.
Proof Let us assume that (I , J ) ≤p (I , J ). It follows that I ⊆ I and J ⊆ J . By the anti-
monotonicity of P (cf. Proposition 2.5),
P (J ) ⊆ P (J ) and P (I ) ⊆ P (I ).
Thus,
The following result shows that stable models of a program P can be described
in terms of (some) fixpoints of the operator SP .
Proposition 2.13 For every program P , an interpretation M ⊆ At(P ) is a stable model of P if and only
if (M , M) is a fixpoint of SP .
Proof It is clear that SP (M , M) = (P (M), P (M)). Thus, the assertion follows.
Theorem 2.22 Let P be a propositional logic program and (I , J ) a four-valued stable model of P .
Then (I , J ) is a four-valued supported model of P .
The Knaster-Tarski theorem combined with Theorem 2.21 implies that the
operator SP has a least fixpoint, which is consistent and provides the basis for the
following definition of the well-founded model of a program. The concept of the
well-founded model is due to Van Gelder et al. [1991]. Our presentation follows the
exposition proposed by Fitting [2002].
Definition 2.17 The well-founded model of a propositional logic program P is defined as the least
fixpoint of SP . We denote it by WF(P ).
By the definition, the well-founded model approximates all partial stable models
and, in particular, all two-valued stable models (if they exist).
The well-founded model of a program is a “tighter” approximation than the
Kripke-Kleene model. This property follows directly from Theorem 2.22.
Let us consider again the program P = {p ← p}. We have seen that KK(P ) =
(∅, {p}). On the other hand, we have
SP (∅, {p}) = (∅, ∅), and
SP (∅, ∅) = (∅, ∅).
172 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
Thus, WF(P ) = (∅, ∅) and so, p is false (rather than unknown) in the well-founded
model, in agreement with the intuitive meaning of the program.
Remark 2.3 We note that originally the semantics we are discussing here were introduced with
their own specific motivations. In particular, the motivation behind the Kripke-
Kleene and the well-founded semantics was to extend the least-model semantics
of Horn programs to programs with negation, with the objective to preserve the
property of the uniqueness of an intended model. In general, this meant moving
beyond the setting of two-valued interpretations. In contrast, the objective behind
the proposal of the stable-model semantics was to keep intended models two
valued. But that meant that the existence and uniqueness properties of intended
models could no longer be guaranteed. Interestingly, it turned out that all major
semantics can be seen from the perspective of the unifying algebraic framework
of fixpoints of lattice operators. This perspective elucidates salient features of the
semantics and allows us to relate them to each other showing, for instance, how
stable models can be approximated by the Kripke-Kleene and the well-founded
semantics. We discuss several other similar connections below.
We have seen that there is a close connection between the semantics of stable
models and the well-founded semantics. First, the well-founded model of a pro-
gram is one of (possibly many) four-valued stable models of the program. Moreover,
if WF(P ) = (I , J ) and M is a two-valued stable model P then we have I ⊆ M ⊆ J .
That is, the well-founded model provides some information about stable models.
We will now discuss some stronger connections between the two.
Theorem 2.23 Let P be a propositional logic program such that WF(P ) is two-valued and equals
(I , I ). Then I is a unique stable model of P .
In view of this result, it is natural to ask if there are any interesting classes of
programs for which the well-founded model is two-valued. The classes of Horn
programs and, more generally, stratified programs are obvious candidates and,
indeed, stratified programs have the property in question.
Proof We will only consider Horn programs and leave the more technically (but not
conceptually) involved case of stratified programs to the reader. If P is a Horn
program, for every interpretation I ⊆ At(P ), P (I ) = LM(P ). Thus, SP (∅, At(P )) =
(LM(P ), LM(P )) and SP (LM(P ), LM(P )) = (LM(P ), LM(P )). It follows that
WF(P ) = (LM(P ), LM(P )).
Proposition 2.14 For every propositional program P , the operator P2 is monotone.
The essence of Proposition 2.14 is that P2 has a least fixpoint, which we will
denote by LF(P2 ). We now have the following result that can be traced back to an
early paper on the well-founded semantics due to Van Gelder [1993] in which he
proposed and studied alternating fixpoints of programs.
Theorem 2.25 Let P be a propositional logic program and let A be the least fixpoint of P2 . Then
WF(P ) = (A, P (A)).
We note that unfounded sets are in some sense complementary to the idea of
external support, which we exploited when discussing the Loop Theorem.
Informally, the condition (1) says that B evaluates to false in (I , J ) and so, the
rule a ← B cannot be used. The condition (2) says that using a ← B to derive a
depends on some other element of X being true, and implies that self-support
cannot be avoided when deriving elements of X. Thus, elements of an unfounded
set cannot be derived from a program under the assumption that I contains atoms
174 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
that are certain and J those that are possible (those that are not impossible).
Consequently, elements of unfounded sets can be regarded as false. This is the
reason why unfounded sets are of interest to the semantics of a program. The key
property of unfounded sets is that they are closed under unions.
Proof Let X be a family of subsets of At(P ) that are unfounded for P with respect to (I , J ).
Let us set Y = X . To show that Y is unfounded for P with respect to (I , J ), let
a ∈ Y and let us consider a rule a ← B in P . If B + ⊆ J or I ∩ B − = ∅, then the
condition (1) of Definition 2.18 holds. Thus, let us assume otherwise (B + ⊆ J and
I ∩ B − = ∅). Since a ∈ Y , there is X ∈ X such that a ∈ X. Since X is unfounded for
P with respect to (I , J ) and the condition (1) does not hold for the atom a and the
rule a ← B, it follows that B + ∩ X = ∅. Thus, B + ∩ Y = ∅ (as X ⊆ Y ).
As a corollary from this result, we obtain that for every propositional program
P and every four-valued interpretation (I , J ) of At(P ), there exists a greatest un-
founded set for P with respect to (I , J ). We will denote it by GUS P (I , J ). This
mapping GUSP is monotone.
Proposition 2.15 Let P be a propositional logic program and (I , J ) and (I , J ) two four-valued
interpretations of At(P ) such that (I , J ) ≤p (I , J ). Then, GUSP (I , J ) ⊆ GUSP (I J ).
where (I , J ) ∈ All 4(P ). We note that the operator WP is monotone, which follows
from our earlier result on the monotonicity of the operator TP (cf. Theorem 2.5; it
implies that if (I , J ) ≤p (I , J ) then P (I , J ) ⊆ P (I , J )) and Proposition 2.15.
Thus, it has a least fixpoint. In general, the operator WP is different from SP .12
However, the least fixpoints of the two operators coincide.
12. Indeed, we have P (∅, ∅) = TP ∅ (∅) and P (∅) = LM(P ∅). In general, TP ∅ (∅) = LM(P ∅) (the
latter is the limit of iterating TP ∅ over ∅). Whenever the two sets are different, WP (∅, ∅) = SP (∅, ∅).
2.6 The Well-Founded Model Semantics 175
Theorem 2.27 Let P be a propositional program. The well-founded model WF(P ), of P is the least
fixpoint of the operator WP .
The fact that the well-founded model approximates stable models allows us to
use it (or, more commonly, computation identifying unfounded sets) as a strong
propagation rule (search-space pruning mechanism) when computing stable mod-
els of programs. The propagation method based on the well-founded semantics
is, in general, stronger than similar methods based on the Kripke-Kleene seman-
tics. However, computation of the well-founded model is relatively expensive. The
well-founded model of a program can be computed in time that is quadratic in the
size of P , as opposed to the linear-time computation of the Kripke-Kleene model.
Some improvements over the quadratic-time worst-case bound have been obtained
[Berman et al. 1995, Lonc and Truszczyński 2001], but it is still an open problem
whether significantly faster algorithms exist. It is however important to note that
the quadratic worst-case arises quite rarely. Moreover, for many programs written
to exploit the well-founded model as the unique intended model in a Prolog-style
fashion, the well-founded semantics can be computed fast enough to make sys-
tems such as XSB [Sagonas et al. 1994] effective in many practical settings (more
comments on XSB follow below).
Warren 1993a, Chen and Warren 1993b, Chen et al. 1993, Sagonas et al. 1994]. It is
at present among the most broadly used Prolog descendants.
In an orthogonal effort, Denecker proposed the well-founded semantics as the
basis for the concept of an inductive definitions [Denecker 1998, Denecker 2000,
Denecker and Ternovska 2008]. Together with his collaborators he designed and
implemented a knowledge representation and reasoning system FO(.) [Denecker
2009], in which first-order logic is extended by modules called definitions that
are interpreted in terms of the well-founded semantics adjusted to account for
“inputs.” This computational knowledge representation system is now among the
best in terms of performance and modeling capabilities [Denecker et al. 2009,
Calimeri et al. 2014].
Concluding Remarks
2.7 This brings our brief tour of the two semantics to an end. There is much that has
been omitted or addressed only briefly. For instance, we said very little about the
impressive body of results concerning the complexity and the expressivity issues.
Excellent papers by Schlipf [1995] and Dantsin et al. [2001] can help fill this gap.
Similarly, we only briefly mentioned answer-set programming, which trans-
formed the stable-model into practical computational methodology and a formal-
ism for modeling and solving hard search problems. For more details we refer to the
paper by Brewka et al. [2011], the monograph by Gebser et al. [2012], papers report-
ing on the answer-set programming competitions [Denecker et al. 2009, Calimeri
et al. 2014], and to the special issue of the AI Magazine dedicated to answer-set
programming [Brewka et al. 2016]. On-going development efforts that have already
resulted in answer-set program processing software with excellent performance
and a growing track record of successful practical applications that are worth men-
tioning include the family of tools around the gringo grounder and the clasp solver,13
the IDP project,14, and the dlv project 15
Practical systems based on the well-founded semantics form another thriving
area of research, with XSB,16 Ontobroker,17 and Flora-218 among the most promi-
nent examples. Yap19 and Ciao Prolog 20 offer partial support for the well-founded
semantics and plan to expand it.
Finally, we have only mentioned but not discussed in any detail recent gener-
alizations of the stable-model semantics to the full syntax of first-order logic and
arbitrary (not only Herbrand) interpretations. The papers by Ferraris et al. [2011]
and Pearce and Valverde [2008] are good starting points for an in-depth look into
that topic. A useful tool to study extensions to the first-order language is the theory
of the stable-model semantics for infinitary propositional logic [Truszczynski 2012,
Gebser et al. 2015, Harrison et al. 2015].
Acknowledgments
The author thanks the reviewers for many constructive comments that helped to
improve the presentation. The author wants to extend special thanks to Thomas
Eiter and Michael Kifer who commented extensively on earlier drafts of the chapter.
References
H. Andréka and I. Németi. 1978. The generalized completeness of horn predicate-logic as a
programming language. Acta Cybern., 4(1): 3–10. 135
K. Apt, H. Blair, and A. Walker. 1988. Towards a theory of declarative knowledge. In J. Minker,
ed., Foundations of Deductive Databases and Logic Programming, pp. 89–142. Morgan
Kaufmann, Los Altos, CA. DOI: 10.1016/B978-0-934613-40-8.50006-3. 122, 137, 138,
145, 152
N. D. Belnap. 1977. A useful four-valued logic. In J. M. Dunn and G. Epstein, eds., Modern
Uses of Multiple-Valued Logic. D. Reidel. DOI: 10.1007/978-94-010-1161-7_2. 168
K. Berman, J. Schlipf, and J.Franco. 1995. Computing the well-founded semantics faster.
In Logic Programming and Nonmonotonic Reasoning (Lexington, KY, 1995), volume 928
of Lecture Notes in Artificial Intelligence, pp. 113–125. Springer. DOI: 10.1007/3-540-
59487-6_9. 175
E. Börger. 1974. Beitrag zur Reduktion des Entscheidungsproblems auf Klassen von
Horn-formeln mit kurzen Alternationen. Archiv für mathematische Logik und
Grudlagenforschung, 16: 67–84. 135
S. Brass and J. Dix. 1995a. Characterizations of the stable semantics by partial evaluation.
In V. W. Marek and A. Nerode, eds., Proceedings of the 3rd International Conference on
Logic Programming and Nonmonotonic Reasoning, LPNMR 1995, volume 928 of LNCS,
pp. 85–98. Springer. DOI: 10.1007/3-540-59487-6_7. 162
19. http://www.dcc.fc.up.pt/~vsc/Yap/ .
20. http://ciao-lang.org .
178 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
S. Brass and J. Dix. 1995b. Disjunctive semantics based upon partial and bottom-up
evaluation. In L. Sterling, ed., Proceedings of the 12th International Conference on
Logic Programming, ICLP 1995, pp. 199–213. MIT Press. DOI: 10.1007/978-3-642-
51136-3_13. 162
S. Brass and J. Dix. 1997. Characterizations of the disjunctive stable semantics by partial
evaluation. J. Log. Program., 32(3): 207–228. DOI: 10.1016/S0743-1066(96)00115-X.
162
G. Brewka, T. Eiter, and M. Truszczynski. 2011. Answer set programming at a glance.
Commun. ACM, 54(12): 92–103. DOI: 10.1145/2043174.2043195. 122, 144, 149, 176
G. Brewka, T. Eiter, and M. Truszczynski, eds. 2016. Special Issue on Answer Set Programming,
volume 37(3) of AI Magazine. AAAI. DOI: 10.1609/aimag.v37i3.2669. 176
J. Büchi. 1962. Turing Machines and the Entscheidungsproblem. Mathematische Annalen,
148. DOI: 10.1007/978-1-4613-8928-6_34. 135
F. Calimeri, G. Ianni, and F. Ricca. 2014. The third open answer set programming
competition. Theory and Practice of Logic Programming, 14(1): 117–135. DOI:
10.1017/S1471068412000105. 176
S. Ceri, G. Gottlob, and L. Tanca. 1990. Logic programming and databases. Surveys in computer
science. Springer-Verlag. DOI: 10.1007/978-3-642-83952-8. 133
A. Chagrov and M. Zakharyaschev. 1997. Modal Logic. Oxford University Press. 164
W. Chen and D. S. Warren. 1993a. A goal-oriented approach to computing the well-founded
semantics. J. Log. Program., 17(2/3&4): 279–300. DOI: 10.1016/0743-1066(93)90034-E.
176
W. Chen and D. S. Warren. 1993b. Query evaluation under the well founded semantics.
In C. Beeri, ed., Proceedings of the 12th ACM SIGACT-SIGMOD-SIGART Symposium on
Principles of Database Systems, PODS 1993, pp. 168–179. ACM Press. DOI: 10.1145/
153850.153865. 176
W. Chen, T. Swift, and D. S. Warren. 1993. Goal-directed evaluation of well-founded
sematics for XSB. In D. Miller, ed., Proceedings of the International Symposium on
Logic Programming, ISLP 1993, p. 679. MIT Press. 176
K. Clark. 1978. Negation as failure. In H. Gallaire and J. Minker, eds., Logic and data bases,
pp. 293–322. Plenum Press, New York-London. DOI: 10.1007/978-1-4684-3384-5_11.
122, 138, 157, 163
A. Colmerauer, H. Kanoui, P. Roussel, and R. Passero. 1973. Un système de communication
homme-machine en Francais. Technical report, Groupe de Recherche en Intelligence
Artificielle, Universitè d’Aix-Marseille II. 121, 135
E. Dantsin, T. Eiter, G. Gottlob, and A. Voronkov. 2001. Complexity and expressive power of
logic programming. ACM Comput. Surv., 33(3): 374–425. DOI: 10.1145/502807.502810.
144, 176
M. Denecker. 1998. The well-founded semantics is the principle of inductive definition. In
J. Dix, L. F. del Cerro, and U. Furbach, eds., Proceedings of the European Workshop on
References 179
Logics in Artificial Intelligence, European Workshop, JELIA 1998, volume 1489 of Lecture
Notes in Computer Science, pp. 1–16. Springer. DOI: 10.1007/3-540-49545-2_1. 176
M. Denecker. 2000. Extending classical logic with inductive definitions. In J. W. Lloyd,
V. Dahl, U. Furbach, M. Kerber, K.-K. Lau, C. Palamidessi, L. M. Pereira, Y. Sagiv, and
P. J. Stuckey, eds., Proceedings of the First International Conference on Computational
Logic, CL 2000, volume 1861 of Lecture Notes in Computer Science, pp. 703–717.
Springer. DOI: 10.1007/3-540-44957-4_47. 176
M. Denecker. 2009. A knowledge base system project for fo(.). In P. M. Hill and D. S.
Warren, eds., Proceedings of the 25th International Conference on Logic Programming,
ICLP 2009, volume 5649 of Lecture Notes in Computer Science, p. 22. Springer. DOI:
10.1007/978-3-642-02846-5_2. 122, 176
M. Denecker and E. Ternovska. 2008. A logic for non-monotone inductive definitions. ACM
Transactions on Computational Logic, 9(2). DOI: 10.1145/1342991.1342998. 131, 133,
176
M. Denecker, V. Marek, and M. Truszczynski. 2000. Approximations, stable operators, well-
founded fixpoints and applications in nonmonotonic reasoning. In J. Minker, ed.,
Logic-Based Artificial Intelligence, pp. 127–144. Kluwer Academic Publishers. DOI:
10.1007/978-1-4615-1567-8_6. 128
M. Denecker, M. Bruynooghe, and V. Marek. 2001. Logic programming revisited: Logic
programs as inductive definitions. ACM Transactions on Computational Logic, 2(4):
623–654. DOI: 10.1145/383779.383789. 131, 133
M. Denecker, J. Vennekens, S. Bond, M. Gebser, and M. Truszczynski. 2009. The second
answer set programming competition. In E. Erdem, F. Lin, and T. Schaub,
eds., Proceedings of the 10th International Conference on Logic Programming and
Nonmonotonic Reasoning, volume 5753 of Lecture Notes in Computer Science, pp.
637–654. Springer. DOI: 10.1007/978-3-642-04238-6_75. 176
M. Denecker, Y. Lierler, M. Truszczynski, and J. Vennekens. 2012. A Tarskian Informal
Semantics for Answer Set Programming. In A. Dovier and V. S. Costa, eds., Technical
Communications of the 28th International Conference on Logic Programming (ICLP
2012), volume 17 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 277–
289. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. DOI:
10.4230/LIPIcs.ICLP.2012.277. 131, 133
K. Doets. 1994. From Logic to Logic Programming. Foundations of Computing Series. MIT
Press, Cambridge, MA. 127
W. Dowling and J. Gallier. 1984. Linear-time algorithms for testing the satisfiability of
propositional Horn formulae. Journal of Logic Programming, 1(3): 267–284. DOI:
10.1016/0743-1066(84)90014-1. 144
T. Eiter and M. Fink. 2003. Uniform equivalence of logic programs under the stable model
semantics. In C. Palamidessi, ed., Proceedings of the 19th International Conference on
Logic Programming, ICLP 2003, volume 2916 of Lecture Notes in Computer Science, pp.
224–238. Springer. DOI: 10.1007/978-3-540-24599-5_16. 166
180 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
T. Jech. 2003. Set Theory. Springer Monographs in Mathematics. Springer, Berlin, New York.
126
R. Kowalski. 1974. Predicate logic as a programming language. In Proceedings of the Congress
of the International Federation for Information Processing (IFIP-1974), pp. 569–574.
North Holland, Amsterdam. 121
R. A. Kowalski and D. Kuehner. 1971. Linear resolution with selection function. Artif. Intell.,
2(3/4): 227–260. DOI: 10.1016/0004-3702(71)90012-9. 121, 135
N. Leone, P. Rullo, and F. Scarcello. 1997. Disjunctive stable models: Unfounded sets,
fixpoint semantics, and computation. Inf. Comput., 135(2): 69–112. DOI: 10.1006/
inco.1997.2630. 160
V. Lifschitz. 2002. Answer set programming and plan generation. Artificial Intelligence,
138(1-2): 39–54. DOI: 10.1016/S0004-3702(02)00186-8. 149
V. Lifschitz. 2010. Thirteen definitions of a stable model. In A. Blass, N. Dershowitz, and
W. Reisig, eds., Fields of Logic and Computation, Essays Dedicated to Yuri Gurevich on
the Occasion of His 70th Birthday, volume 6300 of Lecture Notes in Computer Science,
pp. 488–503. Springer. DOI: 10.1007/978-3-642-15025-8_24. 163
V. Lifschitz and A. A. Razborov. 2006. Why are there so many loop formulas? ACM Trans.
Comput. Log., 7(2): 261–268. DOI: 10.1145/1131313.1131316. 162
V. Lifschitz and H. Turner. 1994. Splitting a logic program. In P. V. Hentenryck, ed.,
Proceedings of the 11th Internationall Conference on Logic Programming, ICLP 1994, pp.
23–37. MIT Press. 148
V. Lifschitz, D. Pearce, and A. Valverde. 2001. Strongly equivalent logic programs. ACM
Transactions on Computational Logic, 2(4): 526–541. DOI: 10.1145/383779.383783.
164, 165
F. Lin and Y. Zhao. 2002. ASSAT: Computing answer sets of a logic program by SAT solvers.
In Proceedings of the 18th National Conference on Artificial Intelligence (AAAI 2002), pp.
112–117. AAAI Press. DOI: 10.1016/j.artint.2004.04.004. 161, 162
J. W. Lloyd. 1984. Foundations of logic programming. Symbolic Computation. Artificial
Intelligence. Springer, Berlin-New York. 126, 135
Z. Lonc and M. Truszczyński. 2001. On the problem of computing the well-founded
semantics. Theory and Practice of Logic Programming, 5: 591–609. DOI: 10.1007/3-
540-44957-4_45. 175
M. J. Maher. 1988. Equivalences of logic programs. In J. Minker, ed., Foundations of Deductive
Databases and Logic Programming., pp. 627–658. Morgan Kaufmann, Los Altos, CA.
DOI: 10.1007/3-540-16492-8_91. 166
V. Marek and M. Truszczyński. 1999. Stable models and an alternative logic programming
paradigm. In K. Apt, W. Marek, M. Truszczyński, and D. Warren, eds., The Logic
Programming Paradigm: a 25-Year Perspective, pp. 375–398. Springer, Berlin. DOI:
10.1007/978-3-642-60085-2_17. 122, 144
W. Marek and M. Truszczyński. 1991. Autoepistemic logic. Journal of the ACM, 38(3): 588–619.
DOI: 10.1145/116825.116836. 144
182 Chapter 2 An Introduction to the Stable and Well-Founded Semantics of Logic Programs
getvar instruction in WAM, 247, 249, 255 Hairpin loops in RNA, 386, 388
Global memory in natural language Haplotype inference, 379–380
processing, 492–497 Answer Set Programming encoding,
Globalizing variables in WAM, 270 381–383
Glue language, 68–69 bioinformatics, 361
Grammar induction in natural language instances, 409
processing constraints, 501–504 modeling, 380–381
GraphDB system, 79 Head constraints in natural language
GraphX, 83 processing, 498
Greater-than comparisons in Datalog, 23 Heads
Greatest upper bounds (gubs) in complete Answer Set Programming rules, 367
lattices, 125–126 Datalog rules, 5, 7, 9, 25–28
Grids planning example, 463–467 IDP rules, 289–290
Gringo language, 322 logic programming rules, 123–124
Ground-and-solve optimization in IDP LogiQL clauses, 335
system, 309 Heap in deterministic Prolog, 256–257
Ground atoms Herbrand base
distribution semantics, 194 Bayesian networks, 217–218
Herbrand interpretations, 128 ground atoms, 123–124
Ground facts in deterministic Datalog, Horn programs, 136
250–251 logic programming, 124–125
Ground terms in logic programming, Herbrand interpretations
123 Horn programs, 136
Grounding and ground instances IDP system, 291
Answer Set Programming rules, 367 logic programming, 127–128
Bayesian networks, 218 one-step provability operator, 128–130
Datalog rules, 6 Stable Model semantics, 145
IDP system, 313–317 well-founded semantics, 175
logic programming, 124 Herbrand model for stratified programs,
LogiQL, 346–347 122
query evaluation for restricted programs, Herbrand universe, 123–124
225 Here-and-there logic in Stable Model
Grounding phase in IDP system, 296 semantics, 163–164
Grounding with bounds in IDP system, 283 Heterozygous sites, 380
groundpropagate procedure in IDP system, Hidden Markov Models (HMMs)
307 distribution semantics, 198–200, 206
groundwithbounds option in IDP system, inferencing in PLP, 226–227
318 query evaluation for restricted programs,
Guanine in DNA, 362–364 226
Guards HiLog, 36–37
natural language processing, 498 Semantic Web, 78
Timed Safety Automata, 444 HIPP-DEC, 381–383
gubs (greatest upper bounds) in complete HMMs (Hidden Markov Models)
lattices, 125–126 distribution semantics, 198–200, 206
570 Index
Timed systems in tabled logic programs, Trust management (TM) for recursive
429 queries, 535–536
timeFunc function, 312 trustmeelsefail instruction in WAM, 266
Timeless assumptions in natural language Truth order in first-order logic, 286
processing, 496–497 trymeelse instruction in WAM, 265–266,
timeOf function, 312 272
TM (trust management) for recursive trymeelsefail instruction in WAM, 265–266
queries, 535–536 Trytophan in DNA, 365
tnot operation in CTL model checking, 435 TSA (Timed Safety Automata), 444–448
Top-down evaluation in Datalog, 9, 52–60 TSP (Traveling Salesman Problem), 348–
Topicalization in natural language 353
processing, 494 Tuple-generating dependencies (TGDs),
Toy DCG, 509–511 26–28, 32
Trail stacks in nondeterministic Prolog, 264 Tuples in IDP system, 299
Transaction Logic, 36 Turing’s computability for Horn programs,
extensions, 542 135
rule updates, 43–46
Transactions in LogicBlox, 335–336 Two-input one-step provability operator,
Transcription in biology, 362 129
Transcriptional regulatory networks, 394 Two-valued structures in first-order logic,
Transfinite induction in Knaster-Tarski 284
theorem, 126 Type groups in LOLA system, 73
Transfinite sequences in Knaster-Tarski Types
theorem, 126 Datalog, 28–32
Transformation IDP system, 293–294, 298–302, 304–305
Datalog, 8
query evaluation for unrestricted UDAs (user-defined aggregates), 67
programs, 221 UNA (unique names axiom), 304
Transitions Unbounded dependencies in natural
labeled transition systems, 436 language processing, 494
Timed Safety Automata, 444–446 Unbounded planner for grids, 466
Transitive closure in IDP system, 290 Uncertain inferences, 186
Translation in biology, 362 Undecidable languages, 295
Translators in Prolog, 11 Unfounded sets
Traveling Salesman Problem (TSP), 348–353 Stable Model semantics, 159
Traversal recursion in PROBE system, 13 well-founded semantics, 173–174
Tree reconstruction in phylogenetics, unicon instruction in WAM, 259
371–374 Unidirectional Grid domain in grid
Triggers for reactive rules, 40 planning, 466
True atoms Uniform equivalence
first-order logic, 285 Datalog, 64
Herbrand interpretations, 128 Stable Model semantics, 166
Horn programs, 138 Union of conjunctive queries in Datalog, 64
well-founded semantics, 167, 170 Unique names axiom (UNA), 304
586 Index
Contributors
Molham Aref earned a Bachelor’s degree in Computer Engineering (1989) and two
Master’s degrees in Electrical Engineering (1990) and Computer Science (1991)
from the Georgia Institute of Technology. He has more than 27 years of experience
developing high-value enterprise analytical solutions across various industries,
including retail, telco, and financial services. He started his career as a software
engineer and scientist at AT&T and founded Relational AI, LogicBlox, Predictix,
Optimi, and Brickstream.
Bart Bogaerts studied mathematics at the University of Leuven (KU Leuven), Bel-
gium. His Master’s thesis was titled “Unieke factorisatie in reguliere lokale ringen
(Unique Factorisation in Regular Local Rings)” and was supervised by Dr. Jan Schep-
ers. He graduated summa cum laude in July 2011. In September 2011, he joined the
DTAI (Declaratieve Talen en Artificiele Intelligentie/Declarative Languages and Arti-
ficial Intelligence) research group in the Department of Computer Science at KU
Leuven to investigate knowledge representation and reasoning techniques, super-
vised by Prof. Dr. Marc Denecker.
As his research interests evolved, Prof. Dr. Joost Vennekens and Prof. Dr. Jan
Van den Bussche became his co-supervisors. He defended his Ph.D. thesis, entitled
“Groundedness in Logics with a Fixpoint Definition” in June 2015. He graduated
with the congratulations of the examination board, which consisted among others
of renowned researches Thomas Eiter and Gerhard Brewka. In September 2015,
Bart Bogaerts joined the Computational Logic group of Aalto University (Espoo,
Finland) to work with Tomi Janhunen, among others, on Logic Programming, SAT
and QBF. In October 2016, he returned to his alma mater, KU Leuven, where he
currently works as an FWO post-doctoral fellow.
ment of electric vehicle charging station problems, and WDM optical network
problems. He also held a postdoctoral position at Los Alamos National Labora-
tory (2014–2016) where he developed mathematical-model-based approaches for
Energy Infrastructure Planning projects sponsored by the U.S. Department of En-
ergy, including natural gas and grid-power transmission, expansion, and design
problems. Since 2016, Dr. Borraz-Sánchez has been part of an R&D group in one
of the Big Four firms, KPMG, where his wide range of engagement projects in-
cludes developing and deploying solutions for Professional Sport Leagues like the
National Basketball Association (NBA), the Women’s National Basketball Associa-
tion (WNBA), the Major League Baseball (MLB), and the National Basketball League
(NBL, Australia, and New Zealand).
Alessandro Dal Palù , Ph.D., is an Associate Professor and head of the Bachelor’s
degree program in Computer Science at the University of Parma, Italy. Over the last
15 years, he has conducted research on protein structure prediction and constraint
programming applications and has published over 40 papers on these topics. His
research interests span from bioinformatics to high-performance computing and
logic programming. He is one of the editors of the Constraint in Bioinformatics se-
ries of the Algorithms for Molecular Biology journal. He has conducted the Workshop
on Constraint-Based Methods in Bioinformatics since 2005.
Agostino Dovier received his Ph.D. in Computer Science from the University of Pisa
and is a professor of Computer Science at the University of Udine, Italy, where he is
coordinating the bachelor and master’s degree programs in computer science. His
research interests include logic and constraint programming, and computational
biology. He served as general and program chair of the international conference
of logic programming (2008, 2012) and as president of the Italian Association for
Logic Programming (2012–2018). Since 2005, he has contributed to the organiza-
tion of the Workshops on Constraint-Based Methods in Bioinformatics. He is a
member of the editorial board of Theory and Practice of Logic Programming and of
the constraints series of Algorithms for Molecular Biology.
a Ph.D. in Computer Science from Oregon Health and Sciences University (OGI
School of Engineering, 2004).
Enrico Pontelli is a Regents Professor of Computer Science and Dean of the College
of Arts & Sciences at New Mexico State University. He received a Ph.D. in Com-
puter Science from NMSU in 1997. His research interests are in computational
logic, constraint programming, high-performance computing, knowledge repre-
sentation and reasoning, bioinformatics, and assistive technologies. He is the re-
cipient of a NSF CAREER award and he has raised over $16M in research funding
in the last 15 years. He has published over 250 peer-reviewed papers and serves on
the editorial boards of several journals.
C. R. Ramakrishnan is a professor in the Department of Computer Science at Stony
Brook University. His research interests revolve around logic programming and for-
mal methods. He works on various aspects of inference in logic programs, ranging
from query evaluation in probabilistic logic programs to incremental evaluation.
He also works on model checking concurrent systems, such as mobile systems,
and expressive logics for specifying properties of such systems. His research has
been consistently funded by grants from the NSF and the ONR.
Fabrizio Riguzzi is an associate professor of Computer Science in the Department
of Mathematics and Computer Science at the University of Ferrara. He was previ-
ously an assistant professor at the same university. He earned his Master’s degree
and Ph.D. in Computer Engineering from the University of Bologna. Dr. Riguzzi is
the Editor-in-Chief of Intelligenza Artificiale, the official journal of the Italian As-
sociation for Artificial Intelligence. He is the author of more than 150 papers in
the areas of machine learning, inductive logic programming, and statistical rela-
tional learning. His aim is to develop intelligent systems by combining in novel
ways techniques from artificial intelligence, logic, and statistics.
K. Tuncay Tekle is a research assistant professor at Stony Brook University with a re-
search focus on high-level programming languages and efficient implementations.
After completing his Ph.D. thesis on the analysis and efficient implementation of
Datalog queries under the supervision of Prof. Annie Liu, he has worked at Log-
icBlox, a company whose state-of-the-art Datalog engine helps solve complex enter-
prise problems. Apart from his research work, he is a software consultant solving
database-centric problems for top retail companies.
Miroslaw Truszczynski is a professor of computer science at the University of Ken-
tucky. Truszczynski’s research interests include knowledge representation, non-
monotonic reasoning, logic programming, and constraint satisfaction and pro-
Biographies 595
gramming. He has authored and co-authored more than 190 technical papers in
journals, conference proceedings, and books, and is a co-author of the research
monograph Nonmonotonic Logic on mathematical foundations of nonmonotonic
reasoning, which marked a milestone in the development of that area. He is one of
the founders of the field of answer-set programming. In 2013, Truszczynski was
elected Fellow of the Association for the Advancement of Artificial Intelligence
(AAAI).
Dr. Theresa Swift has over 25 years of experience in computational logic research
and the design and development of major computer systems. She led the develop-
ment of the XSB Programming system, a major open-source Prolog. As a researcher,
Dr. Swift has published more than 75 articles in major refereed journals and con-
ferences and edited three books. Her research interests include high-performance
logic systems, nonmonotonic reasoning and reasoning under uncertainty, and
knowledge representation.
David S. Warren is Professor Emeritus at Stony Brook University and Vice President
of Sciences at XSB, Inc. His entire research career has been in the area of logic
programming, including theory, systems, and applications. He is the author of
more than 100 technical papers in the area and has served as President of the
Association for Logic Programming. He is the leader of the XSB project that has
developed and supported the open source XSB Tabled Prolog system, which has
been the leading tabled logic programming system for the last 25 years. He is a
Fellow of the ACM, past chair of the Stony Brook Computer Science Department,
and advisor of 20 Ph.D. students. He is co-founder of XSB, Inc., a 20-year-old
software company that commercializes applications supported by the XSB Prolog
system.