Hitzler P Seda A Mathematical Aspects of Logic Programming S
Hitzler P Seda A Mathematical Aspects of Logic Programming S
ASPECTS OF LOGIC
PROGRAMMING
SEMANTICS
Chapman & Hall/CRC
SERIES EDITOR
G. Q. Zhang
Department of EECS
�
Case Western Reserve University
�
Cleveland, Ohio, U.S.A.
�
PUBLISHED TITLES
MATHEMATICAL
ASPECTS OF LOGIC
PROGRAMMING
SEMANTICS
Pascal Hitzler
Kno.e.sis Center at
Wright State University
Dayton, Ohio, USA
antHony seda
University College Cork
Ireland
CRC Press
Boca
TaylorRaton, FL 33487-2742
& Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2011 by Taylor and Francis Group, LLC
No
CRCclaim
Presstoisoriginal U.S.ofGovernment
an imprint worksGroup, an Informa business
Taylor & Francis
assume
This bookresponsibility for the validity
contains information of all materials
obtained or the consequences
from authentic of their use.
and highly regarded The authors
sources. and
Reasonable
publishers
efforts havehave
beenattempted to trace reliable
made to publish the copyright holders
data and of all material
information, but thereproduced
author andinpublisher
this publication
cannot
and apologize
assume to copyright
responsibility holders
for the if of
validity permission to publish
all materials in this form has
or the consequences not been
of their obtained.
use. The If and
authors any
copyright
publishersmaterial has notto
have attempted been acknowledged
trace the copyrightplease
holderswrite and
of all let us know
material so we may
reproduced rectify
in this in any
publication
future reprint.to copyright holders if permission to publish in this form has not been obtained. If any
and apologize
copyright material has not been acknowledged please write and let us know so we may rectify in any
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
future reprint.
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter
The Open
Except as invented, including
Access version
permitted photocopying,
underofU.S.
this book, available
Copyright microfilming,
Law, at part
no ofand
thisrecording,
book mayor
www.taylorfrancis.com, inreprinted,
behasany information
been made stor-
available
reproduced,
under
age or aretrieval
Creativesystem,
Commons Attribution-Non
without Commercial-No
written permission Derivatives 4.0 license.
from the publishers.
For permission
age or to photocopy
retrieval system, or written
without use material electronically
permission from thefrom this work, please access www.copy-
publishers.
right.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222
Rosewood
For Drive,
permission toDanvers, MA
photocopy or 01923, 978-750-8400.
use material CCC from
electronically is a not-for-profit organization
this work, please that pro-
access www.copy-
vides licenses
right.com and registration for a variety
(http://www.copyright.com/) of users.the
or contact ForCopyright
organizations that have
Clearance beenInc.
Center, granted a pho-
(CCC), 222
tocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice:
tocopy license by theProduct
CCC, a or corporate
separate names
system may be trademarks
of payment or registered trademarks, and are
has been arranged.
used only for identification and explanation without intent to infringe.
Trademark Notice:
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
Dedication
List of Figures xi
Preface xv
Introduction xix
vii
viii Contents
Contents ix
Bibliography 243
Index 265
List of Figures
xi
List of Tables
xiii
Preface
xv
xvi Preface
least in part, and is, we believe, unique in its content and coverage and fills a
significant gap in the literature on theoretical computer science.
The book is mainly aimed at advanced undergraduate students, gradu
ate students, and researchers interested in the interface between mathemat
ics and computer science. It presents material from the early days of logic
programming through to topics which are of current importance. It should
be of special interest to those engaged in the foundations of logic program
ming, theoretical aspects of knowledge representation and reasoning, artifi
cial intelligence, the integration of logic-based systems with other models of
computation, logic in computer science, semantics of computation, and re
lated topics. The book should also prove to be of interest to those engaged
in domain theory and in applications of general topology to computer sci
ence. Indeed, it carries out for logic programming semantics, in a general
model-building sense, something akin to what the well-known treatments of
Abramsky and Jung [Abramsky and Jung, 1994] and Stoltenberg-Hansen et
al. [Stoltenberg-Hansen et al., 1994] set out to do for the semantics of conven
tional programming languages.
We have inevitably built up a considerable debt of gratitude to a num
ber of colleagues, collaborators, post-doctoral researchers, and post-graduate
students during the course of conducting the research presented here. It is
therefore a pleasure to record our thanks for insights, comments, and valu
able discussions to all of them. They include Sebastian Bader, Federico Banti,
Howard Blair, Eleanor Clifford, Artur S. d’Avila Garcez, Ben Goertzel, Bar
bara Hammer, Roland Heinze, Steffen Hölldobler, Achim Jung, Matthias
Knorr, Ekaterina Komendantskaya, Vladimir Komendantsky, Ralph Kop
perman, Markus Krötzsch, Kai-Uwe Kühnberger, Luis Lamb, Máire Lane,
Jens Lehmann, Tobias Matzner, Turlough Neary, John Power, Sibylla Prieß-
Crampe, Paulo Ribenboim, Bill Rounds, Sibylle Schwarz, Pawe�l Waszkiewicz,
Matthias Wendt, Andreas Witzel, Damien Woods, and Guo-Qiang Zhang. In
particular, we are grateful to Sebastian Bader for his contribution to Chap
ter 7, and indeed this chapter was written jointly with him.
Our acknowledgments and thanks are also due to a number of institutions
and individuals for hosting us on a number of research projects and visits and
to various funding agencies for making the latter possible.
In particular, Pascal Hitzler acknowledges the support of Science Foun
dation Ireland; the Boole Centre for Research at University College Cork;
University College Cork itself; the Deutscher Akademischer Austauschdienst
(DAAD); and Case Western Reserve University, Cleveland, Ohio. While con
ducting the research which led to the contents of this book, P. Hitzler changed
affiliation several times, and he is grateful to University College Cork Ire
land; the International Center on Computational Logic at Technical Univer
sity Dresden; Case Western Reserve University, Cleveland, Ohio; the Institute
for Applied Informatics and Formal Description Methods (AIFB) at the Uni
versity of Karlsruhe; and the Kno.e.sis Center at Wright State University,
Dayton, Ohio for providing excellent working environments.
Preface xvii
Pascal Hitzler
Anthony Seda
Dayton and Cork
Introduction
1 For some examples, the proceedings of the annual International Conference on Logic
Programming (ICLP) provide a current view of the subject. The book [Bramer, 2010] con
tains an introduction to Prolog programming. A standard reference for the theory under
lying Prolog programming is [Apt, 1997]. The reference [Apt and Wallace, 2007] contains
much about constraint logic programming. See [De Raedt et al., 2008] for details of cur
rent work in (probabilistic) inductive logic programming. For information about disjunctive
logic programming systems, see [Leone et al., 2006] and the website for the DLV project at
http://www.dbai.tuwien.ac.at/proj/dlv/, and for information concerning the related system
smodels, see [Simons et al., 2002] and the website http://www.tcs.hut.fi/Software/smodels/.
xix
xx Introduction
2 See [Gabbay et al., 1994] for an excellent account of some of the main approaches to
For reasons of this sort, research into non-monotonic reasoning has influ
enced research into logic programming, and vice-versa, giving rise to impor
tant and fruitful ideas and research directions in both areas. In particular,
such cross fertilization has led to the realization that logic programs, possi
bly augmented with some additional syntactic features, provide an excellent
language for knowledge representation in the presence of non-monotonicity.
In addition, such research has led to a number of implementations of non
monotonic-reasoning-based logic programming systems commonly known as
answer set programming systems.3
Thus, the interaction between logic programming and non-monotonic rea
soning is important. It is not, however, the main focus of our work. On the
contrary, our main focal points are, in a nutshell, first, the detailed develop
ment of the mathematical tools and methods required to study the semantics
of logic programs, and second, in order to illustrate these methods, the detailed
development of the main semantics of logic programs per se. In addition, we
give an application of the methods we present to study semantics in the con
text of neural-symbolic integration, as described in more detail shortly. Thus,
we do not treat procedural matters and matters concerned with implementa
tion in any depth, and indeed these issues are only touched on incidentally. We
also do not discuss matters primarily concerned with non-monotonic reason
ing other than in the context of their role in guiding our thinking in relation
to negation in logic programs, as already noted. It will therefore be of value
to say a little more about our precise objectives, and we do this next.
In common with most programming languages, the syntax of logic pro
gramming is comparatively easy to specify formally, whereas the semantics is
much harder to deal with. Again, in common with other programming lan
guages, there are several ways of giving logic programs a formal semantics.
First, logic programs have, of course, a procedural or operational semantics,
which describes and is described by their behaviour when executed on some
(abstract) machine. Second, unlike imperative or functional programs, logic
programs have a natural semantics, called their declarative semantics, which
arises simply because a logic program is a consistent set of well-formed formu
lae and can be viewed as a theory. This semantics is usually captured by means
of models, in the sense of mathematical logic, and will play a dominant role
in our development. Indeed, a central problem in the theory is the question of
selecting the “right” model for a program, namely, a model which reflects the
intended meaning of the programmer and relates it to what the program can
compute. It is here that ideas from non-monotonic reasoning play a funda
mental role in determining the right models, including well-known ones such
as the supported, stable, and well-founded models. Third, a standard and very
important way of selecting the appropriate models for a logic program is to as
3 For a discussion of these matters, see [Lifschitz, 1999, Marek and Truszczyński, 1999,
Baral, 2003]. For current developments in non-monotonic reasoning (versus logic program
ming), one may consult the proceedings series of the International Conferences on Logic
Programming and Non-Monotonic Reasoning (LPNMR), for example.
xxii Introduction
sociate with the program one or more of a number of operators called semantic
operators 4 defined on spaces of interpretations (or valuations) determined by
the program. One then studies the fixed points of these operators, leading to
the fixed-point semantics of the program in question. This latter semantics
can roughly be equated with the denotational semantics of imperative and
functional programs associated with the names of Dana Scott and Christo
pher Strachey because some, but not all, of the important semantic operators
which have been introduced are Scott continuous in the sense of domain the
ory, or at least are monotonic. Moreover, fixed points play a fundamental role
also in denotational semantics. Finally, there is a general requirement that
all the semantics described previously should coincide or at least be closely
related in some sense.5
Taking the observations just made a little further forward, we note that
there are several interconnected strands to the programme of analyzing the
fixed points of semantic operators, but three of the main ones are as follows.
First, we consider a number of operators already well-known in the theory, in
addition to introducing several more. In this step, we focus on ensuring that
the operators we study, and their fixed points, correctly reflect the meaning
of programs and their properties. Second, we investigate the properties of the
operators themselves, especially in relation to whether or not they are Scott
continuous and, if not, what properties they do possess. Scott continuity is a
desirable feature for a semantic operator to have because it implies that the
operator has a least fixed point. Furthermore, this least fixed point is often
taken to be the fixed-point semantics of the program in question, and indeed,
operators which are not Scott continuous may in general fail to have any fixed
points at all. Third, we study the fixed-point theory of semantic operators in
considerable generality. In fact, the failure of certain apparently reasonable
semantic operators (already known to capture declarative semantics) to be
Scott continuous often results from the introduction of negation, because the
introduction of negation may render the operators in question to be non-
monotonic and hence to fail to be Scott continuous, as we will see in Chapter 2.
The point just made is important because it is one of the reasons for
introducing alternatives to order theory in studying fixed-point theory in re
lation to semantics and in establishing fixed-point theorems applicable to non-
monotonic operators, see Chapter 4. Therefore, it will help to give some in
sight next into the non-traditional methods we introduce and develop, how
they work in the context of negation, and especially how they work in find
ing models for logic programs with negation. Our point of view is to regard
programs, and logic programs in particular, as (abstract) dynamical systems
whose states change under program execution and whose state changes can be
modelled by an operator T . Starting with some initial state, s0 , say, it is inter
4 This is a generic term which we use to cover all of a number of specific operators we
and in a rather general form by Theorem 5.4.2 and simply states that if P
is any logic program, and I is an interpretation such that T n (I) converges
in the Cantor topology to an interpretation M , then M is a model for P ; if,
further, T is continuous in the Cantor topology, then M is a fixed point of T
(here, again, T denotes the single-step operator associated with P ). Further
comments on this result are to be found in Remark 3.3.3 and in the comments
immediately following Remark 3.3.3. In particular, this fact is exploited on a
number of occasions to find models in the presence of negation and in partic
ular in studying acceptable programs, as just mentioned, and also in studying
the perfect model for locally stratified programs in Chapter 6. Indeed, the
working out of this observation together with some of its implications occu
pies a significant proportion of our time. In addition, because convergence is a
key notion, our development of topology in Chapter 3 is based on it, although
the main conclusions presented there are also given in other equivalent and
familiar forms.
In practice, detecting whether sequences converge or whether operators
have fixed points is most easily done by means of metrics and more general
distance functions (generalized metrics) together with their associated fixed-
point theorems, the latter perhaps being reminiscent of the Banach contrac
tion mapping theorem, see Theorem 4.2.3. Furthermore, underlying the use
of generalized metrics are topologies defined on spaces of interpretations, and
we study these in Chapter 3 with a view to developing, in conjunction with
Chapter 4, the mathematical analysis we apply later in Chapters 5 and 6 in
studying acceptable programs and related semantics, as already mentioned,
and in Chapter 7 in the context of artificial neural networks in relation to logic
programming. This latter work concerns the problem of integrating different
models of computation in an attempt to combine the best of each in a single
system and understanding the semantics of the combined system. In our case,
we consider the integration of logic programming, perhaps taken as repre
sentative of discrete systems, with connectionist systems, or neural networks,
considered as continuous systems inspired by biological models of computa
tion. A means of doing this is to compute semantic operators by means of
neural networks. However, in the case of first-order (non-propositional) pro
grams, it is necessary to employ approximation techniques (rather than exact
computation) which depend on viewing spaces of interpretations as compact
Hausdorff spaces, that is, to employ yet again methods from mathematical
analysis. Such applications as these are another important reason for devel
oping a quite extensive body of mathematics which provides alternative tools
to those based on order theory in studying semantics. In fact, one of the main
highlights, themes and motivating features of this book is the analysis we carry
out of foundational structures of various sorts, with an eye to potential ap
plications in the field of computational logic in general, as exemplified by our
results in, for example, Chapter 7. Indeed, it seems probable that such meth
ods and tools will prove useful in developing foundations in other areas where
discrete and continuous models of computation are combined, quite apart from
Introduction xxv
7 The uniform characterizations by means of level mappings which will be given in Chap
operators we discuss. Such sets themselves may be endowed with various, use
ful structures. In Chapter 3, we illustrate the point just made by studying
various topologies on spaces of interpretations, including the Scott topology
and a topology called the Cantor topology, as already mentioned. The conti
nuity of semantic operators in the Scott topology is examined in Chapter 3,
but the treatment of their continuity in the Cantor topology is deferred until
we reach Chapter 5, where the results are needed. In fact, as noted earlier, it
is convergence in these topologies which is of main interest because it can be
used to find models for logic programs as we show in Chapters 5 and 6, and
thus, convergence is the dominant theme in our development of topology.
We take the theme of structures defined on spaces of interpretations yet
further in Chapter 4 in presenting a detailed account of both various gen
eralized distance functions defined on spaces of interpretations and their as
sociated fixed-point theorems. These tools, some of which depend on level
mappings again, are developed specifically for investigating semantic oper
ators of logic programs with negation, but we believe that Chapter 4 is a
self-contained account of results which are likely to have applications within
computer science outside those areas considered here. In Chapter 5, we com
bine the developments of Chapters 2, 3, and 4 by applying the fixed-point
theorems of Chapter 4 to the more important semantic operators introduced
in Chapter 2. More specifically, we focus on classes of programs, which we
call unique supported model classes, each of which has the property that all
programs in that class have a unique supported model. An example of such
a class is the class of acceptable programs well-known in termination analy
sis, but we examine other important unique supported model classes as well.
These classes are interesting because it turns out that for each of the programs
they contain, many of the main semantics studied in the earlier chapters co
incide, and hence the meaning of each program in a unique supported model
class is unambiguous relative to the most important semantics. In essence,
we obtain these classes by applying to various semantic operators those fixed-
point theorems of Chapter 4 which guarantee a unique fixed point, if there
is a fixed point at all. The process involves working with successively more
general semantic operators, especially Fitting-style operators, and examining
their properties in relation to single-step operators and convergence of their
iterates in the Cantor topology studied in Chapter 3. Indeed, the process cul
minates in a very general semantic operator T which subsumes many of those
studied in the earlier chapters, and we estabish many of its important proper
ties in Chapter 5. In particular, we examine in depth the continuity of T in the
Cantor topology, thereby obtaining the corresponding results for single-step
operators and Fitting-style operators. Finally, we note that the work we do
in this chapter consolidates the uniform approach provided in Chapter 2, em
ploying level mappings, to encompass the additional semantics we introduce
in Chapter 5.
Turning now to Chapter 6, our objectives here are twofold. First, we revisit
the stable model semantics and establish a close connection between the well
Introduction xxvii
known Gelfond–Lifschitz operator GLP and the fixpoint completion fix(P ) for
any normal logic program P by deriving the identity GLP (I) = Tfix(P ) (I), for
any two-valued interpretation I, see Theorem 6.1.4. This will make it a simple
and routine matter to prove many facts about GLP , and hence about the sta
ble model, from properties of the single-step operator, including the derivation
of continuity properties of GLP . Our second objective in Chapter 6 is to re
visit stratification and the perfect model and to present an iterative process for
obtaining the perfect model for locally stratified normal logic programs. This
approach involves careful control of negation in order to produce monotonic
increasing sequences by means of non-monotonic operators and is interesting
for the insight it gives into the structure of the perfect model. In Chapter 7,
we apply the topological and analytical tools developed earlier in order to
discuss logic programming in the context of dynamical systems and artificial
neural networks with a view, in particular, to presenting a detailed account of
these methods in the foundations of neural-symbolic integration. Specifically,
in Chapter 7, we consider the computation by artificial neural networks of
various semantic operators associated with normal logic programs. We view
this as a means of integrating these two computing paradigms because both
can be represented by functions: the semantic operator on the one hand and
the I/O function of the neural network on the other. In fact, exact computa
tion of semantic operators is only possible in the case of propositional normal
logic programs. In the case of first-order programs, approximation methods
are required, and this is where analytical and topological methods make their
entrance. Indeed, it turns out that continuity of a semantic operator in the
Cantor topology is a necessary and sufficient condition for this approximation
process to work, see Theorem 7.5.3. This observation is yet further motiva
tion for studying the Cantor topology, and hence Chapter 7 represents an
important application of analytical ideas in logic programming semantics. In
Chapter 8, we give a brief discussion of further possible applications of our
results and future directions for research involving the methods and results
of this book. In particular, we discuss possible future work in the context
of the foundations of program semantics, quantitative domain theory, fixed-
point theory, the Semantic Web, and neural-symbolic integration, among other
things. In the Appendix, we bring together a summary of those facts from the
theory of ordinals and general topology which will be needed at various points
in our investigations, but are not developed in the main body of the text; its
inclusion makes our treatment essentially self-contained. In particular, the re
sults of Chapter 3 together with those of the Appendix give a treatment of
the Scott topology in terms of convergence.
Finally, on a point of convention, we note that the symbol • will be em
ployed as an end marker in two ways in the body of the text. First, it will
be used to indicate the end of every proof. Second, it will be used on a few
occasions to mark clearly the end of any statement (theorem, proposition,
definition, remark, example, program, etc.), where the end of that statement
might otherwise be unclear.
About the Authors
xxix
xxx About the Authors
member of the board of editors of the Bulletin of the European Association for
Theoretical Computer Science (EATCS), and also, for a number of years, was
on the editorial board of Asian Information-Science-Life: An International
Journal. He is a co-founder of the “Irish Conference on the Mathematical
Foundations of Computer Science and Information Technology (MFCSIT),”
a conference series the proceedings of which are published by Elsevier Sci
ence Publishers, and has strong connections with a considerable number of
other conferences. These include the conference series “International Informa
tion Conference,” usually held in Asia, and the “International Workshop on
Formal Methods,” usually held in Ireland. He is a co-founder of the Boole
Centre for Research in Informatics (BCRI) at University College Cork, is a
member of its executive committee, and leader of the “Theory of Computa
tion” theme within BCRI. He has led various groups of researchers in the
theory of computation and has supervised many Masters degree and PhD de
gree students to completion. More information can be found at the Web site
http://euclid.ucc.ie/pages/staff/seda/tseda.htm
Chapter 1
1
2 Mathematical Aspects of Logic Programming Semantics
(We refer the reader to the Appendix for a brief discussion of the theory of
ordinals.) We note that any ω-chain is, of course, a chain.
A non-empty subset A of a partially ordered set (D, [) is called directed if,
for all a, b ∈ A, there is c ∈ A with a [ c and b [ c. An element b in an ordered
set D is called an upper bound of a subset A of D if we have a [ b for all a ∈ A
and is called a least upper bound or supremum of A if b is an upper bound of A
[ b' for all upper bounds b' of A. Of course, by antisymmetry, the
satisfying b
supremum, A or sup A, of A is unique if it exists.nSimilarly, one defines lower
bound and the greatest lower bound or infimum, A or inf A, of a subset A
of D. An element x of D is called maximal (minimal ) if we do not have x c y
(y c x) for any element y of D. Given an ordering [ on a set D, we define the
dual ordering [d on D by x [d y if and only if y [ x. Lower bounds, greatest
lower bounds, etc. in [ correspond to upper bounds, least upper bounds, etc.
in [d .
Later on, we will encounter examples of each of these notions in the context
of spaces of valuations. Notice that on taking A = D in the previous definition,
we see that a complete upper semi-lattice or a complete lattice always has
a bottom element and that a complete lattice always has a top element or
greatest element, that is, an element T satisfying a [ T for all a ∈ D.
There are various implications between the notions formulated in Defini
tion 1.1.1, some of which are obvious. Indeed, as far as the various notions of
completeness are concerned, each defined concept is apparently less general
than its predecessor. For example, since any chain is a directed set, we see that
any complete partial order is chain complete, and any chain-complete poset
with a bottom element is an ω-complete partial order. However, the following
fact, which we simply state, is less trivial.2
2 For a discussion of chain completeness versus completeness (for directed sets), we refer
the reader to [Markowsky, 1976]; see also [Abramsky and Jung, 1994, Proposition 2.1.15].
Order and Logic 3
We next give some simple examples of the concepts defined above; note
that (1) and (2) are special cases of Theorem 1.3.2.
1.1.5 Example (1) The power set D = P(N) of the set N of natural numbers
is a complete lattice when ordered by set inclusion. In this ordering, D is
also a domain in which the compact elements are the finite subsets of N.
Furthermore, the bottom element of D is the empty set ∅ and ∅ is also
the only minimal element of D; the top element of D is N and N is the
only maximal element of D.
4 Mathematical Aspects of Logic Programming Semantics
(2) Let X be a non-empty set, and let D denote the set of all pairs (I + , I − ),
where I + and I − are disjoint subsets of X. We define an ordering on D
by (I + , I − ) [ (J + , J − ) if and only if I + ⊆ J + and I − ⊆ J − . Then D
is a domain in which the bottom element is the pair (∅, ∅), the compact
elements of D are the pairs (I + , I − ) in D in which I + and I − are finite
sets, and the maximal elements are the pairs (I + , I − ) which satisfy I + ∪
I − = X. Note that D is not a complete lattice.
(3) Let D denote the set of all partial functions f : Nn → N ordered by graph
inclusion, that is, f [ g if and only if graph(f ) ⊆ graph(g), where f
and g are partial functions. (Thus, f [ g if and only if whenever f (x)
is defined, so is g(x) and f (x) = g(x).) Then D is a domain in which a
partial function f is a compact element if and only if graph(f ) is a finite
set and the bottom element is the empty function. Here, the maximal
elements of D are the total functions. Again, D is not a complete lattice.
3 See
[Scott, 1982b].
4 Our
basic references to domain theory are the book [Stoltenberg-Hansen et al., 1994]
and the book chapter [Abramsky and Jung, 1994], but the reader interested in domain
theory may also care to consult the notes of G.D. Plotkin [Plotkin, 1983] and also the
comprehensive treatment to be found in [Gierz et al., 2003].
Order and Logic 5
Proof: Again, this theorem is well-known, and we just sketch its proof.
Let γ be an ordinal whose cardinality exceeds that of D, and form the
set {f β (x) | β ≤ γ}. By cardinality considerations, there must be ordinals
α < β ≤ γ with f α (x) = f β (x), and we can assume without loss of generality
that α is least with this property. Since f α (x) [ f (f α (x)) [ f β (x) = f α (x),
7 Fixed points of certain operators associated with logic programs are of extreme impor
due to Tarski and Kantorovitch in which ω-chains are replaced by countable chains, see
[Jachymski, 2001]. Indeed, the collection containing [Jachymski, 2001] is an excellent general
reference to fixed-point theory. As noted in [Lloyd, 1987], the reference [Lassez et al., 1982]
contains an interesting discussion of the history of fixed-point theorems on ordered sets.
9 In attributing Theorem 1.1.10 to Knaster and Tarski, we are noting Proposition 1.1.2
and then following Jachymski in [Jachymski, 2001]. Theorem 1.1.9 is usually attributed to
Kleene, since this theorem is an abstract formulation of the first recursion theorem, and we
are consistent with [Jachymski, 2001] in this respect.
Order and Logic 7
10 Our approach to the syntax and semantics of first-order logic is standard and is to be
found in any of the well-known texts on mathematical logic, see, for example, [Hodel, 1995,
Mendelson, 1987]. For fuller details of logic in relation to logic programming, the reader
may care to consult [Apt, 1997] or [Lloyd, 1987].
11 Similarly, our use of classes in the definition of an alphabet is also standard in developing
first-order logic and, in our case, is not intended to hint at foundational issues. In logic
programming practice, the classes referred to, namely, those of constant, variable, function,
and predicate symbols, will be finite sets. When working with the set groundJ (P ) defined in
Chapter 2, J will usually (although not necessarily) denote the Herbrand preinterpretation,
and then we will in effect be working with a set containing a possibly denumerable collection
of elements (atoms, in fact).
8 Mathematical Aspects of Logic Programming Semantics
closure step and assume that what is being defined is the smallest set satisfying the basis
and induction steps.
Order and Logic 9
treatment of several aspects of logic programming, and we refer the reader to [Fitting, 2002]
and the works cited therein for more details.
Order and Logic 11
p q ¬p p∧q p∨q
u u u u u
u f u f u
u t u u t
u b u f t
f u t f u
f f t f f
f t t f t
f b t f b
t u f u t
t f f f t
t t f t t
t b f b t
b u b f t
b f b f b
b t b b t
b b b b b
the main reason we work with it despite the fact that most of our applications
are to T W O and T HREE. Notice that Kleene’s weak three-valued logic also
uses the truth set T HREE, but its connectives are defined by Table 5.1.18
The next two definitions are fundamental. In presenting the first of them,
we will use the notation commonly employed in logic programming.
Thus, BL,J is the set of all symbols p(d1 , . . . , dn ), where p is an n-ary predicate
symbol in L and d1 , . . . , dn ∈ D. •
(complete) lattice. In addition, the two orderings are required to interact with each other
so as to obtain various distributive laws.
14 Mathematical Aspects of Logic Programming Semantics
Proof: (a) As already noted, it is routine in this case to verify that the ordering
on I(X, T ) is a partial ordering, with bottom element as already specified.
(b) The argument in this case is similar to the next and is omitted.
(c) If M ⊆ I(X, T ) is directed, then it is easy to check that, for each
x ∈ X, the set {v(x) | v ∈ M } is directed and hence has a supremum in T .
It is now clear that the valuation
vM defined on X by v M (x) = {v(x) |
v ∈ M } is the suprem um, M , of M in I(X, T ). Indeed, for any directed
subset
M ⊆ I(X, T ), M satisfies the following relationship: for each x ∈ X,
( M )(x) = (M (x)), where M (x) denotes the set {v(x) | v ∈ M }.
(d) By the argument used in (c), the supremum M exists for any directed n
subset M of I(X, T ). Also, n for any subset
n M of I (X, T ), we have that M
exists and is defined by ( M )(x) = (M (x)) for each x ∈ X, where again
M (x) denotes the set {v(x) | v ∈ M }.
(e) It is clear from the argument in (c) that any subset M of I(X, T ) has
a supremum in I(X, T ), and, from (d), M has an infimum in I(X, T ).
(f) We begin by showing that the finite valuations are compact elements.
Suppose that v is a finite valuation and that {x ∈ X | v(x) = ⊥} =
{x1 , . . . , xn }. Suppose that
M = {uk | k ∈ K} is a directed set of valuations
in I(X, T ) such that v [ M arbitrary element of {x1 , . . . , xn }.
. Let xi be an
Then we have that v(xi ) ≤ M (xi ) = (M (xi )), that v(xi ) is a compact
element, and that {uk (xi ); k ∈ K} is directed. Therefore, there is uki ∈ M
such that v(xi ) ≤ uki (xi ), and we obtain such uki for i = 1, . . . , n. Since M is
directed, there is u ∈ M such that uki [ u for i = 1, . . . , n, and it now clearly
follows that v [ u. Hence, v is compact.
20 For further details here and in the next three subsections, see [Seda, 2002].
Order and Logic 15