Professional Documents
Culture Documents
OceanofPDF.com Logi - Lech T Polkowski
OceanofPDF.com Logi - Lech T Polkowski
Lech T. Polkowski
Logic:
Reference Book
for Computer
Scientists
The 2nd Revised, Modified,
and Enlarged Edition of “Logics
for Computer and Data Sciences,
and Artificial Intelligence”
Intelligent Systems Reference Library
Volume 245
Series Editors
Janusz Kacprzyk, Polish Academy of Sciences, Warsaw, Poland
Lakhmi C. Jain, KES International, Shoreham-by-Sea, UK
The aim of this series is to publish a Reference Library, including novel advances
and developments in all aspects of Intelligent Systems in an easily accessible and
well structured form. The series includes reference works, handbooks, compendia,
textbooks, well-structured monographs, dictionaries, and encyclopedias. It contains
well integrated knowledge and current information in the field of Intelligent Systems.
The series covers the theory, applications, and design methods of Intelligent Systems.
Virtually all disciplines such as engineering, computer science, avionics, business,
e-commerce, environment, healthcare, physics and life science are included. The list
of topics spans all the areas of modern intelligent systems such as: Ambient intelli-
gence, Computational intelligence, Social intelligence, Computational neuroscience,
Artificial life, Virtual society, Cognitive systems, DNA and immunity-based systems,
e-Learning and teaching, Human-centred computing and Machine ethics, Intelligent
control, Intelligent data analysis, Knowledge-based paradigms, Knowledge manage-
ment, Intelligent agents, Intelligent decision making, Intelligent network security,
Interactive entertainment, Learning paradigms, Recommender systems, Robotics
and Mechatronics including human-machine teaming, Self-organizing and adap-
tive systems, Soft computing including Neural systems, Fuzzy systems, Evolu-
tionary computing and the Fusion of these paradigms, Perception and Vision, Web
intelligence and Multimedia.
Indexed by SCOPUS, DBLP, zbMATH, SCImago.
All books published in the series are submitted for consideration in Web of Science.
Lech T. Polkowski
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature
Switzerland AG 2023
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether
the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse
of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and
transmission or information storage and retrieval, electronic adaptation, computer software, or by similar
or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors, and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
The new book LOGIC: Reference Book for Computer Scientists by Prof. Lech
Polkowski is another remarkable contribution that the author has offered to the hand
of the readers. This is an addition to his another book Logics for Computer and Data
Sciences, and Artificial Intelligence which was published in the series Studies in
Computational Intelligence.
This new book is a substantial extension of the already published book as well as
it covers different domains of classical and non-classical logic; among them senten-
tial logic, first-order logic, intuitionistic and modal logics, temporal logics, many
valued logics, dynamic logic, epistemic logics, mereology and rough mereology
(with important results of Prof. Polkowski), logic models of knowledge in relation
to the rough set approach, and some advanced issues concerning second-order logic,
in particular monadic second-order logic, are a few to name.
What is very impressive is its wide extent covering all these domains with so
many deep mathematical results; usually such a wide range is not even possible to
cover in a monograph of lectures on mathematical logics.
I see this book as a further step and more deep in comparison to the first one,
towards the realization of the idea of Prof. Helena Rasiowa; she formulated in 1960s
some ideas emphasizing the fundamental role of logic for the development of CS
and AI and conversely a very significant role of CS and AI for the development of
logic.
From this perspective, the new book concentrates on the presentation of the basic
domains of logic which have a great importance for the contemporary state of devel-
opment of CS and AI. This concerns, e.g., application of logic as a very important
tool for expressing concepts on which different forms of reasoning can be performed,
deep characterization of computational complexity of many different important prob-
lems in CS and AI as well as application of Boolean reasoning in different domains
of CS and AI.
Moreover, the book also covers theoretical issues which yet have not been consid-
ered in the scope of CS or AI applications. Exploiting these issues more may lead
to the discovery of new technologies. It is worthwhile mentioning that researchers
in AI are gradually discovering the usefulness of advanced tools related to different
vii
viii Foreword
branches of advanced mathematics and logic, e.g., topology and reasoning in solving
the advanced problems related to Machine Learning.
One can also observe that nowadays there is also an important call to logi-
cians, especially from AI, for developing new reasoning tools based on the rele-
vant computing model necessary for solving challenges, related to, e.g., Intelligent
Systems dealing with complex phenomena; the book How Smart Machines Think by
Sean Gerrish (MIT Press, 2019) may be considered as an example of such reflection
of thought.
The research related to an emerging computing paradigm of Interactive Granular
Computing model, different from the classical Turing model, may also be counted
to recognize the importance of research on such new reasoning tools. In this direc-
tion, the section on rough mereological logic, essentially devoted to computing with
granules of knowledge, may provide a starting point towards more complex logics.
The material is presented in a very condensed and precise way. This concerns the
whole book starting from the preliminary chapter which can serve as a basis for a
quite a few courses for graduate and Ph.D. students from CS and AI. It should be
also noted that all theorems are presented together with the detailed proofs.
Moreover, the historical comments added to the chapters will help the readers to
better understand how different branches of logics have been born and developed.
The problems included in all the chapters will also stimulate the readers for deeper
studies.
This will certainty work as a reference book for the graduate students and Ph.D.
students; for the researchers working in CS or AI this book has the potential of
guiding them in their studies through different areas of applied and theoretical issues
of logic.
The content of the book is so varied that the researchers working on different
areas of CS or AI for sure will find some sketch of selected contents relevant for their
areas of interest.
Repetitio mater studiorum est. Repetition allows to perceive some facts not seen
at the first study. It allows for connecting some threads not connected at first and
for better seeing main dominating lines in apparently distinct reasoning moods. For
those moods, let us be allowed to say that logic is about consistency. Satisfaction
of consistent sets implies completeness, maximal consistent sets provide models,
consistency guarantees incompleteness in the Gödel-Rosser sense. Another mood is
exploitation of closures of formulae, also appearing in many places in this text; we
should mention as well the role of the filter separation theorem which is applied in
many important proofs of completeness, witness the Chang theorem.
The aim to exhibit those moods to a fuller degree has been the reason that this
author has underwent the enlarged at the same time corrected edition of his book
styled Logics for Computer and Data Sciences and Artificial Intelligence (the title
abbreviated to ’Logics’ in the sequel) published by Springer Nature Switzerland in
the Series Studies in Computational Intelligence as no. 992.
The present text is larger by about 35% in comparison to the text in ‘Logics’
and much richer topically. It is in fact a new book which implies a new title, better
reflecting the content. Let us present shortly that content to the Reader.
It opens with Chap. 1 which contains prerequisites in order to provide the Reader
with necessary information so they have almost no need to reach for external infor-
mation. Section 1.1, Set Theory Recapitulated, contains an account of ZFC set theory
with theory of relations functions, ordering, complete ordering, well ordering, equipol-
lence theory, cardinal and ordinal numbers, transfinite induction, elements of theory of
graphs and trees, a new section on topology. We include proofs of fundamental theo-
rems: the Knaster-Tarski theorem in Theorem 1.2, the Dedekind-McNeille theorem
in Theorem 1.3, the Cantor diagonal theorem in Theorem 1.5, the Cantor-Bernstein
theorem in Theorem 1.6, the Zermelo theorem on the well ordering in Theorem 1.12,
many of them in the basic repertoire of set-theoretic tools in computer science,
the Zorn maximal principle theorem in Theorem 1.13, the Teichmüller-Tukey prin-
ciple in Theorem 1.14, the König theorem in Theorem 1.15, the Ramsey theorem in
Theorem 1.16. In Sect. 1.2 about Rewriting Systems, we address topics of grammars,
finite-state automata, regular expressions and grammars, automata on infinite words
ix
x Preface
Chapter 3 deals with the first-order logic (FO), the culmination of classical logic
and the environment for the deepest results in logic. The chapter consists of 22
sections. We begin with syntax of FO in Sects. 3.1 and 3.2 brings an account of
semantics. We define the notion of a model, and notions of satisfiability, validity and
unsatisfiability.
In Sect. 3.3 we enter the realm of Natural Deduction with the sequent calculus
and in Sect. 3.4 we continue this topic with diagrams of formulae, due to Rasiowa-
Sikorski, being yet another rendering of the Gentzen idea. This last method allows
us to prove a weak form of completeness for predicate logic. Section 3.5 continues
discussion of methods in Natural Deduction with the method of tableaux. As with SL,
also in predicate logic, tableaux allow for proving the basic properties of predicate
logic.
This is initiated in Sect. 3.6 in which we introduce Hintikka sets and prove
their satisfiability which in turn proves tableau-completeness of predicate logic in
Theorem 3.6. Continuing this line, we prove the Löwenheim-Skolem Theorem 3.8
and the compactness property of predicate logic. Relations between sequents and
tableaux are discussed in Sect. 3.7: by means of then we prove the completeness
of the sequent calculus. Normal forms are introduced in Sect. 3.8. We introduce
the prenex normal form and the Skolem functions. We introduce conjunctive and
disjunctive normal forms and we discuss the techniques of skolemization, renaming
and unification in obtaining these normal forms. In Sect. 3.9, we prove theorems
on existence of the most general unifier, and on soundness and completeness of
predicate resolution. Horn formulae return for predicate logic in Sect. 3.10 along
with SLD-resolution and logic programs. We give examples of reasoning in these
structures.
Section 3.11 begins the discussion of deepest problems in FO, beginning with
undecidability of satisfaction and validity problems. We apply the fact that the deci-
sion problem of membership is undecidable for type 0 grammars and we construct an
undecidable formula of predicate logic. We include a classical undecidable problem
PCP of Post with a proof by Sipser in Theorem 3.22 and the Church theorem with
the proof by Floyd in Theorem 3.19. Section 3.12 is in a nutshell mentioning of
complexity issues. In Sect. 3.13, we prove that the specialization of FO, the monadic
FO is decidable.
Section 3.14 is devoted to the exposition of the Herbrand theory and the proof of
the Herbrand theorem in Theorem 3.29 which reduces the validity problem for predi-
cate logic to validity problem for SL. Many proofs of completeness for various logics
apply the idea of building models as sets of maximal consistent sets of formulae. This
pioneering idea of Henkin was applied by him in the proof of the Gödel completeness
theorem for FO and in Sect. 3.15 we include this proof. Henkin proves a generaliza-
tion of the Löwenheim-Skolem theorem to higher cardinalities.The idea of Henkin
will appear in chapters on modal logics and on many-valued logics. We include in
Sect. 3.16 the Smullyan proof of the Tarski theorem on unprovability of truth in the
arithmetic theory L E .
Preface xiii
In Sect. 4.6, we discuss notions of provability and consistency for modal logics,
maximal consistent sets and relation of accessibility among them as preparation for
completeness theorem in Sect. 4.7. The proof of completeness is in the Henkin style
via maximal consistent sets.
Section 4.8 contains a discussion of the notion of filtration which leads to the
proof of decidability for logic K, T and S4 in Theorem 4.34. A further step for S5
requires the notion of bisimulation which allows for proof od decidability for S5 in
Theorem 4.37. In Sect. 4.9, devoted to satisfiability, we recall the Ladner proof that
SAT(S5) is NP-complete.
With Sect. 4.10 we begin a discussion of quantified modal logic (QML). We
mention the de re and de dicto readings of statements and on this basis we introduce
the Barcan, Definition 4.36, and the converse Barcan formulae, Definition 4.37. We
define the notion of satisfaction for QML which blends elements of FO with Kripke
structures.
Section 4.11 brings an analysis of tableaux for QML. Here one discerns between
constant and variable domains of QML structures. We recall elements of Fitting
approach to either case. For K, we prove tableau-completeness.
With Sect. 4.12 we begin introduction to propositional intuitionistic logic (SIL).
This logic is constructed on ontological insight of L. E. J. Brouwer that truth means
provability. This logic models mathematical truth which requires proofs. SIL for
instance rejects the law of exclusion of the middle. From Gödel’s result that SIL can
be interpreted within the S4 and subsequent Kripke models for SIL, S4 serves as a
structure for SIL with necessary modifications. In this section, we define the notion
of satisfaction for SIL. Tableaux for SIL are introduced in Sect. 4.13 with a proof
of satisfaction for Hintikka families and the resulting proof of tableau-completeness
for SIL.
In Sect. 4.14, we recall the Henkin style proof of strong completeness of SIL.
Section 4.15 opens a discussion of the last in Chap. 4 logic: the first-order intuition-
istic logic (FOIL). It is set in Kripke structures for S4. We introduce the structure for
FOIL which adds to the structure for S4 elements of first-order theory. This serves
as a prelude to Sect. 4.16 in which we prove the completeness of FOIL.
Temporal logics which attempt at defining models for time related events are often
regarded as forms of modality. Chap. 5 opens the second part of the book in which
we meet logics for time, many valued logics and logics for action and knowledge
which have a strong application appeal. Though built on principles inherited to some
extent from first-order and propositional logic, yet they show distinct principles for
their construction.
In Chap. 5, we give a description of temporal logic triad LTL, CTL, CTL*. Their
importance stems from their applications in descriptions of systems properties and
in consequence in model checking.
In Sect. 5.1, we recall the logic of tenses due to Arthur Prior which inspired
Pnueli and Kamp to transfer it to computer science as LTL: Linear Temporal
Logic. In Sect.5.2, we discuss syntactic properties of LTL in few sub-sections.
Sub-section 5.2.1 brings description of operators of LTL: G (always) and F (even-
tually) modeled on the universal and existential quantifiers of FO and additional
Preface xv
new operators X (next) and the binary operator U (until). In sub-section 5.2.2 we
define formulae of LTL: Gp, Fp, Xp, pUq. Sub-section 5.2.3 brings description of
a Kripke structure for LTL as the linear set S = {si : i ≥ 0} of states endowed
with the transition relation modeled as the successor relation with an assignment
si → 2 A P , each i, where A P is the set of atomic propositions.
For branching time models, Kripke structures for CTL are transitions systems,
i.e., sets of states S = {si : i ≥ 0} with transition relations S → 2 S , sets of initial
states I and an assignment L : S → 2 A P , and CTL adds operators A (for all) and E
(exists). The need for considering various paths calls for a complex syntax with the
formulae set split into state and path formulae. We define satisfaction for states and
the global satisfaction for transitions systems. We conclude Sect. 5.3 with examples
of valid CTL formulae.
Section 5.4 is dedicated to Full Computational tree Logic CTL* which subsumes
LTL and CTL. Its models are transitions systems. As for previous systems LTL, CTL,
we discuss in 5.4.1–5.4.4 the syntax, semantics, and satisfaction relation for CTL*.
Section 5.5 begins the discussion of meta-theory of temporal logics. We begin
with LTL, for which we prove the basic result about the ultimate periodic structure
in Definition 5.16 and we define the Fisher-Ladner closure FLC(φ) in Definition
5.17. We define the notion of consistency and we define maximal consistent sets
for FLC(φ) in Definition 5.19. We make maximal consistent sets into a transition
relation, Definition 5.20 and we prove the Sistla-Clarke theorem about satisfiability of
a satisfiable formula in the ultimate periodic model in Theorem 5.7. The consequence
is decidability of LTL in Theorem 5.8. We conclude with the Sistla-Clarke result in
Theorem 5.10 that SAT(LTL) is in PSPACE. We also sketch the proof by Markey
that SAT(CTL) is in PTIME in Theorem 5.11.
In Sect. 5.6, we discuss the logic LTL+PAST which adds to LTL past operators.
In Sect. 5.7, we begin the description of model checking problem beginning with
model checking by automata. We give examples for model checking of some system
properties. In Sects. 5.8–5.10, we discuss tableaux for LTL and CTL with examples
of tableaux and proofs of tableau-completeness for those systems.
With regard to role of automata in model checking, we open in Sect. 5.11 a
discussion of automata on infinite words (Büchi automata) in Definition 5.27. We
define languages accepted by automata in Definition 5.28 and we include basic results
on Büchi automata: constructions of the union, the intersection, and the complement
for Büchi automata in Theorems 5.18–5.21 due to Choueka. Decision problems
for automata are considered in Sect. 5.12 with the Vardi-Wolper theorem on linear
time decidability and NL-completeness of the non-emptiness decision problem in
Theorem 5.22.
Section 5.13 begins with definitions of alternation in Definition 5.34 and of the
structure of labeled trees in Definition 5.35. For alternating automata on labeled
trees which are defined in Definition 5.36, we define runs and acceptance conditions
in Definition 5.37. We recall in Theorem 5.23 the result by Miyano-Hayashi about
equivalence of an alternating Büchi automaton on n states with a non-deterministic
xvi Preface
Büchi automaton on 2 O(n) states. Section 5.14 is concerned with the Vardi-Wolper
theorem on translation of LTL to a non-deterministic Büchi automaton. This requires
the notion of extended closure EC L(φ) in Definition 5.38. Maximal consistent sets
of EC L(φ) serve as states for the automaton defined in Definition 5.39. We include
the theorem (Kupferman) about the existence for an LTL formula φ of an alternating
Büchi automaton on O(|φ|) states and the same induced language in Theorem 5.24. In
Sect. 5.15, we again address the LTL model checking. It is about the problem whether
a given Kripke structure satisfies a given formula. We give a proof of the Sistla-Clarke
theorem on PSPACE-completeness of the problem by indicating a pasage from the
Kripke structure to a non-deterministic Büchi automaton of complexity proportional
to 2 O(|φ|) .
Section 5.16 addresses the parallel problem for branching time logics. This time
structures are labeled trees and automata are alternating tree automata (ata) (Thomas,
Muller-Schupp), see Definition 5.40. Runs of (ata) are defined in Definition 5.41, in
Definition 5.42 we define weak alternating automata and in Definition 5.43 we intro-
duce structures of trees in Kripke structures. The model checking problem for CTL is
defined in Definition 5.44 and Theorem 5.26 brings the theorem by Kupferman-Vardi-
Wolper on the existence of a weak alternating automaton A(φ, Δ) which induces the
same language as the set of trees with spread Δ that satisfy the formula φ.
Section 5.17 is of different character as it addresses the method OBDD (Ordered
Binary Decision Diagrams) for symbolic model checking. Its essence is in building
graphs for representation of propositional formulae. In Definition 5.45 we present
the OBDD methods for representation of sets and transitions in OBDD and Defini-
tion 5.46 treats notions of images and pre-images, essential in model checking. In
Definition 5.47, we give examples of computation and we include OBDD schemes
for LTL and CTL model checking after Bryant and Chaki-Gurnfinkel.
We return in a sense to classical logics in Chap. 6 which is about many-valued
logic whose existence was posed by Jan Łukasiewicz in March 1918 followed by
detailed exposition by Łukasiewicz in 1920 and by Post logics about that time.
We discuss the propositional case. We begin with the Łukasiewicz formulae for
negation and implication and other connectives in Sect. 6.1. In Sect. 6.2, we define
auxiliary functions: T-norms and T-co-norms. Their role my be compared to the
role of accessibility relations in modal logics. We define classical T-norms and the
corresponding T-co-norms. We define the classical T-norms of Łukasiewicz, Goguen,
and Gödel which later define corresponding logics. T-norms induce residua which
serve as implications for respective logics in Definition 6.4. In the end, we recall all
basic connectives for the three T-norms in Theorem 6.1. The interesting idea due to
Hájek of studying the many-valued logic (BL-logic) introduced by the smallest T-
norm which would inherit properties common to all T-norms is presented in Sect. 6.3.
We reproduce axiom schemes for BL and give a list of selected valid formulae.
Deduction theorem for BL is given a proof in Theorem 6.4. An algebraic proof of
completeness of BL is reproduced in Sect. 6.4.
In Sect. 6.5, we embark on theory of 3-valued logic of Łukasiewicz. We begin with
axiom schemes due to Wajsberg (Sect. 6.5, introduction) and we proceed with the
completeness proof by Goldberg-Leblanc-Weaver on lines of the Henkin method of
Preface xvii
In Sect. 8.2, we introduce the syntax and the sematics of the second-order logic SO.
In Definition 8.11, we define the monadic second-order logic MSO. In Definition 8.12–
8.15 we introduce Ehrenfeucht games for MSO and in Theorem 8.10 we enclose the
proof that the class EVEN is not definable in ∃MSO. Theorem 8.12 due to Kannelakis
states the REACH is expressible in ∃MSO for undirected finite graphs and we include
an argument by Ajtai and Fagin. we define Ajtai-Fagin games for ∃MSO in Definition
8.17 and Theorem 8.13 states the equivalence of the winning strategy by Duplicator to
non-definability in ∃MSO with a proof due to Immerman. As an example, we include
the proof by Arora and Fagin that dREACH is not definable in ∃MSO.
Section 8.4 is dedicated to the status of strings in MSO. We begin with definition
Definition 8.23 of languages induced by formulae and in Theorem 8.15 we include
the proof by Ladner of the fundamental theorem due to Büchi that a language is MSO
definable if and only if it is regular. A contrasting theorem due to McNaughton-Papert
that a language is FO-definable if and only if it is regular-star free is given with a
proof by Ebbinghaus-Flum in Theorem 8.16.
Section 8.5 contains two fundamental theorems due to, respectively, Trakhtenbrot
and Fagin. The Trakhtenbrot theorem on undecidability of the finite satisfiability
problem over vocabularies containing a binary predicate is proved in Theorem 8.17.
The Fagin theorem that ∃SO = NP is stated and proved in Theorem 8.18.
With Sect. 8.6, we open the vast area of augmentations of FO by additional
constructs which lead to logics stronger than FO and subsumed by SO. We consider
in Sect. 8.6 FO+inductive definitions; an example of such definition is the Transitive
Closure TC which is non-definable in FO. In Definition 8.24, we return to the Knaster-
Tarski fixed point theorem (see Chap. 1) in order to introduce fixed point operators
LFP and GLP and the logic LFP=(FO+LFP+GLP). The theorem, independently
by Immerman and Vardi, that LFP=PTIME is stated in Theorem 8.20 with a proof
by Immerman. We notice that LFP⊆ ∃MSO.
Introduced by Gurevich and Shelah Inductive fixed points IFP and Inflationary
fixed points are defined in Definitions 8.28 and 8.29. Finally, in Definition 8.30 Partial
fixed points PFPs are defined. Theorem 8.24 by Kreutzer that IFP≡ LFP simplifies
the landscape of fixed points. Theorem 8.25 due independently to Immerman and
Vardi states that on ordered finite structures IFP=LFP=PTIME, and Theorem 8.26
due to Vardi which establishes that PFP=PSPACE conclude Sect. 8.6.
Up tp now, FO and fixed point logics have been unable to count as witnessed
by EVEN. The logics with counting introduced by Immerman and Lander make
up for this deficiency. The logic (FO+Count) is defined in Definitions 8.31–8.33.
Infinitary connectives are defined in Definition 8.34 and their addition leads to the
logic (FO+Count)inf in Definition 8.35. A further step is the logic in Definition 8.36.
Its strength is curtailed by restriction to formulae of a finite rank (Definition 8.37) in
the logic (FO+Count)*inf ,ω (Libkin) in Definition 8.38.
Bijective Ehrenfeucht games (Hella, Libkin) are introduced in Definition 8.39. In
Theorem 8.27, we prove that the winning strategy by Duplicator on structures A, B is
equivalent to the agreement of those structures on closed formulae of (FO+Count)inf,ω
xxii Preface
1 Introduction: Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Set Theory Recapitulated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 ZFC Set Theory. Basic Constructs . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Equipollence and well-Ordered Sets. Cardinal
and Ordinal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.3 Graph Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2 Rewriting Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3 Computability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4 Arithmetization of Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.5 Recursively Enumerable Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.6 Undecidability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7 Incompleteness. Non-provability of Truth . . . . . . . . . . . . . . . . . . . . . 34
1.8 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.9 Algebraic Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.10 Topological Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2 Sentential Logic (SL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.1 A Bit of History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.2 Syntax of Sentential Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.3 Semantics of Sentential Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.4 Normal Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.5 Sentential Logic as an Axiomatic Deductive System . . . . . . . . . . . . 71
2.6 Natural Deduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.7 Natural Deduction: Decomposition Diagrams . . . . . . . . . . . . . . . . . . 79
2.8 Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
2.9 Meta-Theory of Sentential Logic. Part I . . . . . . . . . . . . . . . . . . . . . . . 84
2.10 Meta-Theory of Sentential Logic. Part II . . . . . . . . . . . . . . . . . . . . . . 88
xxv
xxvi Contents
xxxi
List of Tables
xxxiii
Chapter 1
Introduction: Prerequisites
In this chapter, we collect basic information on set theory, rewriting systems, com-
putability, complexity, algebraic structures, topological structures, which will serve
us in what follows as references.
Naïve notion of a set comes from Georg Cantor, the creator of set theory, who
defined a set as a collection of objects united by a common property. This definition
was sufficient in the first period of development up to the end of 19th century; as
reasoning on the basis of it led to antinomies, beginning of the XX century brought
attempts at formal definitions which resulted in some formal theories of sets, accepted
as satisfactory for developing basic mathematical theories.
Definition 1.1 (ZFC theory of sets) The syntactic constituents of ZFC belong in a
few categories of symbols:
(i) the letters X, Y, Z , ... denote sets;
(ii) letters x, y, z, ... denote elements of sets;
(iii) the symbol ∈ (the Greek ‘esti’) denotes the phrase ... is an element of ...;
(iv) the symbol = denotes identity of sets;
(v) connectives ∨, ∧, ⊃, ¬, ≡ meaning intuitively or, and, if ... then ..., ,
if and only if ....
Some relations between sets are derived first. The primitive formula of the set theory
is x ∈ X (‘a thing x is an element of the set X ’).
Definition 1.2 (Containment of sets) The symbol for this notion is ⊆; X ⊆ Y if
and only if x ∈ X ⊃ x ∈ Y no matter what thing is substituted for x. When (X ⊆
Y ) ∧ ¬(Y ⊆ X ), then one uses the symbol ⊂ and writes X ⊂ Y meaning that X is
a proper subset of Y .
Definition 1.3 (Set algebra) We define elements of set algebra: the union X ∪ Y is
the set defined by the formula x ∈ X ∪ Y ≡ x ∈ X ∨ x ∈ Y ; the intersection X ∩ Y
is defined by the formula x ∈ X ∩ Y ≡ x ∈ X ∧ X ∈ Y ; the difference X \ Y is
defined by the formula x ∈ X \ Y ≡ x ∈ X ∧ ¬(x ∈ Y ).
Definition 1.4 (Identity of sets) X = Y if and only if X ⊆ Y ∧ Y ⊆ X ; equivalently,
(X = Y ) ≡ (x ∈ X ≡ x ∈ Y ) for each thing x.
We now list allowed in ZFC operations for forming new sets. We give them in the
format X, Y, Z , ..., x, y, z, ...
,
new constr uct on basis o f X, Y, Z , ..., x, y, z, ...
calling them axioms. The set with elements x, y, . . . is denoted {x, y, . . .}.
x,y
(A1) Axiom of unordered pair: {x,y} ; for each pair of things x, y, there exists the set
{x, y} containing exactly things x and y;
(A2) Axiom of separation: X,P XP
where (x ∈ X P ) ≡ (x ∈ X ∩ P); we are allowed to
single out of X elements which are in P. The set P is called a property, later
on, we meet its symbolic rendition in logic under the name of a predicate;
(A3) Axiom of the power set: 2XX , where (x ∈ 2 X ) ≡ (x ⊆ X ); it follows that the
power set 2 X consists of all subsets of
the set X ;
(A4) Axiom of the union: XX , where (x ∈ X ) ≡ [(x ∈ Y ) ∧ (Y ∈ X )] for some
set Y ; therefore, the set X consists of all elements which are elements in an
element of X ;
(A5) Axiom of the empty set: ∅ , where the empty set ∅ consists of no element: for
each x it is true that ¬(x ∈ ∅);
(A6) Axiom of infinity: ∅∅∞ , where ∅∞ has the following properties:
(i) ∅ ∈ ∅∞ ;
(ii) for each x, if x ∈ ∅∞ , then {x, {x}} ∈ ∅∞ ; thus, ∅, {∅, {∅}}, ... are elements
of the set ∅∞ ;
(A7) Axiom of replacement: let X, Y be sets and F(x, y) be defined for x ∈ X and
be such that for each x ∈ X there exists exactly one y ∈ Y satisfying F(x, y).
Then YX,Y
X,F , where Y
X,F
⊆ Y and y ∈ Y X,F if and only if F(x, y) holds true for
some x ∈ X ;
(A8) Axiom of choice (C): XXC , where X C contains exactly one element from each
element of X ; X C is a selector for X .This supposes that elements of X are
non-empty sets themselves and the set X C selects exactly one element from
each of these sets. We call X a family of sets.
Let us add that letters ZF stand for Zermelo-Fraenkel set theory and the letter C
stands for Choice.
1.1 Set Theory Recapitulated 3
Definition 1.7 (Binary relations) For sets X, Y , the relation R between X and Y
is a subset R ⊆ X × Y . In case <x, y> ∈ R, we write R(x, y) or x Ry. We list
definitions of most frequently used relations. Consider a relation R ⊆ X × X ; R is:
(i) reflexive: R(x, x) for each x;
(ii) linear: R(x, y) ∨ R(y, x) for each pair x, y;
(iii) symmetric: R(x, y) ⊃ R(y, x) for each pair x, y;
(iv) transitive: R(x, y) ∧ R(y, z) ⊃ R(x, z);
(v) serial: for each x, there exists y such that R(x, y);
(vi) Euclidean: R(x, y) ∧ R(x, z) ⊃ R(y, z) for each triple x, y, z;
(vii) directed: if R(x, y) and R(x, z), then there exists t such that R(y, t) and R(z, t)
for each triple x, y, z;
(viii) functional: R(x, y) ∧ R(x, z) ⊃ (y = z) for each triple x, y, z.
A relation satisfying (i) and (iii) is a tolerance relation which expresses similarity, if
R satisfies in addition (iv), then it is an equivalence relation.
The inverse to R relation R −1 is defined by the equivalence (R −1 (x, y)) ≡
(R(y, x)). Clearly, (R −1 )−1 = R. Relations can be composed: (R ◦ S(x, y)) ≡
(R(x, z) ∧ S(z, y)) for some z. Obviously, (R ◦ S)−1 = S −1 ◦ R −1 .
For a binary relation R, we denote by R n the composition of n copies of R; the
union ∞ n
n=0 R is the transitive closure of R denoted T C(R). Two things x, y are in
the relation T C(R) if and only if there exists n such that R n (x, y).
Definition 1.8 (Functions) For sets X, Y , a relation R ⊆ X × Y is a function if and
only if it does observe the property R(x, y1 ) ∧ R(x, y2 ) ⊃ y1 = y2 ; for functions
symbols f, g, ... are used and notation f (x) = y is applied when the instance f (x, y)
holds. Functions are denoted more suggestively by symbols of the form f : X → Y .
We now define basic notions related to the notion of a function like image, counter-
image, domain, range, functions total (surjective), injective, bijective.
Definition 1.9 For a function f : X → Y and a subset Z ⊆ X , the set f (Z ) = {y ∈
Y : y = f (x)} for some x ∈ X is the image of the set Z . By analogy, for a subset
W ⊆ Y , the subset f −1 (W ) = {x ∈ Z : f (x) = y ∧ y ∈ W } of X is the counter-
image of W . The set X is the domain dom( f ) of f and the set f (X ) is the range
r ng( f ) of f ; in case when the range of f is Y the function f is total. The function
f is injective if for each y ∈ Y there exists at most one x ∈ X with f (x) = y; f is
bijective when it is injective and total.
4 1 Introduction: Prerequisites
x ≤ X y ⊃ f (x) ≤Y f (y).
Any lattice X can be embedded into a complete lattice L, i.e., there exists an
isotone injective function from X into L. This construction is called the Dedekind-
McNeille completion.
Definition 1.13 (Structure, operation, vocabulary) An operation of arity n on a set
A is a function which assigns to each sequence of length n of elements of A an
element of A. A structure is a set A with a set Σ of operations on it. The structure A
with the vocabulary Σ and the domain A is the pair (A, Σ).
Proof For a set A, a subset of a lattice M, we define sets: (i) A+ = the set of all upper
bounds for A (ii) A− =the set of all lower bounds for A. Then, one checks that the
following hold:
(iii) if A ⊆ B, then B + ⊆ A+ and B − ⊆ A− ;
(iv) A ⊆ (A+ )− ;
(v) {[(A+ )− ]+ }− = (A+ )− .
We
define the complete lattice L along with the embeddingι. We recall that operations
, are defined for any collection F of sets as follows: F = {x : x ∈ A, A ∈ F}
and F = {x : x in each A ∈ F}.
+ −
(vi) L is the set of all sets A such that A = (A
) +and operations of bounds
are: for
a family F of elements of L, g.l.b.F=( {A : A ∈ F})− , l.u.b. F=( {A+ :
A ∈ F})− ;
(vii) for x ∈ M, we define the set (←, x]={x}− . Then ((←, x]+ )− =(←, x].
(viii) the embedding ι is defined as ι(x) = (←, x].
Definition 1.14 (The set of natural numbers) Consider the collection N of all sets
satisfying (A6) (i), (ii). Call them inductive sets. Let N= N ; then N is the minimal
inductive set; we denote ∅ by 0, the set {∅, {∅}} by 1 and so on, the generic symbols
for elements of N are m, n, ..... They are called natural numbers.
Theorem 1.4 (The principle of mathematical induction) For each n ∈ N there exists
the least element greater than n, i.e., = n ∪ {n}; it is called the successor of n and
it is denoted as n + 1. Suppose that the set A ⊆ N has properties (i) n 0 ∈ A (ii) for
each n > n 0 , if all natural numbers m such that n 0 < m < n are in A, then n ∈ A.
Then each n ≥ n 0 ∈ A. In particular, if n 0 = 0, then A=N.
Definition 1.18 (Equipollence) Sets X, Y are equipollent (are of the same cardinal-
ity) if there exists a bijection f : X → Y . The cardinality type of a set X is denoted
|X |. The equipollence relation between sets X and Y is denoted as |X | = |Y |. For
instance, no natural number n is equipollent with the set of natural numbers N. Each
set equipollent with N is said to be countably infinite. Cardinality of N is denoted by
the symbol ω, the first infinite cardinal number. We say that a cardinal number |X |
is greater than a cardinal number |Y | if the set Y is a bijective image of a subset of a
set X and there is no bijection of Y onto X .
The question whether there exist cardinal numbers greater than ω is settled by the
Cantor theorem.
Theorem 1.5 (Cantor) For each set X , sets X and the power set 2 X are not equipol-
lent and |X | < |2 X |.
We meet here the celebrated diagonal argument, an echo of the ancient Liar
paradox, repeated after Cantor in many proofs and constructions including the Gödel
incompleteness theorem and the Tarski theorem on non-definability of truth.
1.1 Set Theory Recapitulated 7
The set X embeds into the set 2 X by the injection x → {x}, hence cardinality
of X is smaller than cardinality of 2 X . Clearly, |X | = |X |, |X | = |Y | ∧ |Y | = |Z | ⊃
|X | = |Z |; what about condition (iii) of Definition 1.10? It turns out that it also holds.
If |X | ≤ |Y | and |Y | ≤ |X |, then |X | = |Y |.
X
Proof We the power set 2 is completely ordered by inclusion
exploit the fact that
⊆ with as the join and as the meet. By assumptions, there exist an injection
f : X → Y and an injection g : Y → X . We define a function h : 2 X → 2 X by the
formula
h(A) = g[Y \ f (X \ A)]
f (X \ B) ⊆ f (X \ A),
thus
[Y \ f (X \ A)] ⊆ [Y \ f (X \ B)]
and
g(Y \ f (X \ A)) ⊆ g(Y \ f (X \ B)),
i.e.,
h(A) ⊆ h(B).
By the Knaster-Tarski theorem, h(C) = C for some C ⊆ A. Then,
Y \ g −1 (C) = f (X \ C)
an injection gn : X n × {n} →N. The function g : n∈NX n × {n} →N defined as
g(xn,k ) = gn (xn,k ) for n ∈N is an injection of the union X into N.
f (x + 1, y − 1) = bn(x + 1 + y − 1 + 1, 2) + (x + 1) =
bn(x + y + 1, 2) + (x + 1) = f (x, y) + 1 = n + 1.
n + 1 = bn(x + 1, 2) + x + 1 = bn((x − 1) + 1 + 1, 2) + (x + 1) = f (x − 1, 1)
(x + y + 1)(x + y) (x + y)2 + 3x + y
+x = = z.
2 2
hence,
1
(2x + 2y + 1) ≤ (8z + 1) 2 < 2x + 2y + 3
It follows that 1
(8z + 1) 2 + 1
= x + y + 1,
2
finally,
1
(8z + 1) 2 + 1
(x + y) = − 1 = P(z)
2
and 1
(8z + 1) 2 + 1
3x + y = 2z − [ − 1]2 = Q(z).
2
Solving this system of linear equations, we obtain explicit expressions for K (z) =
x and L(z) = y as
1 3 1
K (z) = · (Q(z) − P(z); L(z) = · P(z) − · Q(z).
2 2 2
Corollary 1.1 For each natural number k, the set Nk is equipollent with N.
Definition 1.21 (Order types) In addition to cardinality, linearly ordered sets can
be compared with respect to their orderings; if there exists an isotone function f :
X → Y , then the order type of X is not greater than the order type of Y ; in case f
is an isotone bijection, we call it an isomorphism and then order type of X is equal
to the order type of Y . We recall that a linearly ordered set X is well-ordered when
each non-empty subset of X has the least element.
Theorem 1.9 Consider well-ordered structures (X, ≺) and (Y, <) with strict linear
orderings ≺ and <. Then
(i) if f : X → X is isotone, then x ≺ f (x) or x = f (x) for each x;
(ii) if f : X → Y is isotone, then either f establishes an isomorphism between X
and Y or X is isomorphic to a set S(y) = {z ∈ Y : z < y} for some y ∈ Y (S(y)
is called the initial segment of y);
(iii) no well-ordered set X can be isomorphic to its initial segment.
Proof For (i): the symbol will denote the weak relation ≺ ∪ =. Consider the set
A = {x ∈ X : x f (x)}. The set A is non-empty as 0 ∈ A. Suppose that A = X
and let y be the first element in X \ A. As for x ∈ A we have x ≺ y, we have x
f (x) ≺ f (y). It follows that y f (y), a contradiction which proves (i). Property
(iii) follows: was X isomorphic to a segment S(x), we would have f (x) ≺ x, contrary
to (i). For(ii): as x ≺ y implies f (x) < f (y), f is an embedding of X into Y , hence,
f (X ) is a well-ordered subset of Y . Then either f (X ) = Y or f (X ) is an initial
segment of Y .
Corollary 1.2 For two well-ordered sets X, Y either X and Y are isomorphic or X
isomorphic to an initial segment of Y , or, Y is isomorphic to an initial segment of X .
Theorem 1.10 (Transfinite induction) Suppose the structure (X, ≺) is well-ordered
and the subset A of X has properties (i) 0 ∈ A (ii) for each x ∈ X , if S(x) ⊆ A, then
x ∈ A. Then, A = X .
1.1 Set Theory Recapitulated 11
x ≺ y ≡ (x < X y ∧ x, y ∈ X ) ∨ (x <Y y ∧ x, y ∈ Y ) ∨ (x ∈ X ∧ y ∈ Y ),
i.e., each element of X precedes each element of Y and orderings < X and <Y are
preserved on X and Y , respectively.
This is the anti-lexicographic ordering which is ordering X × Y into the ordinal type
of α · β. On the other hand, the product β · α is the type of the Cartesian product
X × Y with the lexicographic ordering:
Theorem 1.11 The function f (β) = F( f (L(β))) is well and uniquely defined.
Theorem 1.12 (Well-ordering) For each set X there exists a relation well-ordering
X.
Proof The proof relies essentially on the Axiom of Choice (A8): let f be the selector
for the family 2 X \ {∅}; let f be extended by letting f (∅) = q for some q ∈ / X.
Consider the set Γ of all ordinal numbers with the property: γ ∈ Γ if and only if
there exists a subset of X well-ordered into type γ .
Let α be the least ordinal number greater than any number in Γ . Define the transfi-
nite sequence <φ(ξ ) : ξ < α> of type α by letting φ(ξ ) = f (X \ {φ(η) : η < ξ }).
Was φ(ξ ) = q for each ξ < α, we would obtain a well-ordered subset of X of ordinal
type α, contrary to the choice of α. Hence, for some β < α, we have φ(β) = q, which
implies that {φ(ξ ) : ξ < β} well-orders X into
type β.
We return for a while to partially ordered sets. For a set X partially ordered by the
ordering ≤, we call a chain any linearly ordered subset. Set X is upward-bounded if
each chain in X has the least upper bound. An element x is maximal when there is
no element greater than it. We have in this context the Zorn maximal principle due
to Zorn [3] and anticipated by Kuratowski [4] and Hausdorff [5].
Theorem 1.13 (The maximal principle) In each partially ordered upward-bounded
set X there exists a maximal element.
Proof Consider a set X with properties as in assumptions. Let f be a selector for the
family 2 X \ {∅} extended by f (∅) = q ∈ / X . Let the ordinal number α be the same
as in proof of Theorem 1.12.
Define the transfinite sequence <φ(ξ ) : ξ < α> by letting φ(ξ ) = f ({x ∈ X :
x > l.u.b.{φ(η) : η < ξ }}). As in proof of Theorem 1.12, there exists the least β < α
with φ(β) = q which witnesses that there is no x greater than l.u.b.{φ(ξ ) : ξ < β}
therefore l.u.b.{φ(ξ ) : ξ < β} is a maximal element in X .
The statement of Theorem 1.13 is usually called the Zorn lemma. There is a
number of statements asserting the existence of some extremal element. We state
here two of them: (i) The Teichmüller-Tukey lemma cf. Tukey [6], Kelley [7] and (ii)
the Kuratowski-Hausdorff lemma.
Theorem 1.14 (i) A property P of sets if of finite character if a set satisfies P if and
only if each finite subset of it satisfies P. If a family of sets F is of finite character, then
in F there exists a maximal set with respect to inclusion (ii) In a partially ordered
set, each linearly ordered subset is contained in a maximal linearly ordered subset.
Proof For (i): By assumptions, each chain L of sets in F ordered by inclusion has
the least upper bound which is the union L in F, so by the Zorn lemma in F there
exists a maximal element. For (ii), proof goes on similar lines.
1.1 Set Theory Recapitulated 13
Proof Call a vertex v ∈ V promising if the subtree with the root v contains branches
of any finite length. Then produce a path
r oot, v1 ∈ level 1, v2 ∈ level 2, ...,
vk ∈ level k, ....
consisting of promising vertices which is possible due to finiteness of levels. This
path is an infinite branch in T .
Theorem 1.18 Consider an infinite set of vertices V . Then for each graph G on V ,
either G or G contains an infinite clique.
Directed graphs
Directed acyclic graphs (dags) allow topological sorting which means a linearization
of the graph by means of a linear order on the set of vertices. We denote edges of a
directed graph by symbols <u, v>. It is important to know that by definition, directed
graphs allow for loops, i.e, edges of the form <v, v> for any vertex v.
Dag G = (V, E) is topologically sorted when its vertices can be linearly ordered
in an ordering such that u v if and only if <u, v> ∈ E.
Theorem 1.19 In each finite dag G = (V, E), there exist a vertex u without any
incoming edge.
1.2 Rewriting Systems 15
Proof Suppose to the contrary that each vertex v is the end vertex of an edge; choose
a vertex v0 and let <v1 , v0 > be an edge. As the graph is acyclic, v0 = v1 ; in turn, v1
is the end vertex of some edge <v2 , v1 > and as the graph is acyclic, v2 ∈ / {v0 , v1 }.
Continuing, we define an infinite sequence of pairwise distinct vertices {vi : i ∈ N }
such that <vi+1 , vi > is an edge for i ∈ N , a contradiction with finiteness of V .
Proof Let u 0 be a vertex with no incoming edge. Remove u 0 and out-coming from
it edges from the graph to obtain the graph G 1 , put u 0 on the list L and continue with
the graph G 1 putting the obtained vertex u 1 on L after u 0 and repeat until all vertices
are on the list L. The list L contains topologically sorted vertices of the graph G.
reversed order: productions are now of the form v ⇒ u, initial states are q ∈ F and
to reach the state q0 a production ε ⇒ q0 is added. Then the language recognized is
{w : qw ⇒∗ q0 } for some q ∈ F.
We have made no clear distinction between FDA’s and NDA’s. The reason is that
both types accept the same languages.
Theorem 1.21 The following conditions are equivalent for a language L:
(i) L is accepted by an FDA; (ii) L is accepted by an NDA; (iii) L is regular.
Proof (after Salomaa [10], 1.4.1). (i) implies (ii) as each FDA is an NDA. For
the implication (ii)–(iii), we take a closer look at the language L(N D A) accepted
by an NDA. L(N D A) is the union of languages L(N D A, q, q ) for q ∈ Q 0 , q ∈
F. Transition rules of FNA have the form of productions of regular grammar, and
we introduce q0 by production ε ⇒ q0 , declaring q as the initial symbol. Hence,
each L(N D A, q, q ) is regular.The remaining part is to show that finite unions of
L(N D A, q, q )’s are L(N D A). It is enough to show that the union L ∪ M of two
regular languages is regular, the rest is provided by induction.
Suppose that L is generated by the grammar
< N (L) ∪ N (M)∪ {x}, T (L)∪ T (M), x, P(L)∪ P(M)∪ {x ⇒ a(L), x ⇒ a(M)} > .
generates the language L M. In order to obtain a grammar which would generate the
language of type (v ∗ ), form the set of productions P + by replacing each production
x ⇒ w, where x ∈ N (M) and w ∈ T (M)∗ by the production x ⇒ a(M)w. Let x ∗
be a symbol neither in the alphabet of L nor in the alphabet of M and form the
grammar
Definition 1.36 (Infinite words) For an alphabet A, an infinite word, called also an
ω-word, over A is an infinite sequence of symbols in A; the set of all ω-words is
denoted Aω . We can concatenate finite words with infinite ones: if u ∈ A∗ and v ∈ Aω
then uv ∈ Aω .
Processing infinite words requires a new type of automata with modified accep-
tance conditions: Büchi automata Büchi [11].
1.2 Rewriting Systems 19
Proof Clearly, each set of the given form is ω-regular. Conversely, one checks
directly that sets of this form constitute the class satisfying Definition 1.39(i)–(iv),
hence, they are contained in the class R E G(ω).
20 1 Introduction: Prerequisites
Conversely, if L = L(B) for some automaton B, then for each initial state q1 and each
accepting state q2 , the fragment of L containing paths beginning at q1 and ending at
q2 can be written as L(q1 , q2 ) =L ∗ (q1 , q2 )(L(q2 , q2 )ω , i.e., as a regular expression
and the language L is the union {L(q1 , q2 ) : (q1 , q2 ) ∈ I × F}.
Contrary to the finite case (Theorem 1.21), there are languages accepted by non-
deterministic Büchi automata but not accepted by any deterministic Büchi automaton.
1.3 Computability 21
An example is given in Landweber [12] of the language L = ({a} ∪ {b})∗ (bω ) which
is accepted by the automaton NBA in Table 1.2 but not by any deterministic automaton
DBA.
Proof that no deterministic Büchi automaton accepts the language L can be
sketched as follows: let tr ∗ be transitive closure of tr . We denote by b∗ a finite
string of symbols b, irrespective of its length, this will simplify notation.
As bω ∈ L, b∗ reaches an accepting state s1 ∈ F; we define for each k a sequence
σk : b∗ ab∗ a . . . ab∗ with k symbols a such that tr ∗ (s0 , b∗ ab∗ a . . . ab∗ ) = sk ∈ F. As
F is finite, there exist s∗ ∈ F which accepts infinitely many strings σk , hence, the
language L should contain words with infinitely many occurrences of a, a contra-
diction.
1.3 Computability
Definition 1.41 (Actions of the one tape Turing machine) TM operates on words,
rewriting of words is steered by instructions. Instructions are in the form uv, where
u and v are words built from symbols of states, symbols of alphabet A, symbols
L , R. Antecedents of instructions are in the form of words qa, meaning that TM is
currently at the state q and it is scanning the cell in which the symbol a is written, and
consequents denote actions of TM which are of few kinds: TM can erase the symbol
a, it can write a new symbol into the cell, move left or right or make no move. A
sequence of actions constitutes a computation, TM reaches the result of computation
if it halts after a finite number of actions, otherwise it produces no result.
TM can decide the language computed, i.e., output YES if the final string is in
the language and NO otherwise; TM can also accept the string into language. In the
first case the language is recursive, in the second case it is recursively enumerable.
Definition 1.42 (Instructions of TM) We assume that the alphabet A consists of
symbols a0 , a1 , ..., ak ; we denote a0 by the symbol B standing for blank, i.e., the
empty cell, a1 will denote 1. Instructions for TM are of the form:
(1) qi a j ak qn ;
(2) qi a j Rqn ;
(3) qi a j Lqn
Each instruction when performed alters the content of the tape. The content of the
tape is the word written currently on the tape. It is called formally an instantaneous
description, denoted by the symbol ID. For two ID’s, ID1 and ID2, the symbol ID1
ID2 denotes that the instantaneous description ID1 has changed into ID2 as the result
of an applied instruction.
Definition 1.43 (Instantaneous descriptions vs. instructions) A general form of an
ID is Pqi a j Q, where qi is the current state of TM, a j is the alphabet symbol currently
scanned, P is a word to the left of a j , Q is the word to the right of a j . Below, we list
all cases of brought forth by instructions (1)–(3).
(4) if I D1 is Pqi a j Q and an instruction is qi a j ak qn , then I D1 I D2 : Pqn ak Q;
(5) if I D1 is Pqi a j ak Q and an instruction is qi a j Rqn , then I D1 I D2 : Pa j qn ak Q;
(6) if I D1 is Pqi a j and an instruction is qi a j Rqn , then I D1 I D2 : Pa j qn B;
(7) if I D1 is Pak qi a j Q and an instruction is qi a j Lqn , then I D1 I D2 : Pqn ak a j Q;
(8) if I D1 is qi a j Q and an instruction is qi a j Lqn , then I D1 I D2 : qn Ba j Q
An ID is terminal if there is no I D1 such that I D I D1 .
A sequence of instantaneous descriptions related by is a computation.
Definition 1.44 (Computations by TM) A computation by TM is a finite sequence
I D1 , I D2 , . . . , I Dm such that I Di I Di+1 for i = 1, 2, . . . , m − 1 and I Dm is
terminal. For the purpose of computations, the symbol a1 is 1, and the natural
number n is coded as the sequence of n + 1 symbols 1: n = 11...1 (n+1 repeti-
tions, for short 1n+1 ). A sequence n 1 , n 2 , . . . , n k of natural numbers is written down
as 1n 1 +1 B1n 2 +1 B . . . B1n k +1 . This long sequence can be replaced with a shortcut
<n 1 , n 2 , . . . , n k >.
1.3 Computability 23
It follows from Theorem 1.25 that each (partial) recursive function is (partially)
computable. As the converse statement holds true, recursiveness is equivalent to
computability.
Theorem 1.26 The following functions are recursive, hence, computable:
(i) Z (x) ≡ 0;
(ii) A(x) = 1 −∗ x;
(iii) x 2;
1
(iv) x 2 ;
(v) |x − y|;
(vi) xy if y = 0 else 0;
(vii) x −∗ y · xy (the remainder of x divided by y);
(viii) f (x, y) = 21 [(x + y)2 + 3x + y] of Theorem 1.8;
(ix) functions K (z) = x, L(z) = y such that f (K (z), L(z)) = z of Theorem 1.8.
Theorem 1.27 If functions f, g in Definition 1.49 are recursive, then the function h
is recursive, too.
Theorem 1.29 The class of primitive recursive functions is closed on bounded sums
and bounded products: for a primitive recursive
function f (y, x n ), functions
g(k, x n ) = m≤k f (m, x n ) and h(k, x n ) = m≤k f (m, x n ) are primitive recursive.
In the same vein we prove that R ∨ P and R ∧ P are primitive recursive as χ R∨P =
(χ R ) · χ P and χ R∧P = (χ R + χ P ) −∗ (χ R · χ P ).
Minimization also preserves primitive recursiveness. For a relation R(y, x n ), we
let M(z, x n ) = min y≤z R(y, x n ) in case such y exists, otherwise the result is 0.
Theorem 1.31 If the relation R(y, x n ) is (primitive) recursive, then the function
M(z, xn ) is (primitive) recursive.
For the proof see Davis [14].
We notice that relations x = y, x < y and x ≤ y are primitive recursive:
For proof for Prime(n), the argument of Euclid in his proof that there exist infinitely
many prime numbers is used:
It follows from the above that functions K (z), L(z) : N × N → N, of Theorem 1.8
are primitive recursive.
We now propose to discuss a function which is total and not recursive known as
the ‘Busy Beaver’function, BB for short.
Definition 1.51 (Busy Beavers) An example of a function which is not recursive
is the ‘Busy Beaver’ function Radó [15], Aaronson [16]. BB for the given natural
number n begins on a Turing machine TM B B with the alphabet {1, B}, B denoting
blank, with n states, not counting the halting (blocking) state q f and with the clean
tape. BB determines the value of the function Σ(n) = the maximal number of 1s on
the tape when a machine TM B B halts. Endless loops do not count.
The impression about the hardness of the problem can be given, if we realize
that the number of Turing machines satisfying the conditions for the given n is
4 · (n + 1)2n . The function Σ is accompanied by the function S(n)= the maximal
number of moves by the machine TM B B .
Not much is known about the function Σ as well as about the function S. The
largest n is about 6, for which one of the best current results is Kropitz [17]: Σ(6) ≥
3.515 · 1018267 .
Theorem 1.33 Functions Σ and S are total non-computable.
Proof The idea of the proof is to show that Σ grows faster than any computable
function.
Claim For each computable function f there exists a natural number c f such that
Σ(n + c f ) ≥ f (n) for each n ≥ 0.
Proof of Claim. Let TM(f) compute the function f and c f be the number of states
of TM(f). We define the Turing machine TM(f,n): it writes n 1’s to the tape and then
begins to emulate TM(f); clearly,
(i) Σ(n + c f ) ≥ f (n) for n ≥ 0.
Let h(n) = Σ(2n); was Σ computable, we would have
(ii) Σ(n + ch ) ≥ Σ(2n).
As Σ is monotonically increasing, for n ≤ ch , we have
(iii) Σ(n + ch ) ≤ Σ(2n), contrary to (i).
1.4 Arithmetization of Turing Machines 27
BB shows some interesting results, for instance, as shown in (Yedidia and Aaron-
son [18]), with BB on 748 states, it halts if and only if the set theory ZFC is incon-
sistent.
We are now in a position to arithmetize Turing machines, in order that they can, in
a sense, compute on themselves. This approach opens up a way to the most important
results in computability theory.
in general, the alphabet symbol ai is assigned the number 4i + 7 and the state sym-
bol qi is assigned the number 4i + 9. This enumeration extends over sequences of
symbols, e.g.,to the expression q0 1Rq1 , the sequence assigned is <9, 11, 3, 13>.
Definition 1.52 (Gödel numbering) For an expression s = s1 s2 ...s
k enumerated by
the sequence <m 1 , m 2 , ..., m k >, the Gödel number is gn(s) = k1 Prime(n)m n .
This extends over sequences of expressions E : E 1 E 2 ....E k , gn(E) =
k numbering gn(E n)
n=1 Prime(n) .
Due to the uniqueness of decomposition of a natural number into a product of
primes, no two distinct sequences of expressions have the same Gödel number.
As a set X of n expressions can be ordered in n! distinct ways, X has n! distinct
Gödel numbers.
The central place in our discussion in this section will be taken by the Kleene
predicate Kleene [19].
Definition 1.53 (The Kleene predicate) For n > 0, the Kleene predicate is
Tn (z, x n , y), where z = gn(Z ), Z is a Turing machine TM which begins with
I D1 : q0 1x1 +1 B1x2 +1 B....B1xn +1 , and y is the Gödel number of the resulting com-
putation.
The Kleene predicate captures all essential information: full information about
TM is encoded in z, y codes the computation with the initial ID.
The fundamental result is the Kleene theorem Kleene [19].
Theorem 1.34 (Kleene) The predicate Tn (z, x n , y) is primitive recursive.
Proof Though the proof is lengthy, we will sketch it bearing in mind the importance
of the predicate. The proof consists in a series of statements describing essential
aspects of computation (our exposition follows the exposition in Davis [14]).
28 1 Introduction: Prerequisites
(P3) asserts that x is a Gödel number with positive exponents. Its definition is
G N (x) ≡ ∀C(x)+1
y=1 [(G(y, x) > 0) ∨ (G(y + 1, x) = 0)];
(P4) asserts that x is the exponent at some prime factor in Gödel number z. Its
formal name is
C(z)
E x p(x, z) ≡ [G N (z) ∧ ∃i=1 (x = G(i, z))];
C(y)−∗ 1
x⊗y=x· [Prime(C(x) + i + 1)G(i+1,y) ];
i=0
(P6) holds if its argument is a Gödel number of some state qi . Its definition is
(P7) holds if its argument is a Gödel number of an alphabet symbol. Its definition
is
Al(x) ≡ ∃xy=0 (x = 4y + 7);
(P10) holds if its arguments are Gödel numbers of two distinct quadruples having
the same sets of two first symbols. Its definition is
(P11) holds if its argument is a Gödel number of a Turing machine TM. Its definition
is
C(x) C(x)
T M(x) ≡ G N (x) ∧ ∀n=1 [Quad(G(n, x)) ∧ ∀m=1 (¬(N D(G(n, x), G(m, x))))];
(P12) holds if it yields the Gödel number of the code for the machine representation
of its argument. Its definition is
(P14) it is a function which returns the number of ones in an expression with Gödel
number x. Its definition is
C(x)
Cor n(x) = CU (n, x);
n=1
(P15) returns the result of a computation by a Turing machine TM. More generally,
for a sequence of expressions E 1 , E 2 , ..., E n with the Gödel number x, it
returns the number of ones in E n . Its definition is
(P17) represents the Gödel number x of the initial sequence q0 Code(x n ). Its defi-
nition is
(P18) Next group of predicates are related to computations by TM. The first predi-
cate holds true when x, y are Gödel numbers of I D1 and I D2 with I D1 I D2
according to instruction (1) of TM with gn(T M) = z of Definition I.3.3. Its
definition is
E x p(2a · 3b · 53 · 7c , z);
(P21) collects (P18-P20) into one predicate which holds when x, y are Gödel num-
bers of I D1 , I D2 , z is gn(T M) and I D1 I D2 . Formally,
(x, y, z) ≡ ∃i=1
3
i ;
C(z)
∧{∀i=1 [(G(1, G(i, z)) = r ) ∨ G(2, G(i, z)) = s]};
Fin(G(C(y), y));
(P24) the final step in which the Kleene predicate is expressed by the above defined
primitive recursive predicates:
This concludes the proof that the Kleene predicate is primitive recursive.
The Kleene normal form Kleene [20] expresses values of computable functions
in terms of the Kleene predicate.
Theorem 1.35 (The Kleene normal form) For a function f Tn M computed by a Turing
machine Z with gn(Z ) = z, the following holds:
f T(n)
M (x n ) = U (min y [Tn (z, x n , y)]).
Proof For (i): Suppose that the predicate P(x n ) is computable, hence, its charac-
teristic function χ P is computable. Then the set I (P) is the domain of the function
min y [χ P (x n ) + y = 0].
For (ii): I (P) is the domain of the function min y [χ P (y, x n ) = 0].
For (iii), (iv): Suppose that the predicate P(x n ) is recursively enumerable, hence
the set I (P) is the domain of a computable function f (x n ). By Theorem 1.35,
f (x n ) = U (min y [Tn (z, x n , y)]) for some z. It follows that
P is computable.
It turns out that RE predicates can be characterized as ranges of computable
functions. We recall that the class of recursive predicates is close on proposi-
tional connectives ∧, ∨, ¬: indeed, for (partially) recursive predicates P, Q, char-
acteristic functions of, respectively P ∧ Q, P ∨ Q, ¬P are, respectively χ P∧Q =
(χ P + χ Q ) −∗ (χ P · χ Q ), χ P∨Q = χ P · χ Q , χ¬P = 1 −∗ χ P .
1.6 Undecidability 33
Theorem 1.38 (i) If a predicate P(x) is the range of a (partially) computable func-
tion f (x), then P is recursively enumerable (ii) if P is a non-vacuous RE predicate,
then there exists a computable function f (x) such that I (P) is the range of f (x).
Proof For (i): By the Kleene normal form, Theorem 1.35,
for some z. Then, y is a value of f , if and only if for some x, u, y = U (u) and
T (z, x, u) holds. Hence, {y : P(y)}={y : ∃x, u, y = U (u) ∧ T (z, x, u)}, i.e., P is
an RE.
For (ii) (after Davis [14]): we know that (P(x)) ≡ (∃y, z.T (z, x, y)). We denote
by χT (x, y) the characteristic function of the predicate T with z fixed. The function
f is defined as follows: f (0)=the least element x0 in the denotation I (P);
1.6 Undecidability
We will relate some deep results obtained by means of the Kleene predicate. We
denote the predicate T1 (z, x, y) as T (z, x, y).
Theorem 1.39 The predicate Q(x) : ∃y.T (x, x, y) is recursively enumerable but
not computable.
Proof Q(x) is recursively enumerable. Suppose that ¬Q(x) is recursively enu-
merable. By the Kleene enumeration Theorem 1.36(iv), ¬Q(x) ≡ ∃y.T (z, x, y)
for some z. Letting z = x, we obtain a contradiction: ∃y.T (x, x, y) ≡ ¬∃y.T (x,
x, y).
Definition 1.55 (Decision problems) For a predicate P(x n ), the decision problem
is to obtain answer Y es or N o to the question: given an arbitrary argument a n is it
true that P(a n ) holds?
Clearly, the decision problem is closely related to computability: in order to pass
the test of decision problem, the predicate P(xn ) must be computable, i.e., recur-
sive. Hence, a predicate P(xn ) which answers in the positive to decision problem
34 1 Introduction: Prerequisites
Theorem 1.41 There exists a Turing machine TM for which the Halting Problem is
undecidable.
There are many problems about recursive sets which are undecidable, see, e.g.,
(Rozenberg and Salomaa [21]). For each predicate P which is RE but not recursive,
its negation ¬P is not RE. We complete this section with yet another example of a
set which is not RE, cf. Davis [14].
Theorem 1.42 The set of Gödel numbers of Turing machines T M whose functions
f T M are total is not recursively enumerable.
We now involve Gödel’s numbering into discussion and we assume that we have
infinitely many expressions, sentences and predicates and we enumerate all these
sets with infinitely many countably many Gödel’s numbers.
Hence, we denote by E n the expression E with gn(E) = n.
Now, we apply the Cantor diagonal argument.
Definition 1.59 (Diagonal expressions) For any expression E n , the diagonalization
of E n is the expression E n (n), where n = gn(E n ).For any predicate Q, Q n (n) is the
predicate Q n acting on its own Gödel number.
Definition 1.60 (Diagonal function) We define δ(n) = gn(E n (n)). δ is the diagonal
function.
Definition 1.61 (Diagonal sets) For any subset A ⊆ N, we denote by Aδ the set of
natural numbers n such that δ(n) ∈ A. In fact, Aδ = δ −1 (A).
Proof Let Q be the predicate which expresses the set (N \ P)δ and let n = gn(Q)
so Q(n) is true if and only if n ∈ (N \ P)δ . It also means that δ(n) ∈ N \ P.
As δ(n) ∈ P if and only if Q(n) is provable and δ(n) ∈ / P if and only if Q(n)
is not provable, it follows that Q(n) is true if and only if Q(n) is not provable. As
falsity of Q(n) excludes provability by assumption of regularity, we are left with the
conclusion that the sentence Q(n) is true but not provable.
Theorem 1.44 For a set A, if the set Aδ is expressible, then there exists a Gödel
sentence for A.
Proof Essentially, (i) is in need of a proof. Was the set (N \ G(T ))δ expressible,
there would exists a Gödel sentence for it, which would mean that the sentence
would be true if and only if its Gödel number would not be a Gödel number of any
true sentence. (ii) and (iii) follow immediately.
The upshot of the Tarski theorem is that in sufficiently strong systems the notion
of truth is not definable.
Finally, we address the Gödel incompleteness theorem in the general setting.
Definition 1.63 (Consistency) A system is consistent if no sentence is simultane-
ously provable and refutable, i.e., P ∩ R = ∅.
Theorem 1.46 (The Gödel incompleteness theorem) If R E G(F) and the set (N \
P)δ is expressible, then L(F) is incomplete.
Proof Under the same assumptions there exists a sentence which is true and not
provable. As it is true it is not refutable by the assumptions of correctness. Hence,
the system is incomplete.
1.8 Complexity
Proof The idea for constructing T M2 is simple: take a segment of length k · T (n) of
cells on the tape of T M2 and subdivide it into k sub-segments of length T (n) each.
Reproduce on the i − th segment the instantaneous descriptions of the i − th tape of
T M1 by marking the positions of heads and performing a double sweep to the right
and then back to the left; during the right sweep, read positions of heads and after
returning make the second forth and back sweep in order to change the instantaneous
descriptions to the new ones resulting from the instructions. This requires at least
4 · k · T (n)2 steps; if some movements are required for technical reasons, then a
small overhead is added.
Due to this result, we will stay with 1-tape TM’s as by this the polynomial com-
plexities will not be affected.
Complexity theory makes use of Bachmann’s notation Bachmann [25] for orders
of growth of functions from the set of natural numbers N into itself.
38 1 Introduction: Prerequisites
This convention means that constant coefficients are eliminated, for instance the
estimate for T M2 of 4 · k · T (n)2 is of T (n)2 shortly written down as (T (n)2 ).
Definition 1.67 (Complexity classes DTIME and P) We consider first the determin-
istic case when no two instructions of the machine have the common prefix, hence,
in each step of computation at most one instruction may be active.
We first consider languages that can be decided in polynomial time, i.e, the time
complexity function T (n) is bounded by a polynomial p(n) where n is the length
of the input. This case splits into sub-cases bound by polynomials of fixed degree.
Thus, classes DTIME(n k ) for each natural number k are introduced first.
We say that a TM decides a language L if and only if it computes the characteristic
function χ L (x) of L. We let (χ L (x) = 0) ≡ (x ∈ L): the value 0 of χ L (x) means
that the string x ∈ L, otherwise x is rejected.
The language L is in the class DTIME(n k ) if and only if χ L (x) can be decided
in time T (n) ≤ n k .
k
The union of classes DTIME(n ) is the class Pkof languages having deterministic
polynomial time complexity: P= k∈N DTIME(n ).
In the class P we find problems of sorting, graph problems like searching, find-
ing spanning trees, shortest paths etc. There are three issues related to classes of
complexity: reduction, hardness and completeness.
Definition 1.68 (Karp reducibility; X-hard, X-complete languages) We say that a
language L 1 is time-polynomially Karp reducible to the language L 2 if there exists
function f : {0, 1}∗ → {0, 1}∗ computable in polynomial time and such that for each
x ∈ {0, 1}∗ , x ∈ L 1 if and only if f (x) ∈ L 2 . This relation is denoted L 1 ≤ Kp L 2 .
Clearly, the relation ≤ Kp is reflexive and transitive as the composition of two poly-
nomials is a polynomial.
For a complexity class X , a language L is X -hard if each language L ∈ X is ≤ Kp
reducible to L; if in addition L ∈ X , then L is X -complete.
We describe a P-complete problem. We refer to the resolution in propositional
logic and we add that the unit resolution is a particular variant of resolution in which
1 ∨y2 ∨...∨yk
the resolution rule is the following: x,¬x∨y
y1 ∨y2 ∨...∨yk
, i.e., one of clauses is a singleton.
Then, ψ1 (x) is
∀i ∈ I.E{ai,q : q ∈ Q} ∧ ∀i ∈ I.E{bi, j : j ∈ J }∧
∀i ∈ I, j ∈ J.E{ci, j,a : a ∈ Γ },
∀n + m + 1 ≤ j ≤ 2n + 1.c1, j,B ,
The formula ψ4 (x) certifies that any change, be it state’s, head position’s, contents’
of the tape, can be effected only in accordance with an instruction. Let an instruction
be (q, a, b, m, q ), where m ∈ {−1, 0, +1} encodes the movement, respectively, to
the left, no move, to the right. Then, ψ4 (x) is
The formulaψ5 (x) describes the halting step: in it, the unit resolution has to derive
a p(|x|),q f from i ψi (x), hence, ψ5 (x) is
¬a p(|x|),q f .
Definition 1.70 (Classes L and NL) Class L is the class of languages which are
decided by a deterministic Turing machine in space bounded by logarithm of the
length of the input. Class NL is the class of languages which can be decided by a
1.8 Complexity 41
Proof Following (Stockmeyer and Meyer [28]) and (Arora and Barak [29]), we
consider a formula
: Q 1 x1 Q 2 x2 . . . Q n xn φ(x1 , x2 , . . . , xn ),
(ψi (x)(c1 , c2 )) ≡ (∃c.∀c , c .{[(c = c1 ) ∧ (c = c)] ∨ [(c = c) ∧ (c = c2 )]} ⊃
Then, size(ψi (x)) ≤ size(ψi−1 (x)) + 0(m). For ψm (x) which testifies about accept-
ing computation, this formula yields size(ψm (x)) ≤ O(m 2 ). Clearly, ψm (x) can be
converted in polynomial time to the prenex form.
Let us observe that in games of perfect information, like chess, hex or go, the
order of appearance of quantifiers codes the result of play. Suppose that the order is:
Q i is ∃ for i odd and it is ∀ for i even. This means that the first player has a winning
strategy in case the described QBF is true. Thus, the existence of winning strategy
is PSPACE-complete.
We now address relations among complexity classes.
Theorem 1.56 NDSPACE(f)⊆ k>0 DTIME(k f ).
Proof For an f-space bounded deterministic Turing machine TM and c > 0, choose a
natural number r such that f (n)
r
≤ c f˙(n). A machine TM1 simulating TM has alpha-
bet V ∪ V where V is the alphabet of TM, and, the set of states Q × {1, 2, . . . , r }
r
(we assume the one-tape TM for simplicity). Hence, TM1 can represent in a single
cell the content of r cells of TM.
Appropriately modified are IDs of TM. In consequence, DSPACE(f)⊆
DSPACE(c·f).
By symmetry, DSPACE(c·f)⊆ DSPACE( 1c · c· f)=DSPACE(f).
Finally, DSPACE(f)=DSPACE(c·f). In case of NDSPACE we follow along same
lines.
strings of length k and space f (|x|) + 1 cells for computation specified by a given
string. By Theorem 1.58, we can compress the space to f (n). This concludes the
proof of Theorem 1.57.
For PSPACE versus NPSPACE, we have the result due to Savitch [30].
Theorem 1.59 (The Savitch theorem) If the function s is space-constructible (mean-
ing that there exists a Turing machine that uses s(n) cells on input of length n and
s(n) ≥ logn), then NDSPACE(s)⊆ DSPACE(s 2 ).
Proof The idea for a proof is similar to one already used. Let TM be a non-
deterministic Turing machine that decides a language L of space-complexity s(n).
For x ∈ L, with |x| = n, the number of IDs of TM does not exceed 2 O(s(n)) . Deciding
x in deterministic fashion will mean that the accepting ID is reached from starting
ID in O(s(n)) steps.
Given two IDs, ID1 and ID2, the recurrence (I D1, I D2, i) ≡ (∃I D.(I D1, I D,
i − 1) ∧ (I D, I D2, i − 1)), where (I D1, I D2, i) means that ID2 is reached from
ID1 in at most 2i steps, requires finding ID. This is achieved by enumerating all ID’s
in O(s(n)) space and searching for an ID satisfying the recurrence.
At i = O(s(n)) the procedure stops and yields a path from starting ID to a final
ID, which results in deciding x. The space complexity of this procedure is given
by recurrence space(O(s(n)), i) = space(O(s(n)), i − 1) + O(s(n)) hence it is
O(s(n)2 ).
Corollary 1.5 (i) PSPACE=NPSPACE
(ii) L⊆ NL ⊆ P ⊆ NP ⊆ PSPACE = NPSPACE.
Definition 1.78 (Classes co-X, EXPTIME, NEXPTIME) The class co-X for a class
X consists of languages L which are of the form {0, 1}∗ \ L for L ∈ X. From the
logic point of view, the class co-NP is especially interesting as the language S AT
consists of unsatisfiable formulae but their negations are formulae which are valid
(are tautologies) and the language T AU T consisting of valid formulae is in co-NP.
One proves that TAUT is co-NP-complete.
2k
The class EXPTIME of exponential time is defined as k DTIME(2n ). Parallel
2 k
definition of NEXPTIME is k NDTIME(2n ). These classes are interestingly
related to classes with linear exponent in place of a polynomial one. The class E is
defined as DTIME(k n ), the class NE is NDTIME(k n ).
Theorem 1.60 Each language L in NEXPTIME reduces to a language L in NE.
For a proof, see Papadimitriou [31].
An example of NEXPTIME-complete problem is the Bernays - Schönfinkel-
Ramsey SAT(BSR) problem (cf. Ramsey [9]).
Definition 1.79 The SAT(BSR) problem: A formula φ of predicate logic is in BSR
form if it is in the prenex form
and the formula ψ contains only constant and predicate symbols without predicate
of identity.
The problem is: given a formula in this language decide whether it is satisfiable.
To this end, we have the following statement.
Theorem 1.61 Consider a formula φ in SAT(BSR) form with p constant symbols in
ψ. Then, the formula φ is satisfiable if and only if it has an interpretation with at
most m + p elements.
Proof We sketch the proof after Papadimitriou [31]. We may assume that a language
L in NE is decided by a non-deterministic Turing machine TM with two choices at
each step in time of 2n .
For each x ∈ L, the formula φ(x) in the SBR-SAT form is constructed as fol-
lows: the formula ψ(x), the matrix of φ(x) on 2n variables x1 , . . . , xn , y1 , . . . , yn is
quantified universally so
The burden is now on ψ(x). This formula is the conjunction of formulae specifying
computation of TM on x in the way we used for proof in case of completeness of
SAT and CNF-CONTRA-UR. For details, please see (Papadimitriou [31], 8.3).
p p
The polynomial hierarchy PH is the union i>0 Pii = Σi .
p p
It was shown in (Meyer and Stockmeyer [32]) that if for some i, Σi = Πi , then
p
PH= Σi .
Definition 1.81 (The problem SAT(Σi )) It consists in verification of satisfiability of
∃u 1 .∀u 2 . . . . Q i u i .ψ(u 1 , u 2 , . . . , u i ) = 1.
Some completeness proofs for logics are carried out in the algebraic setting, let us
mention here the proof by Chang of completeness of the infinite-valued logic of
Łukasiewicz or the Rasiowa-Sikorski algebraic approach to meta-theory of
logic (Rasiowa and Sikorski [33]). For this reason, we include a short introduction
to algebraic structures.
In this survey a most abstract rendering of notions and results about algebraic
structures is presented, which in some chapters that follow will be given in more
specialized contexts.
Definition 1.82 (Lattices) A set L partially ordered by a relation ≤ is a lattice if and
only if for each pair x, y ∈ L there exist the least upper bound x ∪ y and the greatest
lower bound x ∩ y, with the following properties:
(i) x ≤ x ∪ y;
(ii) y ≤ x ∪ y;
(iii) (x ≤ z) ∧ (y ≤ z) ⊃ (x ∪ y) ≤ z;
(iv) x ∩ y ≤ x;
(v) x ∩ y ≤ y;
(vi) (z ≤ x) ∧ (z ≤ y) ⊃ (z ≤ x ∩ y);
(vii) x ∪ y = y ∪ x;
(viii) x ∩ y = y ∩ x;
(ix) x ∪ (y ∪ z) = (x ∪ y) ∪ z;
(x) x ∩ (y ∩ z) = (x ∩ y) ∩ z;
(xi) (x ∪ y) ∩ x = x;
(xii) (x ∩ y) ∪ x = x;
(xiii) (x ≤ y) ≡ (x ∪ y = y);
(xiv) (x ≤ y) ≡ (x ∩ y = x);
(xv) (x ∪ y = y) ≡ (x ∩ y = x).
Lattices are related by homomorphisms.
48 1 Introduction: Prerequisites
{a : ∃x1 , x2 , . . . , xk ∈ A.a ≥ x1 ∩ x2 ∩ . . . ∩ xk }.
The dual statement for ideals replaces ≥ with ≤ and ∩ with ∪. If a lattice L contains
zero element 0, then by excluding 0 from filter in the filter definition, i.e., by adding
the condition 0 ∈/ F, we define a proper filter. Dually, the condition 1 ∈ / I defines
the proper ideal I . As any increasing chain of filters is a filter, it follows by the Zorn
maximal principle that
Theorem 1.66 In any lattice L containing 0, each proper filter is contained in a
maximal proper filter. Dually, in any lattice containing the unit 1, any proper ideal
is contained in a maximal proper ideal.
Definition 1.86 (Prime filters and prime ideals) A proper filter F is prime if from
x ∪ y ∈ F it follows that either x ∈ F or y ∈ F. A proper ideal is prime if from
x ∩ y ∈ I it follows that either x ∈ I or y ∈ I .
x ∪ (y ∩ z) = (x ∪ y) ∩ (x ∪ z)
Theorem 1.67 Suppose that the lattice L is distributive. Then each maximal filter
F (respectively, each maximal ideal I ) is prime.
Proof Suppose to the contrary that a maximal filter F is not prime. Then there exist
x, y ∈ L such that x ∪ y ∈ F but x ∈/ F and y ∈
/ F. Consider the filter
G = {z ∈ L : ∃u ∈ F.z ≥ x ∩ u}.
Then F ⊆ G and we have to check that the inclusion is proper and G is a proper
filter.
Claim. y ∈
/ G.
Indeed, were y ∈ G, we would have y ≥ x ∩ u for some u ∈ F; as x ∪ y ∈ F and
y ∪ u ∈ F we would have
y = (x ∩ u) ∪ y = (x ∪ y) ∩ (x ∪ y) ∈ F,
Dual proof in which we would replace ≤ with ≥ and ∪ with ∩ would prove the
part for ideals. We now state and prove the theorem on separation of elements in a
lattice by a prime filter, the fact of crucial importance for proofs of completeness of
various logics by algebraic tools.
The following separation theorem plays a decisive role in many proofs of com-
pleteness in the following chapters.
Theorem 1.68 (Filter separation theorem) Suppose that L is a distributive lattice
and x = y are elements of L such that it is not true that x ≤ y. Then there exists a
prime filter F such that x ∈ F and y ∈
/ F.
Proof Consider the set F of all filters on L which contain x and not contain y.
The principal filter F(x) ∈ F, hence, F = ∅. As any linearly ordered chain in F
has an upper bound, by the Zorn maximal principle there exists a maximal filter Fm
satisfying x ∈ Fm , y ∈
/ Fm .
Claim. The filter Fm is prime. Suppose to the contrary. We have u, v ∈ L with
u ∪ v ∈ Fm but u ∈ / Fm and v ∈/ Fm . Let Fu be the filter generated by {u} ∪ Fm , and,
Fv be the filter generated by {v} ∪ Fm .
Sub-claim. Either y ∈ / Fu or y ∈
/ Fv . Was y in Fu and in Fv , then we would have
q1 , q2 ∈ Fm with y ≥ u ∩ q1 and y ≥ v ∩ q2 , hence, for q = q1 ∩ q2 ∈ Fm we would
have y ≥ u ∩ q and y ≥ v ∩ q, hence,
y ≥ (u ∩ q) ∪ (v ∩ q) = (u ∪ v) ∩ q ∈ Fm ,
Definition 1.88 (Complements) Existence of zero or unit elements allows for intro-
duction of complements in a lattice L. For an element x ∈ L, if 1 ∈ L, then a ∪-
complement to x is the least element a ∈ L such that a ∪ x = 1; dually, if 0 ∈ L,
then a ∩-complement to x is the greatest element a ∈ L such that a ∩ x = 0. Ele-
ment a is the complement to x if it is simultaneously the ∩-complement and the
∪-complement. It is denoted by −x.
(iii) −(−x) = x;
(iv) −(x ∩ y) = −x ∪ −y;
(v) −(x ∪ y) = −x ∩ −y;
(vi) −0 = 1; −1 = 0.
Proof Suppose that x ∩ y = 0; then
y = y ∩ (x ∪ a) = (y ∩ x) ∪ (y ∩ a) = y ∩ a
implying that y ≤ a which shows that a is the ∩-complement to x. Dually, one proves
that from x ∪ y = 1 it follows that y ≥ a, hence, a is the ∪-complement to y. Finally,
it shows that a is the complement to x.
Suppose that x ≤ y. Then x ∩ −y = (x ∩ y) ∩ −y=0, i.e, −y ≤ −x. If −x is the
complement to x, then x ∪ −x = 1, x ∩ −x = 0, i.e., x is the complement to −x,
i.e., −(−x) = x.
We have
and
From the last two facts, we deduce that −(x ∪ y) = −x ∩ −y. The claims fourth and
fifth follow by duality. The last claim is obvious as 1 ∩ 0 = 0, 1 ∪ 0 = 1.
The ∩-complement is also called the pseudo-complement.
Definition 1.89 (Relative pseudo-complement) A relative variant of the pseudo-
complement is the pseudo-complement of x relative to y defined as the greatest
element a such that x ∩ a ≤ y, denoted x ⇒ y and called the relative pseudo-
complement. We will dwell on it awhile because of its role in many-valued logics.
We have the fundamental duality
(x ⇒ y ≥ z) ≡ (z ∩ x ≤ y).
Theorem 1.70 The following are among properties of the relative pseudo-
complement:
(i) x ⇒ y ≥ y;
(ii) x ≤ y if and only if x ⇒ y = 1;
(iii) 1 ⇒ y = y;
(iv) −x = x ⇒ 0.
All these properties follow in a straightforward way from definitions.
Theorem 1.71 If in a distributive lattice there exists the complement −x of x, then
x ⇒ y = −x ∪ y for each y.
52 1 Introduction: Prerequisites
(x ≤ F y) ≡ (x ⇒ y ∈ F).
is an equivalence relation and we denote its classes by [x] F and the quotient space by
the symbol L/ ≡ F . The quotient space is an ordered lattice by the relation [x] F ≤ [y] F
if and only if x ⇒ y ∈ F.
x ⇒ x ∪ y = 1, y ⇒ x ∪ y = 1,
Proof Concerning maximal filters, by Theorem 1.75, for a maximal filter F, given
x ∈ L, the filter G(F, x) extends F as a proper filter if and only if −x ∈
/ F and then
it coincides with F. Hence, a maximal filter F contains x or −x for each element
x ∈ L. From this fact it follows that for each x ∈ L, either [x] F = 1 (if x ∈ F ) or
[−x] F = −[x] F = 1 (if −x ∈ F), hence, [x] F = 0; thus the quotient L/ ≡ F contains
exactly two elements 0 and 1.
Dually, all properties of filters are true for ideals; in particular, for each element
x = 1 there exists a maximal ideal I such that x ∈ I .
Definition 1.93 (Boolean algebras) A Boolean algebra is a distributive lattice in
which every element x has the complement −x satisfying properties x ∪ −x = 1,
x ∩ −x = 0. The new construct is the difference of elements defined as x − y =
x ∩ −y. The relative complement ⇒ satisfies the formula x ⇒ y = −x ∪ y.
An example of a Boolean algebra is the two-element algebra L/ ≡ F defined in
Theorem 1.76.
Theorem 1.77 The operations in the algebra L/ ≡ F are as follows:
(i) 0 = 0 ∪ 0 = 0 ∩ 0 = 0 ∩ 1 = 1 ∩ 0 = 1 ⇒ 0 = −1;
(ii) 1 = 0 ∪ 1 = 1 ∪ 0 = 1 ∪ 1 = 1 ∩ 1 = 0 ⇒ 0 = 0 ⇒ 1 = 1 ⇒ 1 = −0.
The reader will find in (Rasiowa and Sikorski [33]) an extensive and deep discus-
sion of the topics in this section.
The role played by topology in certain realms of logic calls for an introduction
of basic notions and results into this chapter; for more information, please consult
Kelley [7].
Definition 1.95 (Topological structures) A topological structure is a pair (Ω, O),
where Ω is a non-empty set and O is a family of subsets of Ω which satisfies the
following conditions:
(i) O is closed on finite intersections;
(ii) O is closed on arbitrary unions.
In particular, the empty set and Ω are in O. We will denote open sets with symbols
F, G, H, ...
Definition 1.96 (Open and closed sets)
A set X ⊆ Ω is open of and only if X ∈ O. A set Y is closed if and only if the
set X = Ω \ Y is open. It follows by Definition 1.95 (i), (ii) that the collection C of
closed sets satisfies the following conditions:
(i) C is closed on arbitrary intersections;
(ii) C is closed on finite unions.
Closed sets will be denoted with symbols K , P, Q, ....
Definition 1.97 label1.10.3(Neighborhoods, interiors, closures) For a thing x ∈ Ω,
an open neighborhood is an open set G such that x ∈ G. A neighborhood of x is a
set X such that there exists an open set G with properties: x ∈ G ⊆ X .
56 1 Introduction: Prerequisites
By the Zorn maximal principle, each filter is a subset of a maximal filter, called an
ultrafilter.
Definition 1.102 (Compactness)
An open covering of Ω is a family C of open sets
with the property that C = Ω; a space (Ω, O) is compact if each open covering
of it contains a finite sub-family which is an open covering.
Definition 1.103 (Centered families. Limit and cluster points) A family of sets is
centered if and only if each finite sub-family has a non-empty intersection. An element
x is a limit point of a filter F if and only if each neighborhood of x is an element of
F. An element x is a cluster point of F if and only if x is in closure of each element
of F.
Theorem 1.83 (i) A space τ is compact if and only if each centered family of closed
sets has a non-empty intersection;
(ii) A space τ is compact if and only if each filter has a cluster point;
(iii) A space τ is compact if and only if each ultrafilter has a limit point.
Proof It suffices to verify that for an ultrafilter F, if xs is a limit point of the ultrafilter
Fs for s ∈ S, then (xs )s∈S is a limit point of F.
58 1 Introduction: Prerequisites
Metric spaces are present in many reasoning schemes, we will find them in Gaif-
man’s graphs in Chap. 8.
Definition 1.105 A metric on a set Ω is a function δ : X × X → R1 such that
(i) δ(x, y) ≥ 0; (δ(x, y) = 0) ≡ (x = y);
(ii) δ(x, y) = δ(y, x);
(iii) δ(x, y) ≤ δ(x, z) + δ(z, y).
Definition 1.106 (Limit and cluster points) A set X endowed with a metric δ is a
metric space. For x ∈ X and r > 0, an open ball B(x, r ) = {y : δ(x, y) < r }.
We now return to the Stone theory (Stone [34]) in its topological aspect.
Theorem 1.86 (The Stone topology) Suppose that a lattice L is a Boolean algebra.
The Stone set F(L) is a compact totally disconnected Hausdorff (T2 ) topological
space. Each element of the Stone set lattice St (L) is open-and-closed and St (L) is
a Boolean algebra (a field of sets).
m
h(∪i=1 ai ) = h(1), hence, ∪i=1 m
ai = 1. Denote by J the ideal generated by the col-
/ J , J is proper, hence, J extends to J ∗ -a maximal
lection {a1 , a2 , . . . , am }. Then, 1 ∈
ideal, hence, prime, and the collection {a : a ∈ / J ∗ } is a prime filter F ∗ , and it fol-
lows by arbitrariness of the selected collection that no a ∈ L is an element of F ∗ , a
contradiction. Hence, F(L) is compact.
As h(a) ∪ h(−a) = F(L), and, h(a) ∩ h(−a) = ∅, each set h(a) is closed-and-
open, hence F(L) is totally disconnected. That F(L) is a Hausdorff space (T2 ),
follows by the same fact: any two distinct filters F1 , F2 point to some a ∈ L which
is an element in one of them only, then, h(a) contains one of filters, say, F1 , and,
h(−a) contains F2 .
A Boolean algebra is complete if and only if each subset has the least upper bound.
References
1. Knaster, B., Tarski, A.: Un théorème sur fonctions d’ensembles. Ann. Soc. Polon. Math. 6,
133–4 (1928)
2. Zermelo, E.: Beweis dass jede Menge wohlgeordnet werden kann. Math. Ann. 59, 514–516
(1904)
3. Zorn, M.: A remark on method in transfinite algebra. Bull. Am. Math. Soc. 41, 667–670 (1915)
4. Kuratowski, C.: Une méthode d’ élimination des nombres transfinis des raisonnement mathé-
matiques. Fund. Math. 3, 89 (1922)
5. Hausdorff, F.: Grundzüge der Mengenlehre, Leipzig (1914)
6. Tukey, J.: Convergence and uniformity in topology. Ann. Math. Stud. 2 (1940)
7. Kelley, J.L.: General Topology. Springer, New York (1991). (reprint of Van Nostrand (1955))
8. König, D.: Über eine Schlussweise aus dem Endlichen ins Unendliche. Acta Litt. ac.sci.Hung.
Fran. Josephinae, Sect. Sci. Math. 3, 121–130 (2927)
9. Ramsey, F.P.: On a problem of formal logic. Proc. Lond. Math. Soc. 30, 264–286 (1930). (2nd.
ser.)
10. Salomaa, A.: Formal Languages. Academic Press, New York (1973)
11. Büchi, J.R.: Weak second-order arithmetic and finite automata. Z. Math. Logik und Grundl.
Math. 6, 66–92 (1960)
12. Landweber, C.H.: Decision problems for ω-automata. Math. Syst. Theory 3, 376–385 (1969)
13. Turing, A.M.: On computable numbers, with an application to the Entscheidungsproblem. Proc.
Lond. Math. Soc. 2(42), 230–265 (1937)
14. Davis, M.: Computability and Unsolvability. McGraw-Hill Book Co., New York (1958)
15. Radó, T.: On non-computable function. Bell Syst. Tech. J. 41(3), 877–884 (1962)
16. Aaronson, S.: The BB frontier. www.scottaaronson.com//papers//bb.pdf
17. Kropitz, P.: Busy Beaver problem. B.Sc Thesis. University Karlova, Prague (2011).
https://is.cuni.cz//webappa//zzp//detail//49210
60 1 Introduction: Prerequisites
18. Yedidia, A., Aaronson, S.: A relatively small Turing machine whose behavior is independent
of set theory. Complex Syst. 25(4) (2016)
19. Kleene, S.C.: Recursive predicates and quantifiers. Trans. Am. Math. Soc. 53, 41–73 (1943)
20. Kleene, S.C.: Introduction to Metamathematics. Van Nostrand, Princeton NJ (1952)
21. Rozenberg, G., Salomaa,A.: Cornerstones of Undecidability. Prentice Hall (1994)
22. Gödel, K.: Über formal unentscheidbare Sätze der Principia Mathematica und Verwandter
Systeme 1. Monatshefte für Mathematik und Physics 38, 173–188 (1931)
23. Tarski, A.: Der Wahrheitsbegriff in den formalisierten Sprachen, Studia Philos. 1, 261–405
(1936). (also in Eng. transl.: Logic, Semantics, Metamathematics. Oxford University Press,
New York (1956))
24. Smullyan, R.M.: Gödel’s Incompleteness Theorems. Oxford Logic Guides. Oxford University
Press, New York-Oxford (1992)
25. Bachmann, P.: Zahlentheorie. Zweiter Teil: Die Analytische Zahlentheorie. Teubner, Leipzig
(1894)
26. Cook, S.A.: The complexity of theorem proving procedures. In: Proceedings of 3rd Annual
ACM Symposium on Theory of Computing, pp. 151–158. ACM (1971)
27. Levin, A.: Universal sequential search problems. Problems Inf. Transm. 9 (1973)
28. Stockmeyer, L., Meyer, A.R.: Word problems requiring exponential time. In: STOC, pp. 1–9.
ACM (1973)
29. Arora, S., Barak, B.: Computational Complexity. Cambridge University Press, Cambridge UK
(2009)
30. Savitch, W.J.: Relationships between nondeterministic and deterministic tape complexities. J.
Comput. Syst. Sci. 4, 177–19 (1970)
31. Papadimitriou, C.: Computational Complexity, 2nd edn. Longman, Reading MA (1995)
32. Meyer, A.R., Stockmeyer, L.: The equivalence problem for regular expressions with squaring
requires exponential time. In: FOCS, pp. 125–129. IEEE (1972)
33. Rasiowa, H., Sikorski, R.: The Mathematics of Metamathematics. PWN-Polish Scientific Pub-
lishers, Warszawa (1963)
34. Stone, M.H.: The theory of representations for Boolean algebras. Trans. Am. Math. Soc. 40,
37–111 (1936)
35. Tychonoff, A.: Über die topologische Erweiterung von Räumen. Math. Ann. 102, 544–561
(1929)
Chapter 2
Sentential Logic (SL)
(ca. 336-246 B.C.E.) founded the Stoic School (Stoa Poikile (the Painted Gate) was
the site for their meetings). Stoics, principally their member Chrysippus of Soloi (ca.
281-205 B.C.E.) created a system of sentential logic in which they discerned among
sentential connectives of disjunction ’or’ (though Chrysippus understood disjunction
as the exclusive disjunction, which bears on the form and meaning of Moods 4 and 5,
below), conjunction ’and’, negation ’it is not the case that ...’, in addition to already
constructed implication ‘if ..., then ...’, they introduced and they built a deductive
system based on five ’indemonstrables’ and four ’themata’. They represented logical
arguments as ’moods’ i.e., sets of numbered terms representing statements either
true or false. They had been:
Mood 1. If 1st, 2nd; but 1st; therefore 2nd.
Mood 2. If 1st, 2nd; but not 2nd; therefore not 1st.
Mood 3. Not 1st and 2nd; but 1st; therefore not 2nd.
Mood 4. 1st or 2nd; but 1st; therefore not 2nd.
Mood 5. 1st or 2nd; but not 2nd; therefore 1st.
Mood 1 is Modus Ponens (detachment), Mood 2 is Modus Tollens. In addition four
themata were used to reduce complex statements to one of five indemonstrables. In
this way, Stoics created a deduction system, in modern times proposed by Gottlob
Frege (Bocheński [2], Bobzien [3], Łukasiewicz [5]). Let us complete this succint
account with the words from (Bocheński [2], p.5): ‘the leading Megaricians and
Stoics are among the greatest thinkers in Logic’.
An expression of SL is any word over A. Some expressions are not meaningful like
pq∨ etc., therefore, we single out well formed expressions denoted wff’s (standing
for well-formed formulae) defined recursively.
By rules (i)-(iii) in Definition 2.2, and by Definition 2.3, all formulae involving con-
nectives of Definition 2.3 and are defined by means of wffs, hence, they are wffs.
Theorem 2.1 By conditions of Definitions 2.2 and of 2.3, the following list consists
of wf formulae:
(1) ( p ⊃ q) ⊃ [(q ⊃ r ) ⊃ ( p ⊃ r )];
(2) p ⊃ p;
(3) p ⊃ (q ⊃ p);
(4) p ⊃ (q ⊃ p ∧ q);
(5) [ p ⊃ (q ⊃ r )] ⊃ [q ⊃ ( p ⊃ r )];
(6) [ p ⊃ (q ⊃ r )] ⊃ [( p ⊃ q) ⊃ ( p ⊃ r )];
(7) p ⊃ ¬¬ p;
(8) (¬¬ p) ⊃ p;
(9) p ⊃ p ∨ q;
(10) q ⊃ p ∨ q;
(11) ( p ∧ q) ⊃ p;
(12) ( p ∧ q) ⊃ q;
(13) [( p ⊃ r ) ⊃ (q ⊃ r )] ⊃ [( p ∨ q) ⊃ r ];
(14) [ p ⊃ (q ⊃ r )] ⊃ ( p ∧ q ⊃ r );
(15) ( p ∧ q ⊃ r ) ⊃ [ p ⊃ (q ⊃ r )];
(16) ( p ∧ ¬ p) ⊃ q;
(17) p ∨ ¬ p;
(18) [ p ⊃ ( p ∧ ¬ p)] ⊃ ¬ p;
(19) ¬( p ∧ ¬ p);
(20) ( p ⊃ q) ⊃ (¬ p ∨ q);
(21) (¬ p ∨ q) ⊃ ( p ⊃ q);
(22) ( p ⊃ q) ⊃ (¬q ⊃ ¬ p);
(23) (¬q ⊃ ¬ p) ⊃ ( p ⊃ q);
(24) ( p ⊃ ¬q) ⊃ (q ⊃ ¬ p);
(25) (¬ p ⊃ q) ⊃ (¬q ⊃ p);
(26) [( p ⊃ q) ⊃ p] ⊃ p;
(27) ¬( p ∨ q) ⊃ (¬ p ∧ ¬q);
64 2 Sentential Logic (SL)
Some formulae in this list bear historic names: (27)–(30) are DeMorgan laws, (17)
is the law of excluded middle, (22) is the law of contradiction, (31)–(34) are laws of
distribution, (1) is transitivity of implication (the hypothetical syllogism), (16) is the
Duns Scotus formula.
For instance, the set {⊃, ¬} is minimal; if we accept ⊥, then ¬φ can be defined
as φ ⊃ ⊥, and the set ⊃, ⊥ is minimal. Other minimal sets are {∨, ¬}, {∧, ¬}.
Indeed, from the set {∨, ¬}, we obtain the following definitions:
(i) p ∧ q is ¬(¬ p ∨ ¬q);
(ii) p ⊃ q is ¬ p ∨ q;
(iii) p ≡ q is (¬ p ∨ q) ∧ (¬q ∨ p) is ¬[¬(¬ p ∨ q) ∨ ¬(¬q ∨ p)].
For the set {∧, ¬}, the definitions are the following:
(i) p ∨ q is ¬(¬ p ∧ ¬q);
(ii) p ⊃ q is ¬( p ∧ ¬q);
(iii) p ≡ q is [¬( p ∧ ¬q)] ∧ [¬(q ∧ ¬ p)].
Minimality of the set {⊃, ¬} was shown in Definition 2.3. If we define ¬ p as
p ⊃ ⊥, then we may use this definition for the set {⊃, ¬} to obtain
(i) ¬ p is p ⊃ ⊥;
(ii) p ∨ q is ( p ⊃ ⊥) ⊃ q;
(iii) p ∧ q is (( p ⊃ ⊥) ⊃ ⊥) ⊃ (q ⊃ ⊥).
We have deliberately left ≡ off.
Definition 2.5 (Other connectives. Sheffer’s stroke, Peirce’s arrow) These two con-
nectives have the property that each of them defines all 16 Boolean functions of two
variables.
(i) ¬ p is p Dp;
(ii) p ⊃ q is p D( p Dq).
Having ⊃ and ¬ defined in terms of D, we can use Definition 2.3 in order to express
∨, ∧, ≡ in terms of D.
The Peirce arrow ↓ (denoted also NOR, ‘logical OR’) is expressed in terms of D
as: p ↓ q is ¬(¬ p D¬q), hence,
(i) ¬ p is p ↓ p;
(ii) p ⊃ q is [( p ↓ p) ↓ q] ↓ [( p ↓ p) ↓ q)];
(iii) p ∨ q is ( p ↓ q) ↓ ( p ↓ q)];
(iv) p ∧ q is ( p ↓ p) ↓ (q ↓ q).
This procedure shows that the truth function for the formula φ at the root of tree is
actually the composition of truth functions of sub-formulae composed according to
the pattern of the formation tree. Labelling allows to bypass this task by the reverse
process of walking the tree bottom-up. This is an example of structural induction:
inferring that a formula φ satisfies a property P from the fact that P is satisfied by
sub-formulae of φ.
Yet another characteristics of a formula is its size.
Definition 2.10 (The size of a formula)
The size of a formula, si ze(φ), is defined by structural induction as follows,
(i) si ze( p) = 0;
(ii) si ze(¬φ) = 1 + si ze(φ);
(iii) si ze(φ ◦ ψ) = si ze(φ) + si ze(ψ) + 1;
(iv) |Sub(φ)| ≤ 2si ze(φ) .
It is easy to realize that si ze(φ) is the number of occurrences of connectives in
φ. As each sub-formula takes a subset of these connectives, we obtain the inequality
(iv).
Definition 2.11 (Validity, satisfiability, unsatisfiability)
We denote by the symbol A∗ (φ, A) the value of the truth function A∗ (φ) under
assignment A. In case A∗ (φ, A) = 1, we say that φ is satisfied by A. A formula φ
is valid (is a tautology) if and only if it is satisfied by each assignment A. A formula
φ is unsatisfiable if and only if the formula ¬φ is valid. A formula φ is satisfiable if
and only if there exists an assignment by which the formula φ is satisfied.
Definition 2.12 (Truth tables)
A truth table for a formula φ is a tabular form of the formation tree: for each assign-
ment A, we compute values of sub-formulae by structural induction and place them
in the table under appropriate headings. A formula is valid when the column headed
by the formula contains only values equal to 1.
68 2 Sentential Logic (SL)
φ : ( p ⊃ q) ⊃ [(q ⊃ r ) ⊃ ( p ⊃ r )].
It follows that φ is valid. One may check that formulae listed above as (1)-(36)
are valid.
Definition 2.13 (Models. Logical consequence)
For a formula φ, an assignment A such that A∗ (φ, A) = 1 determines a model for φ,
we may write this fact down as A |= φ. This notion extends to sets of formulae. For
a set Γ of formulae, we write A |= Γ if and only if A∗ (φ, A) = 1 for each formula
φ ∈ Γ.
We say that a formula φ is a logical consequence of a set Γ of formulae if and only
if for each assignment A, if A |= Γ , then A |= φ. We express this fact of logical
consequence with the formula Γ |= φ.
Much more important are the conjunctive normal form (CNF) and the disjunctive
normal form (DNF).
Correctness of the algorithm follows from the fact that, by virtue of the construc-
tion of DNF(φ), φ and DNF(φ) are semantically equivalent.
As for CNF, we have two possibilities.
Algorithm (B1) which returns CNF of a formula
1 Apply algorithm (A) to the formula ¬φ to obtain DNF(¬φ)
2 Negate the formula DNF(¬φ) and obtain ¬(DNF(¬φ)) which is CNF(φ)
n 1 Write truth table for the given formula φ; if φ( p1 , p2 , . . . , pn ) is valid, then write the formula
i=1 ( pi ∨ ¬ pi ) and return it as CNF(φ)
2 For each assignment A with value 0 for φ, form the disjunction of literals: if a sentential
variable p has the value 1 under A insert into the disjunction the literal ¬ p, otherwise insert p
3 Form the conjunction of obtained disjunctions
4 Return the obtained CNF(φ)
2 ( p ⊃ (q ⊃ r )) ⊃ [( p ⊃ q) ⊃ ( p ⊃ r )];
3 (¬q ⊃ ¬ p) ⊃ [(¬q ⊃ p) ⊃ q)].
In Church [8], a system P1 is discussed, among other systems, whose axiom schemes
involve falsum ⊥:
1 p ⊃ (q ⊃ p);
2 [ p ⊃ (q ⊃ r )] ⊃ [( p ⊃ q) ⊃ ( p ⊃ r )].
3 [( p ⊃ ⊥) ⊃ ⊥] ⊃ p.
Two extremes in this area are the single axiom scheme in Meredith [9]:
((((( p ⊃ q) ⊃ (¬r ⊃ ¬s)) ⊃ r ) ⊃ u) ⊃ ((u ⊃ p) ⊃ (s ⊃ p)))
(cf. a discussion of organic schemata in (Łukasiewicz and Tarski [10])), and a
proposition by Herbrand to accept all valid formulae as axiom schemes. This proposal
would eradicate syntactic considerations: rules of inference, provability problems,
and large part of metatheory.
We adopt in the sequel the Łukasiewicz system Łukasiewicz [11].
Definition 2.21 (The Łukasiewicz axiom schemes)
(L1) ( p ⊃ q) ⊃ [(q ⊃ r ) ⊃ ( p ⊃ r )] (hypothetical syllogism);
(L2) (¬ p ⊃ p) ⊃ p;
(L3) ( p ⊃ (¬ p ⊃ q)) (the Duns Scotus formula).
A set of axiom schemes is one ingredient of a deductive system, the other is a set of
rules of inference, which are symbolic valued functions on sets of formulae producing
new formulae; some systems like Hilbert’s or Kleene’s apply the detachment rule
solely, the first Hilbert system admits substitution, other like (Łukasiewicz’s (L1)-
(L3)) use also the substitution rule along with the replacement rule. We define these
rules formally.
Definition 2.22 (Rules of inference)
(MP) the rule of detachment (Modus Ponens (MP)): (MP) is exactly Mood 1 of the
Stoic logic. It is written now in the following form
p, p ⊃ q
,
q
(∗) Γ ψ ⊃ ψi .
and
( f ) Γ ψ ⊃ (ψm ⊃ ψ j )
(ψ ⊃ (ψm ⊃ ψ j )) ⊃ ((ψ ⊃ ψm ) ⊃ (ψ ⊃ ψ j ))
Using Lemma 2.1 and Definition 2.21 along with detachment, we can obtain the
deduction theorem in the following form.
n
Theorem 2.7 If γ1 , γ2 , . . . , γn φ, then i=1 γi ⊃ φ.
Now, we allow ourselves a bit of digression.
Definition 2.26 (The Polish notation)
This notation, introduced by Jan Łukasiewicz around 1922, called also the prefix
notation, writes down formulae by prefixing arguments with operators, e.g., the for-
mula p ⊃ q is written as C pq (C was the symbol applied for implication); similarly,
negation was written as N p (here, of course, the prefix notation and standard notation
coincide except for the symbol).
For example, the axiom schema (L1) would be written as CC pqCCqrC pr (notice
that the symbol C always acts on two succeeding groups of symbols or single
symbols). The Polish notation and its dual, the Reverse Polish notation, prompted
the introduction of the stack data structure.
Definition 2.27 (Logical matrices)
Invented independently by few authors beginning with C. S. Peirce, among them
Bernays [14] and Łukasiewicz (some authors point also at Post and Wittgenstein),
logical matrices have been used to ascertain the independence of axiomatic schemes
in the sense that no instance of a scheme can be derived from other axiom schemes
by rules of inference. We explain the usage of those matrices with an example in
Łukasiewicz [11].
Consider a matrix which is a specially designed truth table for C that is, ⊃ and N
that is ¬:
We may look at this matrix as a multiplication table, e.g., C12 = 0, C20 = 1.
If we compute the value of (L1) for p = 2, q = 0, r = 2, we obtain the result
CC20CC02C22 = 0, while for (L2) and (L3), any substitution of values yields
the result 1 (Table 2.4).
It remains to notice that the result of computations is invariant under rules of
inference, hence, axiom scheme (L1) is independent of (L2)+(L3).
Definition 2.28 (The Lindenbaum-Tarski algebra)
By deduction theorem, the provable formula p ⊃ p, and, the hypothetical syllogism
(L1), p ⊃ q, q ⊃ r p ⊃ r , it follows that the relation p ∼ q if and only if p ⊃ q
and q ⊃ p are provable is an equivalence relation on the theory T of wffs.
Proof First, we verify the lattice structure: that [φ ∨ ψ]∼ is the join φ]∼ ∪ [ψ]∼
follows from provability of formulae:
(1) ( p ⊃ p ∨ q);
(2) (q ⊃ p ∨ q);
(3) ( p ⊃ r ) ⊃ ((q ⊃ r ) ⊃ (( p ∨ q) ⊃ r ))).
Similarly, [φ]∼ ∩ [ψ]∼ is [φ ∧ ψ]∼ due to provability of formulae:
(4) p ∧ q ⊃ p;
(5) p ∧ q ⊃ q;
(6) (( p ⊃ q) ⊃ (( p ⊃ r ) ⊃ ( p ⊃ q ∧ r ))).
We introduce into the lattice T / ∼ the relative pseudo-complementation ⇒
defined as [φ]∼ ⇒ [ψ]∼ is [φ ⊃ ψ]∼ due to provability of formulae
(7) (( p ⊃ (q ⊃ r )) ⊃ (( p ∧ q) ⊃ r ));
(8) ((( p ∧ q) ⊃ r ) ⊃ ( p ⊃ (q ⊃ r )));
The existence of the complement − is secured by the provable formulae:
(9) p ∧ ¬ p ⊃ q;
(10) (( p ⊃ ( p ∧ ¬ p)) ⊃ p).
By (9), [ p ∧ ¬ p]∼ is the element zero 0. By (10), −[φ]∼ = [φ]∼ ⇒ [φ ∧ ¬φ]∼ =
[φ ⊃ (φ ∧ ¬φ)]∼ = [¬φ]∼ .
Finally, the unit element 1 is provided by provable formula p ∨ ¬ p which implies
[φ]∼ ∪ [¬φ]∼ = 1.
φ : ( p ⊃ q) ⊃ [(q ⊃ r ) ⊃ ( p ⊃ r )],
we could argue as follows: φ may be false only if truth value of the antecedent p ⊃ q
is 1, i.e, when the truth value of p is 0 or truth value of p is 1 and truth value of q is
1. In the first case, truth value of p ⊃ r is 1 which makes the consequent true and φ
valid. In the second case, truth value of the consequent is decided by truth value of
r ; but regardless whether r is valued 0 or 1, the consequent is true and φ is valid.
Such informal ways of estimating validity prompted Jan Łukasiewicz to pose at
the seminar in Warsaw University in 1926 the problem of formalization of ‘natural
deduction’. Solutions were proposed by Jaśkowski (Jaśkowski [16, 17]) and Gentzen
[18]).
We begin with the Gentzen sequent calculus for sentential logic.
Theorem 2.9 A sequent Γ ⇒ Δ is valid if and only if either there exists an invalid
formula in Γ or there exists a valid formula in Δ.
There are many variants of the Gentzen sequent calculus, the original Gentzen cal-
culus LK, the variant K of Ketonen (see Indrzejczak [19]), the systems G, G∗, G 1 , G 2
(see Smullyan [20]), diagrams of (Rasiowa and Sikorski [15]), among others. We
will discuss the system K.
Theorem 2.10 Each rule of the sequent system K is valid in the sense that validity
of the antecedent implies validity of the consequent.
Proof We give a pattern for the proof, all other rules are checked along similar lines.
For (left ¬): suppose the sequent Γ ⇒ Δ, φ is valid. Then, either a formula in Γ is
invalid in which case the consequent ¬φ, Γ ⇒ Δ is valid, or, a formula in the set
Δ ∪ {φ} is valid, in which case, either φ is valid, and then ¬φ is invalid which makes
the consequent valid, or, a formula in Δ is valid which again makes the consequent
valid. This pattern holds as well for rules with two antecedents.
1 p ⇒ q, p p, q ⇒ p
2 p, p ⊃ q ⇒ q by applying (left ⊃) to 1
3 p ⊃ q ⇒ q, ¬ p by applying (right ¬) to 2
4 p ⊃ q, ¬q ⇒ ¬ p by applying (left ¬) to 3
5 p ⊃ q ⇒ ¬q ⊃ ¬ p by applying (right ⊃) to 4
6 ⇒ ( p ⊃ q) ⊃ [(¬q) ⊃ ¬ p] by applying (right ⊃) to 5.
We add a proof of the formula ( p ⊃ q) ⊃ ((¬ p) ∨ q).
1 p ⇒ q, p p ⇒ q, p
2 p, p ⊃ q ⇒ q
3 p ⊃ q ⇒ ¬ p, q
4 p ⊃ q ⇒ (¬ p ∨ q)
5 ⇒ ( p ⊃ q) ⊃ [(¬ p) ∨ q].
That sequent calculus is sound follows from validity of sequent rules and of
validity of axioms. Completeness of sequent calculus will be proved in Sect. 2.8.
We also include a variant of Gentzen system due to (Rasiowa and Sikorski [15])
in which implication is replaced by its equivalent (¬ p) ∨ q.
Theorem 2.11 A formula φ is valid if and only if the tree of decomposition is finite
and all leaf sequences (leaf clauses) in the decomposition of φ are valid.
Proof It is easy to grasp that as decomposition rules are defined by valid equiva-
lences, the formula φ is equivalent to the conjunction of end clauses. Hence, validity
of φ implies validity of all leaf clauses and an upper bound on the height of the tree:
suppose not, and let the tree contain branches of any height. Then, by the König
Theorem 1.15, there exists an infinite branch B. Branch B cannot contain any pair of
contradictory literals because in that case, after the appearance of a complementary
literal making a contradictory pair, the branch would end by the validity condition
for a leaf sequence. It follows that the branch B contains for each literal either only
non-negated or only negated occurrences. But then B would be not valid and the
formula φ would be not valid, a contradiction which proves the finiteness of the tree.
The converse is obvious.
Corollary 2.1 The set of valid formulae of SL is the least set containing all valid
clauses and closed on the decomposition rules.
Theorem 2.12 (a form of completeness theorem for SL) Each valid clause is prov-
able. If a formula φ is valid, then its semantically equivalent CNF is provable.
Yet another offspring of the Gentzen sequent calculus is the method of tableaux
(Beth [21], Smullyan [20]).
2.8 Tableaux 81
2.8 Tableaux
Tableaux realize in similar but distinct form the idea of natural deduction of
Jaśkowski-Gentzen. A tableau is a tree with the given formula φ at the root. In
the subsequent steps, the formula is decomposed in a manner of Definition 2.9. The
difference is that formulae are signed, i.e., prefixed with the symbol T or F, meaning
valid or invalid. Depending on the sign, decomposition takes distinct forms. We con-
tinue with our convention of denoting disjunction with ‘, and conjunction with ‘; .
Tableaux we discuss are called analytic in Smullyan [20] (this name is given tableaux
also in Fitting [22] in distinction to semantic tableaux in Beth [21]). Analyticity of
tableaux means that no external formulae are allowed in the decomposition process
contrary to semantic tableaux of Beth in which such intervention is allowed.
T ( p ∨ q) F( p ∧ q) T ( p ⊃ q)
2
T p, T q F p, Fq F p, T q
T (¬ p) F¬ p
3
Fp Tp
The explanation for schemes is in the following: (1) collects decomposition rules
in which components are related by conjunction (rules of type α); (2) collects decom-
position rules in which components are related by disjunction (rules of type β); (3)
concerns negation. The graphic presentation of rules (1)–(3) is shown in Fig. 2.3.
Tableaux are built recursively from the root. Suppose the process of building the
tableau has reached a node N . We consider the path π(N ) from the root to N . Then
we can extend the path π(N ) if on the path π(N ) before N there is a formula to be
decomposed; if the formula is of type (α), with α1 and α2 as imminent sub-formulae,
then we extend the path π(N ) by adding α1 and then α2 to the path π(N ) so we
obtain the path π(N ) - α1 - α2 .
In case the formula is of type (β), with imminent sub-formulae β1 ,β2 forming
disjunction, the path π(N ) splits into two paths, on one the successor to N is β1 , on
the other the successor to N is β2 . This, clearly, realizes the distributive law. Like in
the diagrammatic method, we obtain a branching tree. A branch is closed (marked
X) when one finds on it a formula along with its negation, so conjunction of formulae
on the branch is unsatisfiable. Otherwise, the branch is open.
82 2 Sentential Logic (SL)
The formula φ is unsatisfiable when all branches in its tableau are closed; it is
valid if and only if all branches on its tableau are open; when there exists an open
branch in the tableau then the formula is satisfiable.
These facts are exploited when the signed formula at the root of a tableau is Fφ.
The closed tableau witnesses unsatisfiability of Fφ, hence, validity of φ; on the
contrary, the existence of an open branch is a witness to satisfiability of ¬φ.
Example 2.3 In Fig. 2.4, the tableau is shown for the signed formula Fφ : F[( p ⊃
(q ⊃ r )) ⊃ (q ⊃ ( p ⊃ r ))]. All three branches are closed, hence, the assumption of
falsity of φ has led to contradiction, hence, φ is valid.
On the contrary, in the tableau in Fig. 2.5 for the signed formula F [(( p ∧ q) ⊃
r ) ⊃ (( p ∨ q) ⊃ r )], we see two branches closed, marked X, and two branches open,
marked , which point to valuations falsifying the formula φ: V1 : p = 0, q =
1, r = 0 and V2 : p = 1, q = 0, r = 0.
(i) neither ⊥ nor any pair F p, T p for any atomic proposition p are in Δ;
(ii) for each formula φ ∧ ξ ∈ Δ, φ, ξ ∈ Δ;
(iii) for each formula φ ∨ ξ ∈ Δ, either φ ∈ Δ or ξ ∈ Δ.
Corollary 2.2 Each open branch of a tableau is a Hintikka set hence it is satisfiable.
In particular an infinite branch of a tableau is satisfiable.
Theorem 2.14 (On tableau completeness) If a formula φ is valid then it has a tableau
proof.
Proof Suppose that φ is not tableau provable, hence, Fφ has a tableau with an open
branch which is satisfiable, and thus, φ is not valid.
It follows from the definition of validity of a sequent in Definition 2.30 that validity
of a sequent Γ ⇒ Δ, where Γ = {γi : i ≤ n} and Δ = {δ j : j ≤ m}, is equivalent
84 2 Sentential Logic (SL)
Proof Suppose that the sequent ⇒ φ is not provable, hence, a tableau for the signed
formula Fφ is not closed, hence, there is an open branch, which is satisfiable, and
thus, φ is not valid.
We have already entered into this realm by proving the deduction theorem. Now, we
address meta-properties of sentential logic. We apply analytic tableaux to this end.
In the first place, we collect the basic properties of the relation Γ φ. We recall
that Σ SL is the set of theorems of SL.
2.9 Meta-Theory of Sentential Logic. Part I 85
Proof For (i): From left to right. Inconsistency of Γ means Γ φ and Γ ¬φ for
some φ. From provable formula ¬φ ⊃ (φ ⊃ ψ) (derivation 36 in [11]) it follows by
detachment applied twice that Γ ψ for each formula ψ. The converse is obvious,
(ii) is the negation of (i).
86 2 Sentential Logic (SL)
Property (iii) follows by the compactness property; for property (iv): suppose that
Γ φ; (L3) states that φ ⊃ (¬φ ⊃ q) is provable and the substitution q/⊥ yields
the provable formula φ ⊃ (¬φ ⊂ ⊥). By detachment, we obtain that Γ ¬φ ⊃ ⊥.
If a sequence σ of formulae is a proof of ¬φ ⊃ ⊥ from Γ , then σ, ¬φ is a proof of
⊥ from Γ ∪ {¬φ}, hence, the latter set is inconsistent;
Property (v) is a transposition of (iv); for property (vi): as Σ SL consists of provable
formulae which are valid by validity-preserving properties of inference rules, no
falsity can be inferred from Σ SL ;
For property (vii): if Γ ∪ {¬φ} is inconsistent, then Γ ∪ {¬φ} ⊥ and by deduc-
tion theorem Γ ¬φ ⊂ ⊥. From (¬φ ⊃ ⊥) ⊃ φ in Σ, we infer that Γ φ.
Consistency of a set Γ will be denoted by the symbol Con(Γ ).
Definition 2.38 (Maximal consistency)
A consistent set Γ is maximal consistent if and only if Γ is consistent and there does
not exist a consistent proper superset Γ ∗ of Γ . Maximality of a consistent set Γ will
be denoted by the symbol MaxCon(Γ ). Maximality has important consequences
and therefore it is important to know that maximal extension exists for each consistent
set Γ . While the finite character of consistency (Theorem 2.17(iii)) allows for the
application of the Teichmüller-Tukey lemma (Theorem 1.14(i)), we include, also for
historic reasons, another argument known as the Lindenbaum Lemma.
Theorem 2.18 (The Lindenbaum Lemma)
Each consistent set Γ of formulae has a maximal consistent extension Γ ∗ .
Proof As each formula in SL uses only finitely many atomic propositions, and
their set is countable, the set of formulae is at most of cardinality of the set of
finite sequences over a countable set, hence, it is countable and we can arrange all
formulae into, possibly infinite, sequence φ0 , φ1 , . . . , φn , . . .. We define a sequence
Γ0 , Γ1 , Γ2 , . . . , Γn , . . . of sets of formulae by letting
(i) Γ0 = Γ ;
(ii) Γn+1 = Γn ∪ {φn } if Γn ∪ {φn } is consistent;
(iii) Γn+1 = Γn , otherwise.
We let Γ ∗ = {Γn : n ≥ 0} and we claim that
(iv) Γ ⊆ Γ ∗ ;
(v) Γ ∗ is consistent;
(vi) Γ ∗ is maximal consistent.
We easily prove by induction that each Γn is consistent. Then for (iv): it follows
by (i) and definition of Γ ∗ . For (v): by the Teichmüller-Tukey Lemma (Thm. 1.14(i))
it is sufficient to check that each finite subset Δ of Γ ∗ is consistent. By finiteness of
Δ, there exists n such that Δ ⊆ Γn . As Γn is consistent, Δ is consistent, hence, Γ ∗
is consistent.
For (vi): suppose that Γ ∗ ⊂ Ω and Con(Ω). Let φ ∈ Ω \ Γ ∗ . Then φ is φn for
some n. It follows that Γn ∪ {φn } is inconsistent, hence, Γ ∗ ∪ {φn } is inconsistent
2.9 Meta-Theory of Sentential Logic. Part I 87
Theorem 2.19 The following are basic properties of maximal consistent sets. Sup-
pose that MaxCon(Γ ).
Theorem 2.20 Each MaxCon(Γ ) is a Hintikka set, hence, each maximal consistent
set is satisfiable.
Corollary 2.5 (i) For a consistent set Γ of formulae and a formula φ, Γ φ if and
only φ ∈ Ω for each maximal consistent extension Ω of Γ ;
(ii) φ ∈ Σ SL if and only if φ ∈ Ω for each MaxCon(Ω);
(iii) Each formula in a consistent set Γ is provable from each maximal consistent
extension of Γ .
88 2 Sentential Logic (SL)
The importance of Corollary 2.4 stems from its relation to completeness. We will
see usages of this relation in the following chapters. This relation may be expressed
in the following statement.
Theorem 2.21 (The strong completeness of SL) If each consistent set of formulae
is satisfiable, then for each set Γ of formulae and each formula φ,
(SC) i f Γ |= φ, then Γ φ.
Proof Suppose the conclusion is false, i.e., for a set Γ of formulae and a formula φ
we have that Γ |= φ but it is not true that Γ φ. Then, the set Γ ∪ {¬φ} is consistent
but not satisfiable because truth of Γ in a model would imply the truth of φ in the
model, hence, the falsity of ¬φ. The property (SC) is called the strong completeness
property.
(A) is proved in Example 2.1, other formulae will be given, when met in the proof,
references to derivations in Łukasiewicz [11].
Theorem 2.23 SL is complete, i.e., each valid formula is provable: for each φ, if
|= φ, then φ.
(14) ¬ψ ⊃ (ψ ⊃ χ )
The idea now is to eliminate subsequently all pi∗ from the antecedent of (16), begin-
ning with pn∗ down to p1∗ . We begin with pn∗ . We choose from the set M P two
assignments A+ and A− such that A+∗ ( pn , A+ ) = 1 and A−∗ ( pn , A− ) = 0. In case
of A+, we have
(17) p1∗ , p2∗ , . . . , pn−1
∗
, pn φ.
Similarly, for A− :
(18) p1∗ , p2∗ , . . . , pn−1
∗
, ¬ pn φ.
We now invoke the provable formula (G) (derivation 120 in [11]), which after sub-
stitutions takes the form
It suffices now to follow the above procedure with pn−1 , ..., p1 and after removing
p1 we are left with
(23) φ
In the above proof, we have witnessed provability in action. This is often a tedious
process to prove a formula, hence, completeness is a very useful meta-property as
checking validity is much easier. In particular, we may check that formulae (1)–(10)
in Definition 2.28 are valid, hence, they are provable.
We now reveal the interpolation property for sentential logic by stating and proving
the Craig interpolation theorem.
This definition can be extended to sets of formulae. Using the formalism of analytic
tableaux, we consider the formula ξ : φ ⊃ ψ with its signed form Fξ which is φ ∧
¬ψ. We begin the tableau with φ and ¬ψ in the initial branch. We use the idea in
Fitting [22] of biased formulae. In the case of our formula ξ , we refer to its original
ancestry by denoting φ as le f t (φ) and ¬ψ as right (¬ψ). This denotation continues
with the buildup of the tableau. For instance, descendants of right (¬(¬ p ⊃ q)) will
be right (¬ p) and right (¬q), all of course in one branch.
The definition of an interpolant can be extended to sets of biased formulae of the
form Γ : {le f t (γ1 ), le f t (γ2 ), . . . , le f t (γn ), right (δ1 ), right
(δ2 ), . .
., right (δm }:
an interpolant for Γ is the interpolant for the formula (I ) n1 γi ⊃ m 1 ¬δ j . This
generalization is in agreement with the case of the formula ξ : φ ⊃ ψ for which the
closed tableau begins with the set Γ =le f t (φ), right (¬ψ), hence, an interpolant
for Γ according to the generalized definition is the interpolant for the formula
φ ⊃ ¬(¬ψ), i.e., an interpolant for ξ .
Definition 2.40 (Rules for closed tableaux for biased signed formulae) We keep the
notation of type α for conjunctions and of type β for disjunctions.
We justify rules (xvi) and (xvii) as a pattern for other rules. Let Γ = {le f t (γ1 ),
le f t (γ2 ), ..., le
f t (γn ), right
(δ1 ), right (δ2 ), ..., right (δm )}, hence, the correspond-
ing formula is in γi ⊃ m 1 ¬δi .
For rule (xvi): Suppose ξ1 is an interpolant for Γ, le f t (β1 ) and ξ2 is an interpolant
for Γ, le f t (β2 ), hence,
(a) β1 ∧ n1 γi ⊃ ξ1 ;
(b) β2 ∧ n1 γi ⊃ ξ2 .
Then,
n
n
β∧ γi ≡ (β1 ∨ β2 ) ∧ γi ≡
1 1
n
n
(β1 ∧ γi ∨ β2 ∧ γi ⊃ ξ1 ∨ ξ2 .
1 1
ξ2 to m
The other implication from ξ1 ∨ 1 ¬δ j follows obviously from implications
from ξ1 respectively, from ξ2 to m 1 ¬δ j .
The requirement
that all atomic proposi-
tions in ξ1 ∨ ξ2 have occurrences in both n1 γi and m 1 δ j is satisfied by virtue of
assumptions about ξ1 and ξ2 .
For rule (xvii), we assume
(c) ξ1 ⊃ m ¬δ j ∨ ¬β1 ;
1
(d) ξ2 ⊃ m 1 ¬δ j ∨ ¬β2 .
94 2 Sentential Logic (SL)
Then,
m
m
ξ1 ∧ ξ2 ⊃ ( ¬δ j ∨ ¬β1 ) ∧ ( ¬δ j ∨ ¬β2 ) ≡
1 1
m
m
m
¬δ j ∨ (¬β1 ∧ ¬β2 ) ≡ ¬δ j ∨ ¬(β1 ∨ β2 ) ≡ ¬δ j ∨ ¬β.
1 1 1
That n1 γi ⊃ ξ1 ∧ ξ2 follows obviously and the requirement about occurrences
of atomic propositions is also satisfied.
After a closed tableau for Fφ ⊃ ψ started with le f t (φ) and right (¬ψ) is con-
structed, we apply the rules bottom-up.
Theorem 2.24 (Craig interpolation, Craig [26]) For each valid formula φ ⊃ ψ there
exists an interpolant.
Remark 2.1 The idea for the proof as well as rules for interpolants come from
Fitting [22].
2.11 Resolution, Logical Consequence 95
The symbol x means that the literal so denoted is omitted; thus, (RR) acts on a
pair of clauses by removing a pair of contradictory literals, one from each clause.
Theorem 2.25 Resolution is sound, i.e., if the initial set of clauses is satisfiable,
then there does not exist resolution refutation.
It is understandable that these procedures may require some other then in resolu-
tion form of clauses.
Definition 2.44 (Horn clauses)
A Horn clause Horn [28] is any clause which contains at most one non-negated
literal. A Horn clause can be in one and only one of the following forms: (i) as a
non-negated literal p or (ii) as a clause with one non-negated literal p ∨ i∈I ¬ pi ,
or (iii),
as a clause with only negated literals
j∈J ¬ p j . A clause of the form (ii)
p ∨ i∈I ¬ pi can be brought to the form i∈I pi ⊃ p called a decision rule. The
clause of the form p is called a fact. The third possibility of j∈J ¬ p j can be written
down in the form j∈J p j ⊃ ⊥ called an integrity constraint. A Horn formula is a
formula in CNF whose all clauses are Horn.
Example 2.7 Backward Chaining The textual version of Knowledge Base is as
follows (Carroll [29]): 1. The only animals in this house are cats. 2. Every animal
that loves to gaze at the moon is suitable for a pet. 3. When I detest an animal, I avoid
it. 4. No animals are carnivorous unless they prowl at night. 5. No cat fails to kill
mice. 6. No animals ever like me, except those that are in this house. 7. Kangaroos are
not suitable for pets. 8. None but carnivorous animals kill mice. 9. I detest animals
that do not like me. 10. Animals that prowl at night always love to gaze at the moon.
11. Query: Therefore, I always avoid a kangaroo.
In order to render this set of statements in symbolic form, we introduce some
acronyms: AH = animal in house; C = cat; LGM = loves to gaze at the moon; Pet
= pet;Det = detest;Av = avoid; CA = carnivorous; PR = prowl; K = kill; LI =
likes; KNG = kangaroo. Clearly, we could encode these phrases with letters a,b,c
etc. but then the reading would be more difficult. With this set, statements 1–11 can
be transformed into decision rules:
(I) AH → C; (II) LG M ⊃ Pet; (III) Det ⊃ AV ; (IV) C A ⊃ P R; (V) C ⊃ K ;
(VI) L I ⊃ AH ; (VII) ¬Pet ⊃ K N G; (VIII) K ⊃ C A; (IX) ¬L I ⊃ Det; (X) P R ⊃
LG M; (XI) Query: AV ⊃ K N G.
In order to prove Query from (I)-(X), we assume that the premise AV is true and we
enter the backward reasoning in order to derive the consequent K N G. The following
chain of derivations leads from consequents to verifying them antecedents. In this
process, we often use the contraposition law, using ¬q ⊃ ¬ p instead of p ⊃ q. We
prefer this approach instead of rendering some of (I)-(X) in the contraposition form
in order to preserve the syntax of the original text.
The solution to the Query is a list of goals: AV to (III): Det to (IX): ¬L I to (VI):
¬AH to (I): ¬Cat to (V): ¬K to (VIII): ¬C A to (IV): ¬P R to (X): ¬LG M to (II):
¬Pet to (VII): K N G.
The consequent K N G of Query (XI) has been derived from (I)-(X), hence, Query
is proved. The backward chaining process is illustrated with the chain of applications
of detachment rule:
AV →(I I I ) Det →(I X ) ¬L I →(V I ) ¬AH →(I ) ¬Cat →(V ) ¬K →(V I I I )
¬C A →(I V ) ¬P R →(X ) ¬LG M →(I I ) ¬Pet →(V I I ) K N G.
98 2 Sentential Logic (SL)
Theorem 2.28 Backward chaining with Horn decision rules is sound and complete.
2.13 Satisfiability, Validity and Complexity in Sentential Logic. Remarks … 99
and resolution tree for Hn contains the order of cn clauses for some constant c.
It may be interesting to point to the idea for the proof. Formulae Hn stem from the
pidgeon-hole principle of Dirichlet: n + 1 letters cannot be put into n mailboxes in
such way that each matchbox contains exactly one letter. For a given n, the formula
Hn is constructed as follows:
for φ. If we meet an assignment for which the value is 1 for φ, then φ is satisfiable
and this assignment yields the model.
The validity problem is dual to satisfiability problem as a formula φ is valid if and
only if the formula ¬φ is unsatisfiable, so checking unsatisfiability for φ by means
of the truth table is equivalent to checking validity of φ. Hence, the decision problem
of validity is decidable.
This approach has exponential complexity of 2n in case of formulae of size n,
hence, it is impractical.
In terms of computability, we formulate the decidability for SL, by stating that
the set of Gödel numbers of valid formulae is recursive, hence, the decision problem
whether a formula is valid is recursively solvable (see Chap. 1 or Davis [31]).
It is known, cf. Theorem 1.53, that the problem CNF-SAT of checking satisfiability
of a formula in CNF as well as the problem (3-CNF)-SAT of checking satisfiability
of a formula in 3-CNF, i.e., in CNF in which each clause has exactly three literals, are
NP-complete. Hence, the validity problem is co-NP-complete. Yet, satisfiability is a
vital property in applications, so there are a number of algorithms to test satisfiability
property of formulae of sentential logic in a heuristic way.
We present here some ideas on which SAT solvers are based. Let us first comment
on some variants of resolution. Let C be a non-empty set of clauses. A unit resolution
is the variant in which the rule (RR) is allowed only if at least one clause is a singleton
(l). It is known that unit resolution is complete for sets of Horn clauses. We now
consider some operations on sets of clauses with resolution on mind.
(1) if we have already observed that each clause containing a pair of contradictory
literals can be removed from a set of clauses without affecting the issue of
satisfiability;
Suppose that there exists a literal l such that the clause (l) ∈ C. Let Cl be the
set {C ∈ C : l ∈ C} and C = C \ Cl . If C is satisfiable in the world V , then
V (l) = 1, hence each clause in Cl is valid at V . The test of satisfiability is with
C , hence, satisfiability of C is equivalent to satisfiability of C . Hence,
(2) if a set of clauses C contains a singular clause l (called an orphan), then the
literal ¬l can be removed from all remaining clauses;
(3) after (i) and (ii) are performed, we remove all orphaned literals.
Finally, consider a valid formula C ⊃ C between clauses in the set C of clauses.
Clearly, if C is valid under an assignment V , then C is valid under V . The impact
of this remark is that
(4) in the set C of clauses we can remove all non-minimal clauses with respect to
set-theoretic inclusion on sets of literals in clauses.
We call a set C of clauses pre-processed with the result being the set of clauses C pr e
if and only if we have applied to C reduction rules (i)–(iv) in this order.
2.13 Satisfiability, Validity and Complexity in Sentential Logic. Remarks … 101
We now introduce the Davis-Putnam (Davis and Putnam [32]) solver which con-
veys the basic ideas of SAT solving.
Example 2.9 (i) Consider the set of clauses: (x ∨ y ∨ z), (y ∨ ¬z ∨ ¬w), (¬y ∨ t).
1 There is no unit literal, so prescription in Definition 2.46(1) is skipped;
2 There are orphaned literals x and ¬w and by Definition 2.46(2), we remove
clauses containing them. A satisfying assignment A should have values A(x) =
1, A(w) = 0 and the pre-processed set of clauses is: (¬y ∨ t). The report is then:
satisfiable.
(ii) Let us consider one more case of a set of clauses in 2-SAT: (x ∨ y), (x ∨
¬y), (¬x ∨ z), (¬x ∨ ¬z).
1 Resolve clauses with x and ¬x, add resolvents, remove clauses resolved; remain-
ing clauses are: (y ∨ z), (y ∨ ¬z), (¬y ∨ z), (¬y ∨ ¬z).
2 Resolve clauses with y, ¬y, add resolvents, remove clauses resolved; remaining
clauses are: (z), (¬z).
3 Resolve the last two clauses: the resolvent is Box - the formula is not satisfiable;
report unsatisfiable.
Example 2.10 Consider clauses (¬x ∨ ¬y), (¬z ∨ y), (¬x ∨ z ∨ ¬w), (z ∨ w).
The search tree begins with the root x and contains levels for y, z, w in that order;
left edge is labelled with 1, right edge is labelled with 0, so we have 16 maximal
branches and we list them as sequences of labels 0,1 on edges of the tree along
branches together with satisfiability results F (unsatisfiable), T (satisfiable):
1111F, 1110F, 1101F, 1100F, 1011F, 1010F, 1001T, 1000F, 0111T, 0110T,
Theorem 2.30 The satisfiability problem SAT-HORN for sets of Horn decision rules
is solvable in time linear in number of literals (Dowling and Gallier [33]). It is a
PTIME-complete problem, see (Greenlaw et al. [34]).
Proof We outline an idea of a proof. Consider the problem 2-SAT in which a formula
in CNF consists of clauses with two literals. The APT-algorithm for solving the
problem in linear time is recalled below. Linearity comes from Tarjan’s algorithm
for finding strongly connected components in a graph Tarjan [36].
APT-algorithm
Represent clauses of φ in the graph called the implication graph: set of vertices W
is the set of all literals in the formula and their negations. Edges are of the following
types:
single inhibitory input and threshold Θ = 0 computes the negation NOT: input x = 1
activates inhibition and the neuron outputs no value, i.e., 0, while the input x = 0
produces the output 1. Then a network of connected McCulloch-Pitts neurons can
compute each Boolean function of finitely many atomic propositions. In order to
provide learning capabilities to neurons one has to endow the neuron with weights
on inputs. Then, one obtains a perceptron Rosenblatt [39]. While weighted networks
are equivalent to networks of McCulloch-Pitts neurons with inhibitory powers, yet
introduction of weights allows for a proof of the perceptron learning theorem.
The computation rule for the perceptron is: if i wi xi ≥ Θ, then y = 1, otherwise
y = 0. In a learning process of a concept, a perceptron is given a sample S of positive
(P) and negative (N) examples, each coded as input vector x = [x1 , x2 , . . . , xn ].
Classification of the concept consists in a linear separation of positive from negative
examples. if this is achieved, then we say that the perceptron has learned the concept.
The criterion for the proper classification is: if an example is positive, then i wi xi ≥
Θ, where the vector x is coding the example, and, in case of a negative example, the
criterion is i wi xi < Θ.
Theorem 2.32 (the perceptron learning theorem) If sets (P) and (N) of examples
coded as sets of vectors in the Cartesian space can be linearly separated by linear
manifold, then the perceptron beginning with a random set of non-zero weights, can
apply a learning algorithm whose execution will terminate after finitely many steps
with a set of weights which will properly classify the concept, i.e, they will separate
linearly (P) from (N).
Proof We make a few simplifications. First, we can suppose that Θ = 0: this change
will result only in a shift of (P)∪(N) by a vector, not affecting relative positions of
(P) and (N). Next, a simplification consists in considering the set (-N) instead of
(N): then the criterion for proper classification will be i wi xi ≥ 0 for each vector
x ∈ (P) ∪ (−N ). Finally, we may assume that all vectors are normalized, i.e., the
length (the norm) of each is 1 as this does not change the sign of the scalar product.
The assumption that (P) and (N) are linearly separable means that there exists a
weight vector w which correctly classifies all vectors in the sample.
In the process of learning, two types of error can be made: (i) a vector x ∈ (P)
can be classified as negative (ii) a vector x ∈ (N ) can be classified as positive. The
learning algorithm has to account for and correct those errors. The remedy is to
change weights.
We simplify notation, we denote the vector of weights as w and we denote the
scalar product i wi xi as x · w.
(ii) wt+1 · w ≥ wt · w + x · w ≥ wt · w + η
By recurrence, we obtain
(iii) wt+1 · w ≥ w0 · w = (t + 1) · η
(iv)||wt+1 || = sqr t[(wt + xt ) · (wt + xt )] = sgr t (||wt ||2 + ||xt ||2 + 2 · xt · wt ) ≤ sqr t (||wt ||2 + 1)
2.15 Problems
Problem 2.17 was picked up from (Gallier J. H.: Logic for Computer Science. Founda-
tions of Automatic Theorem Proving. Dover Publications (2015), 3.5.9) and (Chang,
C. C., Keisler, J. H.: Model Theory. Elsevier Science Publ., Amsterdam (1992),
Chap. 4.6).
106 2 Sentential Logic (SL)
References
1. Łukasiewicz, J.: Aristotle’s Syllogistic from the Standpoint of Modern Formal Logic, 2nd edn.
enlarged. Oxford University Press (1957)
2. Bocheński, I.M.: Ancient Formal Logic. North Holland, Amsterdam (1951)
3. Bobzien, S.: Ancient Logic. In: Zalta, E.N. (ed.) SEP. https://plato.stanford.edu/archives/
sum2020/entries/logic-ancient
References 109
4. Frege, G.: Begriffsschrift, eine der mathematischen nachgebildete Formelsprache des reinen
Denkens. Nebert, L. Halle, A. S. (1879). (also in: Van Heijenoort, J.(ed.): From Frege to Gödel.
A Source Book in Mathematical Logic 1879–1931, , Harvard University Press, Cambridge MA
(1967))
5. Łukasiewicz, J.: From history of sentential logic (in Polish). Przegla̧d Filozoficzny 37, (1934).
(also in Erkenntnis 5, 111–131 (1935-36) and in Borkowski, L. (ed.). Jan Łukasiewicz. Selected
Works. North Holland P.C. Amsterdam-Polish Scientic Publishers (PWN). Warsaw (1970))
6. Kleene, S.C.: Mathematical Logic. Dover Publications, Mineola, N.Y., USA (2002)
7. Hilbert, D., Ackerman, W.: Principles of Mathematical Logic. Chelsea (1950). (Luce, R. (ed.),
Hammond, L.M., Leckie,G.G., Steinhard, F. translation of Grundzüge der Theoretischen Logik.
Julius Springer, Berlin (1938))
8. Church, A.: Introduction to Mathematical Logic. Princeton University Press, Princeton NJ
(1956)
9. Meredith, C.A.: Single axioms for the systems (C, N), (C, O) and (A, N) of the two-valued
sentential calculus. J. Comput. Syst. 1, 155–164 (1953)
10. Łukasiewicz, J., Tarski, A.: Untersuchungen über den Aussagenkalkül. C.R. Soc. Sci. Lett.
Varsovie, Cl. III, 23, 39–50 (1930). (also in: Borkowski, L. (ed.): J. Lukasiewicz: Selected
Works. Studies in Logic and the Foundations of Mathematics. North-Holland Publ. Amsterdam
and Polish. Sci. Publ. (PWN), Warszawa (1970))
11. Łukasiewicz, J.: Elements of Mathematical Logic. Pergamon Press, Oxford and Polish Scien-
tific Publishers (PWN), Warsaw (1966). (reprinted from mimeographed notes by students of
Warsaw University (1929))
12. Herbrand, J.: Recherches sur la théorie de la déemonstration. Ph.D Thesis at the Paris University.
Travaux Soc. Sci. Lett. Varsovie cl. III, pp. 128 (1930). (also in: Van Heijenoort, J.: From
Frege to Gödel. A Source Book in Mathematical Logic 1879–1931, Harvard University Press,
Cambridge MA, pp. 525–581 (1967))
13. Tarski, A.: Über einige fundamentale Begriffe der Metamathematik (1930). (As: ‘On some
fundamental concepts of metamathematics’ in: Tarski, A.: Logic, Semantics, Metamathematics,
pp. 30–37. Oxford University Press, New York (1956))
14. Bernays, P.: Axiomatische Untersuchung des Aussagenkalküls der ‘Principia Mathematica’
Mathematische Zeitschrift, XXV (1926)
15. Rasiowa, H., Sikorski, R.: The Mathematics of Metamathematics. Polish Scientific Publishers
(PWN), Warszawa (1963)
16. Jaśkowski, S.: Teoria dedukcji oparta na dyrektywach założeniowych (in Polish) (Theory
of deduction based on suppositional directives). In: Ksiȩga Pamia̧tkowa I Polskiego Zjazdu
Matematycznego. Uniwersytet Jagielloński, Kraków (1929)
17. Jaśkowski, S.: On the rules of suppositions in formal logic. Stud. Logica 1, 5–32 (1934). (Also
in: McCall, S. (ed.). Polish Logic 1920–1939. Oxford University Press, pp. 232–258 (1967))
18. Gentzen, G.: Untersuchungen über das Logische Schliessen, I, II. Math. Z. 39, 176–210, 405–
431 (1934/5)
19. Indrzejczak, A.: Sequents and Trees. Springer Nature Switzerland, Cham, Switzerland (2021)
20. Smullyan, R.M.: First Order Logic. Dover, Minneola N.Y (1996)
21. Beth, E.W.: The Foundations of Mathematics. A Study in the Philosophy of Science. Harper
& Row Publishers, New York (1966)
22. Fitting, M.: First-Order Logic and Automated Theorem Proving. Springer, New York (1996)
23. Hintikka, K.J.J.: Form and content in quantification theory. Acta Philosophica Fennica 8, 7–55
(1955)
24. Post, E.L.: Introduction to a general theory of elementary propositions. Am. J. Math. 43(3),
163–185 (1921). https://doi.org/10.2307/2370324
25. Kalmár, L.: Über die Axiomatisierbarkeit des Aussagenkalküls. Acta Sci. Math. 7, 222–243
(1935)
26. Craig, W.: Linear reasoning. A new form of the Herbrand-Gentzen theorem. J. Symb. Logic
22, 250–268 (1957)
110 2 Sentential Logic (SL)
27. Robinson, J.A.: A machine oriented logic based on the resolution principle. J. ACM 12(1),
23–41 (1965)
28. Horn, A.: On sentences which are true of direct unions of algebras. J. Symb. Log. 16(1), 14–21
(1951)
29. Carroll, L.: Complete Works. Symbolic Logic, vol. 60. Vintage Books, New York (1976)
30. Haken, A.: The intractability of resolution. Theoret. Comput. Sci. 39, 297–308 (1985)
31. Davis, M.: Computability and Unsolvability. McGraw-Hill Book Co., New York (1958)
32. Davis, M., Putnam, H.: A computing procedure for quantification theory. J. ACM 7, 201–215
(1960)
33. Dowling, W.F., Gallier, J.H.: Linear-time algorithms for testing the satisfiability of sen-
tential Horn formulae. J. Logic Progr. 1(3), 267–284 (1984). https://doi.org/10.1016/0743-
1066(84)90014-1
34. Greenlaw, R., Hoover, J., Ruzzo, W.: Limits to Parallel Computation. P-Completeness Theory.
Oxford University Press, Oxford, UK (1995)
35. Aspvall, B., Plass, M.F., Tarjan, R.E.: A linear-time algorithm for testing the truth of certain
quantified boolean formulas. Inf. Process. Lett. 8(3), 121–123 (1979). https://doi.org/10.1016/
0020-0190(79)90002-4
36. Tarjan, R.E.: Depth-first search and linear graph algorithm., SIAM J. Comput. 1(2), 146–160
(1972). https://doi.org/10.1137/0201010
37. McCulloch, W., Pitts, W.: A logical calculus of the ideas immanent in nervous activity. Bull.
Math. Biophys. 9, 127–147 (1943)
38. Ramón y Cajal, S.: New Ideas on the Structure of the Nervous System in Man and Vertebrates.
MIT Press, Cambridge, MA (1990). (1st ed. Paris (1894))
39. Rosenblatt, F.: The perceptron: a probabilistic model for information storage and organization
in the brain. Psychol. Rev. 65, 386–408 (1958)
Chapter 3
Rudiments of First-Order Logic (FO)
In this chapter we present basic results on the second classical logic, first-order
logic in many topics discussed here reduced to the predicate logic, i.e, logic without
function symbols, yet with the full power of FO when deepest results like the Gödel
completeness theorem, Gödel incompleteness theorems, the Rosser incompleteness
theorem, and the Tarski theorem on non-definability of truth are discussed.
First-order logic (FO) adds to propositional logic the possibility of expressing prop-
erties of individuals collectively by using quantified phrases ‘for all’ and ‘for some’.
In this, it follows in the footsteps of Aristotle’s Syllogistics which introduced those
expressions into its syllogisms.
In order to express properties, FO is using relations rendered symbolically in the
form of predicates encoded as relational symbols. The term ‘predicate’ is derived
from the latin ‘praedicatum’ meaning a declared property of an object/subject. As
predicates are interpreted as relations, we will use the name of a relational symbol
in place of a name of a predicate but we keep the traditional name of the predicate
logic for FO without function symbols.
For instance, when we want to state that ‘John loves each animal’, we need
the binary predicate loves(J ohn, x) and a unary predicate animal(x); the pred-
icate ‘loves’ does express a relation of being in love for two beings, and, the
unary predicate ‘animal’ renders the property of being an animal. In proposi-
tional logic,we could express our statement, at least partially, by listing all ani-
mals, at least accessible to John, as a1 , a2 , . . . , an , . . . and forming the formula
loves(J ohn, a1 ) ∧ loves(J ohn, a2 ) ∧ ... with each loves(J ohn, a) as an atomic
proposition. In predicate logic, we would write down the formula (∀x.(animal(x) ⊃
loves(J ohn, x))).
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 111
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4_3
112 3 Rudiments of First-Order Logic (FO)
‘If some animal loves me, then it is an animal in the house’ is rendered as
In the above examples, ‘m’ meaning myself and ‘Mary’ are constants.
‘If a prime number divides the product of two numbers then it does divide at least
one of them’ is rendered as
In the last formula, we meet specialized predicates which express some arithmetic
properties; in such cases we say that this statement belongs in the theory of arith-
metics, a specialized case of FO. In absence of specialized predicates, we simply
speak of FO and in absence of function symbols and the relational symbol = of
identity, we discuss predicate logic.
From the above examples it follows that in order to be able to render in sym-
bols such complex statements, we may need symbols for individual variables like
‘x’, symbols for individual constants like ‘m’ or ‘Mary’, symbols for functions and
predicates, quantifier symbols, symbols for propositional connectives and auxiliary
symbols like parentheses and commas.
We now define formally the syntax of first-order logic. We distinguish between
logical and non-logical symbols. Logical symbols are those for individual variables,
logical connectives, quantifiers, and auxiliary symbols like punctuation marks, paren-
theses. Non-logical symbols are constant, relational and function symbols which are
subject for interpretations.
List of symbols L = L v ∪ L c ∪ L q ∪ L a , where
(i) L v = {x1 , x2 , . . . , xn , . . .} is the countably infinite set of individual variables,
often expressed in formulae as x, y, z, . . .;
(ii) L c = {∨, ∧, ⊃, ≡, ¬} is the set of logical connectives of SL;
(iii) L q = {∀, ∃} is the set of quantifier symbols ‘forall’ and ‘exists’;
3.1 Introduction to Syntax of FO 113
It is obvious from our discussion of syntax of predicate logic that the notion of
truth for predicate logic should be defined in more complex environment then it
was the case for propositional logic: we should accommodate individual variables,
constants, function symbols, relational symbols and quantifiers, i.e, various types of
grammatical categories of the syntax language for first-order logic. Semantic theory
for predicate logic which we will present goes back to Tarski [1].
It remains to settle the case of individual variables. Their meanings are decided
by assignments.
We now address the issue of satisfiability and we define the notion of satisfaction
of a formula in an A-structure.
Sequents, introduced in Gentzen [2] responded to the call for formalization of natural
deduction whose first formalization had been due to Jaśkowski [3, 4]. In case of Γ
and Δ being finite sets of formulae, Γ = {γ1 , γ2 , . . . , γk }, Δ = {δ1 , δ2 , . . . , δl }, we
call the ordered pair < Γ, Δ > a sequent.
Definition 3.13 The meaning of the pair is: if all formulae in Γ are true in an interpre-
tation M, then some formula in Δ is true in the interpretation M; this understanding
of the pair < Γ, Δ > is stressed by the notation: we denotesequents by the symbol
k
Γ ⇒ Δ and the truth condition in any structure M is M |= i=1 γi ⊃ lj=1 δ j . This
condition is equivalent to saying that Δ is a logical consequence to Γ .
3.3 Natural Deduction: Sequents 117
Before we list the rules, we comment on some limiting cases involving empty sets
of formulae.
(i) in case of a sequent ∅ ⇒ Δ (written in Gentzen [2] as ⇒ Δ), the conjunction
of the empty set of formulae is valid, hence the sequent is valid if at least one
formula in Δ is valid;
(ii) in case of a sequent Γ ⇒ (we already apply the Gentzen notation), the disjunc-
tion of Δ is false, hence, the sequent is valid if and only if at least one formula
in Γ is invalid;
(iii) in the extreme case, the sequent ⇒ is unsatisfiable as neither there is a valid
formula in Δ nor there is an invalid formula in Γ .
We may now list the rules of sequent calculus pertaining to predicate logic (i.e.,
without function and identity symbols). The reader may check their validity by means
of our definition of a sequent as an implication. Each rule is traditionally presented
as a fraction with premisses in the numerator and consequents in the denominator.
We know from Chap. 1 that connectives ∨, ¬ define all other connectives, and,
similarly, by definition of semantics, the equivalence ∀x.φ ≡ ¬∃¬φ is valid, thus, we
need only, e.g., the quantifier ∃; accordingly, the rules below employ only connectives
∨, ¬ and quantifier ∃. In case we want to prove a formula with other connectives or
quantifier, we use replacement rules.
Γ ⇒Δ Γ ⇒Δ
, .
Γ, φ ⇒ Δ Γ ⇒ Δ, φ
The Gentzen ‘Hauptsatz’ theorem concerns the elimination of the Cut Rule:
Γ1 , φ ⇒ Δ1 Γ2 ⇒ φ, Δ2
;
Γ 1 , Γ 2 ⇒ Δ 1 , Δ2
each formula proved with usage of Cut Rule can be proved without using it. We
return to this topic in Sect. 3.5.
We suppose that individual variables and constants are ordered into infinite
sequence σ without repetitions. With these provisos, diagrams are the following:
3.4 Natural Deduction: Diagrams of Formulae 119
Γ0 , α ∨ β, Γ1
(∨)(1)
Γ0 , α, β, Γ1
Γ0 , ¬(α ∨ β), Γ1
(¬∨)(2)
Γ0 , ¬α, Γ1 ; Γ0 , ¬β, Γ1
Γ0 , α ∧ β, Γ1
(∧)(3)
Γ0 , α, Γ1 ; Γ0 , β, Γ1
Γ0 , ¬(α ∧ β), Γ1
(¬∧)(4)
Γ0 , ¬α, ¬β, Γ1
Γ0 , α ⊃ β, Γ1
(⊃)(5)
Γ0 , ¬α, β, Γ1
Γ0 , ¬(α ⊃ β), Γ1
(¬ →)(6)
Γ0 , ¬α, Γ1 ; Γ0 , β, Γ1
Γ0 , ¬¬αΓ1
(¬¬)(7)
Γ0 , α, Γ1
Γ0 , ∃x.α(x), Γ1
(∃)(8)
Γ0 , α(c), Γ1 , ∃x.α(x)
Condition for (8): c is a term in the sequence σ with the property that the formula
α(c) does not appear at any earlier step of decomposition, including the consequent
of the currently considered rule.
Γ0 , ¬∃x.α(x), Γ1
(¬∃)(9)
Γ0 , ∀x.¬α(x), Γ1
Γ0 , ∀x.α(x), Γ1
(∀)(10)
Γ0 , α(y), Γ1
Condition for (10): y is a variable which has no occurrence in any formula in the
consequent.
Γ0 , ¬∀x.α(x), Γ1
(¬∀)(11)
Γ0 , ∃α(y), Γ1
valid disjunction p ∨ ¬ p, the disjunction Γ is valid. As with propositional logic,
this disjunction is provable.
The procedure for a formula φ begins with a formula φ at the root and then a tree is
grown: each time a type β is met, the tree branches according to the distributive law.
There are two outcomes possible: either the obtained tree is finite and all formulae
at the nodes are indecomposable or the tree is infinite; in the latter case the formula
φ is unsatisfiable, in the former case the result is a conjunction of disjunctions of
indecomposable formulae. When all disjunctions are valid the resulting formula is
valid, moreover it is provable.
Theorem 3.2 A formula φ is a valid formula of predicate logic if and only if the
diagram for φ is finite and all conjuncts are valid.
Theorem 3.3 (A form of completeness theorem for predicate logic) For each valid
formula of predicate logic, the formula resulting from decomposition is provable.
Example 3.3 Consider Fig. 3.2 which represents the diagram for the formula φ :
∀x.(P(x) ⊃ (Q(x)) ⊃ P(x)). The final sequence ¬P(y) ∨ Q(y) ∨ P(y) proves
validity of φ.
D. Distributivity laws
(15) ∀x.(φ(x) ⊃ ψ(x)) ≡ (∀x.φ(x) ⊃ ∀x.ψ(x));
(16) ∃x.(φ(x) ∨ ψ(x)) ≡ (∃x.φ(x) ∨ ∃x.ψ(x));
(17) (∀x.φ(x) ∨ ∀x.ψ(x)) ⊃ (∀x.(φ(x) ∨ ψ(x));
(18) ∃x.(φ(x) ∧ ψ(x)) ⊃ (∃x.φ(x) ∧ ∃x.ψ(x)).
on condition in (vi) that in both cases d has not been employed before.
In Fig. 3.3, we present diagrams for signed formulae of types (γ) and (δ).
We show in Fig. 3.4 the tableau for the signed formula Fξ. Please observe that
both branches are closed: the left branch contains contradictory atomic formulae
P(a), ¬P(a), the right branch contains contradictory atomic formulae Q(a), ¬Q(a).
This means that ξ is valid (we know that, actually, this is the valid formula (9).
presents tableau whose all three branches are open, i.e., not contradictory which
point to satisfying structures. In effect, the formula [∃x.((¬P(x) ⊃ P(x)) ⊃ P(x))]
is valid.
Proof As announced, the proof goes by structural induction. For atomic formulae,
we assign to P the value 1 (truth) if T P ∈ Γ , and, the value 0 (falsity) if F P ∈ Γ ;
otherwise, if {T P, F P} ∩ Γ = ∅, we assign truth value at random. Consider now
formulae of size > 0.
If φ is φ1 ∧ φ2 , then φ1 , φ2 ∈ Γ by (H1), and, by hypothesis of induction, φ1 , φ2
are satisfied in M, hence, φ is satisfied in M. Same argument works for φ which is
φ1 ∨ φ2 with (H2) in place of (H1). If φ ∈ Γ is of the form ∀x.ψ (i.e., of type (γ)),
then, by (H3), ψ(d) ∈ Γ for each d ∈ D, hence, by hypothesis of induction, each
ψ(d) is valid in M and this is necessary for validity of φ ∈ M. Finally, if φ ∈ Γ
is ∃x.ψ, then, by (H4), ψ(d) ∈ Γ for some d ∈ D which implies by hypothesis of
induction that ψ(d) is valid in M, witnessing validity of φ in M. Similarly, for (H5).
The point is now in considering the tableau for a formula φ with validity of φ on
mind. Let us observe that if a tableau for a formula Fφ contains an open branch then
(H0) and (H1) and (H2) are satisfied for some open extension, the same holds for
(H4), (H5) and only (H3) requires more attention as it can lead to an open infinite
branch. With some judicious choice of a strategy for expanding nodes, one can
3.6 Meta-Theory of Predicate Logic. Part I 125
satisfy (H3) in order to make some open extension, possibly infinite, a Hintikka set,
i.e, satisfiable. It follows that if a formula φ is valid, then the tableau for Fφ is closed,
i.e., all branches are closed and these facts must be noticed in a finite number of steps
for each branch, hence, the tableau is finite. A theorem obtains.
Proof For a countable set Γ of formulae {φn : n ≥ 1}, suppose that formulae are
ordered in that order, and, modify the tableau by beginning it with φ1 . After φ j for j <
n have been used, attach φn to the end of each open branch and continue. By induction,
a tableau is built. Was the tableau closed, it would prove joint unsatisfiability of a
finite set of formulae from Γ , a contradiction. Therefore, there exists an open branch
proving joint satisfiability of formulae from Γ . The branch is countable.
Proof The condition that each finite set of formulae is jointly satisfiable implies that
no tableau built from them as in proof of Theorem 3.8 can close, hence there exists
in it, by the König Theorem 1.43 an open infinite branch witnessing satisfiability of
Γ . The converse is manifest.
S : {γ1 , γ2 , . . . , γk } ⇒ {δ1 , δ2 , . . . , δm }
supplies the proof of validity of the sequent S. The following result obtains by
tableau-completeness.
Theorem 3.11 (Completeness of sequent calculus) Sequent calculus for predicate
logic is complete: each valid sequent is provable.
We can render sequent rules in tableaux, as the following examples show. We
denote as TΓ the sequence T γ1 , . . . , T γk and as FΔ the sequence Fδ1 , . . . , Fδm
(Table 3.1).
Tableau-completeness supplies also a short argument in favor of Hauptsatz in
Smullyan [6]. Gentzen’s Hauptsatz concerns Cut Rule:
Γ 1 , φ ⇒ Δ1 Γ2 ⇒ φ, Δ2
Γ 1 , Γ 2 ⇒ Δ1 , Δ2
3.8 Normal Forms 127
and the possibility of proving sequents without the Cut Rule. The Hauptsatz states
that each sequent provable with use of Cut Rule is provable without use of Cut Rule.
The argument for Hauptsatz formulated in the framework of tableau counterpart
to sequents runs as follows: suppose that tableaux for Γ, φ and for Γ, ¬φ are closed,
hence, both Γ, φ and Γ, ¬φ are unsatisfiable which forces the conclusion that Γ is
unsatisfiable, hence, the tableau for Γ is closed. This means that φ is eliminable.
In (Gentzen, op.cit.), a constructive proof of the Hauptsatz is given, by means of
a primitive recursive function which does estimate complexity of the closed tableau
for Γ in terms of complexities of closed tableaux for Γ, φ and for Γ, ¬φ. Smullyan
[6] gives the proof on these lines which does encompass the Hauptsatz for tableaux
and sequents.
Laws of predicate logic allow for presentation of formulae in some specialized forms.
As with propositional logic, we meet in FO negative normal form, CNF and DNF
forms and some forms which we discuss later on: Prenex normal form, Skolem
normal forms and Herbrand normal forms. A good introduction to this topic is the
negative-normal form. We recall that a literal is either an atomic formula or its
negation.
Duality laws of predicate logic secure the existence of negative-normal form for
each formula. Consider, e.g., the formula
yields a negative-normal form for φ. Let us observe that negative-normal forms are
not defined uniquely.
The form (**)is yet another normal form: the prenex form.
Renaming, laws (1)–(20) of Theorem 3.4 and equivalences allow for transforming
each formula into a prenex form. An example is formula (**), the prenex form of
formula (*). A formal proof of the existence of prenex can be given by structural
induction:
(i) literals are already in prenex;
(ii) if a connective ◦ is ∨ or ∧ (and they suffice), φ is ψ ◦ ξ and, by induction
hypothesis ψ, ξ are in prenex forms, then renaming and laws (12)-(15) give
prenex form for φ;
(iii) if φ is ¬ψ and ψ is in a prenex form, e.g., ∀x.ξ(x), then duality laws (1)-(4),
transform φ into ∃x.¬ξ(x) and, by induction hypothesis,¬ξ(x) is in a prenex
form, hence, φ is in the prenex form;
(iv) if φ is Qx.ψ and ψ is in a prenex form, then φ is in prenex form.
Elimination of existential quantifier symbols from a formula can be effected by
means of a technique due to Skolem [12].
3.8 Normal Forms 129
(i) for a formula φ : ∃y.ψ(y): the Skolem function symbol becomes a function of
arity 0, i.e., a Skolem constant f and the formula φ becomes ψ( f );
(ii) for a formula φ : ∀x.∃y.ψ(x, y): the Skolem function symbol is f (x) and φ
becomes ψ(x, f (x)).
Skolem normal form is a prenex form in which for all Skolem sequences, existen-
tial quantifiers have been replaced with Skolem function symbols. We denote by the
symbol ∀F O the set of all formulae in FO in prenex forms whose prefixes consist
solely of universal quantifier symbols and matrices contain only bound individual
variables. A formula in a Skolem normal form is in ∀F O.
Theorem 3.12 A formula φ is satisfiable if and only if its Skolem normal form is
satisfiable.
Proof Suppose that φ is Skψ, with Sk of Definition 8.4, free variables in ψ are
x1 , x2 , . . . , xn , y and φ is closed. If φ is satisfied in an A-structure M I,A = (D, I, A),
then, for each sequence d = (d1 , d2 , . . . , dn ), each di ∈ D, there exists ad ∈ D such
that ψ(x1 /d1 , x2 /d2 , . . . , xn /dn , y/ad ) holds in M I,A .
For the Skolem normal form, with the substitution y/ f (x1 , x2 , . . . , xn ), we let
f (d1 , d2 , . . . , dn ) = ad , for each substitution (x1 /d1 , x2 /d2 , . . . , xn /dn ) and then
ψ(x1 /d1 , x2 /d2 , . . . , xn /dn , y/ f (x1 /d1 , x2 /d2 , . . . , xn /dn ) holds in M I,A .
A formula and its Skolem normal form need not be equivalent: introducing, e.g.,
a constant reduces the class of possible interpretations for the Skolem normal form.
A remedy is to add to the Skolem normal form a set of Skolem axioms, see (Boolos
et al. [13]).
A finite diagram in Example 3.3 for a formula φ yields a CNF form of φ, i.e., a
conjunction
of disjunctions.
Also, a tableau for Fφ results in DNF of φ, viz., this
DNF is branches (branch). Negating this DNF, we obtain the CNF form for φ.
130 3 Rudiments of First-Order Logic (FO)
Theorem 3.14 Suppose that C1 , C2 are two ground clauses with contradictory lit-
erals l, l c . Let C = (C1 \ {l}) ∪ (C2 \ {l c }) be the resolvent r es(C1 , C2 ). If clauses
C1 , C2 are satisfiable, then the clause r es(C1 , C2 ) is satisfiable.
Proof Suppose that M = (D, I )) is the structure in which C1 , C2 are true. Either
(l) M = 1 or (l c ) M = 1.As two cases are symmetric, we suppose that (l) M = 1, hence,
(l c ) M = 0. As the clause C2 is valid, there exists a literal l ∈ C2 such that (l ) M = 1
which secures satisfiability of r es(C1 , C2 ).
We denote the empty clause by the symbol . Obviously, the empty clause is
ground and unsatisfiable.
Corollary 3.2 (Soundness of ground resolution) If for a set of clauses, after a finite
number of resolution rule applications, the empty clause is obtained, then the set of
clauses is unsatisfiable.
We may observe that as open clauses are substitutions into propositional formulae,
resolution is actually the propositional resolution whose completeness have been
proved in Chap. 1.
We introduce Skolem constants: into the first conjunct w/a, x, b, y/c to obtain the
atomic formula P(b, a, c) and into the second conjunct: w/e, x/ f to obtain the
atomic formula ¬P( f, e, f ). The unifier {b/ f, c/ f, a/e} leads to .
Example 3.9 Consider the following textual form of knowledge base (see Russell
and Norvig [19]): 1. Jack owns a dog. 2. Every dog owner is an animal lover. 3. No
animal lover kills an animal. 4. Either Curiosity or Jack killed the cat named Tuna.
(L)L = {a n : Cn → a n }
Corollary 3.3 The membership decision problem for type-0 grammars is undecid-
able.
Let us give a few necessary facts about type 0 grammars. Each grammar G over
a vocabulary V generates from a word X 0 called an axiom, the language L(G)
containing words over V obtained by means of a finite set P of productions; each
production in case of type 0 grammars is an expression P : Q ⇒ R, where Q and R
are words over V . The action of a production Q ⇒ R consists in rewriting a word of
the form T QW into the word T RW . A word Z is in L(G) if there exists a proof of
it from X 0 , i.e., a finite sequence of productions P1 , P2 , . . . Pk such that the premiss
to P1 is X 0 , each Pi+1 has premiss obtained as the consequent of the production Pi
136 3 Rudiments of First-Order Logic (FO)
where (x, y) is satisfied in M if and only if there exist words (x/T, y/W ) such
that T ⇒ W ∈ P. Then
Theorem 3.17 A word Z is in L(G) if and only if Q is satisfied in M with yk /Z .
Theorem 3.18 The satisfiability problem for predicate logic is undecidable. Hence,
the validity problem for predicate logic is undecidable.
Proof Was Q satisfiability decidable for each Z ∈ L(G), the membership problem
for L(G) would be decidable. As it is not, satisfiability problem for predicate logic
is undecidable. As validity is equivalent to unsatisfiability, the decision problem for
validity is undecidable for predicate logic.
We can render these results in terms of computation theory by recalling the Church
theorem Church [21].
Theorem 3.19 (Church) The set of Gödel numbers of valid formulae of predicate
logic is recursively enumerable but not recursive. Hence the validity problem for
predicate calculus is recursively unsolvable (undecidable).
Proof (Floyd [22] in Manna [23]). We exploit here the undecidability of PCP in
Theorem 3.22, below. We consider the PCP over the alphabet {0, 1}. Let
A = {(u 1 , v1 ), (u 2 , v2 ), . . . , (u k , vk )}
be an instance of PCP.
Proof consists in the construction of a formula F with the property that F is valid
if and only if the instance A has a solution. Models for F will have as domain the
set of words {0, 1}∗ , i.e., the set of finite binary sequences, a relational vocabulary
consisting of a binary predicate symbol P, two unary function symbols f 0 and f 1 ,
0-ary function, i.e. a constant symbol c.
The formula F is defined as follows:
F : [(∀i=1
k
P( f u i (c), f vi (c)) ∧ ∀x, y.(P(x, y) ⊃ ∀i=1
k
P( f u i (x), f vi (y))] ⊃
∃z.P(z, z).
Proof (Sipser [27]). In this proof, given a word w over the alphabet of a Turing
Machine T M, an accepting computation is searched for; the instance of PCP is
constructed from instructions of the machine with antecedent filling top side and
consequent filling bottom side; as instructions are repeated one by one antecedents
and consequents occupy alternately top and bottom sides. A match is achieved if and
only if the word w has an accepting computation.
The construction proceeds in steps.
Step 1. The initial domino tile is [ #q0 a1 a#2 ...ak # ];
Step 2. In this step, for each instruction (q, a → q , b, right), where q = qr eject ,
add the tile [ bq
qa
];
Step 3. In this step, for each instruction (q, a → q , b, le f t), where q = qr eject ,
add the tile [ qcqa
cb ], where c is a tape symbol, for each c;
For some classes of formulae, the satisfiability problem has high complexity: the
Bernays-Schönfinkel-Ramsey SAT(BSR) problem is NEXPTIME-complete (see
p
Sect. 1.8), the SAT(TQBF) problem is PSPACE-complete (see Sect. 1.8), SAT(Σi )
p
is Σ i -complete (see Sect. 1.8). It follows that any level of the polynomial hierarchy
is accessible with formulae of predicate logic.
Monadic predicate logic allows for unary predicates only. The main property of
monadic logic is the following theorem about finite model property.
Theorem 3.23 For each formula φ(P1 , P2 , ..., Pn , x1 , x2 , ..., xk ) of monadic predi-
cate logic, if M |= φ for a structure M, then there is a sub-structure M ∗ ⊆ M such
that cardinality of M ∗ is not greater than 2n and M ∗ |= φ.
Consider the set of binary sequences of length k and for each such sequence σ form
the set M(σ) = {a ∈ M : A(Pi (a)) = σ(i) for i=1,2,..., n}. From each subset M(σ)
of M, select an element a(σ) and let M ∗ = {a(σ) : σ ∈ {0, 1}n }. Then M ∗ |= φ.
The Herbrand structure for L is the pair M H (L)=(T (L), I T (L) ), where I T (L) (t) =
t for each t ∈ T (L). Thus, in Herbrand interpretation, the logic L interprets in a sense
itself.
We recall known from tableau theory types of quantified formulae: γ for uni-
versally quantified formulae ∀xφ, ¬∃xφ and δ for existentially quantified formulae
∃xφ, ¬∀xφ.
Example 3.10 We consider φ : ∀x.P(c, f (a, x), h(x, c)) with the matrix P(c,
f (a, x), h(x, c)). T (φ) is:
{a, c, f (a, a), f (a, c), h(a, c), h(c, c), f (a, f (a, c)), f ( f (a, c), a)),
It may happen that a formula φ has no occurrences of any constant symbols; in such
case we add a constant symbol {c} in order to built a non-empty Herbrand universe.
Definition 3.31 (The Herbrand normal form (the validity functional form))
The closed formula φ (denoted ψ H ) is the Herbrand normal form of the closed
formula ψ if φ is ¬Sk(¬ψ), where Sk(α) is the Skolem normal form of α. Please
observe that ψ H is valid if and only if ψ is valid: suppose that ψ is valid, hence, ¬ψ
is unsatisfiable, thus, by Theorem 3.12, Sk(¬ψ) is unsatisfiable, hence, ¬(Sk(¬ψ))
is valid. The converse is proved by reversing the direction of these inferences.
Proof It suffices to prove the implication to the right. Suppose then that φ is satisfiable
in an interpretation M = (D, I ). We assign to each term t ∗ ∈ D H the value assigned
to t in M, and to each atomic formula P ∗ (t1∗ , t2∗ , . . . , tk∗ ), we assign the value which
M assigns to the atomic formula P(t1 , t2 , . . . , tk ). Then φ is satisfiable in M H .
Example 3.12 For φ and φ H of 13.6 and the domain T = {c, f (c)}, the Herbrand
expansion HE (φ, T ) is ¬Q( f (c), c) ∨ Q(c, c) ∨ ¬Q( f (c), f (c)) ∨ Q( f (c), c) ∨
¬Q( f ( f (c)), c) ∨ ¬Q( f ( f (c)), f (c)) and it is valid as it contains an occurrence
of a pair of contradictory literals.
The Herbrand theorem states that a closed formula of the language L is valid if
and only if there exists the Herbrand expansion of φ valid as a propositional formula,
thus reducing validity in L to validity in PL. We precede a proof of this theorem with
a more detailed look at consistency and satisfiability via Hintikka sets.
Let Γ be the set of all sets of closed formulae of L. The collection Γ is said
to be the FO consistency property if and only if for each set Δ ∈ Γ , in addition to
properties for α and β types of propositional formulae, it possesses the following
properties for γ and δ types of quantified formulae; for each set Δ ∈ Γ , we require
the following:
(i) if γ ∈ Δ, then Δ ∪ {γ(t)} ∈ Γ for each closed term t of L;
(ii) if δ ∈ Δ, then Δ ∪ {δ(t)} ∈ Δ for some closed term t in L, which has no occur-
rence in Δ.
Proof The proof is on lines of the proof of Lindenbaum’s Lemma: let (φn )∞
n=1 be an
enumeration of all closed formulae of L. We define a new sequence (Δi∗ )i=1
∞
:
(i) Δ1 ∗ = Δ1 ;
(ii) Δ∗n+1 = Δ∗n if Δ∗n ∪ {φn } ∈
/ Γ , else Δ∗n+1 = Δ∗n ∪ {φn } if φn is not of type δ;
∗ ∗
(iii) Δn+1 = Δn ∪ {φn } ∪ {φn (t)} if φn is of type δ and t is a closed term not used
yet (which is possible as we have countably many parameters).
Then, as in propositional case, Δ∗ = n Δ∗n is maximal consistent.
Hintikka sets provide a link to Herbrand models via the following result. It is a
specialization of Theorem 3.5.
3.14 The Theory of Herbrand 143
it follows that
is valid, a contradiction, as β ∈ Δ ∈ Γ .
By condition (ii), only the case of γ type requires a proof. Suppose that Δ ∈ Γ ,
γ ∈ Δ and for aclosed term t, Δ ∪ {γ(t) ∈ / Δ. Hence, there exists a finite D ⊆ T ,
such that ¬HE ( Δ ∧ γ, D) is valid.
144 3 Rudiments of First-Order Logic (FO)
would go ad infinitum. The Herbrand theorem does express a form of the complete-
ness property of FO.
It will be only fair to state that the analysis of the Herbrand theory here has been
influenced by the exposition in Fitting [29]. The idea of FO consistency comes from
Fitting [29] as well.
The proof of completeness theorem in Gödel [30] was followed by a novel idea of a
proof in Henkin [31] by creating models for sets of 1st order formulae as maximal
consistent sets. Simplified in Hasenjaeger [32], the proof is known as the Henkin-
Hasenjaeger proof.
From historic perspective, our exposition in this chapter goes back in historic
time: we have seen already the idea of maximal consistency as the implication for the
model existence, we have met the Löwenheim-Skolem theorem, we have witnessed
the introduction of auxiliary constants called parameters, used to satisfy existentially
quantified formulae. On the other hand, in the Henkin proof we find the Lindenbaum
Lemma. The Henkin proof initiated a long series of results based on His idea. We
will see it in non-classical logics, modal and temporal, for example.
Proof (Henkin [31]). The alphabet of the first-order logic language L is standard:
it consists of symbols ( ) f = ⊥ ⊃: the symbol f ‘false’ is used, following
Church [33] to denote falsity. The acronim ‘wf’ means ‘well-formed (’formula’), the
acronim ‘cf’ means closed (well-formed formula) instead of the original acronim
‘cwff’. Well-formed formulae are defined as usual: (1) if φ, ψ are wfs, then φ ⊃ ψ
is wf; (1’) if φ is wf, then ∀x.φ is wf. As usual, negation of φ is φ ⊃ f , ∃x.φ is
introduced as (∀x.φ ⊃ f ) ⊃ f .
The axiom system of the language L consists of the following schemes. We only
consider cfs.
(2) φ ⊃ (ψ ⊃ φ);
(3) (φ ⊃ ψ) ⊃ ((ψ ⊃ ξ) ⊃ (φ ⊃ ξ));
(4) ((φ ⊃ f ) ⊃ f ) ⊃ φ;
(5) if x is not free in φ, then (∀x.(φ ⊃ ψ)) ⊃ (φ ⊃ ∀x.ψ);
(6) (∀x.φ) ⊃ ψ, where ψ results from substitution of free occurrences of x in φ by
y under proviso that x is independent of y (i.e., no free occurrence in x falls
into a sub-formula of φ of the form ∀y.ξ).
146 3 Rudiments of First-Order Logic (FO)
(III) After all existential formula in Δ0 have underwent step (II), enlarge the
resulting set to a maximal consistent set Δ1 .
(IV) Repeat the steps (II), (III) with Δ1 using parameters in the set P(2) to obtain
a maximal consistent set Δ2 and then in the same manner sets Δi with use of P(i)
for i = 3, 4, . . ..
∞
Finally let Δ∗ = i=1 Δi . The set Δ∗ is maximal consistent and each formula
∗
∃x.χ(x) is in Δ along its substitution χ(x/ pi j ) for an appropriate pi j .
The model proposed for Δ∗ is actually the Herbrand model: its domain D is the
set of constants of the set L ∪ i P(i) and interpretation I sends each constant c
to itself: c I = c. For relational symbols, we assign the extent of them, i.e., to R n
the set of tuples (a1 , a2 , . . . , an ) having the property that Δ∗ R n (a1 , a2 , . . . , an ).
Propositional symbols p are assigned the value T or F depending on whether Δ∗ p.
Claim 2. For each cf φ of L ∪ i P(i), the value assigned to φ is T if and only if
Δ∗ φ and it is in agreement with the semantic value of φ.
Proof of Claim 2. The proof is by structural induction on sub-formulae. For for-
mulae χ of type φ ⊃ ψ, we need to consider some cases.
For a formula χ of type ∀x.φ, suppose that Δ∗ χ. Then, by axiom scheme (6) and
(MP), Δ∗ φ(x) for each x, hence, by hypothesis of induction, the assigned value of
φ(x) is T for each x and this means that χ has the semantic value T which agrees with
the assigned value; on the other hand, if Δ∗ χ does not hold, then Δ∗ χ ⊃ f ,
and, by the scheme (12), and (MP), Δ∗ ∃x.(φ ⊃ f ).
It follows that for an appropriate pi j , after substitution x/ pi j into φ the resulting
formula φ has the property that Δ∗ (φ ⊃ f ). This does exclude the possibility
that Δ∗ φ as such fact would imply by (MP) that Δ∗ f , which is impossible.
Thus, φ(x) is not satisfied for some x, hence the formula χ has the semantic value F
which agrees with the assigned value.
Suppose that cardinality of the alphabet of L is κ and that λ is the first ordinal
of that cardinality; replace in the above proof countable sequences with transfinite
sequences defined on the set λ and well-order by the Zermelo theorem sets of cf
formulae and sets of parameters. The result obtained is the generalization of the
148 3 Rudiments of First-Order Logic (FO)
The intended meaning of symbols is that 0 explains itself, prime denotes the suc-
cessor function, hence, 1 is 0 , 2 is 0 and so on, o means operation, ‘, serves to
denote arithmetic operations: o, is +, o, , is ·, o, , , is exp - exponentiation, same
device as to numerals is applied to the symbol v standing for ‘individual variable’, v,
stands for v1 , v, , for v2 and so on. Meanings of = and ≤ are obvious. The remaining
symbols are those for logical connectives and the universal quantifier; this form of
symbolics comes from Smullyan [34].
By this usage of primes and commas, the infinitely countable universe is encoded
by means of 13 symbols. The notion of a term requires an explication. We recall that
the shortcut cf means closed formula.
(5) an atomic cf c1 = c2 is true if and only if c1 and c2 designate the same natural
number n;
(6) an atomic cf c1 ≤ c2 is true if and only if ci designates a natural number n i for
i = 1, 2 and n 1 ≤ n 2 ;
(7) a cf ¬φ is true if and only if cf φ is not true;
(8) a cf φ ⊃ ψ is true if and only if either φ is not true or ψ is true;
(9) a cf ∀vi .φ is true if and only if for each natural number n, the cf φ(n) is true.
[0 1], [ 0], [( 2], [) 3], [o 4], [, 5], [v 6], [¬ 7], [⊃ 8], [∀ 9], [= X ]
[≤ X ], [# X ].
3.16 The Tarski Theorem on Inexpressibility of Truth 151
In order to assign the Gödel number to a string of symbols, we first represent the
string by the sequence of positions of consecutive symbols in the listing (A) and then
we express the obtained sequence in the base 13, for instance, the natural number n is
represented as the string 0 ... of 0 with n accent signs, represented as the sequence
of 1 followed by n zeros, i.e., in base 13 as 13n .
By E 0 is denoted the expression , for n > 0, E n denotes the expression with the
Gödel number n; it follows that concatenation E n E m of expressions has the Gödel
number n ◦13 m.
Following Tarski and Smullyan, we consider the formula φ(v1 ) where v1 is the
only free variable in φ and we define cf φ(n). The latter is equivalent to the for-
mula ∀v1 .(v1 = n ⊃ φ(v1 )), denoted in what follows φ[n]. We generalize the lat-
ter notation: for any expression E, the symbol E[n] will denote the expression
∀v1 .(v1 = n ⊃ E) which is a formula if E is a formula.
We define a function Λ whose value Λ(x, y) is the Gödel number of the expression
E x [y] which is ∀v1 .(v1 = y ⊃ E x ).
We recall the symbol gn(...) meaning ‘the Gödel number of (...)’.
Proof Indeed, gn(Λ(x, y)) = gn(∀v1 .(v1 =)) ◦13 13 y ◦13 8 ◦13 x ◦13 3, i.e., Λ(x, y)
is Arithmetic, hence, Λ(x, y) = z is Arithmetic.
For a set Q of natural numbers, we let Q ∗ denote the set d −1 (Q), i.e., n ∈ Q ∗ if
and only if d(n) ∈ Q.
Theorem 3.36 For each Arithmetic set Q there exists a Gödel sentence.
152 3 Rudiments of First-Order Logic (FO)
Let T be the set of Gödel numbers of all true Arithmetic sentences (cf’s) of L E . The
theorem by Tarski [1] settles the question of Arithmetic of T in the negative.
We continue with the setting from Sect. 3.16. We address the Gödel incomplete-
ness theorem Gödel [36] following Smullyan [34]. We begin with axiomatization of
Arithmetic known as Peano Arithmetic. We continue from Sect. 3.16 with inclusion
of exponentiation into arithmetic operations and with the system of Gödel numbering
adopted there, and, we denote the system to be presented as L P E . In this case we
meet both logical axioms for 1st-order logic FO and arithmetic axioms. We begin
with logical axioms due to (Kalish, Montague [37]).
Lemma 3.1 The following relations are Arithmetic. We recall that the relation
ex p(x, y) denotes the expression x y .
(1) pr e(x, y) and su f (x, y):
σ : # φ1 # φ2 # . . . #φk #
and gn(σ) which is called the sequence number. This new construct induces
some new relations. We recall that gn(#) = X . Relations are:
(a) Seq(x), x is gn(σ) for some σ:
(4) relations which define terms and formulae: the relation F(t1 , t2 , t3 ) holds if and
only if t3 is one of t1 + t2 , t1 · t2 , ex p(t1 , t2 ), t1 . Then, an expression t is a term
if and only if there exists a proof t1 , t2 , . . . , tk , where each ti is a variable or a
numeral or F(t j , tl , ti ) holds with j, l < i.
For formulae, we let G(φ1 , φ2 , φ3 ) to hold in cases where φ3 is one of ¬φ1 ,
¬φ2 , φ1 ⊃ φ2 , for some vi , ∀vi φ1 , ∀vi φ2 . A φ is a formula if it is an element of a
sequence φ1 , φ2 , . . . , φk with each φi either an atomic formula or G(φ j , φl , φi )
holds with j, l < i.
These relations are Arithmetic; proof is given below. For an expression E, the
symbol E x denotes that x = gn(E). We embark on the second part of arithmetization
of L P E .
Forming sequences serve the purpose of replacement of inductive definitions of
terms or formulae with formal proof-like definitions. Let F(t1 , t2 , t3 ) be a relation
which holds if t3 is either t1 + t2 or t1 · t2 , or, ex p(t1 , t2 ). Then we say that t is a term if
and only if there exists a sequence t1 , t2 , . . . , tn called a term-forming sequence such
that each ti is either a variable or a numeral, or there exists an instance F(tk, tl , ti )
with k, l < i. The expression t is a term if there exists a term-forming sequence with
t as its element.
We treat formulae in a similar way: let G(φ1 , φ2 , φ3 ) holds if and only if φ3 is one
of: ¬φ1 or ¬φ2 , or, φ1 ⊃ φ2 , or, ∀vi .φ1 , or, ∀vi .φ2 , for some vi . A formula-forming
sequence is a sequence φ1 , φ2 , . . . , φm such that each φi is an atomic formula or it
satisfies G(φk , φl , φi ) for some k, l < i. A φ is a formula if it is an element of a
formula-forming sequence.
We list arithmetic and logical expressions and symbols for their Gödel numbers.
We consider expressions E x , E y and we list Gödel numbers for:
Expressions (i)–(ix) are Arithmetic, for instance, gn = (x, y) = 2 ◦13 x ◦13 η ◦13
y ◦13 3.
Now, we continue the list or relations necessary for the proof. In order to facilitate
the task of arithmetization, we borrow a trick: instead of I n(x, y) we will write xεy.
This will alow to write ∀yεx in some formulae below, instead of wrestling with the
problem of formulae ∀y I n(y, x) ∧ .. which would call for ⊃.
The term A(y) denotes that y is an instance of an axiom scheme. We leave the
arithmetization of axiom schemes off. The Reader may fill this gap in at their will,
and we assume that A(y) is arithmetized. It follows that all formulae are arithmetic.
We denote by the symbol P the set of all Gödel numbers of provable formulae of
L P E and the symbol R will stand for the set of Gödel numbers of refutable formulae.
This proof which we owe to Smullyan [34] is probably the simplest. The orig-
inal proof in Gödel [36] was based on the notion of ω-consistency: a system is
ω-inconsistent if there exists a formula φ(x) such that the formula ∃x.φ(x) is prov-
able but for each n, the formula φ(n) is refutable. A system is ω-consistent if it is
not ω-inconsistent. Gödel’s formulation of incompleteness theorem was: ‘if Peano
Arithmetic is ω-consistent, then it is incomplete’. Rosser [38] proved incompleteness
of Peano Arithmetic under assumption of mere consistency.
Definition 3.49
We adopt or recall the following notation:
(P) the symbol P denotes the set of Gödel numbers of provable formulae;
(R) the symbol R denotes the set of Gödel numbers of refutable (i.e., not provable)
formulae;
(E n ) the symbol E n denotes that the Gödel number of the expression E is n;
(E n (n)) the symbol E n (n) denotes the Gödel number of E n (n) (cf. the di-
agonal function in sect. 15.);
(P ∗ ) the symbol P ∗ denotes the set {n : E n (n) is provable};
(R ∗ ) the symbol R ∗ denotes the set {n : E n (n) is refutable}.
Theorem 3.39 Under assumptions about Σ, if a formula ¬F(v1 ) represents the set
P ∗ and f = gn(F(v1 )), then F( f ) is neither provable nor refutable.
Proof Since ¬F(v1 ) represents P ∗ , F(n) is refutable if and only if n ∈ P ∗ , for each
n. In particular, F( f ) is refutable if and only if f ∈ P ∗ . On the other hand, F( f ) is
provable if and only if f ∈ P ∗ . Thus, we have two cases: (a) F( f ) is provable and
refutable (b) F( f ) is neither provable nor refutable. The case (a) must be dismissed
by consistency assumption, hence, (b) remains.
Theorem 3.40 Suppose that the formula Ψ (v1 ) separates the set A from the set B
in Σ. Then, Ψ (v1 ) represents a set C which contains A and is disjoint from B.
Theorem 3.41 If Ψ (v1 ) separates P ∗ from R ∗ and p is the Gödel number of Ψ (v1 ),
then the formula Ψ ( p) is undecidable.
It is now desirable to have an explicit formula which separates two sets. Let us
observe that for given sets A, B it is sufficient to separate sets A \ B and B \ A.
Proof Suppose that the set A is enumerated by the formula A(x, y) and the set B is
enumerated by the formula B(x, y).
Claim. The formula (∀y.A(x, y)) ⊃ (∃z ≤ y.B(x, z)) separates A \ B from B \ A.
Proof of Claim. Suppose that n ∈ B \ A; as n ∈ B, there exists k such that (i)
B(n, k) is provable (in Σ).
As n ∈ / A, A(n, m) is refutable for each m, hence, by (IV), the sentence ∀(y ≤
k)¬A(n, y) is provable, and, the formula y ≤ k ⊃ ¬A(n, y) is provable which is
158 3 Rudiments of First-Order Logic (FO)
equivalent to provability of A(n, y) ⊃ ¬(y ≤ k). By (V), the formula (ii) A(n, y) ⊃
(k ≤ y) is provable.
By (i) and (ii), the formula (iii) A(n, y) ⊃ (k ≤ y) ∧ B(n, k) is provable.
From (iii), we obtain the provable formula (iv) A(n, y) ⊃ (∃z ≤ y) ∧ B(n, z);
the inference rule (Gen) yields from (iv) the formula (v) ∀y(A(n, y) ⊃ (∃z ≤ y) ∧
B(n, z)).
Suppose now that n ∈ A \ B, hence, there exists k such that A(n, k) is provable
and for each m the formula B(n, m) is refutable. By (IV), the formula (vi) ∀(z ≤
k)¬B(n, z) is provable. This implies provability of A(n, k) ∧ ∀(z ≤ k)¬B(n, z) and
provability of
(vii) ¬(A(n, k) ⊃ ∃(z ≤ k).B(n, z)),
Theorem 3.43 If the system Σ is consistent, sets P ∗ and R ∗ are enumerable and
all instances of axiom schemes (IV) and (V) are provable in Σ, then Σ is incomplete
and the incompleteness is witnessed by the Rosser sentence
is undecidable.
The Rosser sentence is often paraphrased as the statement ‘if the given formula
is provable, then there is a shorter (i.e., with a smaller Gödel number) proof of its
unprovability’.
We recall that
(i) individual variables and constants are terms; terms are denoted as t, s, . . .;
(ii) atomic formulae are expressions of the form t = s or Pi (t1 , t2 , . . . , ta(Pi ); a(Pi )
is the arity of Pi ;
(iii) formulae are expressions φ ∨ ψ, φ ∧ ψ, φ ⊃ ψ, ¬ψ, ∀x.φ, ∃x.φ in case φ and
ψ are formulae.
The notion of satisfaction under given interpretation I and assignment V in a
structure M = (D, I, V ) is defined in the standard for FO manner. The definition of
truth for a structure is also standard for FO. If a formula is true in a structure M,
them M is a model for the formula. A formula true in all models is valid. Otherwise
it is invalid.
The notion of satisfaction for pointed structures is defined in the standard way;
the symbol x/d means substitution for all free occurrences of variable x in a formula
by an element d ∈ D.
(i) for each set {d1 , d2 , . . . , dn } ⊆ D1 and relation P I1 of arity n, the equivalence
holds: (d1 , d2 , . . . , dn ) ∈ P I1 if and only if (h(d1 ), h(d2 ), . . . , h(dn )) ∈ P I2 ;
(ii) h(c I1 ) = c I2 for each constant symbol c.
(i) for each relation P I1 of arity n and each set {d1 , d2 , . . . , dn } ⊆ dom( f ),
P I1 (d1 , d2 , . . . , dn ) if and only if P I2 ( f (d1 ), f (d2 ), . . . , f (dn )) holds;
(ii) for each constant symbol c, if c I1 ∈ dom( f ) then f (c I1 ) = c I2 .
We now define the crucial notion of FO-definability, opening the way up to assert-
ing whether a given class of structures can be axiomatized within FO. We recall that
Cls − mod(φ) is the collection of all structures which are models for φ.
The following theorem brings forth the methodology for answering the FO-
definability question in the negative.
Theorem 3.45 For a class C of finite structures, if for each natural number m there
exist structures M1 and M2 such that: (i) M1 ≡m M2 ; (ii) M1 ∈ C and M2 ∈ / C, then
C is not FO-definable.
Proof Suppose that, to the contrary, C is FO-definable and let φ be the formula
with the property that C = Cls − mod(φ). Let m = qr (φ). As, by (i), M1 ≡m M2 ,
and, by (ii), M1 |= φ, it follows by Definition 3.60 that M2 |= φ, hence, M2 ∈ C, a
contradiction.
In the light of Theorem 3.45, it is important to have a test for the relation ≡m . This
is supplied by Ehrenfeucht games Ehrenfeucht [40].
In each party of the game, players make m moves, beginning with the first move
by Spoiler, who selects an element either from D1 or from D2 to which
Duplicator responds with a choice of an element from the set not chosen by Spoiler in
its first move. This pattern is repeated m − 1 times and the play is terminated leaving
players with the pointed structures (D1 , (a)k1 (u)m
1 ) and (D2 , (a)1 (w)1 ), where (u)1
k m m
162 3 Rudiments of First-Order Logic (FO)
are elements chosen by players from the set D1 and (w)m 1 are the elements chosen
by players from the set D2 .
Duplicator wins the party if and only if the mapping f : (a)k1 (u)m1 → (b)1 (w)1 is
k m
a partial isomorphism. Duplicator has a winning strategy in the game G m (M1 , (a)k1 ;
M2 , (b)k1 ) if and only if it wins every party of the game.
An example of the winning strategy for Duplicator, which has a better position
as it always makes the second move in each ply, is when structures M1 and M2
are isomorphic under an isomorphism h, because then if Spoiler selects an element
u ∈ D1 , then Duplicator responds with h(u) ∈ D2 , and, for a choice of w ∈ D2 by
Spoiler, Duplicator responds with h −1 (w) ∈ D1 . This remark establishes
if and only if the mapping f : (a)k1 → (b)k1 is a partial isomorphism. For m > 0, we
have the following properties to observe.
Theorem 3.47 The following statement holds for the Ehrenfeucht game, please
observe that the subscript m means m moves to be made: (i) if the Duplicator has
the winning strategy in the game
j j
then for each j < m the position (a)k1 (u)1 ; (b)k1 (w)1 establishes a partial isomor-
j j
phism f j : (a)k1 (u)1 → (b)k1 (w)1 .
Corollary 3.5 At each stage j < m of each party of the game G m , if Duplicator has
the winning strategy for the game G m , then there are moves extending the winning
strategy to G j−1 , viz.
(i) (forth) for each a ∈ A, there exists b ∈ D2 such that the pair (a, b) added to
the position of G j provides a partial isomorphism at the position of G j−1 ;
(ii) (back) for each b ∈ B, there exists a ∈ D1 such that the pair (a, b) added to
the position of G j provides a partial isomorphism at the position of G j−1 .
The next result Ehrenfeucht [40] paves the way from existence of the winning
strategy for Duplicator to m-equivalence of structures.
Theorem 3.48 If Duplicator has the winning strategy in the game G m (M1 , (a)k1 ;
M2 , (b)k1 ), then for each formula φ(x1 , x2 , . . . , xk ) of quantifier rank less or equal
to m, M1 |= φ(a1 , a2 , . . . ak ) if and only if M2 |= φ(b1 , b2 , . . . , bk ).
3.20 Ehrenfeucht Games 163
Proof It is by induction on m.
Case 1. m = 0; Duplicator wins game G 0 in position (a)k1 ; (b)k1 if and only if f 0 :
(a)k1 → (b)k1 is a partial isomorphism and the thesis follows by definition of a partial
isomorphism.
Case 2. m > 0: as the class of formulae satisfying the thesis is closed on Boolean
connectives and negation, the only case is that of quantified formulae, so consider a
formula φ of the form ∃y.ψ(x1 , x2 , . . . , xk , y). Suppose that M1 |= φ(a1 , a2 , . . . ak ),
hence, M1 |= ψ(a1 , a2 , . . . ak , a) for some a ∈ D1 . As Duplicator has the win-
ning strategy in G m , by 18.4 (i), there exists b ∈ B such that Duplicator wins
G m−1 in position (a)k1 a; (b)k1 b. As qr (ψ) ≤ m − 1, by the hypothesis of induction,
M2 |= ψ(b1 , b2 , . . . , bk , b), i.e., M2 |= φ(b1 , b2 , . . . , bk ). By symmetry, the converse
follows as well.
(i) for each j ≤ m, for each a ∈ D1 , and, each h ∈ I j , there exists g ∈ I j−1 such
that g extends h and a ∈ dom(g); (i) is (forth property);
(ii) for each j ≤ m, for each b ∈ D2 , and, each h ∈ I j , there exists g ∈ I j−1 such
that g extends h and b ∈ r ng(g); (ii) is (back property). We denote the fact of
an m-isomorphism between M1 and M2 due to (I j )m 1 as (I j )0 : M1 ∼ M2 .
m
M1 |= φ ≡ M1 |= ¬ψ ≡ ¬M1 |= ψ ≡ ¬M2 |= ψ ≡ M2 |= ¬ψ ≡ M2 |= φ.
In case of φ which is ψ ∨ ξ:
Example 3.13 The class EVEN of sets of even cardinality is not FO-definable.
Proof The relational vocabulary of EVEN=∅. For a given m, let us consider sets A
and B with |A| = 2k > m and |B| = 2k + 1. Obviously, A ∈ E V E N , B ∈ / EV E N.
In the game G m (A, B), Duplicator has the winning strategy: we prove it by induc-
tion on the number of moves: suppose that the position is after i − th move by
each player and Spoiler selects its (i + 1) − st, ai+1 , element from, say, the set
A. In case ai+1 has been already selected as an element a j , Duplicator selects
already selected element b j ∈ B, otherwise Duplicator selects any element in the
set B\{alr eady selected elements o f B}. By Theorem 3.45, the class EVEN is not
FO-definable.
3.20 Ehrenfeucht Games 165
Example 3.14 The class EVEN(LO) of linear finite ordered sets of even cardinality
is not FO-definable.
Proof The relational vocabulary of EVEN(LO)={<, min, max} where < is a binary
linear ordering predicate and min, max are constants which in corresponding struc-
tures denote the least (l) and the greatest (g) elements. Given m, let us consider
ordered sets A, B of cardinalities |A| = 2k and |B| = 2k + 1. We suppose that after
i moves the position is (a)k1 ; (b)k1 . The inductive condition to be checked is:
The condition (a p < aq ↔ b p < bq ) guaranties partial isomorphism, the first two
allow for the winning strategy by Duplicator. The initial step 0 of induction can be
provided by prefixing (a)k1 by l A , g A and by prefixing (b)k1 by l B , g B . To prove it,
we consider the next ply i + 1. Suppose that Spoiler selects a ∈ A, the other case is
symmetrical. We consider cases in (ind).
Case 1. selected element a falls into an interval [a p , aq ] with no other already selected
element of A in it - we have a sufficient space to assume this, and then the correspond-
ing B-interval [b p , bq ] contains no already selected element of B. If |a p − aq | < 2k−i ,
then, by (ind), [b p , bq ] is of the same length as [a p , aq ] and Duplicator can find
b ∈ [b p , bq ] such that [a p , aq ] and [b p , bq ] are isomorphic.
Case 2. |a p − aq | ≥ 2k−i and, by (ind), |b p − bq | ≥ 2k−i . Either a falls in one of the
open intervals defined by the middle point of [a p , aq ] and Duplicator selects b in
same relative distances from b p and bq as a is to a p and aq , or, a divides [a p , aq ] into
equal halves and Duplicator selects midpoint of [b p , bq ]. In all cases this provides
winning strategy for Duplicator.
Example 3.15 The class CONN of finite directed connected graphs is not FO-
definable.
The situation changes when we are allowed to quantify over sets represented
as, e.g., relations. Consider anew the class CONN of undirected graphs with the
166 3 Rudiments of First-Order Logic (FO)
∃x.∀y.P(x, y)}
(φ ⊃ (ξk ⊃ ξi )) ⊃ ((φ ⊃ ξk ) ⊃ (φ ⊃ ξi ))
The Craig interpolation theorem Craig [43] states that given closed formulae φ, ψ
such that the formula φ ⊃ ψ is valid, there exists a closed formula η, called an
interpolant, which satisfies two conditions:
(i) all non-logical symbols in η occur in φ ∨ ψ;
(ii) both formulae φ ⊃ η and η ⊃ ψ are valid.
We recall that non-logical symbols are those interpretable ones: symbols of constants,
functions and relations.
Please observe that the crucial condition is (i), otherwise we could have trivial
η’s, hence, it is (i) that makes proofs more difficult. In those proofs the principal
role is played by consistency: if there is no interpolant, then the set {φ, ¬ψ} is
consistent, in the contrary case the set is inconsistent. In the proof which we include
due to Halvorson, [44], out of many proofs, we meet familiar themes od maximal
consistency, the idea of the Lindenbaum Lemma and the Henkin construction.
168 3 Rudiments of First-Order Logic (FO)
Theorem 3.51 If there is no interpolant for φ ⊃ ψ, then the set {φ, ¬ψ} is consistent.
We now use the Henkin construction to provide models M1 for Q 1 and M2 for
2
Q (notice that existential formulae are already grounded by our use of parameters),
which actually are isomorphic over L1,2 as the model for Q 1 ∩ Q 2 . This yields the
common model M for Q 1 ∪ Q 2 ; as φ ∈ Q 1 and ¬φ ∈ Q 2 , hence both φ, ¬ψ ∈ M,
it follows that φ ⊃ ψ is not valid, a contradiction. Hence, there exists an interpolant
for the closed formula φ ⊃ ψ. The proof is concluded.
The problem of how to find effectively an interpolant can be solved within any
paradigm for proof, e.g., tableaux, resolution, circuit theory. Let us employ tableaux.
We provide an analysis of this approach which applies also to the discussion
of Craig’s interpolation theorem in Chap. 2. For a formula φ ⊃ ψ the proof of its
validity is the closeness of each tableau for the formula ¬(φ ⊃ ψ), i.e., for the
formula φ ∧ ¬ψ. These two conjuncts fill the first two lines of the tableau. In order
to most easily describe the procedure for finding an interpolant form the tableau,
we adopt the markers proposed in Fitting [29], to wit, we mark formulae to the left
of ⊃ with the symbol L (left) and those to the right with R.
In the general setting, we have the formula which we represent in the marked
form as
(∗) Lφ1 , Lφ2 , . . . , Lφn , Rψ1 , Rψ2, . . . , Rψm .
Then, we define an interpolant for the marked set (*) as the interpolant for the formula
(∗∗) φi ⊃ ¬ψ j .
i≤n j≤m
This would yield for the original formula in the tableau format Lφ, R¬ψ the inter-
polant for the formula φ ⊃ ψ.
For the purpose of the further discussion, we shorten formulae: (*) to LΦ, RΨ and
(**) to Φ ⊃ ¬Ψ . We now propose interpolants for particular cases. Our discussion
encompasses the propositional case in Ch.II.
Case 1. LΦ, Lφ, L¬φ, RΨ : the formula (**) is Φ ∧ φ ∧ ¬φ ⊃ ¬Ψ , the interpolant
is ⊥;
Case 2. LΦ, Rφ, R¬φ, RΨ : the formula is Φ ⊃ ¬φ ∨ φ ∨ ¬Ψ , the interpolant
is ;
Case 3. LΦ, Lφ, R¬φ, RΨ : the formula (**) is Φ ∧ φ ⊃ ¬¬φ ∨ ¬Ψ , the inter-
polant is φ;
Case 4. LΦ, L¬φ, R(φ), RΨ : the formula is Φ ∧ ¬φ ⊃ ¬φ ∨ ¬Ψ , the interpolant
is ¬φ;
Case 5. LΦ, L(⊥): the formula is Φ ∧ ⊥ ⊃ ¬Ψ , the interpolant is ⊥;
Case 6. LΦ, R(⊥), the formula is Φ ⊃ , the interpolant is ;
Case 7. Obvious: if LΦ, L(), RΨ has interpolant φ, then φ is an interpolant for
LΦ L¬⊥, RΨ ; same for replacement /⊥, ¬⊥/¬ and L/R;
170 3 Rudiments of First-Order Logic (FO)
Case 8. For φ of type α, if LΦ, Lφ1 , Lφ2 , RΨ has an interpolant ψ, then LΦ, L(φ),
RΨ has an interpolant ψ;
Case 9. For ψ of type α, if LΦ, Rψ1 , Rψ2 , RΨ has an interpolant η, then LΦ,
Rφ, RΨ has an interpolant η;
Case 10. For φ of type β, if LΦ, Lφ1 , RΨ has an interpolant χ and LΦ, Lφ2 , RΨ
has an interpolant ξ, then LΦ, Lφ, RΨ has the interpolant χ ∨ ξ: formulae in this
case are Φ ∧ φ1 ⊃ ¬Ψ , and Φ ∧ φ2 ⊃ ¬Ψ , hence,Φ ∧ (φ1 ∨ φ2 ) ⊃ ¬Ψ has the
interpolant χ ∨ ξ;
Case 11. For φ of type β, if LΦ, Rφ1 , RΨ has an interpolant η and LΦ, Rφ2 , RΨ
has an interpolant δ, then LΦ, Rφ, RΨ has the interpolant η ∧ δ; formulae in this
case are Φ ⊃ ¬φ1 , ¬Ψ and Φ ⊃ ¬φ2 , ¬Ψ , hence, Φ ⊃ ¬φ1 ∨ ¬φ2 ∨ ¬Ψ is φ ⊃
¬(φ1 ∧ φ2 ), ¬Ψ , hence, the interpolant is η ∧ δ;
Case 12. For a formula γ of type γ, quantified universally, suppose
(i) that η is an interpolant for LΦ, Lγ(c), RΦ where c has occurrences in Φ, then
η is the interpolant for LΦ, Lγ, RΨ ;
(ii) that η is an interpolant for LΦ, Lγ(c), RΦ where c has no occurrences in
Φ, then ∀xη(c/x) is the interpolant for LΦ, Lγ, RΨ , where x is an idividual
variable not in Φ, γ;
(iii) that η is an interpolant for LΦ, Rγ(c), LΨ and the constant c occurs in Ψ , then
η is the interpolant for LΦ, Rγ, RΦ;
(iv) that η is an interpolant for LΦ, Rγ(c), RΨ and c has no occurrence in Ψ , then
∃x.η(c/x) is the interpolant for LΦ, Rγ, RΨ .
The Reader will check please that the formula Q yields the signed biased set
{L(∀x(P(x) ⊃ Q(x))); R(¬(P(x) ⊃ (Q(x) ⊃ P(x))))} which after expanding the
tableau yields the interpolant (¬P(x) ∨ P(x)) ≡ .
Now, the Beth theorem Beth [8] states that each implicit definition induces an
explicit definition.
Proof (Craig [43]). One can foresee that the formula which will provide the explicit
definition of P is going to be an interpolant. Definition 3.64 supplies us with two
sets of formulae: Γ and Γ # and these formulae will provide us with a valid impli-
cation which will yield an interpolant defining P explicitly. The rest is the matter of
technique.
We begin, on the basis of the assumption in Theorem 3.52 and Definition 3.64
with
The valid implication (iii) and the Craig theorem supplies an interpolant
φ( p2 , p2 , . . . , pn ), i.e.,
(iv) Δ ∧ P( p1 , p2 , ..., pn ) ⊃ φ( p2 , p2 , ..., pn ) ⊃ ( Δ# ⊃ P # ( p1 , p2 , ..., pn ))
Finally,
(i x) Γ |= (P( p1 , p2 , . . . , pn ) ≡ φ( p2 , p2 , . . . , pn )).
3.23 Problems
< h in ( f 1 (i), f 2 (i), . . . , f n (i) >i∈I ∼ F < h in (g1 (i), g2 (i), . . . , gn (i) >i∈I .
The following three problems concern Ehrenfeucht’s games and come from
(Kolaitis, Ph. G.: On the expressive power of logics on finite models. In: Finite
Model Theory and its Applications. Springer (2007)).
References
1. Tarski, A.: Der Wahrheitsbegriff in den formalisierten Sprachen. Stud. Philos. 1, 261–405
(1936). (Also in: Tarski, A.: Logic, Semantics, Metamathematics. Oxford University Press
(1956, 1983))
2. Gentzen, G.: Untersuchungen über das Logische Schliessen. Math. Z. 39(176–210), 405–431
(1934)
3. Jaśkowski, S.: Teoria dedukcji oparta na dyrektywach założeniowych (in Polish) (Theory
of deduction based on suppositional directives). In: Ksiȩga Pamia̧tkowa I Polskiego Zjazdu
Matematycznego. Uniwersytet Jagielloński, Kraków (1929)
4. Jaśkowski, S.: On the rules of suppositions in formal logic. Stud. Logica 1, 5–32 (1934). (Also
in: Storrs McCall (ed.). Polish Logic 1920–1939. Oxford U. P., 232–258 (1967))
5. Indrzejczak, A.: Sequents and Trees. Springer Nature Switzerland, Cham, Switzerland (2021)
6. Smullyan, R.M.: First Order Logic. Dover, Minneola N.Y (1996)
7. Rasiowa, H., Sikorski, R.: The Mathematics of Metamathematics. Polish Scientific Publishers
(PWN). Warsaw (1963)
8. Beth, E.W.: The Foundations of Mathematics: A Study in the Philosophy of Science. Harper
& Row Publishers, New York (1966)
9. Hintikka, K.J.J.: Form and content in quantification theory. Acta Philosophica Fennica 8, 7–55
(1955)
10. Löwenheim, L.: Über möglichkeiten im Relativkalkül. Math. Ann. 76(4), 447–470 (1915).
https://doi.org/10.1007/bf01458217. (Also in: Van Heijenoort,J. (ed.): From Frege to Gödel.
A Source Book in Mathematical Logic, 1879-1931, pp. 228–251. Harvard U. Press, Cambridge
MA (1967))
11. Skolem, T.A.: Logico-combinatorial investigations in the satisfiability or provability of mathe-
matical propositions: A simplified proof of a theorem by L. Löwenheim and generalizations of
the theorem. In: Van Heijenoort, J. (ed.) From Frege to Gödel: A Source Book in Mathematical
Logic, 1879–1931, pp. 252–263. Harvard University Press, Cambridge MA (1967)
References 177
42. Mendelson, E.: Introduction to Mathematical Logic. CRC Press. Taylor and Francis Group,
Boca Raton FL (2015)
43. Craig, W.: Three uses of the Herbrand-Gentzen theorem in relating model theory and proof
theory. J. Symb. Logic 22(3), 269–285 (1957)
44. Halvorson, H.: https://www.princeton.edu/hhalvors/teaching/phi312_s2013/craig.pdf
45. Chang, C.C., Keisler, J.H.: Model Theory. Elsevier Science Publication, Amsterdam (1992)
Chapter 4
Modal and Intuitionistic Logics
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 179
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4_4
180 4 Modal and Intuitionistic Logics
Modal logics described here play important roles as a basis for models for reason-
ing in system analysis, model checking, software verification, epistemic and doxastic
logics, agent systems. We adopt L as the symbol for necessity and M as the symbol
for possibility, departing from very often used symbols of box [] and diamond .
Basic modal operators express necessity (symbol L) and possibility (symbol M);
formula Lφ reads it is necessary that φ and the formula Mφ reads it is possible
that φ.
The formal buildup of SML begins with formulae. We define the recurrent set of
well-formed formulae and the symbol wf will denote that a formula is well-formed.
Theorem 4.1 Modal logic K is normal. The following formulae are provable in K:
In Table 4.1 we prove the formula (i). In Table 4.2, we give a proof of the for-
mula (iii).
Semantics for K is the possible worlds semantics due to Saul Kripke (the Kripke
semantics, the possible worlds semantics) (Kripke [6]). The notion of a possible
world goes back to Leibniz and possible world semantics was initiated in Carnap
[5], also in connection with the famous problem posed by Frege of ‘the Morning
Star’ and ‘the Evening Star’.
In Kripke semantics, we observe a fusion of the idea of a possible world with
the Tarski semantics. Kripke structures correspond in a sense to interpretations in
predicate logic.
Example 4.1 Assume that a world w in a model M is such that N F (w) = ∅. Then
the formula L p ⊃ p is not true at w: if A( p, w) = 0, then p is false at w while L p
is true at w as the universal quantification of any formula over the empty set yields
us truth. The same argument shows the falsity of the formula L p ⊃ M p: one may
say that ‘what is necessary is impossible’.
Proof Consider a pointed structure (M, w). Suppose that the premiss L( p ⊃ q) and
the premiss L p are true at w. Then for each world w in the neighborhood N F (w),
formulae p ⊃ q and p are valid at w , hence, by detachment the formula q is valid
at w , and this implies that Lq is true at w so the formula (K) is true at w and
arbitrariness of (M, w) testifies to the validity of (K).
Example 4.2 We give exemplary proofs of validity for formulae (i),(ii) below.
Proof We prove (i). Suppose that L(φ ⊃ ψ) is true at a world w in a pointed structure
(M, w). The formula φ ⊃ ψ is true at each w ∈ N F (w). Suppose that the formula
Mφ is valid at w, hence, there exists a world w ∈ N F (w) such that the formula φ
is true at w . As the implication φ ⊃ ψ is true at w , the formula ψ is true at w by
detachment, which implies that the formula Mψ is true at w so the formula (i) is true
at (M, w) and in consequence, it is valid.
Now, we prove (ii). Suppose that the formula M(φ ⊃ ψ) is true at the world w
which implies that the formula φ ⊃ ψ is true at some w ∈ N F (w). Suppose that
the formula Lφ is true at w, hence, the formula φ is true at each world in N F (w).
By detachment, the formula ψ is true at w which shows that the formula Mψ is
true at w.
There are schemes that are not valid in K.
Theorem 4.4 The following schemes are not valid in the modal system K:
(i) L(φ ∨ ψ) ⊃ (Lφ) ∨ (Lψ);
(ii) (Mφ) ∧ (Mψ) ⊃ M(φ ∧ ψ);
(iii) φ ⊃ L Mφ;
(iv) Mφ ⊃ L Mφ;
(v) M Lφ ⊃ L Mφ.
Proof Consider the set of possible worlds W = {w1 , w2 , w3 } with the assignment A:
A(w1 , p) = A(w3 , p) = A(w1 , q) = A(w2 , q) = 1 and A(w2 , p) = A(w3 , q) = 0;
the relation R has instances (w1 , w2 ), (w1 , w3 ), (w2 , w3 ), (w3 , w3 ). Then, in the
structure S1 = (W, R, A): (i) is not true at w1 , (ii) is equivalent to (i), (iii) is not
true at w1 , (iv) is not true at w1 . In this structure (v) is satisfied. In order to fal-
sify (v), we consider the structure S2 = (W , R A ) with W = {w1 , w2 , w3 , w4 },
R = {(w1 , w2 ), (w1 , w3 ), (w4 , w2 ), (w4 , w3 )} and any assignment A . Then, (v) is
not true at w1 .
From the above it follows that properties of logic depend on properties of acces-
sibility relations. We already know that logic K does not set any demands on acces-
sibility relations in its models. For other logics, properties of the relation R are
instrumental. We gather below in pairs formulae of modal logic alongside types of
relations of accessibility which make the formulae valid.
Theorem 4.5 The following are pairs of particular formulae and accessibility rela-
tions which define Kripke structures in which formulae are true, hence, valid:
(i) (T) Lφ ⊃ φ: formula (T) is true in all structures in which accessibility relation
R is reflexive, i.e., R(w, w) for each w. Such structures are said to be reflexive;
(ii) (B) φ ⊃ L Mφ: formula (B) is true in all structures in which accessibility
relation is symmetric, i.e., if R(w, v) then R(v, w) for each v, w ∈ W . Such
structures are said to be symmetric;
(iii) (4) Lφ ⊃ L Lφ: formula (4) is true in all structures in which accessibil-
ity relation is transitive, i.e., if R(w, v) and R(v, u) then R(w, u) for each
w, v, u ∈ W . Such structures are said to be transitive;
4.2 Semantics of the Modal System K 185
(iv) (D) Lφ ⊃ Mφ: formula (D) is true in all structures in which accessibility is
serial, i.e., for each w there exists v such that R(w, v). Such structures are
called serial;
(v) (5) Mφ ⊃ L Mφ: formula (5) is true in all structures in which accessibil-
ity relation is Euclidean, i.e., if R(w, v) and R(w, u) then R(v, u) for each
w, v, u ∈ W . Such structures are said to be Euclidean;
(vi) (DC) Mφ ⊃ Lφ: formula (DC) is true in all structures in which accessibil-
ity relation is partly functional, i.e., if R(w, v) and R(w, u) then v = u, or,
functional, i.e., there exists v such that R(w, v) and for each u, if R(w, u)
then u = v, for each w, v, u ∈ W . Such structures are called partly func-
tional/functional;
(vii) (4C) L Lφ ⊃ Lφ: formula (4C) is true in all structures in which accessibility
relation is (weakly) dense, i.e., for each pair w, v, if R(w, v), then there exists
u such that R(w, u) and R(u, v). Such structures are said to be dense;
(viii) (G) M Lφ ⊃ L Mφ: formula (G) is true in all structures in which accessibility
relation is directed, i.e., for each triple w, v, u, if R(w, v) and R(w, u) then
there exists t such that R(v, t) and R(u, t). Such structures are called directed.
Proof We prove statements (i)–(viii). For (i): Consider a frame F = (W, R) in which
accessibility relation R is reflexive. Suppose that the formula Lφ is true at w ∈ W
which means that if w ∈ N F (w), then w |= φ. As R(w, w), w ∈ N F (w), hence,
w |= φ.
For (ii), suppose that a frame F = (W, R) is symmetric and the formula φ is true
at w ∈ W . We need to prove the truth of the formula L Mφ at w which means that
if w ∈ N F (w) then there exists w ∗ ∈ N F (w ) such that w ∗ |= φ. By symmetry, we
can take w ∗ = w which proves truth of the formula.
For (iii), suppose that Lφ is true at w ∈ W and the frame (W, R) is transitive.
Truth of L Lφ at w means that if w ∈ N F (w) and w ∗ ∈ N F (w ) then w ∗ |= φ. By
transitivity of R, w ∗ ∈ N F (w) and, by truth of Lφ at w, we have w ∗ |= φ which
proves the case.
Concerning (iv), suppose that a frame F = (W, R) is serial and consider the
formula (D): Lφ ⊃ Mφ. To prove its truth at w ∈ W , assume that the formula Lφ is
true at w which means that if w ∈ N F (w), then w |= φ. By the seriality property
of R, there exists w ∗ such that w ∗ ∈ N F (w), hence, w ∗ |= φ by which we conclude
that w |= Mφ.
For (v), consider a Euclidean frame F = (W, R) and suppose that the formula Mφ
is true at w ∈ W . There exists w with R(w, w ). If R(w, w ∗ ), then R(w ∗ , w ), hence,
w ∗ |= Mφ and this holds true for each w + such that R(w, w+ ) thus w |= L Mφ.
For (vi), assume that a frame F = (W, R) is functional and the formula Mφ is true
at w ∈ W . It suffices to consider the only w ∈ N F (w) satisfying the definition of
functionality. If w |= Mφ then w |= φ and, it being the only neighbor of w, w |= Lφ.
To treat the case (vii), assume the dense frame F = (W, R) and truth of the
premise L Lφ at w ∈ W . Suppose that w ∈ N F (w) and w |= L Lφ, hence, w |= Lφ.
Consider w ∗ such that w ∗ ∈ N F (w) and w ∈ N F (w ∗ ). Then w ∗ |= Lφ and w |= φ
by which w |= Lφ.
186 4 Modal and Intuitionistic Logics
Theorem 4.9 Any relation R which is symmetric and Euclidean is transitive. Hence,
any model for (B5) is a model for (4). Hence (B5) extends (4).
Proof (i) implies (ii): given w with R(w, w ), R(w, w ∗ ), we have by symmetry that
R(w , w), R(w, w ∗ ) and transitivity implies R(w , w ∗ );
(ii) implies (iii): as R is reflexive, it is serial, consider R(w, w∗ ). By instances
R(w, w∗ ), R(w, w), it follows by the Euclidean property of R that R(w∗ , w) holds
true;
(iii) implies (iv): proof in 3.9;
(iv) implies (v): consider w, as R is serial there exists w∗ with R(w, w ∗ ). By
symmetry, R(w∗ , w) and transitivity yields from the last two instances that R(w, w),
i.e., reflexivity. If R(w, w∗ ), R(w, w ) then symmetry yields R(w ∗ , w) which along
with R(w, w ) yields by transitivity R(w ∗ , w ) proving the Euclidean property of R;
(v) implies (i): only symmetry needs a proof which is simple: from R(w, w∗ ),
R(w, w), R(w∗ , w ∗ ) we obtain by the Euclidean property that R(w ∗ , w).
Proof (K) holds true unconditionally in all frames, (T) requires reflexive frames,
(4) requires additionally to reflexivity also transitivity and (5) requires additionally
symmetry and simple examples show that no two of these frames are equivalent as
relational systems.
Please observe that the scheme (T) implies the schema (T n ): L n+1 φ ⊃ L n φ, where
L is L, L n+1 is L(L n ) for n > 1.
1
System T is in our notational convention the system KT. Formulae of T are valid
in reflexive frames; we denote by the symbol F r the class of reflexive frames. Valid
formulae of T are also : φ ⊃ Mφ and, more generally, M n φ ⊃ M n+1 φ.
Hence, in S4, we have Lφ ≡ L Lφ, more generally L n φ ≡ L n+1 φ with dual formulae
M n+1 φ ≡ M n φ for n ≥ 1. System S4 is in our notational convention, the system
KT4, hence, formulae of S4 are valid in reflexive transitive frames, the class of these
frames is denoted as F r t .
The dual formula is M Lφ ⊃ Lφ. System S5 is in our notation the system KT45,
hence, frames for S5 are reflexive, symmetric and transitive, i.e., equivalent, their
class is denoted F eq .
4.3 Natural Deduction: Analytic Tableaux for Modal Logics 189
Analytic tableaux for modal logics differ essentially from tableaux for sentential
and predicate logics. The reason is obvious: in case of modal logics semantics is
defined via Kripke structures in which the main role is played by relations, hence,
their properties bear on the form of tableaux. We have therefore to discuss separately
particular cases.
If we have the formula TMφ at w then again w may satisfy T φ along with
consequences of the formulae up the tree on the branch from w to w : if TLφ is at
w, then we should have T φ at w prior to the expansion of T Mφ; similarly, if FLφ
occurs on the branch before w , we should add Fφ to w before expanding TMφ.
The rules for tableaux for K are then:
T Lφ F Lφ T Mφ F Mφ
Tφ
; Fφ ; T φ ; Fφ
Example 4.3 We consider the formula φ : L(ψ ∧ ξ) ⊃ (Lψ) ∧ (Lξ). The tableau
develops as follows.
(1.) F [L(ψ ∧ ξ) ⊃ (Lψ) ∧ (Lξ)]
(2.) T [L(ψ ∧ ξ)]; at this step, we add the condition F[(Lψ) ∧ (Lξ)] which initiates
two branches into which we expand 2;
(3.) we develop left branch:
(4.) T [ψ ∧ ξ]; we continue development;
(5.) T ψ;6.
(6.) T ξ : at this point we add the consequent of FL(ψ)
6.’ we initiate the right branch by adding Fξ to (1.-6.);
(7.) F ψ
7.’ Fξ;
(8.) X: the left branch closes
X the right branch closes.
at the node for w, along with expansions of preceding formulae exactly as in case of
the modal logic K. The rules for T-tableau are as follows:
T Lφ F Mφ F Lφ T Mφ
T φ
; Fφ ; Fφ; Tφ
Example 4.4 We propose to discuss the tableau for the T-formula φ : L Lψ ⊃ Lψ.
The tableau develops as follows.
(1.) F L Lψ ⊃ Lψ;
(2.) T L Lψ
(3.) F L p : at this node, we first develop the content of line 2
(4.) T Lp
(5.) Tp
(6.) F p we develop the content of line (2.)
(7.) X: the branch closes.
Example 4.6 In figures below: Figs. 4.1, 4.2, and 4.3, we sketch tableau trees for
K,T,S4-formulae.
The above rules for K,T,S4-tableaux come from (Fitting [7–9]). It will be useful
for the sequel to adopt notation already established in Fitting [9], viz., the rules TT Mφ
φ
and F Lφ
F φ
are called π-rules with the consequents in them denoted as π0 and rules
T Lφ
T φ
and FFMφφ
are called ν-rules with consequents denoted ν0 .
For a set Γ of modal formulae, we denote by Γ ∗ the set which is: {ν0 : ν ∈ Γ }
in case of K and T and {ν : ν ∈ Γ } in case of S4, this last definition is reflecting
transitivity of Kripke structures for S4.
4.3 Natural Deduction: Analytic Tableaux for Modal Logics 191
call them ε-rules in addition to known from Ch. 3 types α, β, γ, δ. We have therefore
the following rules:
T Lφ F Mφ F Lφ T Mφ
T φ
; Fφ ; Fφ; Tφ
and ε-rules:
T φ
; Fφ
T Mφ F Lφ
Example 4.7 We insert an example of a tableau for S5. We consider the formula
φ : L Mξ ⊃ Mξ.
(1.) F L Mξ ⊃ Mξ;
(2.) T L Mξ;
(3.) F Mξ: here we apply an ε-rule;
(4.) F L Mξ
(5.) X: tableau closes: expansion of 2. yields in two steps T ξ and expansion of 4.
yields in two steps F ξ on the single branch.
Theorem 4.12 (The extension lemma) For L in {K, T, S4}, if an L-tableau for φ
is satisfiable and it is modified by an application of a tableau rule for L, then the
resulting tableau is satisfiable.
Proof The proof is by structural induction. Different logic’s cases can be settled by
slightly different arguments. If a rule of type α or β is applied, then the proof goes
as in the sentential case. Suppose that the rule applied is, e.g., TT Mφ
φ
. Let w be the
world such that w |= T Mφ, then there exists w such that R(w, w ) and w |= Mφ
so the extended branch is satisfiable. Other cases are decided in a similar manner.
Proof Provability of φ means that each tableau for Fφ is closed, hence Fφ is unsat-
isfiable by Theorem 4.12 and φ is valid.
Definition 4.20 (Hintikka sets, Hintikka consistency property for modal logics K,
T, S4)
It turns out that it is convenient to consider families of sets of formulae. Hintikka
sets from Chap. 3 undergo modifications adapting them to modal contexts. Clearly,
the sentential context remains unchanged.
Proof The steps in proof are the following. Consider a family H of Hintikka sets.
First, use, e.g., the Lindenbaum Lemma (recalled below) to extend each Hintikka
set to a maximal Hintikka set. Consider the collection MaxCon(H) of maximal
Hintikka sets for H. Accept maximal Hintikka sets as possible worlds in a Kripke
frame H+ and complete the frame by a definition of the accessibility relation R H :
for two maximal Hintikka sets W and W , let R H (W, W ) if and only if W ∗ ⊆ W .
Then, a lemma follows.
194 4 Modal and Intuitionistic Logics
Lemma 4.1 The accessibility relation R H has no conditions for K; it is reflexive for
T and transitive for S4.
Proof It suffices to prove that the family of finite sets with the property that no
tableau for them closes is a Hintikka consistent family H. Suppose H is a set with
this property and α ∈ H . Suppose that H ∪ {α1 , α2 } ∈/ H. Then there is a closed
tableau which contains a vertical sequence -α-α1 -α2 -Θ. Hence, before propagation
of α, we have a fragment −α − Θ of the tableau that closes. Thus, a contradiction.
Similarly, for other cases of β, ν, π.
We have met sequent calculus in Chaps. 2 and 3 and now we propose to meet it in case
of modal logics. We present the system for S4 developed in (Ohnishi and Matsumoto
[10]).
A sequent in modal logic is an ordered pair < Γ, Δ > of sets of modal formulae
which we write down as Γ ⇒ Δ. A sequent is valid if in each case when all formulae
in Γ are valid a formula in Δ is valid. In particular, if a sequent < ∅, φ > is valid
then φ is valid. The same concerns provability : if a sequent < ∅, φ > is provable,
then φ is provable. This is exactly the case of entailment
(logical consequence) and
a sequent < Γ, Δ > is equivalent to the formula Γ ⊃ Δ.
We have been applying the idea of Smullyan of relating sequents to tableaux: a
sequent < Γ, Δ > is equivalent to the set of signed formulae {T γi : γi ∈ Γ } ∪ {Fδ j :
δ j ∈ Δ}. We now recall the aforementioned sequent system for S4.
Definition 4.22 The modal sequent system for S4:
1. Axioms: Γ, φ ⇒ φ, Δ;
Though rules for sentential part are already given in Chs. 2 and 3, yet we recall
them here for our convenience.
196 4 Modal and Intuitionistic Logics
Γ ⇒Δ,φ Γ,ψ⇒Δ
2.3 (left ⊃) Γ,φ⊃ψ⇒Δ
(right ⊃) ΓΓ,φ⇒Δ,ψ
⇒Δ,φ⊃ψ
Γ ⇒Δ,φ Γ,φ⇒Δ
2.4 (left ¬) Γ,¬φ⇒Δ
(right ¬) Γ ⇒Δ,¬φ
3. Rules for modal connectives We recall that Γ ∗ = {ν : ν ∈ Γ } and we add
Γ ∗∗ = {π : π ∈ Γ }
∗
Γ,φ⇒Δ ⇒Δ∗∗ ,φ
3.1 (left L) Γ,Lφ⇒Δ (right L) ΓΓ ⇒Δ,Lφ
Γ ∗ ,φ⇒Δ∗∗ Γ ⇒Δ,φ
3.2 (left M) Γ,Mφ⇒Δ
(right M) Γ ⇒Δ,Mφ
Example 4.8 We give a sequent proof and a parallel tableau proof for the formula
Lφ ∧ Lψ ⊃ L(φ ∧ ψ).
The sequent proof
(S.i) φ, ψ ⇒ φ;
(S.ii) φ, ψ ⇒ ψ : axiom instances;
(S.iii) φ ∧ ψ ⇒ φ;
(S.iv) φ ∧ ψ ⇒ ψ;
(S.v) Lφ ∧ ψ ⇒ φ;
(S.vi) Lφ ∧ ψ ⇒ ψ;
(S.vii) Lφ ∧ Lψ ⇒ φ ∧ ψ;
(S.viii) Lφ ∧ Lψ ⇒ L(φ ∧ ψ);
(S.ix) ⇒ Lφ ∧ Lψ ⊃ L(φ ∧ ψ).
This was the sequent set of rules for S4 modal logic. For logics K and T, modal
rules apply different sets Γ ∗ and Γ ∗∗ .
4.6 Meta-Theory of Modal Logics. Part II 197
Let us observe that the necessitation rule (N) allows for an extension of the formula
(K) to the rule (RK):
Definition 4.24 (The rule (RK))
γ1 ⊃ (γ2 ⊃ . . . ⊃ (γk )) ⊃ φ
(R K ) .
Lγ1 ⊃ (Lγ2 . . . ⊃ (Lγk )) ⊃ Lφ
To prove the rule (RK), observe that for k = 1 it suffices to apply necessitation and
then the rule (K); the rest follows by induction on k.
We denote by Σ = a1 a2 ...ak the signature of the logic in question, where a ::
K |T |D|B|4|5. The symbol Σ will denote the logic with the signature Σ. In our case
Σ is a generic symbol for signatures K, KT,KT4,KT45, KB. The symbol Σ φ,
equivalently, ∅ Σ φ denotes that φ has a proof in the logic Σ. There is a counterpart
for relative validity modulo sets of formulae, Γ Σ .
Definition 4.25 (Deducibility)
A formula φ is deducible from a set of formulae Γ within a logic with the signature
Σ if there exist formulae γ1 , γ2 , . . . , γn ∈ Γ such that the formula i γi ⊃ φ is
provable in the logic Σ (we omit here some instances of axiom schemas).
Theorem 4.18 We list below some properties of relations Σ and Γ Σ which
denote provability and provability from a set Γ .
(i) If SL φ, then Γ Σ φ. This is a symbolic rendering of the fact that SL is a
subset of any modal logic;
(ii) If φ ∈ Γ , then Γ Σ φ. This fact comes by our notion of a proof and the first
step in it; or by the tautology p → p;
(iii) If Γ Σ ψ and {ψ} φ is a consequence of a tautology, then Γ Σ φ. This is
an instance of the tautology ( p ⊃ q) ⊃ [(q ⊃ r ) ⊃ ( p ⊃ r )];
(iv) Γ Σ ⊥ if and only if Γ Σ φ ∧ ¬φ for any formula φ. By (iii) and tautology
⊥ ≡ φ ∧ ¬φ;
(v) Γ Σ (φ ⊃ ψ) if and only if Γ ∪ {φ} Σ ψ. The one way implication (to the
right) follows by detachment. The reverse way is the deduction theorem and
the proof of it follows the lines of the proof for sentential logic;
198 4 Modal and Intuitionistic Logics
ψ1 ⊃ (. . . ⊃ (ψk ⊃ φ))
(L R K ) .
Lψ1 (⊃ . . . ⊃ (Lψk ⊃ Lφ))
The following fact (Chellas [12]) is of importance for our forthcoming discussion.
Theorem 4.22 For a MaxCon Σ (Γ ), if a formula φ has the property that φ belongs
in each MaxCon(Δ) with the property that {ψ : Lψ ∈ Γ } ⊆ Δ, then Lφ ∈ Γ .
Proof Suppose that the assumption of the theorem is true. It follows that φ belongs to
each maximal consistent set which contains the set {ψ : Lψ ∈ Γ }. We state a Claim.
Claim. For a set Γ of formulae and a formula φ, if φ in Δ for each
MaxCon Σ (Δ) which contains Γ , then Γ Σ φ for any normal Σ.
200 4 Modal and Intuitionistic Logics
We continue with the assumption that our logics are normal. This concerns in partic-
ular logics K, T, S4, S5. We apply maximal consistent sets in order to define models
for modal logics.
This fact paves our way toward a proof of completeness: the idea is to build a
frame such that each world w in it would have the property that w φ if
and only if w |= φ. Such property is immanent to maximal consistent sets and this
determines their crucial role in proofs of completeness as they provide worlds for
canonical structures.
Definition 4.30 (Canonical frames and structures)
A canonical frame for a normal modal logic Σ is a pair F Σ = (W Σ , R Σ ), where
(i) W Σ = {Γ : MaxCon Σ (Γ )};
(ii) R Σ (Γ, Γ ) ≡ (Lφ ∈ Γ ⊃ φ ∈ Γ ), equivalently, by duality, if φ ∈ Γ then
Mφ ∈ Γ for each φ;
(iii) A canonical structure for a normal modal logic Σ is a pair M Σ = (F Σ , AΣ ),
where AΣ ( p) = {Γ : p ∈ Γ }.
We denote worlds in canonical frames with capital letter W eventually endowed
with apostrophes, stars, etc. The condition in Definition 4.30(ii) tells the meaning of
the relation R Σ : if R Σ (W, W ), then formulae valid at w are possibly valid, i.e.,
plausible at w. This condition admits its converse in a sense.
Theorem 4.25 In conditions of Definition 4.30, for any formula φ, if Mφ ∈ Γ then
there exists a MaxCon Σ (Γ ) such that φ ∈ Γ and R Σ (Γ, Γ ).
Proof Suppose that Mφ ∈ Γ . The set Δ ={ψ : Lψ ∈ Γ } ∪ {φ} is consistent: was the
converse true, we would have a proof γ1 , . . . γn for ¬φ and by necessity, (K) and
maximality of Γ , we would have L¬φ ∈ Γ which by duality would be equivalent
to ¬Mφ ∈ Γ , a contradiction. By the Lindenbaum Lemma, the set Δ extends to a
MaxCon Σ (Γ ) which contains φ.
The last step is to check that axioms of any normal modal logic Σ are valid in
canonical models. This is true for atomic propositions by definition; also tautologies
are valid as they are valid in all models. For a formula ψ: Mφ, validity at world Γ
follows from Theorem 4.25.
Theorem 4.26 (Strong completeness theorem for the modal logic K) K is strongly
complete with respect to class of all frames.
Proof Let Γ be a K-consistent set of formulae. Let MaxCon K (Γ + ) be an extension
of Γ . We have Γ + |= Γ .
This argument extends to normal modal logics of signatures of the form KA where
A is a sequence of ai s.
Theorem 4.27 Logic KT is strongly complete with respect to reflexive frames.
Proof We show that canonical structure for KT is reflexive. For a canonical world
MaxCon K T (Γ ), assume that φ ∈ Γ . As Γ contains the formula Lφ ⊃ φ equivalent
to the formula φ ⊃ Mφ, by detachment, Mφ ∈ Γ , which implies that R K T (Γ, Γ ),
i.e., that R K T is reflexive.
202 4 Modal and Intuitionistic Logics
Theorem 4.29 Logic K4 is strongly complete with respect to the class of transitive
frames.
Corollary 4.3 Logic S4 is strongly complete with respect to the class of reflexive
and transitive Kripke frames, logic S5 is complete with respect to the class of Kripke
frames whose accessibility relations are equivalences.
The main result on this topic for sentential modal logics is the finite model property
Ladner [13]. Roughly speaking, it means that if a formula φ is valid at some world w
in a structure M then it is valid at some world in a finite structure. On this occasion,
we will be introduced to a classical method in modal theory, the filtration.
This notion extends to sets of formulae. A set of basic modal formulae Γ is closed
on sub-formulae if for each formula in it all its sub-formulae are in the set Γ . We
denote the set of sub-formulae of a collection Γ of formulae by the symbol Sub(Γ ).
For instance if Γ = {M( p ⊃ q) ⊃ ( p ∧ q); (r ∨ s) ⊃ (Mr ∨ Ms)}, then sub-
formula-closed set is the closure C(Γ ) of Γ , i.e., the set {M( p ⊃ q) ⊃ ( p ∧
q), M( p ⊃ q), p ∧ q), ( p ⊃ q), p, q, (r ∨ s) ⊃ (Mr ∨ Ms)(r ∨ s), r, s,
(Mr ∨ Ms), Mr, Ms}.
The comparison of the set of worlds W to the set of worlds W ≈ shows that distinct
worlds in the filtered model have distinct sets of formulas true in them; hence, the
cardinality of the set W ≈ is not greater than the number of subsets in Γ which is
2|Γ | .
The next task is to prove that both structures, the structure M and the filtered
structure M≈ satisfy the same set of formulas from the set Γ .
Theorem 4.30 For each formula φ ∈ Γ , the following equivalence takes place,
under assumed properties in Definition 4.33(i)-(iv) of the filtered model: M, w |= φ
if and only if M ≈ , [w]≈ |= φ.
Proof Proof goes by structural induction. The first step is when φ is an atomic
proposition p. As valuations A and A≈ assign to p the same set of worlds, the
theorem holds for p. Hence, the theorem is true for sentential formulae and it remains
to consider the case of a basic modal formula, say Mψ in Γ . Suppose first that
M, w |= Mψ. There exists a world v in M with properties: (a) R(w, v) (b) M, v |= ψ.
As R(w, v) holds, by condition 7.3(ii), we have that R ≈ ([w]≈ , [v]≈ ). By inductive
assumption, as ψ ∈ Γ , we have that M ≈ , [v]≈ |= ψ and thus M ≈ |= Mψ.
The converse is proved along similar lines by use of the condition (iii): sup-
pose that M ≈ , [w]≈ |= Mψ. There exists a world [v]≈ such that R ≈ ([w]≈ [v]≈ )
204 4 Modal and Intuitionistic Logics
All of these was under proviso that we have a relation R ≈ which satisfies conditions
(ii) and (iii) of Definition 4.33. It is necessary now to construct this relation.
There are three possible ways (Blackburn et al. [14]): in addition to Defini-
tion 4.33(ii) which defines the relation which we now denote as R ≈ I and to Def-
inition 4.33(iii) which defines the relation now denoted R ≈ II we may consider the
following condition (after Definition 4.33(iv)):
(v) R ≈
I I I ([w]≈ , [v]≈ ) if and only if for each modal basic formula Mψ ∈ Γ , if
M, v |= ψ ∨ Mψ then M, w |= Mψ.
Theorem 4.32 All three candidates for filtration accessibility relations are satisfy-
ing conditions (ii), (iii) of Definition 4.33.
Proof Clearly, R ≈ ≈
I satisfies condition (ii). For (iii), suppose that R I ([w]≈ , [v]≈ ) and
suppose that M, v |= ψ. Then there exist w1 , v1 such that R(w1 , v1 ) and M, v1 |= ψ,
hence M, w1 |= Mψ and thus M, w |= Mψ. Proofs for R ≈ ≈
I I and R I I I go along same
lines.
Theorem 4.33
(i) Any formula of the form p ⊃ M p (logic T) has a finite reflexive satisfying
structure;
(ii) Any formula of the form M¬M¬ p ⊃ p (logic B) has a finite symmetric satis-
fying structure;
4.8 Small Model Property, Decidability 205
(iii) Any formula of the form M M p ⊃ M p (logic 4) has a finite transitive satisfying
structure.
It remains to discuss the case of S5. Our notion here is that of bisimulation, which
constitutes the next step in factorization of a modal structure.
Theorem 4.35 For each reduced structure M, there exists a simple model M and
a bisimulation Λ. Moreover, as the simple model is constructed within the reduced
model, the relation Λ has as the domain the world-set of M and as the range the
world-set of M .
Proof It suffices to check the claim in case of a sub-formula of the form Lψ. The
proof is by structural induction. Suppose that M, v |= Lψ but M ∗ , v not. There is,
by (ii), z ∈ M ∗ such that ¬ψ is valid at z. By assumption of induction, M, z does not
satisfy ψ, hence, M, v does not satisfy Lψ, a contradiction. Proof of the converse is
straightforward.
Theorem 4.38 (Ladner [13]) The problem SAT(S5) of satisfiability for logic S5 is
NP-complete.
(ii) Some people are such that Sally believes that they are good.
On the surface, both sentences carry the same message: Sally thinks that some
people are good. However, in the (i)-sentence, we have a modal operator ‘believes’
(which we may interpret as ‘it is possible for Sally’) which prefixes the statement
‘some people are good’ which is existentially quantified while in the (ii)-sentence
the quantified phrase ‘some people are such that’ precedes the modal phrase Sally
believes that ...’.
In case of (i)-sentence, the modal attitude depends on the reading of the dictum,
i.e., what was said to be believed. This form is the de dicto reading. In case of (ii)-
sentence, the case is brought forth first and presented to be believed or not, it is res/re
and the reading is de re.
General forms of (1) and (2) with a generic φ replacing good(x), respectively,
¬good(x), are Barcan formulae Marcus [17]
The question now is to introduce proper syntax and semantics for interpreting
such formulae. Interpretations may vary, bordering on intensional approach, which
would demand that each possible world has its own domain of interpretation. We
begin with the assumption that the domain D for the sentential part of the syntax is
one and the same for all possible worlds.
There are two main kinds of models for quantified modal logic which depend
on a choice of the kind of domain assignment to possible worlds. One is called the
constant domain model and here a chosen domain D is assigned to each possible
world, the other called the variable domain model in which a functional assignment
gives distinct domains to distinct worlds. We will present the constant domain models
based quantified modal logic: the variable domain model requires some technical
changes in the exposition.
We denote by the symbol D a fixed domain which is a non-empty set of beings.
We impose a linear ordering (ai )∞1 on the domain D, calling it σ. We will keep a fixed
σ without mentioning it explicitly. We add the usual components of the sentential
modal logic and predicate logic in this new context:
(i) a set W of possible worlds, each w ∈ W a possible world;
(ii) an accessibility relation R ⊂ W × W ;
(iii) a set P n of countably many relation symbols for each arity n ≥ 1; P = n P n ;
(iv) n {x 1 , x 2 , . . . , x n , . . .};
a countable set X of individual variables
(v) an interpretation I : W × P :→ 2 n D ; for each pair < w, Q >, where arity
of Q is n, I (w, Q) ⊂ D n is a relation of arity n;
(vi) an assignment A : X → D, A(xi ) is an element ai of the domain D;
(vii) symbols L , M of modal operators and ∀, ∃ of quantifiers as well as auxiliary
symbols.
A structure M for quantified modal logic is a quadruple < W, R, D, A > and the
pair F =< W, R > is the frame of M, D is the domain of the frame F.
An atomic formula is an expression of the form Q(x1 , x2 , . . . , xn ) where Q is an
n-ary relation symbol. Formulae are built in the usual way by means of sentential
connectives, and, generalization and necessitation rules, as we have witnessed in case
of Barcan formulae.
Example 4.10 The converse Barcan formula in Definition 4.37(iii) is valid. Suppose
that: (i) M, w |= I,A ∃x Mφ(x). Then; (ii) for some a ∈ D, M, w |= I,A Mφ(a). Then;
(iii) for some world w ∈ W such that R(w, w ), it holds: M, w |= I,A(x/a ) φ(a );
Now, we consider the antecedent M∃x φ(x). Its validity requires that;
(iv) for some w ∈ W and for some a ∈ D, M, w |= I,A(x/a φ(a );
(v) Then, letting a to be a and w to be w makes the antecedent satisfied and
the converse Barcan formula (iii) is valid.
The essential assumption for the proof has been the constancy of the domain. A
simple generalization is the condition of monotonicity of models; let D(w) stands
for the domain at the world w; then, increasing monotonicity means that if R(w, w ),
then D(w) ⊆ D(w ). Obviously, constant domain models satisfy this condition.
Example 4.11 The converse Barcan formula (iii) is not valid when the monotonicity
condition fails. Suppose that W = {w1 , w2 }, D(w1 ) \ D(w2 ) = ∅, R(w1 , w2 ) is the
only instance of R, for some c ∈ D(w1 ) \ D(w2 ) P(c) is valid in w2 , then w1 |=
∃x M P(x) but w1 fails M∃P(x).
Theorem 4.39 A frame F is monotonic increasing if and only if the Barcan converse
formula is true in each F-based structure.
Proof We can modify the proof in Example 4.10 to prove that in increasingly mono-
tonic case the converse Barcan formula is valid and Example 4.11 shows that when
a structure is not monotonically increasing, then the converse Barcan formula is not
true. This proves the theorem.
Let us observe that reversing arrows of the relation R in the structure of Exam-
ple 4.11 shows falsity of the Barcan formula: M∃x P(x) ⊃ ∃x M P(x), in general the
converse Barcan formula p ⊃ q is valid in a monotonically increasing model if and
only if the corresponding Barcan formula q ⊃ p is valid in the dual model obtained
by reversing arrows of the relation R. This implies that a frame F is monotonically
decreasing if and only if the Barcan formula is valid in each F-based structure.
210 4 Modal and Intuitionistic Logics
We recall for reader’s convenience the rules for predicate logic in Chap. 3). We
recall that; stands for conjunction and , denotes disjunction.
T ( p∧q)
(v) For type α: T p;T q
F( p∨q)
F p;Fq
F( p⊃q)
T p;Fq
;
T ( p∨q) T ( p⊃q)
(vi) For type β: T p,T q F( p∧q)
F p,Fq F p,T q
;
T (¬ p) F¬ p
(vii) Fp Tp
;
(∀x.φ)
(viii) For type (γ): TT(φ(x/ p))
F(∃x.φ)
F(φ(x/ p))
;
(∃x.φ)
(ix) For type (δ): TT(φ(x/ p))
F(∀x.φ)
F(φ(x/ p))
.
Example 4.12 We give the tableau proof for the Barcan formula ∀x Lφ(x) ⊃
L∀xφ(x). Parameters are additional variables denoted p, q, r, ... in distinction to
quantifiable variables x, y, z, ..., which enter tableaux and replace variables x, y, z, ..
in steps in which the last quantifiers or modal operators are removed from a branch.
The announced tableau follows.
(1.) F [∀x Lφ(x) ⊃ L∀x φ(x)]
(2.) T [∀x Lφ(x)]
(3.) F L ∀xφ(x)]
(4.) T Lφ(x): from 2;
(5.) F ∀xφ(x): from 3;
(6.) T φ( p): from 4, use of parameter p;
(7.) F φ( p); from 5, use of the same parameter p as the rule in 5 is universal;
(8.) X: by 6,7, tableau closes.
This tableau is constructed for the constant domain models. Tableaux for variable
domain models require more attention. Obviously they contain constant domain
cases. We apply the device of prefixed tableaux Fitting [20] cf. Goré [21]. Prefixes
4.11 Natural Deduction: Tableaux for Quantified Modal Logics 211
are finite sequences of natural numbers in the form σ.n.m....k, where σ names a world
and σ.n etc. names a world accessible from that named σ. We reproduce prefixed
rules. We denote with coma, disjunction of formulae and with semicolon ; we denote
conjunction of formulae. Formulae separated by coma at a node will initiate forking
of the branch into two extensions, one formula in each extension, semicolon separated
formulae will both extend the current branch. With this notation, we state tableau
prefixed rules.
Definition 4.42 (Prefixed sentential logic tableau rules)
σφ∧ψ
(i) σφ;σψ
;
σφ∨ψ
(ii) σφ,σψ
;
σ¬(φ∧ψ)
(iii) σ¬φ,σ¬ψ
;
σ¬(φ∨ψ)
(iv) σ¬φ;σ¬ψ
;
σφ⊃ψ
(v) σ¬φ,σψ
;
σ¬(φ⊃ψ)
(vi) σφ;σ¬ψ
;
σ¬¬φ
(vii) σφ
;
σφ≡ψ
(viii) σφ⊃ψ;σψ⊃φ
;
Proof Consider a Hintikka set H . The canonical model for H has the set of possible
worlds W defined as the set of prefixes of the formulae in H ; the accessibility relation
R is the set of pairs < σ, σ.n > for each prefix σ ∈ W , the domain function maps each
world σ ∈ W to the set of parameters pσ ∈ H . The interpretation I sends each pair
< P, σ >, where P is an n-place relation symbol, into the set {< p1 , p2 , . . . , pn >:
σ P( p1 , p2 , . . . , pn ) ∈ H }.
It remains to define an assignment A on the model M =< W, R, I >: A( pσ ) = pσ
for each parameter pσ . Now, we have to verify that M, σ |= A φ for each φ ∈ H . This
is done by structural induction. By the very definition, each atomic formula in H is
satisfied. Conditions (H1),(H2),(H3) settle sentential cases. Quantified formulae are
satisfied by (H6) and (H7) and modal formulae are satisfied by (H4),(H5) by virtue
of the model construction. Negated formulae are satisfied due to (H0) and (H1).
Suppose now that a formula φ is valid in all variable domain K-models and there
exists in the set T of all tableaux for Fφ a tableau T which is not closed. Hence,
there exists in T an open branch which is a Hintikka set, hence, satisfiable, which
shows that φ is not valid, a contradiction. This leads to completeness theorem for
tableaux.
4.12 Sentential Intuitionistic Logic (SIL) 213
It follows from (ii) and (v) that w |= ⊥ for no world w. Please take heed of the fact
that truth of a formula at a world is coupled with its truth at all accessible worlds.
Proof Statement (i) is secured by condition in Definition 4.47(i). For (ii), suppose
that M, w |= Γ ; as ΓT ⊂ Γ , it follows that M, w |= ΓT and by Definition 4.47(i),
4.12 Sentential Intuitionistic Logic (SIL) 215
The system we propose to discuss comes from Beth [27] with modifications in Fitting
[7] which introduce signed formulae and standard, in the sense of Smullyan’s, usage
of trees.
Definition 4.50 (Tableau rules)
We state the rules for intuitionistic sentential tableaux. We use the symbol Γ to
denote non-active in a rule set of formulae.
Γ,T (φ∧ψ)
(∧) (T ∧) Γ,T φ;T ψ
;
Γ,Fφ∧ψ
(F ∧) (Γ,Fφ),(Γ,Fψ) ;
Γ,T (φ∨ψ)
(∨) (T∨) (Γ,T φ),(Γ,T ψ)
;
Γ,F(φ∨ψ)
(F ∨) Γ,Fφ;Fψ ;
(¬) (T ¬) Γ,T
Γ,Fφ
¬φ
;
Γ,F¬φ
(F ¬) ΓT ,T φ ;
Γ,T (φ⊃ψ)
(⊃) (T⊃) (Γ,Fφ),(Γ,T ψ)
;
Γ,F(φ⊃ψ)
(F ⊃) ΓT ,(T φ;Fψ) .
We recall that ΓT is defined as {T φ : T φ ∈ Γ }.
Example 4.14 A one-way De Morgan law ( p ∨ q) ⊃ ¬ (¬ p ∧ ¬q) has a tableau
proof.
1 F [( p ∨ q) ⊃ ¬ (¬ p ∧ ¬q)];
2 T ( p ∨ q) F ¬ (¬ p ∧ ¬q);
3 T ( p ∨ q) T (¬ p ∧ ¬q);
4 T ( p ∨ q) T ¬ p T ¬q;
5 T ( p ∨ q), F p, T ¬q;
6 T ( p ∨ q), F p, F q
7 left branch: T p, F p, F q X: branch closes;
8 right branch: T q, F p, F q X: branch closes.
We now consider the converse formula: ¬ (¬ p ∧ ¬q) ⊃ ( p ∨ q). The tableau is
the following.
1 F [¬ (¬ p ∧ ¬q) ⊃ ( p ∨ q)];
2 T ¬ (¬ p ∧ ¬q), F ( p ∨ q);
3 F (¬ p ∧ ¬q), F ( p ∨ q);
4 F (¬ p ∧ ¬q), F p, F q;
5 left branch: F ¬ p, F p, F q;
6 left branch continues: T p, F p, F q X: branch closes
7 right branch: F (¬q), F p, F q
8 right branch continues: T q, F p, F q X: branch closes.
4.13 Natural Deduction: Tableaux for SIL 217
Theorem 4.43 The tableau system of proof is sound: each provable formula is valid.
We recall that a formula φ is provable if the tableau for Fφ closes.
Proof To the contrary, suppose that a formula φ is provable but not valid. Then the
formula Fφ is satisfiable, i.e, there is a pointed frame (F, w) which satisfies Fφ.
The crux of the proof is in realization that each step in expansion of a tableau for Fφ
preserves satisfiability by checking each of tableau rules, for instance, if at a level
(n) of the tableau the satisfiable formula is T ψ ∧ ξ then the next level (n+1) contains
formulae T ψ and T ξ, both satisfiable. When the tableau branches conclude, the
tableau is open, contrary to the assumption that φ is provable.
(H) If T φ ∈ Γ ∈ H, then Γ |= φ
We apply the idea already used with tableaux, viz., we begin with atomic formula
and for atomic formula P, we let Γ |= P if and only if P ∈ Γ and we extend |= by
structural induction.
218 4 Modal and Intuitionistic Logics
We provide an example:
T (φ ⊃ ψ) ∈ Γ ≡ ∀Δ((ΓT ⊆ Δ) ⊃ T (φ ⊃ ψ ∈ Δ)
≡
∀Δ((ΓT ⊆ Δ) ⊃ (F(φ) ∈ Δ ∨ T (ψ) ∈ Δ))
≡
∀Δ((ΓT ⊆ Δ) ⊃ Δ¬ |= φ ∨ Δ |= ψ))
≡
∀Δ((ΓT ⊆ Δ) ⊃ (Δ |= φ ⊃ ψ)
≡
Γ |= φ ⊃ ψ).
Theorem 4.45 The tableau system is complete: each valid formula is provable.
Proof The scheme for proof is standard by now. Suppose a formula φ is valid but not
provable. There is a model M for φ. Non-provability of φ provides an open tableau
for Fφ with open branches satisfying properties for Hintikka sets, hence satisfiable,
contrary to validity of φ.
with previous developments, for any signed atomic formula p we let MaxConC |= p
if and only if p ∈ MaxCon(C).
First-order intuitionistic logic shares syntactic features with classical predicate logic:
a set of countably many individual variables denoted x, y, z, . . ., a countable set of
n-ary predicate symbols P1 , P2n , . . . for each n ≥ 1, sentential connective symbols,
quantifier symbols, and auxiliary symbols of parentheses and punctuation marks.
In addition, as usual in case of prefixed tableaux, there is a countable set I P of
individual parameters, i.e., non-quantifiable variables.
Atomic formulae are P jn (a1 , a2 , . . . , an ), each ai an individual variable or indi-
vidual parameter. Formulae are built in the standard recursive way, beginning from
atomic formulae, by means of sentential connectives and quantifiers.
Models for first-order intuitionistic logic (FOIL) presented here are due to Kripke
[25]. The notation presented here follows, with some modifications, one adopted in
(Fitting [7–9]).
A family H is a Hintikka family if the following conditions hold for each set
H ∈ H:
(H0) H is consistent;
(H1) if Tφ ∧ ψ ∈ H , then Tφ ∈ H and Tψ ∈ H ;
(H2) if Fφ ∧ ψ ∈ H , then Fφ ∈ H or Fψ ∈ H ;
(H3) if Tφ ∨ ψ ∈ H , then Tφ ∈ H or Tψ ∈ H ;
(H4) if Fφ ∨ ψ ∈ H , then Fφ ∈ H and Fψ ∈ H ;
(H5) if T¬φ ∈ H , then Fφ ∈ H ;
(H6) if Tφ ⊃ ψ ∈ H , then Fψ ∈ H or Tψ ∈ H ;
(H7) if Fφ ⊃ ψ ∈ H , then for some H1 ∈ H such that R(H, H1 ): Fψ ∈ H1 and
Tφ ∈ H1 ;
(H8) if F¬φ ∈ H , then for some H1 ∈ H such that R(H, H1 ): Tφ ∈ H1 ;
(H9) if T∀xφ(x) ∈ H , then Tφ( p) ∈ H for each p ∈ P(H );
(H10) if F∀xφ(x) ∈ H , then there exists H1 ∈ H such that R(H, H1 ) and Fφ(a) for
some a ∈ P(H1 );
(H11) if T∃xφ(x) ∈ H , then Tφ(a) for some a ∈ P(H );
(H12) if F∃xφ(x) ∈ H , then Fφ(a) ∈ H for each a ∈ P(H ).
222 4 Modal and Intuitionistic Logics
Proof Building a model begins with definitions of R and P as above, and, for atomic
φ, letting for each H ∈ H that H |= φ if and only if Tφ ∈ H . Then, |= is extended
by structural induction to all formulae: as an example, suppose that T∀xφ(x) ∈ H .
Steps in verification that H |= ∀xφ(x) are as follows:
(i) T∀xφ(x) ∈ H ;
(ii) for each H such that R(H, H ): T ∀x φ(x) ∈ H (by 14.2(viii));
(iii) for each H such that R(H, H ): T φ(a) ∈ H for each a ∈ P(H );
(iv) for each H such that R(H, H ): H |= φ(a) for each a ∈ P(H );
(v) H |= ∀x φ(x).
In case of F ∀x φ(x) ∈ H , we follow same lines except that we replace line (ii)
with line (ii’):
(ii’) there exists H such that R(H, H ) and F φ(a) ∈ H for some a ∈ I (H );
and we replace line (iii) with line (iii’): there exists H such that R(H, H ) and it
is not the case that H |= φ(a) for some a ∈ I (H );
and we replace line (v) with line (v’): H |= ∀xφ(x) does not hold.
We proceed by analogy in case of existential quantification. Sentential cases were
considered in case of the intuitionistic sentential logic. The symbol Par denotes the
countable (infinite) set of parameters.
Theorem 4.49 Each consistent set of signed formulae H with P being the set of
parameters in formulae of H and Q a countably infinite set ordered as (qn )∞
1 of
parameters, disjoint with P, extends to a (P ∪ Q)-saturated set H ∗ .
4.16 Natural Deduction: FOIL-Tableaux 223
Proof Proof of Theorem 4.49 resembles proof of the Lindenbaum Lemma, a sat-
urated extension is built inductively. Formulae in H can be made into a sequence
Φ : φ1 , φ2 , . . . and parameters in Q form a sequence Q : q1 , q2 , . . .. Disjointness of
Q with P secures preservation of consistency after substitution of any qi into for-
mulae of the form T ∃x.φ(x) ∈ H . Steps in construction of saturation are as follows.
(i) if Tφ ∧ ψ ∈ H
(ii) initialization: H0 = H ;
(iii) inductive step: suppose that Hn is already defined. Pick the first φ j which is
T ∃x ψ(x) and there is no p ∈ P such that T ψ( p) ∈ Γn∗ ; for qn , form the set
{Γn∗ , T ψ(qn )} and extend it to MaxCon P∪{q1 ,...,qn } ; call it Hn+1 ;
(iv) define H ∗ = n≥0 Hn .
Proof Consider a formula φ and suppose that φ is not provable, so the set {Fφ}
is Z n∗ -consistent for some n, hence, it extends to some Z n∗ -saturated set U , hence,
U ∈ H, and F φ ∈ U , a contradiction.
4.17 Problems
M, v |= Lφ}.
Prove: (a) In structures with accessibility defined as T C R for any relation R, formulae
(K), (T), (4) are valid;
(b) If a relation R is symmetric, then under T C R the formula (B) is valid, a
fortiori, the structure is a model for S5;
(c) Define semantics for the operator M ω φ = ¬(L ω ¬φ).
4.17 Problems 225
References
1. Smith, R.: Aristotle’s Logic. The Stanford Encyclopedia of Philosophy (Fall 2020 Edition),
Zalta, E.N.(ed.). https://plato.stanford.edu/archives/fall2020/entries/aristotle-logic
2. Bobzien, S.: Stoic logic. In: Inwood, B. (ed.) The Cambridge Companion to Stoic Philosophy.
Cambridge University Press (2003)
3. Knuuttila, S.: Medieval Theories of Modality. The Stanford Encyclopedia of Philosophy
(Summer 2021 Edition), Zalta, E.N. (ed.). https://plato.stanford.edu/archives/sum2021/entries/
modality-medieval/
4. Lewis, C.I.: A Survey of Symbolic Logic. Berkeley: University of California Press; reprinted:
Dover Publications (1960) (without Chs. 5, 6)
5. Carnap, R.: Meaning and Necessity. University of Chicago Press (1947, 1956)
6. Kripke, S.: Semantical analysis of modal logic I: Normal modal propositional calculi. Z. Math.
Logik und Grundlagen der Mathematik 9(5-6), 67-96 (1963). https://doi.org/10.1002/malq.
19630090502
7. Fitting, M.C.: Intuitionistic Logic Model Theory and Forcing. North-Holland Publishing Co.,
Amsterdam (1969)
8. Fitting, M.C.: Model existence theorems for modal and intuitionistic logics. J. Symb. Logic
38, 613–627 (1973)
9. Fitting, M.C.: Proof Methods for Modal and Intuitionistic Logics. Springer Science+Business
Media, Dordrecht (1983)
10. Ohnishi, M., Matsumoto, K.: Gentzen method for modal calculi I, II. Osaka Math. J. 9, 113–130
(1957); 11, 115–120 (1959)
11. Henkin, L.: The completeness of the first-order functional calculus. J. Symb. Logic 14(3),
159–166 (1949)
12. Chellas, B.F.: Modal Logic. An Introduction. Cambridge University Press, Cambridge UK
(1980)
13. Ladner, R.E.: The computational complexity of provability in systems of modal propositional
logic. SIAM J. Comput. 6(3), 467–480 (1977)
14. Blackburn, P., de Rijke, M., Venema, Y.: Modal Logic. Cambridge University Press, Cambridge
UK (2001)
15. Halpern, J., Moses, Y.O.: A guide to completeness and complexity for modal logics of knowl-
edge and belief. Artif. Intell. 54(2), 319–379 (1992)
16. Nelson, M.: Propositional Attitude Reports. The Stanford Encyclopedia of Philosophy
(Spring 2022 Edition), Zalta, E.N. (ed.). https://plato.stanford.edu/archives/spr2022/entries/
prop-attitude-reports
17. Marcus, R.B.: A functional calculus of first order based on strict implication. J. Symb. Logic
11, 1–16 (1946)
18. Kripke, S.: Semantical considerations on modal logic. Acta Philosophica Fennica 16, 83–94
(1963)
19. Fitting, M.C., Mendelson, R.L.: First-Order Modal Logic. Springer Business+Media B.V, Dor-
drecht (1998)
20. Fitting, M.C.: Tableau methods of proof for modal logics. Notre Dame J. Form. Logic 13,
237–247 (1972)
21. Gorë, R.: Tableau methods for modal and temporal logics. In: D’Agostino, M., et al. (eds.)
Handbook of Tableau Methods. Kluwer, Dordrecht (1998)
22. Heyting, A.: Die formalen Regeln der intuitionistischen Logik, Preussischen Akademie der
Wissenschaften. Physikalisch-mathematische Klasse, pp. 42–56, 57–71 & 158–169 (1930)
23. Gödel, K.: Eine Interpretation des intuitionistischen Aussagenkalküls. Ergebnisse eines math-
ematischen Kolloquiums 4, 39–40 (1933). (English transl.: Interpretation of the intuitionistic
sentential logic. In: Hintikka, J.K.K. (ed.):The Philosophy of Mathematics, Oxford University
Press, 128–129 (1969))
24. Schütte, K.: Vollständige Systeme modaler und intuitionistischer Logik. Springer, Berlin (1968)
References 229
25. Kripke, S.: Semantical analysis of intuitionistic logic I, Formal Systems and Recursive Func-
tions. In: Proceedings of the Eighth Logic Colloquium, Oxford 1963, pp. 92–130. North-
Holland Publishing Co. (1965)
26. Wajsberg, M.: Untersuchungen über den Aussagenkalkül von A. Heyting. Wiadomości Matem-
atyczne 4, 45–101 (1938). (also in: Logical Works by Mordechaj Wajsberg, Surma, S. (ed.),
Polish Acad. Sci. 132, 171, (1977))
27. Beth, E.W.: The Foundations of Mathematics. A Study in the Philosophy of Science. Harper
& Row Publishers, New York (1966)
28. Smullyan, R.M.: First Order Logic. Dover, Minneola N.Y (1996)
Chapter 5
Temporal Logics for Linear and
Branching Time and Model Checking
Temporal expressions had been with humanity from the beginnings. Once the oral
speeches or written texts begun, it was possible to record for contemporary and future
generations reflections on time. The Flood was perceived as a time related event: after
it time begun anew, time as a main factor was mentioned in earliest philosophy, e.g.,
in philosophy of Heraclitus of Ephesus, time flows bringing cycles of opposites, life
and death, way upward and way downward.
In the Bible, we see recognition of God’s time, eternal and not changing, and
the limited time of man, without past and without future ‘To every thing there is a
season, and a time to every purpose under the heaven; A time to be born, and a time
to die ... (Kohelet [1], 3:1,3:2).
Megaric and Stoic schools (Diodorus Cronus, Zeno of Elea) disputed the nature of
motion trying to resolve paradoxes they created which implicitly involved time as a
sequence of events. Into logic time came in Aristotle in connection with the problem
of future contingencies:‘there will be a sea battle tomorrow; there will not be any
sea battle tomorrow’. Analysis of those problem in Aristotle led Jan Łukasiewicz to
invention of many-valued logic Łukasiewicz [2].
Some medieval thinkers involved time in emerging dynamics (Nicolas d’Ore sme).
Avicenna (Ibn Sina) at the turn of 9th century CE considered temporal qualifications
to syllogisms: ‘at all times’, ‘at most times’, ‘at some time’.
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 231
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4_5
232 5 Temporal Logics for Linear and Branching Time and Model Checking
Modern temporal logic begun with introduction of formalized notion of time into
analysis of language, the work of Arthur Prior in Prior’s ‘Tense Logic’ Prior [3].
Prior’s tense operators listed below, reflect expressions for time events used in natural
language:
Definition 5.1 (The Prior tense operators) They are divided into past time operators
and future times operators.
Prior’s past time operators
(i) P: ‘... it has at some time been the case that...’;
(ii) H: ‘... it has always been the case that ...’.
Prior’s future time operators
(iii) F: ‘... it will at some time be the case that...’;
(iv) G: ‘... it will always be the case that ...’.
Pairs P, H and F, G are dual to each other.
(i) Pφ ≡ ¬H ¬φ;
(ii) Fφ ≡ ¬G¬φ;
(iii) H φ ≡ ¬P¬φ;
(iv) Gφ ≡ ¬F¬φ.
Time may be modelled as continuous, but time may be as well modelled as discrete.
In Pnueli [4], modal logic of time was proposed as a tool in verification of programs
and in model checking, and, the linear time model (LTL) was proposed. Later on,
more complex models of time emerged, for instance, tree-like structures and then
we speak of branching time models (BTL) of which Computational Tree Model
(CTL) and its extension CTL* are most often discussed. These models find their
use in modelling various systems. In temporal logics one discusses long sequences
of moments of time called paths, which are modelled as infinite sequences of states
connected by instances of a transition relation.
In applications, temporal logics are often coupled with automatons and languages,
hence, we collected in Chap. 1 basic facts about grammars, formal languages and
automata. In the final part of this chapter, we give an account of model checking with
automata for linear and branching temporal logics. We begin with the linear discrete
model of time.
Introduction of time aspect into computer science problems is owed to Kamp [5] and
Pnueli who discussed linear time which led to emergence of Linear Temporal Logic
(LTL). Linear temporal logic studies basically the behavior of systems over a single
5.2 Linear Temporal Logic (LTL) 233
sequence of time moments modelled as an infinite path. LTL uses as the set of worlds
W in the simplest case the discrete set of natural numbers N. Let us call in this case
numbers—states. So we have the infinite sequence od states s0 , s1 , s2 , ..sn , .....
This means that LTL is concerned with events present and future. By a path,
denoted σ, we mean any infinite subsequence of states si0 , si1 , . . . , ..... However,
LTL can be enriched by addition of mirror operators symmetric with respect to
the state s0 to future time operators. This variant of LTL is denoted LTL+PAST; a
canonical model of time for LTL+Past is the set Z of integers.
Definition 5.3 (Formulae of LTL) Well-formed formulae (wffs) of LTL are defined
by structural complexity as follows:
(i) all atomic propositions p ∈ A P are wffs;
(ii) falsum ⊥ (falsity) is the wff;
(iii) if φ is a wff, then Fφ, Gφ, Xφ are wffs;
(iv) if φ and ψ are wffs, then φ U ψ is a wff;
(v) If φ and ψ are wffs, then φ ⊃ ψ, and ¬φ are wfs.
From Definition 5.3 it follows in a standard way that if φ, ψ are wffs, then φ ∨ ψ,
φ ∧ ψ are wffs and verum defined as ¬⊥ is a wff. We call valid formulae of
sentential logic SL tautologies in order to discern them from proper formulae of
LTL.
Definition 5.4 (Linear Kripke structures for LTL) LTL semantics borrows from
modal logic the notion of a Kripke structure as a set of worlds together with an
accessibility relation and an assignment on A P, which assigns to each world the set
of atomic propositions true in that world.
For purposes of LTL, this scheme has to be adapted to already mentioned
structure of an infinite sequence of moments of time. Let σ =< s0 , s1 , . . . , s j ,
. . . > be an infinite sequence of states and Σ be the set of elements of σ. The acces-
sibility relation is the successor relation Succ with instances of the form si → si+1
for i ≥ 0.
Definition 5.5 (The relation of satisfaction) The pointed structure is the pair
(M f , si ), where si ∈ Σ. We define the relation M f , si |= φ by structural induction.
(i) M f , si |= for each f and each si ;
(ii) for each atomic proposition p, M f , si |= p if and only if p ∈ f (si ) ;
(iii) M f , si |= φ ⊃ ψ if and only if either it is not true that M f , si |= φ or
M f , si |= ψ;
(iv) M f , si |= φ ∨ ψ if and only if either M f , si |= φ or M f , si |= ψ;
(v) M f , si |= φ ∧ ψ if and only if M f , si |= φ and M f , si |= ψ;
(vi) M f , si |= Xφ if and only if M f , si+1 |= φ;
(vii) M f , si |= φUψ if and only if there exists j ≥ i such that M f , s j |= ψ and
M f , sk |= φ for each i ≤ k < j;
(viii) M f , si |= Fφ if and only if there exists j ≥ i such that M f , s j |= φ;
(ix) M f , si |= Gφ if and only if for each i ≤ j, M f , s j |= φ.
Proof For example, we prove (iii). Suppose that M f , si |= Fφ. Hence, there exists
j ≥ i such that M f , s j |= φ. By Definition 5.5(i), M f , sk |= for each k. By Defi-
nition 5.5(vii), M f , si |= U φ. The converse is proved along same lines.
Theorem 5.2 The following formulae are among valid formulae of LTL.
I. Formulae involving F and G.
Proof For (I.i): M f |=FFφ if and only if there exists j ≥ 0 such that M f j |=Fφ if
and only if there exists k ≥ j such that M f j k |= φ if and only if there exists k ≥ 0
such that M f k |= φ, i.e., M f |= Fφ.
For (I.iv): please observe that GFφ means that φ occurs at states of Σ infinitely
often so adding F once more does not change this behavior of φ. Formally,
M f |=FGFφ if and only if there exists j ≥ 0 such that M f j |= GFφ if and only
if for each k ≥ j there exists m ≥ k such that M f m |= φ if and only if for each p ≥ 0
there exists q ≥ p such that M f q |= φ if and only if M f |= GFφ.
For (IV.ii): M f |= Gφ if and only if φ is true at each si . M f |=Fψ if and only
if M f,si |= ψ for some si , hence, for j < i, M f , s j |= φ and M f , s j |= ψ which is
equivalent to M f , s |= φUψ.
236 5 Temporal Logics for Linear and Branching Time and Model Checking
Example 5.1 Consider the system of traffic lights with green, red, yellow lights.
We let A P = {green, red, yellow}. Let the mapping f assign to σ the sequence
(green, red, yellow)ω . Then the following formulae are valid:
(i) GF(green), respectively, GF(red), GF(yellow); the meaning is ‘infinitely often
red, same for green, yellow;
(ii) yellow⊃ F(red): after ‘yellow, at some time red’;
(iii) G(yellow ⊃ X red): ‘always, after yellow, next red’.
Branching time logics model more sophisticated approaches to time in which one
allows that time may ramify in various directions, e.g., when at a given state one
has a non-deterministic choice of progression along distinct paths. Such cases are
modelled by transition systems. We recall here the notion of a transition system.
(iv) I is a set of initial states, all actions of a transition system begin in one of initial
states;
(v) L is an assignment of sets of atomic propositions to states, i.e, L : S → 2 A P .
Choice of L determines logical language L(s) at each particular state s. L may
be also called a valuation or a labelling.
A transition system is actually a directed graph which may possess various prop-
erties of directed graphs, i.e, be acyclic or cyclic, be a tree or a forest. A transition
system T is rooted when it has the unique initial state, and it is tree-like when it is a
tree.
A transition system is total when the transition relation →T is serial, i.e., each
state s has a successor s ∈→T (s). We assume that transition systems considered
here are total and rooted.
For each state s, we denote by the symbol Path(s) the set of paths which begin
with s. Then s is the root for the fragment of transition system defined by Path(s). For
each π ∈ Path(s), s is denoted as f ir st (π). For each path π, the trace T race(π) is
the sequence (L(s))s∈π , (cf. Mazurkiewicz [6]).
We now introduce CTL: Computational Tree logic, which belongs in the family
of Branching Time Logics, whose structures allow for each state to begin distinct
paths, i.e, time ramifies in those models. This calls for another type of structures than
linear structures we have met in the case of LTL.
Definition 5.11 (Syntax of CTL) Formulae of CTL are divided into two categories:
state formulae and path formulae. State formulae describe the statuses of states and
path formulae describe the behavior of paths. In addition to known from LTL temporal
operators X, U, F, G, we find in CTL two path operators: A meaning ‘for all paths’
and E meaning ‘there exists a path’.
Proof Part for state formulae follows from laws of sentential logic: ( p ∨ q) ≡
(¬ p ⊃ q) and ( p ∧ q) ≡ ¬(¬ p ∨ ¬q), and, from duality s ≡ ¬⊥s .
For path formulae, we have AFφs is defined as A Uφs , EFφs is defined as E
Uφs ; AGφs is defined as ¬EF¬φs , EGφs is defined as ¬ AF¬φs .
For instance AF( ps ∨ qs )∧ EG( ps ⊃ qs ) is a well-formed state formula of CTL
(we do not discuss as of yet its validity). Now, there comes time for semantics of
CTL. We assume a rooted and total transition system T = (S, A P, →T , I, L).
Definition 5.12 (Semantics of CTL) For a path π, we denote by the symbol π[i]
the i-th state in π. By the symbol T, s |= φ, we denote the fact that the state s in
the transition system T satisfies the formula φ, and analogous symbol will denote
satisfiability by a path π. The notation for a path is π : π[0], π[1], . . . , π[i], . . .,
where π[0] is f ir st (π).
Definition 5.13 (Satisfaction relation for transition systems) Semantics for CTL
does encompass the global satisfiability by transition systems. For a transition system
T , we let
(i) T |= φs if and only if T, s |= φs for each initial s ∈ I ; under our assumptions,
there is a unigue such s which we may denote root, so T |= φs if and only if
T, root |= φs ;
(ii) T |= AXφs if and only if for each path π ∈ Path(root), π[1] |= φs ;
(iii) T |= A φs U ψs if and only if for each path π ∈ Path(root), there exists i π ≥ 0
such that T, π[i π ] |= ψs and T, π[ j] |= φs for each 0 ≤ j < i π .
Counterparts to (ii), (iii) with A replaced by E define T |= EXφs and T |= Eφs Uψs
when we replace the phrase ‘for each π ∈ Path(root)’ with the phrase ‘for some π ∈
Path(root)’.
The term AFψ asserts that ψ appears on each path at some state; the term ¬ E(¬ψ
U¬ψ ∧ ¬φ)] asserts that in no path the term ¬ψU ¬ψ ∧ ¬φ holds.
Consider an arbitrary path π. Let si be the fist state on π with the occurrence of
q. Then, at all preceding states, ¬ψ holds, hence φ holds, witnessing Aφ Uψ. The
converse is equally simple.
CTL* subsumes both LTL and CTL as it applies operators A and E which are in
CTL but not in LTL and it allows for blocks of temporal operators like in LTL but
not in CTL. As with CTL, formulae of CTL* are divided into state formulae and
path formulae.
240 5 Temporal Logics for Linear and Branching Time and Model Checking
Definition 5.14 (Syntax of CTL*) We give separate rules for state and path formulae.
State formulae
(i) for each p ∈ A P, ps is a state formula;
(ii) ⊥s is a state formula;
(iii) if φs , ψs are state formulae, then φs ⊃ ψs is a state formula;
(iv) if φs is a state formula, then ¬φs is a state formula;
(v) if φ p is a path formula, then Eφ p is a state formula.
Path formulae
(vi) each state formula is a path formula;
(vii) if φ p , ψ p are path formulae, then φ p ⊃ ψ p is a path formula;
(viii) if φ p is a path formula, then ¬φ p is a path formula;
(ix) if φ p is a path formula, then Xφ p is a path formula;
(x) if φ p , ψ p are path formulae, then φ p Uψ p is a path formula.
Proof In CTL* which allows for blocks of temporal operators along with A,E, we
can define F,G as in LTL, i.e., Fφ p is Uφ p , and, Gφ p is ¬F¬φ p , and, Aφ p as
¬E¬φ p . Sentential formulae follow in the standard way.
We begin with the linear temporal logic LTL and its decidability and we begin
with preliminaries. We recall the notion of a linear Kripke structure for LTL: let
σ =< s0 , s1 , . . . , s j , . . . > be an infinite sequence of states with Σ the set of elements
of σ. The accessibility relation is the successor relation Succ with instances of the
form si → si+1 for i ≥ 0.The set A P consists of atomic propositions.
A functional space (2 A P )Σ is the space of all assignments si → X i ⊆ A P for
i ≥ 0. Each element of the space (2 A P )Σ is a mapping f : Σ → 2 A P . Hence, f (Σ)
is an ω-sequence (ω-word) of subsets of A P.
We denote the linear structure defined by the mapping f by the symbol M f . We
denote by σ j the prefix < s0 , s1 , . . . , s j > and by Σ j the suffix < s j , s j+1 , . . . > of
Σ. For f ∈ (2 A P )Σ , we denote by the symbol f j the restriction f |Σ j . Similarly,
we define the mapping f j as f |Σ j .
(i) Γ contains neither the pair ⊥, nor any pair φ, ¬φ, nor, ψ, ∼ ψ;
(ii) if ¬¬φ ∈ Γ , then φ ∈ Γ ;
(iii) if φ ∧ ψ ∈ Γ , then φ ∈ Γ and ψ ∈ Γ ;
(iv) if φ ∨ ψ ∈ Γ , then φ ∈ Γ or ψ ∈ Γ ;
(v) if ¬(φ ∧ ψ) ∈ Γ , then ∼ φ ∈ Γ or ∼ ψ ∈ Γ ;
(vi) If ¬(φ ∨ ψ) ∈ Γ , then ∼ φ ∈ Γ and ∼ ψ ∈ Γ .
Clearly, the number of maximal consistent sets does not exceed 2|Sub(φ)| , i.e., 2|φ| .
As with the Henkin idea of treating maximal consistent sets as elements in a model,
applied in Chap. 4, we define the successor relation between MaxCons.
Definition 5.20 (Transition relation between maximal consistent sets) The transition
relation Γ1 →T Γ2 between MaxCon(Γ1 ) and MaxCon(Γ2 ) holds if:
(i) if Xφ ∈ Γ1 then φ ∈ Γ2 ;
(ii) if ¬ Xφ ∈ Γ1 then ∼ φ ∈ Γ2 ;
(iii) if ψ1 Uψ2 ∈ Γ1 then either ψ2 ∈ Γ1 or (ψ1 ∈ Γ1 and ψ1 Uψ2 ∈ Γ2 );
(iv) if ¬(ψ1 Uψ2 ) ∈ Γ1 then ∼ ψ2 ∈ Γ1 and (∼ ψ1 ∈ Γ1 or ¬(ψ1 Uψ2 ) ∈ Γ2 ).
5.5 Meta-theory of Temporal Logics 243
Theorem 5.6 The following hold true by semantic laws of LTL and Definition 5.20.
In the forthcoming case, we denote the transition →T by the symbol →φ .
(i) MaxCon(F LC M f i (φ));
(ii) for i ≥ 0, the relation F LC M f i (φ) →φ F LC M f i+1 (φ) holds.
By Theorem 5.6, the sequence S:(F LC M f i (φ) : i ≥ 0) is a linear structure con-
sisting of maximal consistent sets. Now, we state the crucial fact about small models
for a formula φ of LTL (Sistla and Clarke [8]).
It is obvious that, as the set FLC(φ) is finite, there exist minimal k, l such that k
is the prefix length and l is the loop length, i.e., the sequence (S) is the ultimately
periodic one. The problem consists in finding values of prefix length and loop length
depending on φ. This problem may be resolved to the effect stated in the theorem in
(Sistla, Clarke [8]) that follows.
Theorem 5.7 For each formula φ of L T L , if φ is satisfiable in M f , i.e., f (0) |= φ,
then it is satisfiable in a periodic model M f ∗ with the prefix length at most 2|φ| and
the loop length at most |φ| · 2|φ| .
Proof For the prefix of the periodic model, the number of sub-formulae of φ is
bounded from above by 2|φ| , hence, i = 2|φ| is sufficient for the length of the prefix.
For the loop, it has to accommodate the U formulae, their number bounded from
above by |φ|. Any two states satisfying distinct U-formulae can be separated in the
loop by all remaining sub-formulae, their number bounded from above by 2|φ| , hence,
the sufficient number of states in the loop is l = |φ| · 2|φ| . The size of the periodic
model is then bounded by |φ| + |φ| · 2|φ| .
By Theorem 5.7, if a formula φ of LTL is satisfiable, i.e., if M f , σ[0] |= φ for
some f, σ, then there exists the transition system ({Γ j : j ≤ i + l}, →φ ) where each
Γi is maximal consistent and φ ∈ Γ0 . Hence, φ is satisfiable in the ultimately periodic
structure and LTL has the small model property. The conclusion is
Theorem 5.8 The problem of satisfiability of formulae in LTL is decidable. As valid-
ity problem is co-unsatisfiability problem, the validity problem is decidable.
We address the problem of model checking for LTL. Model checking problem
consists in decision whether, for a given transition system (T, s, →T , L) and an LTL
formula φ, T, s |= φ. The idea for solving this decision problem is to apply already
existing witness for satisfiability in the form of the ultimately periodic model, adapted
to the new setting of a transition system, and augmented with necessary additional
ingredients taking into account states in T . Formally, one considers the existence
of a sequence (Γ j , s j ) : j ≤ i + l) for some i < l, such that this sequence consists
of a prefix and a loop of the ultimately periodic sequence. Then the following are
satisfied.
244 5 Temporal Logics for Linear and Branching Time and Model Checking
(vii) let Γ ∗∗ be the last set Γ j and Rec(U )∗ be the last Rec(U j ) with Rec(U )∗∗ the
last Rec(U j )∗ ;
(viii) if Γ ∗ = Γ ∗∗ and Rec(U )∗ ⊆ Rec(U )∗∗ then accept else reject.
There are finitely many guesses, checking that the witnessing sequence consists of
maximal consistent sets, that transition relation satisfies conditions, and, checking
inclusions can be done in space polynomial in size of φ, hence, non-deterministic
polynomial space is sufficient. By the Savitch Theorem 1.59, the problem is in
PSPACE.
Proof It is known that temporal operators EX,EU,AF define other operators and
all formulae of CTL can be thus expressed by means of them and of sentential
connectives. Consider as a model a Kripke structure M = (W, R, A) along with a
pointed structure (M, w0 ) for some world w0 ∈ W . Let φ be a formula of CTL. The
proof is using the labelling procedure.
(i) for each atomic proposition p, for each word w, world w is labelled with p if
and only if w ∈ A( p);
(ii) for Boolean formulae: w is labelled with φ ∧ ψ, respectively with φ ∨ ψ, if
and only if w is labelled with φ and ψ, respectively, w is labelled either with φ
or ψ; w is labelled with ¬φ if and only if w is not labelled with φ;
(iii) for a sub-formula EX ψ of φ, each world w is labelled with EX ψ if and only if
there exists a world w such that R(w, w ) and w is labelled with ψ; correctness
follows by semantics of EX;
(iv) for a sub-formula ψUξ of φ, we label with ψUξ all worlds already labeled
with ξ; next, we label with ψUξ each world labeled with ψ such that there
exists a world w such that R(w, w ) and w is labelled with ψUξ; clearly, this
is monotone operation on sets of formulae in a complete set of all subsets of
sub-formulae of φ so it reaches the fixed point by the Knaster-Tarski Theorem
1.2; correctness of this labelling follows by the valid formula of CTL: EψUξ ≡
ξ∧EXEψUξ;
(v) for a sub-formula AFψ of φ, we label with AFψ each world w either already
labelled with ψ or such that each world w with R(w, w ) is labelled with
AFψ; correctness of this labeling follows by the valid formula of CTL: AFψ ≡
ψ ∨ AXAFψ; as in (iv) , the Knaster-Tarski theorem ensures that the labelling
reaches the fixed point;
(vi) M, w0 |= φ if and only if w0 is labeled with φ.
246 5 Temporal Logics for Linear and Branching Time and Model Checking
In order to conclude that model checking for CTL is PTIME-complete, one has
to show PTIME-hardness of it. In Markey [11] the proof is proposed by reduction
of the CIRCUIT-VALUE problem known to be log space PTIME-complete Ladner
[12] to the problem of model checking for CTL.
The corresponding problem for CTL* is PSPACE-complete (Emerson and Lei
[13]).
Theorem 5.12 CTL* model checking is PSPACE-complete.
The idea for a proof: as for each world w in a Kripke structure, w |= L T L φ if and
only if w |=C T L ∗ Aφ, the idea of a proof is to apply LTL model checking along of a
reduction of formulae of CTL* to those of LTL. In that respect please see Schnoebelen
[14].
Some fragments of logics have been also explored for model checking, e.g., the
model checking problem for the logic L(F) is NP-complete (Sistla, Clarke [8]).
We include in Table 5.1 some results from literature.
The temporal logic LTL+PAST is LTL augmented with past operators which are in
a sense mirrored LTL operators. While it is possible to consider them in the standard
model of an infinite path, yet more natural is to enlarge the standard path by going
from the set of natural numbers N to the set of integers Z. For each state s in Z, we
denote by the symbol (←, s] the set of states preceding s in the set Z ordered by the
natural ordering ≤ and we denote by the symbol [s, →) the set of states following s
with respect to the natural ordering ≤.
We preserve temporal operators X,U, F,G with their semantics and we add new
operators Y, which mirrors X, S, which mirrors U, and operators F−1 , G−1 as past
counterparts to F and G.
Definition 5.21 (Syntax of LTL+PAST) Formulae of LTL+PAST are defined as fol-
lows:
5.7 Properties of Systems, Model Checking by Means of Automata 247
We suggest Chap. 1 which brings notions and facts about transition systems, finite
and infinite automata and regular expressions and languages. We give here some
insights into the vast area of model checking. The model checking problem consists
of verifying whether a transition system T satisfies a given formula φ.
The mentioned above in Definition 5.7 properties of systems are expressed by
LTL formulae and those properties can be represented by automata. We give simple
examples of LTL properties modeled by Büchi automata. In that case the alphabet
consists of formulae of LTL.
We give some examples of automata.
Example 5.3 The automaton B1 in Table 5.2 specifies the formula G p and the
language L(B1) is p ω . This is a safety property. The accepting state is in bold. The
initial state is marked with ∗.
248 5 Temporal Logics for Linear and Branching Time and Model Checking
The automaton B2 in Table 5.3 specifies the formula F p. The language L(B2) is
(¬ p)∗ ( p)()ω . This is the property ‘eventually p’ a particular case of the liveness
property. Accepting state is in boldface.The initial state is marked ∗.
We encode the complement to the property ‘infinitely many times on’, i.e., the
property ‘from some time on, always ¬ on’ in a Büchi automaton B3 shown in
Table 5.5. The accepting state is printed inboldface. The initial state is q0 .
We define the synchronous product T S B3. We recall that the signature of T S
is (S, Act, →T S , I, A P, L) and the signature of B3 is (Q, 2 A P , →B3 , Q 0 , F). The
synchronous product has as its components
(i) the set of states S × Q;
(ii) the transition relation → defined as the smallest of relations satisfying the
following:
s1 →T S s2 , q1 →B3
L(s2 ) q2
(28)
(s1 , q1 ) → (s2 , q2 )
Table 5.6 Product TS B1
States (s0 , q0 ) (s0 , q1 ) (s1 , q0 ) (s1 , q1 )
Transitions (s1 , q0 ) ∅ {(s0 , q1 ), (s0 , q0 )} (s0 , q1 )
Let us observe that the demand that transitions in the synchronized product be
possible under labels of parallel transitions of TS, forces the condition that any
accepting run of B3 induces a path in TS which negates the condition ‘infinitely
many times on’, ie., TS does not satisfy it. In Table 5.6 the product T S B1 is
shown.
There is no infinite path in the product which meets any of accepting states
(s0 , q1 ), (s1 , q1 ) infinitely many times. This proves that T S satisfies the property
‘infinitely many times on’.
We have met tableaux in Chaps. 2–4 for, respectively, sentential, predicate and modal
and intuitionistic logics, and now we embark on tableau satisfaction checking for
temporal logics. We begin with tableau method for LTL. Tableau construction for
LTL is definitely distinct from previously discussed by us constructions: first, LTL
deals with paths, next, among its operators are operators like φ Uψ and ¬ Gφ whose
satisfaction is verified in future. These features pose new problems for their rendering
in tableaux. We begin with a list of LTL-equivalences which will be useful in tableau
constructions.
We also recall the classification of formulae of any logic into four types, two types
for sentential formulae and two types for formulae of logics with operators, these
types being α, β ,γ, δ. Types α, γ are conjunctive, meaning that formulae of those
types decompose into conjunctions, types β, δ are disjunctive, i.e., formulae of those
types decompose into disjunctions. Figure 5.1 recollects sentential formulae of types
α and β.
Equivalences in Theorem 5.13 allow for decomposition patterns of types γ (con-
junctive) and δ (disjunctive); these patterns are shown in Fig. 5.2. One more type of
formulae are successor formulae Xφ and X¬φ which propagate , respectively, as φ
and ¬φ. We call these formulae as being of type ε.
250 5 Temporal Logics for Linear and Branching Time and Model Checking
Among decomposition components are formulae which have come from disjunc-
tive types β and δ as well as from conjunctive types α and γ. The laws of distribution
allow to separate these formulae into disjoint sets: decomposition implicants.
Example 5.5 We show in Fig. 5.3 the initial tableau for the formula (G p) ∧
¬( pUq). We owe some explanations pertaining to the construction. We denote
252 5 Temporal Logics for Linear and Branching Time and Model Checking
is responsible for children s0, s1 of the root Aux. The loop from s3 to the second
AU X stems from the provisos: the auxiliary state which would be obtained from s3
would be identical with this AU X . Crosses under s0 and s2 mean as usual that paths
through these states are contradictory, hence, closed: both states contain p and ¬ p.
We obtain the final tableau by elimination of auxiliary states: if for an auxiliary
state AU X , there exists a state s with transition arrow s → AU X , then add arrows
s → s for each state s for which the arrow AU X → s exists and remove AU X
and all arrows in and out of it.
5.9 Tableaux Construction for Linear Temporal Logic 253
(H6) if ¬(φUψ) ∈ H(i), then ¬ψ ∈ H(i) ∧ (¬φ ∈ H(i) ∨ ¬(φUψ) ∈ H(i + 1)),
for each i ∈ N;
(H7) if ¬(φUψ) ∈ H(i), then ¬ψ ∈ H(i + j) for each j ≥ 0 or ∃ j ∈ N such that
¬φ ∈ H(i + j) and ¬ψ ∈ H(i + k) for each 0 ≤ k ≤ j.
Conditions (H6) and (H7) offer two readings of ¬(φUψ) ∈ H(i), easy to compre-
hend. One may see that definition of Hintikka traces is fully consistent with semantics
of LTL, and, basically, we construct a transition system in which labelling is Hintikka
traces.
In order to induce a Hintikka trace from a formula φ, we need, according to (H1)–
(H7), to find decomposition components of φ. Let us consider a trace σ : Σ → 2 A P ,
where σ, A P are components of a transition systems over LTL, and, for each n,
we consider the set dc(φ)n = {ψ ∈ dc(φ) : σ[n] |= ψ}. Then, we verify that the
following holds.
Theorem 5.14 The sequence dc(φ)n )∞n=0 is a Hintikka trace and φ is satisfiable if
and only if φ ∈ dc(φ)n for some n.
Proof That (dc(φ)n )∞ n=0 is a Hintikka trace follows by Definition 5.25. If for some n,
φ ∈ dc − cl(φ)n , then σ, n |= φ. Suppose now that φ is satisfiable. The existence of a
Hintikka trace {H (n) : n ∈ N } with φ ∈ H (0) can be proved by structural induction:
by Definition 5.25(i), the thesis follows for the sentential formula φ and (ii) and (iii)
imply the thesis in cases of Xφ and ψ1 Uψ2 .
A final tableau for a formula φ is open if and only if the tableau contains an infinite
path with φ in some state. Otherwise, a tableau is closed. Let us observe that each
path in the tableau is a Hintikka trace for some sub-formula of φ.
We recall that in CTL temporal operators X,F,U,G are prefixed with path operators A,
E and can occur in well-formed formulae only in the prefixed form and that structures
for CTL are branched time models, e.g., trees. We recall that basic operators of CTL
are: EG, EF, E(φUψ), A(φUψ), EXφ, AXφ and their negations.
We recall CTL rules for decomposition of formulae.
5.10 Tableaux for Computational Tree Logic CTL 255
Definition 5.26 (CTL Hintikka structure) Each Hintikka structure (S, →, H) satis-
fies the following conditions:
In Sect. 5.7, some Büchi automata are shown, which model some properties of reac-
tive systems. Now, we will discuss in a more systematic way the relations between
temporal logics and automata. We begin with a survey of automata on infinite words.
We assume that δ is serial, i.e., for each pair (q, a) there exists q such that
(q, a, q ) ∈ δ. B is deterministic if and only if for each pair (q, a) there exists a
unique q such that (q, a, q ) ∈ δ. In this case, δ : Q × Σ → Q is a mapping, and
we write δ(q, a) = q . Otherwise, B is non-deterministic.
∞
A run of B is any sequence ρ = (qi , ai )i=0 such that (i) q0 ∈ I (ii) (qi , ai , qi+1 ) ∈ δ
∞
for each i ≥ 0. The sequence (ai )i=0 is the label of the run ρ, denoted l(ρ).
For each run ρ, and each state symbol q, we define the set O(q, ρ) = {i : qi = q};
this is the set of numbers of positions in ρ at which the state symbol is q. The set
in f (ρ) is the set {q : |O(q, ρ)| = ω}. The symbol |.| denotes cardinality of a set, ω
in this case denotes the cardinality of the set of natural numbers N.
As runs are infinite, their labels are infinite words over the alphabet Σ, i.e,
ω-words. We denote them with symbols w, v, u,. . ., sometimes primed. Non-
deterministic Büchi automata on infinite words will be marked as NBAω .
(Σ, Q 1 ∪ Q 2 , I1 ∪ I2 , δ, F1 ∪ F2 ),
Proof This time the product of two automatons must be defined in a more complex
way. We use the notation of Theorem 5.18. We let
where
δ((q1 , q2 , j), a) = δ1 (q1 , a) × δ2 (q2 , a) × f (q1 , q2 , j)
f (q1 , q2 , j) = 1
if
[either ( j = 1) ∧ (q1 ∈
/ F1 )or ( j = 2) ∧ (q2 ∈ F2 )]
260 5 Temporal Logics for Linear and Branching Time and Model Checking
and
f (q1 , q2 , j) = 2
if
[either ( j = 1) ∧ (q1 ∈ F1 )or ( j = 2) ∧ (q2 ∈
/ F2 )].
Thus, runs of the product automaton oscillate between copies of either automaton
infinitely often.
The problem of complementation is more difficult. Its solutions involved some
additional tools including graph-theoretical tools like Ramsey’s theorem. We outline
a proof in (Kupferman, Vardi [27]) which exploits a visualization of automatons in
the form of graph G of runs (gr G) defined for any automaton and each ω-word w.
Definition 5.30 (The graph grG of runs of an automaton NBAω ) The graph gr G for
∞
an automaton B = (Σ, Q, I, δ, F) and a word w = (ai )i=1 is defined as follows: (i)
∞ ∞
the set of vertices is V = i=0Q i × {i} where the sequence (Q i )i=0 is defined by
induction as Q 0 = I , Q i+1 = q∈Q i δ(q, ai+1 ).
The set of edges E is {((q, i), (q , i + 1)) : q ∈ δ(q, ai+1 }, i.e,
∞
E⊆ (Q i × {i}) × (Q i+1 × {i + 1}).
i=0
∞ ∞
The accepting condition is i=0 F × {i}: a run (qi , ai+1 )i=0 is accepted if and only
if (q, ai+1 ) ∈ F for infinitely many i’s.
The graph gr G for B and w represents all runs of B on w. It follows that acceptance
by B is equivalent to acceptance by gr G. We assume that our automaton has n states.
Definition 5.31 (The ranking function on grG) An accepted run must stabilize
on an even rank. Hence, the dichotomy: accepted—non-accepted is equivalent to
dichotomy: odd-even for runs. The ranking f is odd if and only if all runs are odd.
In this case, B is rejecting. It turns out that the converse is true as well.
The main result in (Kupferman, Vardi [27]) establishes the effect of odd runs.
Theorem 5.20 B is rejecting if and only if all runs are odd.
Proof One way it has been observed. We have to prove that if B is rejecting then all
path rankings are odd. Suppose to the contrary that there is a run ρ not having the
odd ranking. Then ρ stabilizes on the even rank, hence, infinitely many vertices on
ρ fall into F, i.e, ρ is accepting, a contradiction.
Definition 5.32 (A level ranking) A level ranking is a function g : Q → {0, 1, . . . ,
2n, ⊥} such that the odd value of g(q) means q ∈ / F. For two level rankings g, g , and
q, q ∈ Q, g refines g if g (q ) ≤ g(q) any time when q = δ(q, a) for some a. Thus,
a level ranking g is constant on levels of the graph gr G for the given automaton. As
with ranking functions, level rankings diminish as they go to higher valued levels.
The set of even values of a level ranking g is denoted par (g).
5.12 Decision Problems for Automata 261
We now outline the proof in (Kupferman, Vardi [27]) on the existence of the
complementary automaton B − to the given B=(Σ, Q, I, δ, F).
Theorem 5.21 (Kupferman, Vardi) For the given NBAω B with n states, there exists
an NDAω B − on less or 2 O(nlogn) states and such that Σ ω \ L(B) = L(B − ).
Proof Let B − = (Σ, Q , I , δ , F ).
(i) Let Lrank be the set of level rankings on gr G and let variable P runs over sets
in 2 Q . Then Q = {(g, P) : g ∈ Lrank, P ∈ 2 Q };
(ii) I = {(g0 , ∅) : g0 (q) = 2n if q ∈ I, else g(q) = ⊥};
(iii) if P = ∅, then δ ((g, P), a) = {(g , P ) : g refines g, P = {q : q ∈ δ(q, a)
for some q ∈ P and g (q ) is even};
Definition 5.33 (Three main decision problems) These decision problems for non-
deterministic Büchi automaton B are:
(i) The non-emptiness problem: whether L(B) = ∅;
(ii) The non-universality problem: whether L(B) = Σ ω ;
(iii) The containment problem: for B and B ∗ : whether L(B) ⊆ L(B ∗ ).
Let us observe that (i) and (ii) are equivalent in the sense that if L(B) = ∅, then
L(B ) = Σ ω for B in which accepting states are the complement of accepting states
in B.
For (iii), it is equivalent to (i) for L(B ∗ ) ∩ L(B − ) = ∅. For these reasons we
discuss (i) only. We remark only that complexities are distinct in each of these three
problems.
The emptiness problem was decided in (Vardi, Wolper [28]) as follows.
Theorem 5.22 The emptiness problem is decidable in linear time. It is an NL-
complete problem.
262 5 Temporal Logics for Linear and Branching Time and Model Checking
Proof Consider NBAω (Σ, Q, I, δ, F). Recall the graph G with V = Q and E =
{(q, q ) : ∃a ∈ Σ.q = δ(q, a)}. A run ρ is accepting if and only if there exists a path
π beginning at qo ∈ I and ending at first q f ∈ F and continuing with a loop from
q f to some q f ∈ F; in other words, π is periodic due to finiteness of F and infinite
length of π.
Hence, the emptiness problem is equivalent to reachability problem for the graph
G. Let us observe that in f (ρ) is a strongly connected component (SCC) of G, i.e.,
a maximal strongly connected subset of V which means that each pair of vertices in
SCC is connected by a path.
Strongly connected components in a directed graph can be found in linear time
(|V | + |E|) by double depth search on the graph and its transpose, see, e.g., (Cor-
men et al. [29]). The reachability problem solution consists in selection of an SCC1
which contains an initial state, and an SCC2 which contains an accepting state and in
guessing a path from SCC1 to SCC2 in the reduced graph. This requires logarithmic
space: one has to keep in memory the initial state, the accepting state, the currently
guessed state, and the current number of steps, all requiring logarithmic space.
Actually, the non-emptiness problem is NL-complete.
Definition 5.35 (Labeled trees) Trees are defined and discussed in Chap. 1. An
abstract tree T # over a set T is a set T # of finite sequences of elements of T such
that with each sequence s the set T # contains each prefix of s including the empty
prefix ε called the root of T # . If all sequences in T # are finite, then the tree is finite in
5.13 Alternation. Alternating Automata on Infinite Words 263
case the upper bound of lengths of all sequences is finite, otherwise the tree contains
sequences of any finite length.
For a sequence s, its length is the distance from the root, and sequences of the same
distance from the root form levels of the tree. A collection of sequences such that the
prefix relation orders this collection into a linear order defined as s ≤ s if and only
if s is a prefix of s , is called a path in the tree. In particular, {ε} is a path.
A maximal path is called a branch. A successor to a path p is the path p
such that p ≤ p and length of p is the length of p +1. Therefore, p = px
for an element x ∈ T . If p = px is a branch, then the element x is a leaf. Let
T = {x ∈ T : for some paths p,p’, p’=px}; elements of T along with the root are
vertices of the tree T # , the set of vertices of the tree T # is denoted V (T # ).
A labeling of a tree T # is a mapping L : A → V (T # ), where A is a set of symbols.
The pair (T # , L) is a labeled tree.
The components of the tuple are Σ, Q which are finite sets of, respectively, alphabet
symbols and states, the acceptance condition is F ⊆ Q ω , δ : Q × Σ → Bool ∨,∧ (Q),
q0 is the single initial state which corresponds to the root of the tree T # .
For a formula φ in Bool∨,∧ (Q), and δ(q, a) → φ, an implicant is a minimal
subset of Q satisfying φ. If φ is converted into the DNF then implicants of DNF are
implicants in the current sense.
For instance, consider the transition δ(q, a) → φ : [q1 ∨ q2 ∨ q3 ) ∧ (q4 ∨ q5 )].
The automaton has to make a non-deterministic choice from {q1 , q2 , q3 } and a non-
deterministic choice from{q4 , q5 } and it has to perform two runs, one for each
choice. The DNF of φ is ( i=1,2,3 (qi ∧ q4 ) ∨ ( i=1,2,3 (qi ∧ q5 ) which prompts the
automation to a non-deterministic choice of one of the implicants, which is equivalent
to the former choice.
A run is accepting if and only if it meets the acceptance condition F, i.e, the word
w ∈ F. The language L(A) is the set of accepted words.
Acceptance conditions can be distinct, as with Büchi automata:
264 5 Temporal Logics for Linear and Branching Time and Model Checking
Example 5.8 For our purpose in what follows it will be useful to give a small
example of the graph G in Definition 5.37.
The transition relation δ is as follows. For simplicity, our Σ = {a}:
δ(q0 , a) = q1 ∧ q2 ∨ q3 ;
δ(q1 , a) = q2 ∨ q4 ;
δ(q2 , a) = q2 ∧ q3 ;
δ(q3 , a) = q1 ∧ q2 ∧ q4 ;
δ(q4 , a) = .
Theorem 5.23 (Miyano, Hayashi) For any alternating Büchi automaton A, with
n states, there exists a non-deterministic Büchi automaton B with an exponential
number of states.
Definition 5.38 (The extended closure) The extended closure ECl(φ) is subject to
the following conditions:
(i) φ ∈ ECl(φ);
(ii) ψ ∈ ECl(φ) if and only if ¬ψ ∈ ECl(φ);
(iii) ψ ∧ χ ∈ ECl(φ) if and only if ψ ∈ ECl(φ) and χ ∈ ECl(φ);
(iv) if Xψ ∈ ECl(φ) then ψ ∈ ECl(φ);
(v) if ψUχ ∈ ECl(φ), then ψ ∈ ECl(φ) and χ ∈ ECl(φ).
The transition relation δ is defined as follows: for two MaxCon sets Γ, Δ and
a ∈ Σ, i.e., a ⊆ A P, Δ ∈ δ(Γ, a) if and only if
(i) a = Γ ∩ A P;
(ii) if Xψ ∈ ECl(φ), then Xψ ∈ Γ if and only if ψ ∈ Δ;
(iii) if ψUχ ∈ ECl(φ), then ψUχ ∈ Γ if and only if either χ ∈ Γ or ψ ∈ Γ and
ψUχ ∈ Δ.
Theorem 5.24 ([23]) For each LTL formula φ, there exists an alternating Büchi
automaton Aφ with O(|φ|) states and such that L(Aφ ) = L(φ).
Proof This time we apply the closure of the formula φ, which we denote φ. The
closure satisfies the following conditions:
(i) φ ∈ φ;
(ii) for ◦ ∈ {∨, ∧, U, R}, if ψ ◦ χ ∈ φ, then ψ, χ ∈ φ;
(iii) if Xψ ∈ φ, then ψ ∈ φ.
The automaton Aφ is defined as follows:
(i) the alphabet Σ = 2 A P ;
(ii) the set of states Q = φ;
(iii) the initial state q0 = φ;
(iv) the transition relation δ is defined for particular cases in the following way:
(a) δ( p, a) = if p ∈ a, else ⊥;
(b) δ(¬ p, a) = ¬δ( p, a);
(c) δ(ψ ∧ χ, a) = δ(ψ, a) ∧ δ(χ, a);
(d) δ(ψ ∨ χ, a) = δ(ψ, a) ∨ δ(χ, a);
(e) δ(ψUχ, a) = δ(χ, a) ∨ (δ(ψ, a) ∧ (ψUχ));
(f) δ(ψRχ, a) = δ(χ, a) ∧ (δ(ψ, a) ∨ (ψRχ));
The problem of LTL model checking consists in verification whether a given structure
for LTL satisfies a given LTL formula φ. Concerning the structure, it is a Kripke
structure defined for this purpose as a tuple M=(A P, W, R, I, L), where
(i) A P is the set of atomic pripositions;
(ii) W is the set of worlds;
5.16 Model Checking for Branching-time Logics 267
We now outline the problem of model checking for branching-time logics. In this
case, automata are a tree automata. Hence, we begin with them. Our exposition is
based on (Vardi, Wilke [33]) and also (Kupferman, Vardi, Wolper [35]).
We assume that a set Δ ⊆ N is the star number function which defines star numbers
of vertices: for a vertex x, Δ(x) is the number of successors to the vertex x. We
assume that the width of the tree is bounded from above, so the set Δ is finite and all
levels of the tree are of bounded size. For a tree T , and a set Σ, a Σ-labeling of T is
a mapping L : Σ → T which assigns to each vertex x a symbol L(x) in Σ. Usually,
Σ is taken as the set 2 A P of sets of atomic propositions, and, L establishes a logic at
each vertex.
We recall the known notions of a path in the tree and a branch of the tree.
We have already met the notion of an alternating automaton and the set Bool∨,∧ (Q)
of sentential formulae over Q written with use of only ∨ and ∧ connectives. We denote
by m the set of smaller than m natural numbers, i.e., m = {0, 1, 2, . . . , m − 1}.
268 5 Temporal Logics for Linear and Branching Time and Model Checking
A = (Σ, Q, q0 , δ, Δ, F)
Thomas [36], (Muller, Schupp [37]), where Σ, Q have the already established mean-
ing, q0 is the initial state, Δ is the star number function, F is acceptance conditions.
We denote by D the maximal value of Δ. The transition function δ is defined as: δ :
Q × Σ × D → Bool∨,∧ (N×Q); given a triple (q, a, n), δ(q, a, n) ∈ Bool∨,∧ (n ×
Q). The acceptance condition F may be the Büchi acceptance F ⊆ Q or already
mentioned by us Rabin’s acceptance, or, Parity acceptance, or, Büchi modified accep-
tance F ⊆ Q ω .
Definition 5.41 (Runs of alternating tree automata) For a labeled tree (T, L) and
an alternating tree automaton
A = (Σ, Q, q0 , δ, Δ, F),
a run of A is a tree (T , L ) with nodes of the form (x, q), where x ∈ N and q ∈ Q.
Definition 5.43 (The Kripke structures treefied) Kripke structures we know from
modal logics, undergo some augmentation aimed at giving them a form plau-
sible for cooperation with automata. Therefore, the Kripke structure is a tuple
5.16 Model Checking for Branching-time Logics 269
The structure of the tree (T, V ) carried by K develops from w0 = V (ε), by recur-
rence: for v ∈ T , with R-successors w1 , w2 , . . . , wn of the node V (v), vi ∈ T and
V (vi) = wi for 1 ≤ i ≤ n.
Definition 5.44 (The model checking problem for branching-time logics) The model
checking problem is as for LTL: given a Kripke structure K = (A P, W, R, w0 , L , Δ)
and a formula φ determine whether K |= φ. The idea of this checkup is as follows:
build an alternating automaton A(φ, Δ) which accepts exactly all trees with the
function Δ which satisfy φ. Then build the product of treefied K with A(φ, Δ). Check
whether the Kripke tree (T, V ) in Definition 5.43 belongs in L(A(φ, Δ)) ∩ {(T, V )}.
If it is so, then K |= φ, if not K does not satisfy φ.
This procedure leads to the non-emptiness problem. We now recall the construc-
tion of the automaton A(φ, Δ) in [35].
Theorem 5.26 (CTL model checking) There exists a weakly alternating automaton
A(φ, Δ) whose language consists of all and only trees with the parameter Δ that
satisfy the given formula φ.
(g) δ(EψU χ, a, k) = δ(χ, a, k) ∨ [(δ(ψ, a, k) ∧ k−1 (c, EψU χ))];
c=0
k−1
(h) δ(Aψ Rχ), a, k) = δ(χ, a, k) ∧ [(δ(ψ, a, k) ∨ c=0 (c, Aψ Rχ))];
(j) δ(E(ψ Rχ), a, k) = δ(χ, a, k) ∧ [(δ(ψ, a, k) ∨ k−1
c=0 (c, EψU χ))].
By structural induction on φ, one proves that for each accepting run r of Aφ,Δ on the
Kripke tree (Tk , Vk ), the run tree (Tr , r ) has the property that for every node (x, ψ)
of Tr , VK (x) |= ψ. It follows that for the initial node (ε, φ), ε satisfies φ.
This means soundness of Aφ,Δ .
To prove completeness, suppose that (T, V ) is a tree with the spread Δ such that
(T, V ) |= φ.
It is to be proved that Aφ,Δ accepts (T, V ). An accepting run (Tr , r ) begins with ε
and r (ε) = (ε, φ). Throughout the run r , the property is kept that for each run node
(x, ψ), V (x) |= ψ. This property is carried to successors of a node by definition of
δ which reflects the semantics of CTL. So-called eventualities related to R, which
make the acceptance condition F, are eventually reached by infinite paths due to
appropriate parts of definition of δ. Finally, we have the theorem due to (Kupferman,
Vardi, Wolper [35]).
Theorem 5.27 The language of Aφ,Δ is non-empty if and only if the Kripke tree
structure with the parameter Δ in Definition 5.43 satisfies φ.
We kindly refer the reader to ([35]) for the proof.
(1.) φ1 is VAR(1);
(2.) φ2 is VAR(2);
(3.) φ3 is VAR(3);
(4.) φ4 is AND(φ1 , φ2 );
(5.) φ5 is AND(φ4 , φ3 );
(6.) φ6 is NOT(φ1 );
(7.) φ7 is AND(φ6 , φ3 );
(8.) φ8 is OR(φ5 , φ7 ).
It remains to represent the transition function R. We exploit to this end the mapping
f (s) into open complete description and substitutions of primed atomic propositions:
Definition 5.46 (Images and Preimages) In model checking, the dominating idea is
to explore the space of states by checking the set of successors as well as the set of
predecessors of a given set of states.
For a set X ⊆ S of states, the image of X under the transition relation R, is the
set Im(X,R)={t ∈ S : ∃s ∈ X.(s, t) ∈ R}. We need one more operation of rev.prime
(reverse prime), shortly, rp, which consists in substitution of pi for pi . The BDD
rendering of the image Im(X,R) is the formula BDDIm(X,R):
∃{ p1 , p2 , . . . , pk }.R ∧ Y .
f (s1 ) is p;
For X = {s0 , s1 }, f (X ) is (( p ∧ q) ∨ p) ≡ p;
For the transition relation R, f (R) is [( p ∧ q ∧ p ) ∨ ( p ∧ p )].
BDDImage for X = {s1 } is BDDIm(X,R)=(∃ p, q. p ∧ p ∧ p ,r p ≡ ( p ,r p ) ≡ p =
f (s1 ).
BDDPreimage for X = {s1 } is BDDPREIm(X,R)=∃ p , q .( p ∧ q ∧ p
∨ p ∧ p ) ≡ p ∧ p ∨ p = f (s0 , s1 ).
Definition 5.47 (Symbolic model checking for CTL via OBDD) We know that a base
for temporal CTL operators may be provided by EX, EG,EU, which proclaim the
existence of a path on which X, respectively, G, or U takes place. All these cases may
be model checked by beginning with the set of all states of a Kripke structure and
using BDDPREIm in order to find recursively preceding states from which a path is
initiated on which the formula for X or G, or U happens to be true.
5.18 Problems
Problem 5.1 (Time modalities) Due to their meanings, the pair G, F of temporal
operators is equivalent to the pair L , M of modal operators. Please write the for-
mulae (K),(T),(4),(5),(B), (D), (L(n,m)), (G(k,l,n,m)),(Bc ), (5c ) from Sect. 4.16 in
the temporal context, i.e., by replacing L by G and M by F and applying temporal
equivalences.
Check validity of the obtained formulae and write valid temporal formulae defin-
ing temporal variants of logics K, T, S4, S5.
We consider the structure (R+ , <), where R+ = [0, ∞) and < is the natural
linear order. Let η : (an )∞ n=0 be a strictly increasing sequence of real numbers with
lim n→∞ = ∞. Let δ0 = [0, a0 ) and for n > 0, δn = [an−1 , an ). Let P be the count-
able set of atomic propositions and P <ω be the set of finite subsets of P. Let f be
an assignment which assigns to each δn a subset f (δn ) ∈ P <ω . The induced linear
order on the collection Δ = {δn : n ∈ N is the order on indices n. Define operators
G f,η , F f,η , X f,η , U f,η as follows:
(i) δu |= G f,η φ ≡ ∀δn ≥ δu .δn |= φ;
(ii) δu |= G f,η φ ≡ ∃δn ≥ δu .δn |= φ;
(iii) δu |= X f,η φ ≡ δu+1 |= φ;
(iv) δu |= φU f,η ψ ≡ ∃δn ≥ δu .δn |= ψ ∧ ∀δu ≤ δm < δn .δm |= φ.
Verify: which of LTL formulae in Theorem 5.2 are preserved in this new setting.
Fψ ⊃ φUψ.
Problem 5.4 (LTL formulae) The following are expressions of LTL involving dis-
tributivity wrt. U:
(i) φ U (χ ∨ ξ) ≡ ((φ U χ) ∨ (φUξ));
(ii) (χ ∧ ξ) U φ ≡ (χ U φ) ∧ (ξUφ);
(iii) ((χ ⊃ ξ U φ) ∧ (χ Uφ)) ⊃ (ξ U φ);
Prove validity of these formulae.
Problem 5.5 (CTL formulae) Prove validity of formulae involving the Release oper-
ator R:
(i) (AφRψ) ⊃ (ψ ∧ (φ∨ AXA(φ Rψ)));
(ii) (EφRψ) ⊃ (ψ ∧ (φ∨ EXE(φ Rψ)));
Verify whether converse implications to (i), (ii) are valid.
Problem 5.6 (CTL∗ formulae) Verify whether CTL∗ implications below, where φ
is a state formula, are valid:
Problem 5.8 (Periodic structures) Consider a model for LTL over the alpha-
bet {a, b} of the form M f in which the assignment f is given as the ω-word
(a)(a, b)(b)(a, b a, b b)ω . In the periodic form it has the prefix length=3 and the
loop length=3.
Prove validity of the following formulae:
(i) M f |= GFa;
(ii) M f |= GFa⊃ GFb;
(iii) GFaU b.
Problem 5.9 (Embedding of CTL into CTL∗ ) Verify the claim: each CTL formula
is a CTL∗ state formula.
Problem 5.10 (More CTL formulae) Verify validity of the following formulae ([9],
7.5.2):
(i) (AX(φ ⊃ ψ))⊃((AXφ)⊃ (AXψ));
(ii) (ψ ∨ (φ∧ EXE(φUψ)))⊃E(φUψ);
(iii) (ψ ∨ (φ∧ AXA(φUψ)))⊃A(φUψ).
(iv) EX;
(v) AG((ψ ∨ (φ∧ EX χ)) ⊃ χ) ⊃ (E(φ Uψ)⊃ χ));
(vi) AG((ψ ∨ (φ∧AXχ)) ⊃ χ) ⊃ (A(φUψ)⊃ χ));
(vii) (ψ∨ EXEFψ) ⊃EFψ;
(viii) (ψ∨ AXAFψ) ⊃AFψ;
(ix) AG((ψ∨EXχ) ⊃ χ) ⊃(EFψ ⊃ χ);
(x) AG((ψ∨AXχ) ⊃ χ) ⊃(AFψ ⊃ χ).
Problem 5.11 (LTL) For any sequence a=(an )∞ n=0 of natural numbers, define the
operator Fa as follows: for an LTL formula φ and a state sk , sk |= Fa φ if and only if
(i) sk+a0 |= φ;
(ii) ∀n.sk+i=0
n |= φ ⊃ sk+i=0
n+1 |= φ.
Problem 5.13 (LTL; [9]) The axiomatic system for LTL consists of the following
axiom schemes
(A1) all tautologies (i.e., valid formulae) of sentential logic;
(A2) X(χ ⊃ ξ) ⊃ (Xχ ⊃Xξ) (the modal (K) for X);
(A3) X; truth is satisfied always;
(A4) X¬χ ≡ ¬ Xχ;
(A5) Gχ ⊃ (χ∧Gχ);
(A6) G(χ ⊃ ((ξ∧Xχ)) ⊃ (χ ⊃ Gξ);
(A7) (χ ∨ (ξ ∧ ξUχ)) ⊃ (ξUχ);
(A8) G((χ ∨ (ξ∧Xη)) ⊃ η) ⊃ ((ξUχ) ⊃ η),
5.18 Problems 277
Problem 5.14 (LTL) Explain the meaning of the LTL formula Fχ ⊃ ξUχ; compare
it to the proposition in ([9], 6.2) of the operator B (Before): ‘if χ is satisfied, then ξ
is satisfied before χ.
Problem 5.15 (CTL) (after Emerson, Halpern [16]), Emerson, E. A.: Temporal and
modal logics. In: Leeuwen, J. van (ed.): Handbook of Theoretical Computer Science,
B. MIT Press, Cambridge MA (1990). Axiomatic system for CTL developed in [16],
consists of the following schemes:
(A1) all tautologies of sentential logic;
(A2) (K C T L ) AX(χ ⊃ ξ) ⊃ [(AXχ) ⊃ (AXξ);
(A3) EX (the realization of seriality of the underlying transition system);
(A4) (χ ∨ (ξ∧EXE(ξUχ))) ⊃E(ξUχ);
(A5) (χ ∨ (ξ∧AXA(ξUχ))) ⊃A(ξUχ);
(A6) AG((χ ∨ (ξ∧EXη) ⊃ η) ⊃ (E(ξUχ) ⊃ η);
(A7) AG((χ ∨ (ξ∧AXη) ⊃ η) ⊃ (A(ξUχ) ⊃ η).
Inference rules are (MP) and (N): if χ, then AXχ.
The Deduction theorem: Γ ∪ {χ} ξ ≡ Γ χ ⊃ ξ.
Derive from (A1)–(A7) by means of (MP) and (N) the formula E(ξUχ) ≡ (χ ∨
(ξ∧EXE(ξUχ)).
[Hint: please consult eventually [9], 7.5.2.].
Problem 5.17 (CTL∗ ); (after [9]). Find, why the formula A(G p ⊃AG p) is not valid
in CTL∗ . Provide a falsifying structure.
278 5 Temporal Logics for Linear and Branching Time and Model Checking
The two following problems come from (Wolper, P.: Temporal logic can be more
expressive. Information and Control 56(1–2), 72–99 (1983)) and (Manna, Z.: Veri-
fication of sequential programs: Temporal axiomatization. In: Bauer, F. L., Dijkstra,
E. W., Hoare, C.A.R. (eds.). Theoretical Foundations of Programming Methodology.
NATO Sci. Ser. Reidel (1981)).
Problem 5.18 (LTL) (after (Wolper, Manna)). A slightly different set of axiom
schemes for a variant of LTL called PTL (the Propositional Temporal Logic) was
proposed in by Manna and analyzed by Wolper. These axiom schemes are
(MW1) F p ≡ ¬G¬ p;
(MW2) G( p ⊃ q) ⊃(G p ⊃Gq);
(MW3) X¬ p ≡ ¬X p;
(MW4) X( p ⊃ q) ⊃ (X p ⊃Xq);
(MW5) G p ⊃ ( p∧X p∧XG p);
(MW6) G( p ⊃X p) ⊃ ( p ⊃G p);
(MW7) G p ⊃ pUq;
(MW8) pUq ≡ q ∨ ( p∧X( pUq)).
Inference rules are (MP) and (NG ). This variant treats Until in a different way:
s0 |= pUq if and only if (i) either s |= p for each s ≥ s0 or (ii) there exists s ≥ s0
such that s |= q and s |= p for each s0 ≤ s < s. This latter interpretation (ii), which
is adopted for LTL, comes from (Gabbay, D., Pnueli, A., Shelah, S., Stavi, J.: The
temporal analysis of fairness. In: 7th ACM Symp. on Principles of Programming
Languages, 163–173 (1980).).
Derive the formula (G p) ⊃ p.
Problem 5.19 (Linear properties in LTL and Quantified LTL) (after Wolper). Prove:
(i) the formula
p ∧ G( p ⊃ X¬ p) ∧ G(¬ p ⊃ X p)
does not express the property: ‘every second state satisfies p’ (EVEN(p)) (ii) the
formula ∃q.q ∧ G(q ⊃ X¬q) ∧ G(¬q ⊃ Xq) ∧ G(q ⊃ p) expresses the property
EVEN(p).
References
1. Kohelet: In Alter, R.: The Hebrew Bible: A Translation with Commentary. W. W. Norton &
Company (2018)
2. Łukasiewicz, J.: On the Principle of Contradiction in Aristotle. Kraków (1910)
3. Prior, A.: Time and Modality. Oxford University Press, Oxford (1957)
4. Pnueli, A.: The temporal logic of programs. In: FOCS: Annual Symposium on Foundations of
Computer Science, pp. 46–57 (1977)
5. Kamp, J.: Tense logic and the theory of linear order. Ph.D. thesis, UCLA (1968)
References 279
6. Mazurkiewicz, A.: Concurrent program schemes and their interpretation. DAIMI Rept. PB-78,
Aarhus University, Aarhus (1977)
7. Fischer, M.J., Ladner, R.E.: Propositional modal logic of programs. J. Comput. Syst. Sci. 18,
194–211 (1979)
8. Sistla, A.P., Clarke, E., M.: The complexity of propositional linear temporal logic. J. ACM.
32(3), 733–749 (1985)
9. Demri, S., Goranko, V., Lange, M.: Temporal Logics in Computer Science. Finite-State Sys-
tems. Cambridge University Press, Cambridge, UK (2016)
10. Vardi, M.Y., Stockmeyer,L.: Improved upper and lower bounds for modal logics of programs:
preliminary report. In: STOC85
11. Markey, N.: Temporal logics (2015). hal-01194612
12. Ladner, R.: The circuit value problem is log space complete for P. ACM SIGACT News. 7(1),
18–20 (1975). https://doi.org/10.1145/990518.990519
13. Emerson, E.A., Lei, C.L.: Modalities for model checking: branching time logic strikes back.
Sci. Comput. Program. 8(3), 275–306 (1987)
14. Schnoebelen, P.: The complexity of temporal logic model checking. In: Advances in Modal
Logic, vol. 4. World Scientific, Singapore (2003)
15. Wolper, P.: The tableau method for temporal logic: an overview. Logique et Anal. (N.S.) 110–
111, 119–136 (1985)
16. Emerson, E.A., Halpern, J.Y.: Decision procedures and expressiveness in temporal logic of
branching time. J. Comput. Syst. Sci. 30, 1–24 (1985)
17. Reynolds, M.: A tableau-based decision procedure for CTL*. Form. Asp. Comput. 23(6), 739–
779 (2011)
18. Reynolds, M.: A faster Tableau for CTL*. In: Proceedings of the GandALF’2013
19. Clarke, E.M., Grumberg, O., Peled, D.A.: Model Checking. The MIT Press, Cambridge (2000)
20. Cimatti, A., Clarke, E.M., Giunchiglia, E., Giunchiglia, F., Pistore, M., Roveri, M., Sebastiani,
R., Tacchella, A.: NuSMV 2: an open-source tool for symbolic model checking. In: Proceedings
of the 14th International Conference CAV, pp. 359–364 (2002)
21. Li, J., Yao, Y., Pu, G., Zhang, L., He, J.: Aalta: an LTL satisfiability checker over infinite/finite
traces. In: Proceedings of the 22nd ACM International Symposium on Foundations of Software
Engineering, pp. 731–734 (2014)
22. Bertello, M., Gigante, N.,Montanari, A., Reynolds, M.: Leviathan: a new LTL satisfiability
checking tool based on a one-pass tree-shaped tableau. In: Proceedings of the Twenty-Fifth
International Joint Conference on Artificial Intelligence (IJCAI-16) (2016)
23. Kupferman, O.: Automata theory and model checking. In: [24], 107–152
24. Clarke, E.M., Henzinger, T.A., Veith, H., Bloem, R. (eds.): Handbook of Model Checking.
Publishing, Springer Nature. Springer International (2018)
25. Perrin, D., Pin, J.-É.: Infinite Words. In: Automata, Semigroups, Logics and Games. Elsevier,
Academic, Amsterdam (2004)
26. Choueka, Y.: Theories of automata on ω-tapes: a simplified approach. J. Comput. Sci. 8, 117–
141 (1974)
27. Kupferman, O., Vardi, M.Y.: Weak alternating automata are not that weak. ACM Trans. Comput.
Log. 2(2), 408–429 (2001)
28. Vardi, M.Y., Wolper, P.: Reasoning about infinite computations. Inf. Comput. 115(1), 1–37
(1994)
29. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms. The MIT
Press, Cambridge (2009)
30. Sistla, A.P., Vardi, M.Y., Wolper, P.: The complementation problem for Büchi automata with
applications to temporal logic. Theor. Comput. Sci. 49, 217–237 (1987)
31. Chandra, A.K., Kozen, D.C., Stockmeyer, L.J.: Alternation. J. Assoc. Comput. Mach. 28(1),
114–133 (1981)
32. Miyano, S., Hayashi, T.: Alternating finite automata on ω-words. Theor. Comput. Sci. 32,
321–330 (1984)
33. Vardi, M.Y., Wilke, T.: Automata: from logics to algorithms. In: [34], 629–736
280 5 Temporal Logics for Linear and Branching Time and Model Checking
34. Flum, J., Grädel, E., Wilke, T. (eds.): Logic and Automata. History and Perspective. Amsterdam
University Press, Amsterdam (2008)
35. Kupferman, O., Vardi, M.Y., Wolper, P.: An automata-theoretic approach to branching-time
model checking. J. ACM. 47(2), 312–360 (2000)
36. Thomas, W.: Automata on infinite objects. In: van Leeuwen, J. (ed.) Handbook of Theoretical
Computer Science B, pp. 133–191. Elsevier Science Publishers (1990)
37. Muller, D.E., Schupp, P.E.: Alternating automata on infinite trees. Theor. Comput. Sci. 54,
167–176 (1987)
38. Muller, D.E., Saoudi, A., Schupp, P.E.: Alternating automata, the weak monadic theory of the
tree and its complexity. In: Proceedings of the 13th International Colloquium on Automata,
Languages and Programming. Springer, New York (1986)
39. Bryant, R.E.: Binary decision diagrams. In: Clarke, E.M., Henzinger, T.H.A., Veith, H., Bloem,
R. (eds.) Handbook of Model Checking, pp. 191–218. Publisher, Springer International (2018)
40. Chaki, S., Gurnfinkel, A.: BBD-based symbolic model checking. In: Clarke, E.M., Henzinger,
T.H.A., Veith, H., Bloem, R. (eds.) Handbook of Model Checking, pp. 219–246. Publisher,
Springer International (2018)
Chapter 6
Finitely and Infinitely Valued Logics
Definition 6.1 (Assignments. The Łukasiewicz formulae) Suppose that the assign-
ment A is defined for atomic propositions. Its extension to formulae, A∗ , is defined on
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 281
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4_6
282 6 Finitely and Infinitely Valued Logics
¬ L φ ≡ A φ ⊃ L 0.
We introduce the connective ∨ called the strong disjunction. The truth function
of φ∨ψ is equal to the truth function of (¬ L φ) ⊃ L ψ. For given φ, ψ, truth function
A∗ (φ∨ψ) = min{1, 1 − (1 − A∗ (φ)) + A∗ (ψ)}=min{1, A ∗ (φ) + A∗ (ψ)}. Hence
φ∨ψ ≡ A (¬ L φ) ⊃ L ψ.
The connective φ&ψ is called the strong conjunction. The truth function of φ&ψ is
equal to the truth function of ¬ L (¬ L φ∨¬ L ψ) which is equal to the truth function
of the formula φ ⊃ L ¬ψ. For given φ, ψ, truth function A∗ (φ&ψ = 1 − min{1, 1 −
A∗ (φ) + 1 − A∗ (ψ)}= max{0, A∗ (φ) + A∗ (ψ) − 1}.
6.1 3-Valued Logic of Łukasiewicz (3 L ). Introduction 283
φ ∧ ψ ≡ A φ&(φ ⊃ L ψ).
The lattice operator, the join ∨, is defined as follows. The truth function of φ ∨ ψ
is equal to the truth function of ¬ L (¬ L φ ∧ ¬ L ψ). By duality (1), A∗ (φ ∨ ψ) =
max{A∗ (φ), A∗ (ψ)}. We put for the record the equivalence
(φ ∨ ψ) ≡ A ¬ L (¬ L φ ∧ ¬l ψ).
Formulae in (iv) and (v) tell us that the lattice order ≤ is preserved as the natural
order in the set of values of formulae. The connective & is dual to the implication ⊃ L
in the following sense, where A∗ (&) denotes the truth function of &, and A∗ (⊃ L ) is
the value of ⊃ L .
That (6.1b) actually holds can be verified by a simple calculations in two cases:
Case 1. max{0, x + y − 1} = 0, Case 2. max{0, x + y − 1} = x + y − 1. In Case 1,
x + y − 1 ≤ 0 and z ≥ 0, hence min{1, 1 − x + z} ≥ min{1, 1 − x} ≥ y. in Case 2,
x + y − 1 > 0 and x + y − 1 ≤ z, hence, 1 − x + z ≥ y and min{1, 1 − x + z} ≥
y, thus, in both cases (6.1b) has been shown to hold.
In algebraic theory, x ⊃ L y is the relative pseudo-complement of x with respect
to y (see Sect. 1.9).
Yet another duality bounds & and ∨:
It is now time to reveal in more detail the fabric of many-valued logic. The formula
max{0, x + y − 1} is the value TL (x, y) of the function TL : [0, 1] × [0, 1] → [0, 1]
called the Łukasiewicz T-norm. T-norms go back to Menger [4] who introduced them
in his attempts at modeling uncertainty by means of probabilistic metric spaces.
The discussion of T-norms is postponed to a further section, let us mention here that
the duality (#) makes the set of values for many-valued logic into a residuated lattice
(see Sect. 1.9). The connective & is called the strong conjunction, and the dual ∨ is
called the strong disjunction. The meet and the join are then also called conjunction
and disjunction. The last operator of use in some algebras related to many-valued
logics is the difference , which interprets the composition of connectives
φ&¬ψ
with the value max {0, A∗ (φ) − A∗ (ψ)}. In particular, x ≤ y if and only if x y = 0.
If all these connectives are applied to a set A∗ of values then the structure
∗
(A , ¬ L , ⊃ L , &, ∨, , 0, 1) is denoted A L and called the Łukasiewicz residuated
lattice. In addition to Łukasiewicz many-valued logics, there are some other ‘clas-
sical’ many-valued logics. We focus here only on principal of them induced by
T-norms, i.e,
The Gödel logic induced by the minimum T-norm TM (x, y) = min{x, y}.
{0, n−1
1
, . . . , n−2
n−1
, 1} producing the n-valued logic n L for each natural number
n > 2;
Theorem 6.1 The following hold for residua of T-norms. In case x ≤ y, all residua
take on the value 1. We consider the case when x > y.
(i) for the Łukasiewicz T-norm , the value of the residuum x ⇒ L y is the value of
the Łukasiewicz implication: min{1, 1 − x + y};
(ii) for the product T-norm, the value of the residuum x ⇒ P y is xy ;
(iii) for the minimum T-norm, the value of the residuum x ⇒ M y is y.
In Definition 6.2(ii), we have given the value of ∨ as min {1, A∗ (φ) + A∗ (ψ)}.
This function comes as dual to & via the equivalence φ∨ψ ≡ A ¬(¬φ&¬ψ).
This duality applied to any T-norm yields the dual function ST called T-co-norm:
ST (x, y) = 1 − T (1 − x, 1 − y).
286 6 Finitely and Infinitely Valued Logics
Before proceeding with the logic 3 L , we give an account of the minimal many-valued
logic based on the above scheme, i.e., BL.
As with sentential logic, semantics of many-valued logic is determined by assign-
ments. Each assignment creates world in which a formula can be true; the designated
value for truth is 1. A formula true in all worlds is valid. A formula is satisfiable if
and only if its value is 1 in at least one world, otherwise the formula is unsatisfiable.
Let us observe that a formula is valid if and only if its negation is unsatisfiable.
In BL, the implication is ⊃T whose value is the residuum of T , and, strong
conjunction &T is just T . The constant is 0 is interpreted as 0. Other connectives are
defined from ⊃T and &T by means of equivalences:
6.3 Basic Logic (BL) 287
(i) ¬T φ ≡ φ ⊃T 0;
(ii) φ ∧ ψ ≡ φ&T (φ ⊃T ψ);
(iii) φ ∨ ψ ≡ [(φ ⊃T ψ) ⊃T ψ] ∧ [(ψ ⊃T φ) ⊃T φ];
(iv) φ∨ψ ≡ ¬T (¬T φ&T ¬T ψ).
Definition 6.5 (Axiomatization of BL) Axiom system for BL comes from Hájek [5].
We reproduce it along with some provable formulae of BL referring to Hájek [5] for
a more complete account. Axiom schemes for BL are the following (≡ is defined as
⊃ & ⊃):
(A1) ((φ ⊃T ψ) ⊃T (ψ ⊃T ξ )) ⊃T (φ ⊃T ξ );
(A2) φ&T ψ ⊃T φ;
(A3) φ&T ψ ⊃T ψ&T φ;
(A4) (φ&T (φ ⊃T ψ)) ⊃T (ψ&T (ψ ⊃T φ));
(A5) (φ ⊃T (ψ ⊃T ξ )) ⊃T ((φ&T ψ) ⊃T ξ );
(A6) ((φ ⊃T ψ) ⊃T ξ ) ⊃T (((ψ ⊃T φ) ⊃T ξ ) ⊃T ξ );
(A7) 0 ⊃T φ.
Proof It consists in checking that value of each scheme is 1. We prove this for (A2).
We have
Theorem 6.3 The following selected formulae are provable, hence, valid in BL.
(i) φ ⊃T φ;
(ii) φ ⊃T (ψ ⊃T φ);
(iii) (φ ⊃T (ψ ⊃T ξ )) ⊃T (ψ ⊃T (φ ⊃T ξ ));
(iv) (φ&T (φ ⊃T ψ)) ⊃T ψ;
(v) φ ⊃T (ψ ⊃T φ&T ψ);
(vi) φ&T (ψ&T ξ ) ≡T (φ&T ψ)&T ξ ;
(vii) (φ&T ψ) ⊃T φ ∧T ψ;
(viii) φ ⊃T (φ ∨T ψ);
(ix) (φ ⊃T ψ) ∨T (ψ ⊃T φ);
(x) (φ ⊃T ψ) ⊃T (¬T ψ ⊃T ¬T φ);
(xi) φ ⊃T (¬φ ⊃T ψ);
(xii) φ ⊃T ¬¬φ;
(xiii) (φ&T ¬φ) ⊃T 0;
288 6 Finitely and Infinitely Valued Logics
6.4 Meta-Theory of BL
We now come to the principal tool in algebraic proofs of completeness: the filter
separation theorem (cf. Theorem 1.68). We recall it in the current setting.
Theorem 6.6 (The filter separation theorem) For an L and x = 1, there exists a
prime filter F with x ∈
/ F.
Theorem 6.8 (the completeness theorem for BL) If for each BL-algebra L, φ is
L-valid, then φ is BL-provable.
Remark 6.1 From the embedding E into Π ∗ in Definition 6.13, it follows that each
formula φ is valid in each BL-algebra if and only if it is valid in each linearly ordered
BL-algebra.
6.5 Meta-Theory of 3 L
Axiomatization of logic 3 L and the proof of its completeness were provided in Wajs-
berg [8]. Wajsberg’s axiom schemes are:
(W1) φ ⊃ (ψ ⊃ φ);
(W2) (φ ⊃ ψ) ⊃ [(ψ ⊃ ξ ) ⊃ (φ ⊃ ξ )];
(W3) [(φ ⊃ ¬φ) ⊃ φ] ⊃ φ;
(W4) (¬ψ ⊃ ¬φ) ⊃ (φ ⊃ ψ).
We denote this system by the symbol (W). Inference rules are detachment and uniform
substitution. A formula is provable if it has a proof from axioms
by means of inference rules. The relation between syntax and semantics is provided
by properties of soundness and completeness; about them later on. It is easy to check
that axiom schemas (W1)–(W4) are valid and inference rules preserve validity, hence,
the system (W) is sound, i.e., each provable formula is valid.
We say that a set of formulae Γ proves a formula φ, Γ φ, if and only if there
exists a proof of φ from Γ , i.e., a sequence φ0 , φ1 , . . . , φn , where (i) φ0 ∈ Γ or φ0
is an instance of an axiom scheme (ii) φn is φ (iii) each φi , 0 < i < n, is the result
of substitution into an axiom scheme or is in Γ , or, it is obtained from some φr , φs ,
r < s < i, where φs is φr ⊃ φi , by means of detachment.
Original proof of completeness of the system (W) was provided in Wajsberg [8].
We recall the proof provided in (Goldberg et al. [9]), carried out by the method of
canonical models, on the lines of the Henkin completeness proof in Chap. 3.
We comment on detachment rule: we will apply it in the form (D); the syntactic
consequence is denoted by .
(W11) (¬¬φ) ⊃ φ;
(W12) φ ⊃ (¬¬φ);
(W13) φ ⊃ φ;
(W14) (φ ⊃ ψ) ⊃ (¬ψ ⊃ ¬φ);
(W15) (φ ⊃ ψ) ⊃ ((¬¬φ) ⊃ ψ);
(W16) [(¬¬φ) ⊃ ψ] ⊃ [(¬¬φ) ⊃ (¬¬ψ)];
(W17) (φ ⊃ ψ) ⊃ [(¬¬φ) ⊃ (¬¬ψ)];
(W18) [φ ⊃ (φ ⊃ ¬φ)] ⊃ (φ ⊃ ¬φ);
(W19) [(φ ⊃ ¬φ) ⊃ ¬(φ ⊃ ¬φ)] ⊃ φ;
(W20) [¬(φ ⊃ ψ)] ⊃ φ;
(W21) [¬(φ ⊃ ψ)] ⊃ ¬ψ;
(W22) [φ ⊃ [¬ψ ⊃ ¬(φ ⊃ ψ)];
(W23) [(φ ⊃ ¬φ) ⊃ (ψ ⊃ ¬¬ψ)] ⊃ (φ ⊃ ψ);
W(24) [φ ⊃ (φ ⊃ (ψ ⊃ ξ )) ⊃ (φ ⊃ (φ ⊃ ψ)] ⊃ (φ ⊃ ξ );
(W25) ⊥ ≡ ¬(φ ⊃ φ) is unsatisfiable.
We will use (W1)–(W4) and (W5)–(W25) in the proof of completeness of the three-
valued logic 3 L . First, we establish properties of consistent and maximal consistent
sets of formulae and of the syntactic consequence .
Theorem 6.9 The following are basic properties of provability Γ which we recall.
(i) monotonicity: if Γ φ and Γ ⊆ Γ then Γ φ;
(ii) compactness: if Γ φ then Γ φ for a finite subset Γ of Γ ;
(iii) If Γ φ and Γ (φ ⊃ ψ) then Γ ψ;
(iv) if φ ∈ Γ , then Γ φ;
(v) if φ, then Γ φ for each Γ , in particular Γ φ for each φ in (W5)–(W25).
(vi) if φ is an instance of an axiom scheme, then Γ φ for each Γ .
Theorem 6.10 (The deduction theorem) If Γ ∪ {φ} ψ then Γ φ ⊃ (φ ⊃ ψ).
Proof Suppose that Γ ∪ {φ} ψ and let ψ1 , ψ2 , . . . , ψn be a proof of ψ from Γ ∪
{φ}. We prove by induction on i the following Claim.
Claim. Γ φ ⊃ (φ ⊃ ψi ) for each i ≤ n. Suppose then that Claim is true for i < j.
Consider the following cases.
Case 1. ψ j is φ. The formula φ ⊃ (φ ⊃ φ) follows from axiom scheme (W1) by
substitution (ψ/φ).
Case 2. ψ j is an instance of an axiom scheme or an element of Γ . Then Γ ψ j by
Theorem 6.9 (v), (vi). By (W1), Γ ψ j ⊃ (φ ⊃ ψ j ).
By 5.2 (iii), Γ φ ⊃ ψ j . Substitutions into (W1) of (φ/φ ⊃ ψ j ; ψ/φ) yield
Γ (φ ⊃ ψ j ) ⊃ (φ ⊃ (φ ⊃ ψ j )),
(a) φ ⊃ (φ ⊃ ψk );
To prove Case 3, it is sufficient to apply (W24) with 5.2 (iii), (a) and (b). The proof
is concluded.
Theorem 6.11 The following are basic properties of consistent and inconsistent
sets.
(i) a set of formulae Γ is syntactically inconsistent if and only if Γ φ for each
formula φ;
(ii) a set Γ of formulae is syntactically inconsistent if and only if Γ ⊥;
(iii) inconsistency of Γ ∪ {φ} implies that Γ φ ⊃ ¬φ;
(iv) inconsistency of Γ ∪ {φ ⊃ ¬φ}, implies that Γ φ.
Proof For (i): Suppose that Γ is inconsistent. Then Γ φ and Γ ¬φ for some
formula φ. We apply (W6) in order to obtain
Γ (¬φ) ⊃ (φ ⊃ ψ)
Theorem 6.12 (The strong completeness property) For each formula φ and a set of
formulae Γ of logic 3 L , Γ φ if and only if Γ |= φ.
Proof The proof is by structural induction. The case of atomic propositions is already
settled in Theorem 6.13(i)–(iii). We have some cases to consider.
Case 1. α is ¬β and Sub-claim holds for β. If Γ ∗ ¬β, then by inductive assumption
A∗ (β) = 0, hence, A∗ (¬β) = 1. If Γ ∗ ¬¬β, then A∗ (¬β) = 0. In both cases
Sub-claim holds for α. If neither of two sub-cases holds, then, by Theorem 6.13(iii),
A∗ (β) = 2 and A∗ (α) = 2.
Case 2. α is β ⊃ γ and Sub-claim is true for β and γ . There are three sub-cases to
consider:
Sub-case 2.1. Γ ∗ (β ⊃ γ ). To obtain that A∗ (β ⊃ γ ) = 1, we have to discuss
three possibilities.
2.1.1 If A∗ (γ ) = 1 or A∗ (β) = 0, then A∗ (α) = 1;
2.1.2 If A∗ (γ ) = 0, then Γ ∗ (¬β) so A∗ (α) = 1;
2.1.3 The third sub-case is when neither of β, ¬β, γ , ¬γ has a derivation from
Γ ∗ , hence, A∗ (β) = 2 = A∗ (γ ), hence, A∗ (α) = 1.
Case 3. Next, we consider Γ ∗ ¬(β ⊃ γ ). By (W20) and (W21), Γ ∗ β and
Γ ∗ ¬γ , hence, A∗ (β) = 1, A∗ (γ ) = 0 so A∗ (α) = 0.
Case 4. Finally, we consider the case, when neither Γ ∗ (β ⊃ γ ) nor Γ ∗ ¬(β ⊃
γ ). By (W6), Γ ∗ ¬β is not true and (W1) implies that Γ ∗ γ is not true, hence,
A∗ (β) = 0 and A∗ (γ ) = 1.
Sub-case 4.1. First, let A∗ (β) = 1 so Γ ∗ β. By (W21), Γ ∗ ¬γ is not true, so
A (γ ) = 0 and finally A∗ (γ ) = 2, so A∗ (α) = 2; next, let A∗ (β) = 2, i.e., Γ ∗ β
∗
A concise interlude about some other proposals for 3- and 4-valued logics follows.
We recall here 3-valued logics of Kleene and Bochvar and the 4-valued modal logic
of Łukasiewicz.
Definition 6.18 (The logic 3 K of Kleene) The Kleene 3-valued logic 3 K Kleene [10],
whose values we denote as {0, 21 , 1} has the values of sentential connectives defined
as follows; for atomic propositions p, q, x denotes the value of p and y denotes the
value of q: then, negation ¬ p is defined as 1 − x, the value of conjunction p ∧ q is
defined as min{x, y}, the value of disjunction p ∨ q is max{x, y}.
Definition 6.19 (The Bochvar logics) The Bochvar three-valued external logic 3 B E
(Bochvar [11]), treats values of 21 and 0 in the same way, hence truth tables for this
logic are simplified by omitting the value 21 . Hence, the negation ¬ B E is the classical
negation ¬, and truth tables for ∨ B E , ∧ B E , ⊃ B E are identical with truth tables for
classical ∨, ∧, ⊃.
Observe that values of formulae in the logic 3 B E are only 0 or 1. The class of
formulae valid in the logic 3 B E coincides with the class of formulae valid in sentential
logic SL; hence, the class of formulae unsatisfiable in the logic 3 B E coincides with
the class of formulae unsatisfiable in the sentential logic SL.
The Bochvar three-valued internal logic 3 B I Bochvar [11] is defined by truth
table for negation ¬ B I , identical with the truth table for the Łukasiewicz 3-valued
negation, so truth function of it is 1 − x, truth table for conjunction ∧ B I is shown in
Table 6.7. The following formulae (i), (ii) define disjunction and implication
(i) ( p ∨ B I q) ≡ ¬ B I (¬ B I p ∧ B I ¬ B I q);
(ii) ( p ⊃ B I q) ≡ (¬ B I p ∨ q).
Definition 6.20 (The Łukasiewicz 4-valued logic) The Łukasiewicz 4-valued modal
logic 4 L M Łukasiewicz [12] adopts as atomic propositions pairs ( p, q) of atomic
propositions of sentential logic, hence, formulae of 4 L M are pairs of formulae of SL.
Connectives of 4 L M are defined as coordinate-wise actions of connectives of SL, i.e.,
(i) ( p, q) ⊃ L M (r, s) is (( p ⊃ r ), (q ⊃ s));
(ii) ¬ L M ( p, q) is (¬ p, ¬q)
The set of values is T = {(0, 0), (0, 1), (1, 0), (1, 1)}. Valid formulae are those whose
value is constantly (1, 1). Table 6.8 brings the truth table for the logic 44 L M .
In addition to ¬ = N , with N (0) = 1, N (1) = 0, one can define three more
unary functions: V (0) = 1, V (1) = 1; F(0) = 0, F(1) = 0; S(0) = 0, S(1) = 1.
This allows for definitions of 16 binary functions on pairs of values 0, 1. Of them,
Łukasiewicz singled out the two as representing modal operators L , M:
(i) M(v( p), v(q)) is (V (v( p)), S(v(q)), where v( p) is the value of p;
(ii) L(v( p), v(q)) is N M N (v( p), v(q))
Check that tables, Tables 6.9, 6.10, below present truth tables for modalities M
and L.
6.7 The n-Valued Logic n L : The Rosser-Tourquette Theory 297
With respect to the criterion of acceptance, one may check that modal formulae
(K), (T), (4) are accepted but the formula (5) is rejected.
We now proceed with the general finite-valued Łukasiewicz logic. The value set
L n = {0, 1, n−11
, . . . , n−2
n−1
} makes with operations ∨, &, ∨, ∧, ⊃, ¬ and constants
0, 1 a finite algebra—the Łukasiewicz residuated lattice (see Chap. 1 for basic alge-
braic structures).
Consider a natural number n > 2. We recall that the set of values for n-valued logic
is {0, n−1
1
, n−1
2
, . . . , n−2
n−1
, 1}. We denote these values by symbols 1, 2, . . . , n − 1, n.
For the two-valued (Boolean) sentential logic we have designated 1 as the truth value
and 0 as the designated falsity value, but for the case of n values, we may choose a
number 1 ≤ s < n and declare a formula α accepted when its truth value is always
less or equal to s for all assignments of truth values to sentential variables in α.
Otherwise, α is rejected.
This convention, due to (Rosser and Tourquette [13]), calls as well for modification
of truth functions so the smaller truth value corresponds to the greater degree of
acceptance: regardless of the choice of the threshold s, the truth value 1 signifies the
certainty of truth while the truth value n signifies certainty of falsity. We denote by
A the truth assignment on atomic propositions and A∗ denotes the extension of A to
valuation on formulae. Thus, we let
Definition 6.21 (Rosser, Tourquette) Axiom schemes for n-valued logic are:
(A1) ψ ⊃ (φ ⊃ ψ);
(A2) [φ ⊃ (ψ ⊃ ξ )] ⊃ [ψ ⊃ (φ ⊃ ξ )];
(A3) (φ ⊃ ψ) ⊃ [(ψ ⊃ ξ ) ⊃ (φ ⊃ ξ )];
(A4) [Jk (φ) ⊃ (Jk (φ) ⊃ ψ)] ⊃ (Jk (φ) ⊃ ψ) for k = 1, 2, . . . , n;
(A5) Γ1n (Jk (φ) ⊃ ψ)ψ;
(A6) Jk (φ) ⊃ φ for k = 1, 2, . . . , s;
(A7) Γk=1
b
J pk (Pk )J f (Fi (P1 , P2 , . . . , Pb )), where b is arity of Fi , i runs over indices
of operators Fi , each p j is the value of atomic proposition P j - an argument
for Fi and f is the value f i ( p1 , p2 , . . . , pb ) for the value function f i of Fi and
values pi s of Pi s.
Theorem 6.14 (The completeness theorem for n-valued logic n L ) For a formula φ
of n-valued logic, the formula is accepted if and only if it is provable from axiom
schemes A1–A7, i.e., |= φ ≡ φ.
Proof It is based on few claims. Its idea is in analogy to the Kalmár proof of SL
completeness in Chap. 2: elimination of atomic propositions. It will be convenient
to use small letters p, q, r, .... as denoting atomic propositions and then the symbol
V ( p) will denote the value of p.
Claim 1. (q ⊃ r ) ⊃ [( p ⊃ q) ⊃ ( p ⊃ r )].
Proof consists in substituting p/q ⊃ r , q/ p ⊃ q, r/ p ⊃ r in the scheme (A2)
and then applying detachment with the scheme (A3).
Claim 2. q ⊃ q.
Proof consists in substitution into the scheme (A2) of p/q, q/ p, r/q which yields
(ii) p ⊃ (q ⊃ q)
and from the last two facts we get Claim 4 by applying the scheme (A3).
Case 2. l > 0. As pl is some q j , by inductive assumption, we get
300 6 Finitely and Infinitely Valued Logics
j−1
(iii) Γ1l−1 pi r ⊃ Γ j+1
m+1
qi (Γ1 qi r );
Claim 1 gives
j−1
(iv) Γ1l pi r ⊃ (q j ⊃ (Γ j+1
m+1
qi (Γ1 qi r ))).
By inductive assumption,
j−1
(vi) (q j ⊃ Γ j+1
m
qi (Γ1 qi r )) ⊃ (Γ1m qi r ).
Claim 1 yields
Now, (i), (ii), (iv) together with scheme (A3) prove Claim 5.
Claim 6.
p p p
(Γ1 JV ( pr ) ( pr )(r ⊃ s)) ⊃ ((Γ1 JV ( pr ) ( pr )r ) ⊃ (Γ1 JV ( pr ) ( pr )s)),
6.7 The n-Valued Logic n L : The Rosser-Tourquette Theory 301
Claim 5 implies
(Γ1k JV ( pr ) ( pr )s)).
Claim 6 applied to (v) and then (ii) applied to the result, yield
Definition 6.22 (The m-valued Post logic) For m ≥ 2, the Post logic Pm (Post [14])
has as the set of truth values the set {0, m−1
1
, m−1
2
, . . . , m−2
m−1
, 1}.
ST (x, y) = 1 − T (1 − x, 1 − y).
S P (x, y) = 1 − (1 − x) · (1 − y) = x + y − x · y.
The third classical T-norm is the minimum T-norm TM (x, y) = min{x, y} with the
adjoint T-co-norm STM =max {x, y}.
The Łukasiewicz T-norm TL and the product T-norm TP are Archimedean. They
have some specific properties. We establish some basic properties of Archimedean
T-norms.
304 6 Finitely and Infinitely Valued Logics
Proof by induction.
(vi) T (x, y) < min{x, y}: T (x, y) ≤ T (1, y) = y;
Suppose that 0 <rn+1 (x) ≤rn (x) < 1 for some x, n; then
0 < x = T n+1 (rn+1 (x)) = T (T n (rn+1 (x)), rn+1 (x)) ≤ T (x, rn+1 (x)) < x,
a contradiction.
6.9 Infinite-Valued Logics 305
Let s = limn rn (x). By property (vii), s > rn (x) for each n. We have x =
T n (rn (x)) < T n (s) for each n. Was s < 1 we would have T n (s) < 1 for each
n and by property (ii), we would find some m such that T mn (s) = T m (T n (s)) <
x, a contradiction.
Theorem 6.17 (Ling [16]) Each Archimedean T-norm T admits the Hilbert-style
representation T (x, y) = g( f (x) + f (y)), where g : [0, a] → [0, 1] is a continuous
decreasing function and f is its inverse (called also a pseudo-inverse, when extended
to minus ∞ on the left and to ∞ on the right).
The function g is called the generator for T . We find for instance, the generator
for the Łukasiewicz T-norm.
Proof Suppose f (1) = a. Then g(x) = 1 for x ∈ [0, a], hence 1 = TL (1, 1) =
g( f (1) + f (1)) = g(2a), hence, 2a ∈ [0, a], i.e. a = 0 and g maps [0, 1] onto [1, 0];
this makes g(x) = 1 − x a candidate for the generator with f (y) = 1 − y. Insert-
ing these hypothetical functions into functional equation g( f (x) + f (y)) we get
1 − [(1 − x) + (1 − y)] = x + y − 1 if x + y ≥ 1 and 0 if x + y < 1, i.e., we get
TL (x, y).
Theorem 6.20 For each T-norm T , the residuum ⇒T satisfies the following prop-
erties:
(viii) x ≤ (x ⇒T y) ⇒T y;
(ix) T (x, y) ⇒T 0 = x ⇒T (y ⇒T 0).
Also,
(d) T (sup, a) ≤ u ≡ sup ≤ a ⇒T u ≡
S S
Now, letting u = sup S T (x, a), we get T (sup S , a) ≤ sup S T (x, a).
For (vi), we address for example the case of the second coordinate as proof for the
first coordinate goes along the same lines. Let a ≤ b and x ≤ y ⇒T a so T (x, y) ≤ b
and x ≤ y ⇒T b. Arbitrariness of x proves that y ⇒T a ≤ y →T b.
Concerning (vii), it follows by (v) and the duality between T and →T .
For (viii), we begin with obvious y ⇒T z ≤ y ⇒T z so T (y →T z, y) ≤ z thus
T (y, y ⇒T z) ≤ z and y ≤ (y ⇒T z) ⇒T z.
Property (ix) is proved on similar lines: z ≤ T (x, y) ⇒T 0 ≡ T (z, T (x, y)) ≤ 0,
i.e., T (T (z, x), y) ≤ 0 hence z ≤ x ⇒T (y ⇒T 0).
Proof Suppose that ⇒T is continuous. First we check that the following statement
holds true.
Claim. y = (y ⇒T a) ⇒T a for y ∈ [a, 1] and a ∈ [0, 1). By 9.8 (viii), y ≤ (y ⇒T
a) ⇒T a. To prove the converse inequality, observe that the function h(x) = x ⇒T a
is continuous decreasing with h(a) = 1, h(1) = a, hence, there exists z ≥ a such that
y = z ⇒T a. Then
(a) y = z ⇒T a ≥ ((z ⇒T a) ⇒T a) ⇒T a = (y ⇒T a) ⇒T a
which proves that the T-norm T is definable in terms of its residuum and as such is
continuous.
Now, for the second part, consider the equation T (x, x) = x. Suppose there is a
solution x0 = 0, 1 and choose c, d such that c ≤ x0 ≤ d and c = T (x, u) for some u.
Then T (x, c) = T (x, T (x, u)) = T (T (x, x), u) = T (x, u) = c and c = T (x, c) ≤
T (d, c) ≤ T (1, c) = c so T (d, c) = c. This means that for c < x, the function ⇒T
c is not injective, a contradiction witnessing that no x = 0, 1 solves the equation
T (x, x) = x. Now one can refer to theorems by Mostert - Shields and Faucett: as
only TL has the continuous residuum, T-norm T is equivalent to TL .
This logic is based on Łukasiewicz’s T-norm and its residuum and on the Łukasiewicz
negation. Anticipating the problem of completeness, we want to say that the proof of
completeness for this logic is an intricate one. The announcement in Wajsberg [20]
was without proof and the first proof in (Rose and Rosser [21]) made use of linear
functionals on real vector spaces, which delineated sets of formulae, close to the
referred below approach by McNaughton. We prefer to include main lines of a proof
by Chang [7] which makes use of the algebraic technique of MV-algebras.
The Łukasiewicz truth functions for negation A∗ (¬ p) = 1 − A( p) and for impli-
cation A∗ ( p ⊃ q) = min{1, 1 − A( p) + A(q)} form the basis for semantics of the
infinite-valued logic [0, 1] L . The set of values W for this logic is a subset of the unit
interval [0,1]. As shown by McNaughton, the set W should be a dense subset of the
unit interval [0,1] with 0, 1 ∈ W . The obvious candidates are the set Q ∗ = Q ∩ [0, 1]
of the rational numbers in [0,1] and the whole unit interval [0,1]. We focus on [0,1] as
310 6 Finitely and Infinitely Valued Logics
the set of values and we choose 1 as the designated value of acceptance. As already
pointed to, other functors are defined from negation and implication. The symbol TL
denotes the Łukasiewicz t-norm.
Definition 6.26 (Syntactic aspects of [0, 1)) As usual, we use the ‘turnstile’ symbol
to signal that a formula is provable in the system, i.e, it admits a proof from
axiom schemes plus possibly a set Γ of formulae in which case we will use the
symbol Γ .... The derivation rule is that of detachment. Łukasiewicz conjectured
in (Łukasiewicz and Tarski [22]) a famous set of axiom schemes which would make
[0,1] L a completely axiomatizable system. These axiom schemes have been:
(L1) (φ ⊃ ψ) ⊃ φ;
(L2) (φ ⊃ ψ) ⊃ [(ψ ⊃ ξ ) ⊃ (φ ⊃ ξ )];
(L3) (φ ∨ ψ) ⊃ (ψ ∨ φ). Equivalently: ((φ ⊃ ψ) ⊃ ψ) ⊃ ((ψ ⊃ φ) ⊃ φ);
(L4) (¬φ ⊃ ¬ψ) ⊃ (ψ ⊃ φ);
(L5) (φ ⊃ ψ) ∨ (ψ ⊃ φ).
The scheme (L5) was shown redundant in Meredith [23] and in Chang [24].
As shown in Hájek [5], the Łukasiewicz system (L1)–(L4) is equivalent to the
system BL+¬¬φ ⊃ φ which we will denote by BLDN.
Let us consider relations between BL and [0,1] L on the level of axiom systems in
Hájek [5].
Theorem 6.25 The following are relations among axiom schemes for BL and axiom
schemes for [0,1] L .
(i) BL implies (L1): the axiom schema (A2) gives (φ&ψ) ⊃ φ; the axiom schema
(A5): [(φ&ψ) ⊃ φ] ⊃ (φ ⊃ (ψ ⊃ φ)) and detachment yield (L1).
(ii) (L2) is (A1).
6.10 Infinite-Valued Logic [0,1] L of Łukasiewicz 311
(iii) For (L3): as B L φ ⊃ ¬¬φ (cf. Hájek [5], 2.2.(17)), it follows that B L D N
φ ≡ ¬¬φ and by (Hájek [5], 2.2.(18’)) B L (φ ⊃ ψ) ⊃ (¬ψ ⊃ ¬φ).
(iv) For (L4): from the axiom schema (A4) we get
hence,
¬φ&(ψ ⊃ φ) ⊃ ¬ψ&(φ ⊃ ψ),
so we get
¬(¬ψ&(φ ⊃ ψ)) ⊃ ¬(¬φ&(ψ ⊃ φ))
which yields
((φ ⊃ ψ) ⊃ ψ) ⊃ ((ψ ⊃ φ) ⊃ φ).
Theorem 6.26 The following inferences and formulae are among valid inferences
and provable formulae of the system [0,1] L .
(i) If Γ p ⊃ q, Γ q ⊃ r , then Γ p ⊃ r ;
It follows by axiom schema (L2) and detachment.
(iii) p ⊃ q, q ⊃ r p ⊃ r ;
By (i).
(iv) ( p ∨ q) ≡ (q ∨ p);
By (L3).
(vi) p ⊃ (q ∨ p);
312 6 Finitely and Infinitely Valued Logics
(vii) p ⊃ p ∨ q;
By (vi) and (L3).
(viii) ( p ⊃ (q ⊃ r )) ⊃ (q ⊃ ( p ⊃ r ));
By (vii), we obtain q ⊃ (q ∨ r ) and by (L2) we obtain
(c) ((q ∨ r ) ⊃ ( p ⊃ r )) ⊃ (q ⊃ ( p ⊃ r ))
Substitution (q/q ⊃ r ) into (c) and an application of (L2) yield
(d) ( p ⊃ (q ⊃ r )) ⊃ ((q ∨ r ) ⊃ ( p ⊃ r ))
From (c) and (d), (viii) follows by means of (L1);
(ix) (q ⊃ r ) ⊃ [( p ⊃ q) ⊃ ( p ⊃ r )];
By (viii) and (L2);
(xii) p ≡ p;
By (xi).
(xiii) ( p q) ≡ ( p ⊃ q);
By (L1), into which substitutions ( p/q; q/ p) has been made and by (vii) in which
the functor ∨ was replaced by its definiens ( p ⊃ q) ⊃ q;
(xiv) q ≡ (q ∨ q);
Substitute ( p/q ⊃ q) into (xiii) and apply (xi);
(xv) p ⊃ r, q ⊃ r ( p ∨ q) ⊃ r ;
By (L2),
(g) ((q ⊃ r ) ⊃ ( p ⊃ r ) ⊃ (( p ∨ r ) ⊃ (q ∨ r ))
and (L2) applied to (g) yields
(h) ( p ⊃ q) ⊃ (( p ∨ r ) ⊃ (q ∨ r ))
and, by (L3), we obtain
(j) ( p ⊃ q) ⊃ ((r ∨ p) ⊃ (r ∨ q))
6.10 Infinite-Valued Logic [0,1] L of Łukasiewicz 313
This implies
(k) ( p ⊃ r ) ⊃ (( p ∨ q) ⊃ (r ∨ q))
and
(l) (q ⊃ s) ⊃ ((r ∨ q) ⊃ (r ∨ s))
We digress here, to recall from (Rosser and Tourquette [13], 6.12. Claim 3) the valid
formula
(∗) (q ⊃ r ) ⊃ (Γi=1
m
pi q ⊃ Γi=1
m
pi r )
From (*), we obtain
(∗∗) Γi=1
m
pi q, Γi=1
n
si (q ⊃ r ) Γi=1
m
pi Γi=1
n
si r
Indeed, Suppose (ι) Γi=1
n
si (q ⊃ r ) and obtain via (viii) (κ) q ⊃ Γi=1
n
si r . Then (*)
yields
Γi=1m pi q ⊃ Γi=1
m
pi Γi=1
n
si r
Now, by (**), we obtain from (k) and (l) that (m)(( p ⊃ r ) ⊃ ( p ∨ q)) ⊃ ((q ⊃ s) ⊃
(r ∨ s)) which by (viii) yields
(γ ) ( p ⊃ r ) ⊃ ((q ⊃ s) ⊃ (( p ∨ q) ⊃ (r ∨ s))).
By applying (xiv) to (γ ), we conclude the proof;
(xvi) ¬¬ p ⊃ p;
Begin with (L1) to obtain (α): (¬¬ p) ⊃ ((¬¬q) ⊃ (¬¬ p)) by substitutions
( p/¬¬ p; q/¬¬q).
Substitute in (L4) ( p/¬ p; q¬q) and apply to (α) to obtain (β): (¬¬ p) ⊃ ((¬ p) ⊃
(¬q)).
Apply again (L4) to (β) to obtain (δ): (¬¬ p) ⊃ (q ⊃ p).
(ix) applied to (δ) yields (η): q ⊃ (¬¬ p ⊃ p) and by substitution in (η) of (xi)
for q,i.e.,(q/ p ⊃ p), we obtain (xvi) by detachment.
(xvii) p ⊃ ¬¬ p;
Apply (ix) to (xvi) to obtain (λ): ( p ⊃ ¬q) ⊃ ((¬¬ p) ⊃ (¬q)) and apply (L4) to
(λ) to obtain (μ): ( p ⊃ ¬q) ⊃ (q ⊃ ¬ p).
Substitution ( p/q; q/ p) in (xvi)) and repetition of above steps yield (ν): (q ⊃
¬ p) ⊃ ( p ⊃ ¬q) and (λ) and (ν) yield (π ): ( p ⊃ ¬q) ≡ (q ⊃ ¬ p). Substitution
q/¬ p) in (π ) yields p ⊃ ¬¬ p.
(xviii) p 𠪪 p;
By (xvi) and (xvii);
Definition 6.27 (Wajsberg algebras) A Wajsberg algebra, see (Font et al. [26]) is an
algebra W = (L , ⊃, ¬, 1) which satisfies the following conditions:
(WA1) 1 ⊃ x = x;
(WA2) (x ⊃ y) ⊃ [(y ⊃ z) ⊃ (x ⊃ z)] = 1;
(WA3) (x ⊃ y) ⊃ y = (y ⊃ x) ⊃ x;
(WA4) (¬x ⊃ ¬y) ⊃ (x ⊃ y).
(i) (x ⊃ x) = 1;
By (WA1), 1 ⊃ 1 = 1, by (WA2), 1 ⊃ (x ⊃ x) = 1, substitution (x/x ⊃ x) yields
x ⊃ x = 1 ⊃ (x ⊃ x), hence, x ⊃ x = 1;
(ii) If (x ⊃ y) = (y ⊃ x) = 1, then x = y;
(WA1) and (WA3) yield
x = 1 ⊃ x = (y ⊃ x) ⊃ x = (x ⊃ y) ⊃ y = 1 ⊃ y = y.
This property reveals the origins of Wajsberg algebra as the Tarski-Lindenbaum
algebra of 3-valued logic axiomatized by Wajsberg.
(iii) x ⊃ 1 = 1;
By (WA3), then by (i)(1), we get
(x ⊃ 1) ⊃ 1 = [(1 ⊃ x) ⊃ x] = x ⊃ x = 1
Using the obtained identity (x ⊃ 1) ⊃ 1 = 1, by (WA1) and (WA2), we obtain
1 = 1 ⊃ x = [(x ⊃ 1) ⊃ (1 ⊃ 1)] = x ⊃ (x ⊃ 1) ⊃ 1 = x ⊃ 1
(iv) x ⊃ (y ⊃ x) = 1;
By (WA1), (WA2), (iii), in some order, we get
1 = (y ⊃ 1) ⊃ [(1 ⊃ x) ⊃ (y ⊃ x)] = 1 ⊃ [x ⊃ (y ⊃ x)] = x ⊃ (y ⊃ x)
Yet another Wajsberg’s axiom scheme.
6.11 Wajsberg Algebras 315
(vi) If x ⊃ (y ⊃ z) = 1 then y ⊃ (x ⊃ z) = 1;
Suppose that x ⊃ (y ⊃ z) = 1. Substitution (y/y ⊃ z) in (W2) yields
1 = [x ⊃ (y ⊃ z)] ⊃ {[(y ⊃ z) ⊃ z] ⊃ (x ⊃ z)} =
⊃ [(y ⊃ z) ⊃ z] ⊃ (x ⊃ z)
By applying (WA1) and (WA3), we obtain [(z ⊃ y) ⊃ y] ⊃ (x ⊃ z) = 1. (iv) yields
y ⊃ [(z ⊃ y) ⊃ y] = 1. Substitute in (v): (x/y; y/(z ⊃ y) ⊃ y; z/x ⊃ z). It obtains
y ⊃ (x ⊃ z) = 1;
(viii) x ⊃ (y ⊃ z) = y ⊃ (x ⊃ z);
(WA3) and (iv) yield
(a) y ⊃ [(y ⊃ z) ⊃ z] = y ⊃ [(z ⊃ y) ⊃ y] = 1
By (vii),
(b) [(y ⊃ z) ⊃ z] ⊃ {[(x ⊃ (y ⊃ z)] ⊃ (x ⊃ z)} = 1
Application of (v) obtains from (a), (b),
(c) y ⊃ {[x ⊃ (y ⊃ z)] ⊃ (x ⊃ z)} = 1
By (vi), (d)[x ⊃ (y ⊃ z)] ⊃ [y ⊃ (x ⊃ z)] = 1 follows.
By symmetry, (e)[y ⊃ (x ⊃ z)] ⊃ [x ⊃ (y ⊃ z)] = 1. The result follows from
(d) and (e) by (ii)
These are basic conclusions from (WA1)–(WA3). As (WA4) is concerned with
negation, we now recall some properties involving negation. The basic ones are:
(ix) (¬1) ⊃ x = 1;
By (iv), (¬1) ⊃ (¬x ⊃ ¬1) = 1, hence, by (WA4), (¬1) ⊃ (1 ⊃ x) = 1 and (WA1)
yields (¬1) ⊃ x = 1;
(xi) ¬¬x = x;
By (x), (WA1) and (WA3), (¬¬x) = (x ⊃ ¬1) ⊃ ¬1 = (¬1 ⊃ x) ⊃ x = 1 ⊃ x =
x;
(xii) x ⊃ y = ¬y ⊃ ¬x;
(WA4) and (xi) imply
1 = (¬¬x ⊃ ¬¬y) ⊃ (¬y ⊃ ¬x) = (x ⊃ y) ⊃ (¬y ⊃ ¬x).
The converse implication is (WA4) and then the thesis follows by (ii).
MV-algebras provide an environment for the Chang completeness proof. We will
see their important interrelations with Wajsberg algebras in what follows.
6.12 MV-Algebras
6.28 (MV algebras) An MV-algebra is an algebra (A, , ¬, 0) with
Definition
a binary , unary ¬ and a constant 0. This algebra should satisfy the following
conditions, see Chang [7], Mundici [27], Mundici et al. [28].
(MV1) x (y z) = (x y) z;
(MV2) x y=y x;
(MV3) x 0 = x;
(MV4) ¬¬x = x;
(MV5) x (¬0) = ¬0;
(MV6) ¬(¬x y) y = ¬(¬y x) x.
(A) ¬1 = 0;
By (MV4).
(B) x y = ¬(¬x ¬y);
By (MV4).
(C) x ¬x = 1;
By (MV6) 1 = ¬0.
Theorem 6.30 The ordering ≤ is a partial ordering, i.e., it is reflexive, weakly anti-
symmetric and transitive.
318 6 Finitely and Infinitely Valued Logics
Proof Reflexivity means x ≤ x, i.e., x ¬x = 1 which is (C). Weak anti-symmetry
follows by (MV6) and identities x y = 0 = y x. Transitivity follows by (iv) in
Theorem 6.29.
Partial ordering≤ implies that
the complement ¬x is z that satisfies the system
of equations: (i) z x = 0 (ii) z x = 1.
Indeed, in the language of partial ordering ≤, these two conditions come down to
a double inequality ¬x ≤ z ≤ ¬x, hence z = ¬x.
Theorem 6.31 We collect here important properties of the partial ordering ≤.
(i) x ≤ y if and onlyif ¬y ≤ ¬x;
≤ y implies x
(ii) x z≤y z and
x z≤y z;
(iii) x y ≤ z if and only if x ≤ ¬y z.
m
J (I, x) = {y ∈ A : y ≤ ( x) z : z ∈ I, for some m}.
so x ∈ I , a contradiction.
320 6 Finitely and Infinitely Valued Logics
The
MV-operations are performed coordinate-wise: < xs >s∈S < ys >s∈S =<
xs s ys >s∈S and analogously for , , ¬.
Relations among the Cartesian product and MV-algebras in the family F are
expressed by projections πs : P As → As defined as πs (< xs >s∈S ) = xs .
Proof Suppose that I is a family of ideals that satisfy (i), (ii). Denote by h I : A →
A/ ∼ I the isomorphism existing by:
(i) for each I and let h : A → P A/ ∼ I be defined as h(x) =< h I (x) > I .
(ii) h is injective.
Let us observe, that each MV-chain is a distributive lattice with the meet x ∧ y =
min{x, y} and the join x ∨ y = max{x, y}.
Theorem 6.38 tells that any equation holds in all MV-algebras if and only if it
holds in all MV-chains. The next result is a breakthrough: any equation holds in all
MV-algebras if and only if it holds in the MV-algebra on [0,1].
We state the crucial result by Chang. The proof comes from (Cignoli and Mundici
[25]).
Theorem 6.39 (Chang [7]) For each equation t = 0 in the language of MV-algebras,
it holds true in each MV-algebra if and only if it holds in the MV-algebra [0,1] which
is the Łukasiewicz residuated lattice.
Definition 6.34 (Lattice-ordered abelian groups (-groups)) For such group G and
0 < u, u ∈ G, [0, u] denotes
the segment {x ∈ G : 0 ≤ x ≤ u}. For x, y ∈ [0, u],
we define operators: x y = u ∧ (x + y), ¬x = u − x.
Then, ([0, u], , ¬, 0) is an MV-algebra, denoted Γ (G, u); in particular, Γ (R, 1)
is [0,1] - Łukasiewicz MV-algebra.
Additional
in Γ (G, u) are: 1 = u, x
constants and operators y=
¬(¬x ¬y) = (x + y − u) ∨ 0, x ¬y = (x − y) ∨ 0, x ≤ y if and only if
¬x y = u (cf. Theorem 6.29).
v j =k Z π( j) − Z π j−1 ; embed Z
n+1
Consider vectors into Rn+1 and consider the sub-
space P = { j = 1 λ j v j : λ j ≥ 0}. We let also N ∗ = −P ∗ , then P ∗ ∩ N ∗ = {0},
∗
We recall that the Tarski-Lindenbaum algebra is the quotient algebra by the rela-
tion ∼ defined as:
α ∼ β ≡ α ⊃ β∧ β ⊃ α
(i) α ∼ β implies α ⊃ γ ∼ β ⊃ γ ;
(ii) α ∼ β implies ¬α ∼ ¬β.
Property (i) follows by the axiom scheme (L2), property (ii) follows by valid formulae
β ≡ ¬¬β and if (α ⊃ ¬¬β), then (¬β ⊃ ¬α), and, by (L4).
We denote by the symbol [α]∼ the equivalence class of the formula α. The quotient
algebra For m/ ∼ carries a structure of a Wajsberg algebra as well as that of an MV-
algebra.
Theorem 6.42 For m/ ∼ bears the structure of the Wajsberg algebra under the
interpretation:
A parallel result is
Theorem 6.43 For m/ ∼ bears the structure of the MV-algebra under the interpre-
tation:
(i) [α]∼ [β]∼ = [¬α ⊃ β]∼ ;
(ii) ¬[α]∼ = [¬α]∼ ;
(iii) 0 = ¬[Pr ovable]∼ .
The MV-algebra (For m/ ∼, , ¬, 0) is the Lindenbaum-Tarski algebra of the
Łukasiewicz infinite-valued MV-algebra A L . The soundness of [0,1] L is shown along
standard lines: axiom schemes are valid, detachment preserves validity, hence, each
provable formula is valid. The converse is
326 6 Finitely and Infinitely Valued Logics
Theorem 6.44 (The completeness theorem for [0, 1] L ) Each valid formula in [0,1] L
is provable.
Definition 6.41 (The infinite-valued logic of Goguen) In this logic, the semantics of
the implication ⊃ is given by the formula A∗ ( p ⊃ q) = 1 in case A( p) ≤ A(q) and
A(q)
A( p)
in case A( p) > A(q).
Definition 6.42 (The infinite-valued logic of Gödel) The implication is the Gödel
implication valued A∗ ( p ⊃ q) = 1 in case A( p) ≤ A(q) and A(q) in case A( p) >
A(q). The strong conjunction & is given by A∗ ( p&q) = min{A( p), A(q)}, the strong
disjunction is given by A∗ ( p∨q) = max{A( p), A(q)} and it follows that in Gödel’s
logic, we have
(i) (φ ∧ ψ) ≡ (φ&ψ)
(ii) (φ ∨ ψ) ≡ (φ∨ψ)
We denote by the symbol SAT the satisfiability problem for sentential logic, by,
respectively, SAT(Gödel), SAT(Goguen), SAT(Luk), satisfiability problems for log-
ics of,respectively, Gödel, Goguen, Łukasiewicz . Following the idea in (Hájek [5],
6.2.2), we consider a set P = { p1 , p2 , . . . , pn } of atomic propositions and for an
assignment A on P, we denote by N (A) the set { pi ∈ P : A( pi ) = 0}. Formulae
undergo reduction: to each formula φ its reduction φ ∗ is assigned as follows
(i) ⊥∗ is ⊥, ∗ is ;
(ii) pi∗ is ⊥ if pi ∈ N (A), pi∗ is pi , otherwise;
(iii) (⊥ ⊃ φ)∗ is ;
(iv) (φ ⊃ ⊥)∗ is ⊥ if φ ∗ = ⊥;
(iv) (φ ⊃ ψ)∗ is φ ∗ ⊃ ψ ∗ in cases other than (iii) and (iv);
(v) (119) (φ&⊥)∗ is ⊥, (φ&ψ)∗ is φ ∗ &ψ ∗ in other cases.
It follows form (i)–(v) above that the following holds.
Theorem 6.45 For logics of Goguen and Gödel, for each formula φ and each assign-
ment A, either φ ∗ is ⊥ or φ ∗ contains no symbol ⊥.
Theorem 6.47 SAT, SAT(Gödel), SAT (Goguen) are equivalent, hence, SAT (Gödel)
and SAT(Goguen) are NP-complete.
For SAT(Luk), see Mundici [29], where a proof is given that SAT(Luk) is NP-
complete. We may here only outline the main ideas of this approach. The rest is just
calculations. The starting point is given by McNaughton’s result McNaughton [15]
about representation of formulae of [0,1] L by piece-wise continuous functions on an
n-cube (we are close here to the proof of completeness of [0,1] L in Rose and Rosser
[21]).
Theorem 6.48 Consider [0, 1] L with operators defined as above. For a formula
q( p1 , p2 , .., pn ), where pi s are atomic propositions, we denote by Q(x1 , x2 , ..., xn )
the value of q with x1 , x2 , .., xn being values of p1 , p2 , ..., pn . We regard x1 , x2 , . . . , xn
as coordinate values in the cube [0, 1]n . The question posed by McNaughton was
328 6 Finitely and Infinitely Valued Logics
Lemma 6.2 (The Hadamard inequality) (cf. Hadamard [31]). For a matrix M with n
rows and n columns, whose all entries are bounded by a constant C, the determinant
det(M) satisfies the inequality |det(M)|≤ C n · n n/2 .
We recall that for a formula φ the size* of φ, size*(φ), is the number of symbols
in φ. The following couple of propositions come from Mundici [29].
Definition 6.43 (A function and a formula) The following pair define a formula ξn,t
f n,t = f ξn,t . We denote by h the function h applied to itself t times,
t
and the
function
i.e. h ... h (t times). We define consecutive functions for i, n ≥ 1 and t ≥ 2:
6.19 Complexity of Satisfiability Decision Problem for Infinite-Valued Logics 329
(iii) ξn,t is
K ψ1,t K ψ2,t . . . K ψn−2,t K ψn−1,t ψn,t
Theorem 6.49 A formula φ is valid in sentential logic if and only if the formula
ξn,t ⊃ φ is valid in infinite-valued logic [0, 1] L .
We recall that by SAT we mean the satisfiability problem for sentential logic. As we
know SAT is NP-complete.
Theorem 6.50 SAT(Luk) is NP-hard: the reduction SAT≤ p SAT(Luk) is provided by
the mapping φ → ¬ξn,t ⊃ ¬φ.
Concerning the NP-membership of SAT(Luk), geometric considerations from piece-
wise linear geometry, along with the hadamard inequality have brought the following
estimates.
Their form comes by McNaughton’s Theorems 6.48, A, B: if a formula φ(x1 , x2 ,
. . . , xn ) is satisfiable, then the corresponding McNaughton function f φ takes on
(x1 , x2 , . . . , xn ) the positive value. As (x1 , x2 , . . . , xn ) is an element of a convex
compact region R which may be assumed to be a simplex, the affine f φ takes its
maximal, i.e., positive value at one of vertices, say, r .
The description of r is given as a solution to the system M of n affine equations,
hence r = ( ab1 , . . . , abn ) with b given as the determinant of the system M, whose value
may be estimated by means of the Hadamard inequality. As computed in Mundici
[29], coefficients of the equations which express facets of the simplex are bound by
2 · si ze∗ (φ) and clearly n ≤ si ze∗ (φ). These considerations lead to the following
theorem.
Theorem 6.51 For a McNaughton function f φ for a satisfiable φ, there exists in
∗
[0, 1]n a rational point r = [ ab1 , . . . , abn ] with f φ (r ) > 0 and b < 24·si ze (φ) .
2
As shown in Mundici [29], guessing r along with b satisfying the bound in The-
orem 6.51, can be done non-deterministically in polynomial time. This shows that
SAT(Luk) is NP-complete.
330 6 Finitely and Infinitely Valued Logics
An analogous reasoning carried out for any logic n L with n > 2 proves that
SAT(n L ) is NP-complete Mundici [27].
6.20 Problems
Problem 6.1 (Kleene’s logic 3 K ) Prove: (i) in the logic 3 K (i) ( p ∨ q) ≡ ¬(¬ p ∧
¬q) (ii) ( p ⊃ q) ≡ ¬( p ∧ ¬q).
Problem 6.2 (Kleene’s logic 3 K ) Prove that the detachment rule ( p ∧ ( p ⊃ q)) ⊃ q
is valid in 3 K .
Problem 6.3 (Kleene’s logic 3 K ) Prove that if a set of formulae Γ entails a formula
φ in Kleene’s logic, then Γ entails φ in sentential logic. Verify that the formula
¬( p ≡ q) entails in sentential logic the formula ( p ≡ r ) ∨ (q ≡ r ) but it is not true
that this entailment holds in the logic 3 K .
Problem 6.4 (Łukasiewicz’s logic 3 L ) Prove: each formula valid in the logic 3 L is
valid in sentential logic.
Problem 6.5 (Łukasiewicz’s logic 3 L ) Prove that the following formulae valid in
sentential logic are not valid in the logic 3 L :
(i) p ∨ ¬ p;
(ii) ¬( p ∧ ¬ p;
(iii) ( p ⊃ (q ⊃ r )) ⊃ (( p ⊃ q) ⊃ ( p ⊃ r )).
Problem 6.6 (Łukasiewicz’s logic 3 L ) Prove that entailment in the logic 3 L holds
in the sentential logic and detachment rule holds in 3 L .
Problem 6.9 (Łukasiewicz’s logic 4 L M ) Verify whether modal formulae (D), (B),
(DC), (4C), (G) are valid in the logic 4 L M .
Problem 6.10 (Łukasiewicz’s logic [0,1] L ) (after Meredith [23]). Consider the orig-
inal set (L1)–(L5) of Łukasiewicz’s axiom schemes for the infinite-valued logic [0,1] L
and verify that following sequence of formulae in Polish notation is a proof of (L5)
from (L1)–(L4).
The following symbol are used: Apq is CC pqq (i.e., ( p ⊃ q) ⊃ q)) (disjunction);
(i) (L2); substitute into (L2): { p/C pq; q/Cqp; r/ p}; (ii) obtains;
References 331
(ii) CCC pqCqpC ApqCC pqp; apply 10.3(iv); substitute into (L2):
{ p/CC pqCqp; q/C ApqCC pqr ; r/CCqC pqCqp}; it obtains
(iii) CCC ApqCC pqpCCqC pqCqpCCC pqCqpCCqC pqCqp; apply 10.3(iv)
to obtain
(iv) CC pqCrq ≡ CCqpr p; substitute into (iv): { p/N p; q/N q; r/Nr }; it obtains
by 10.3(xix)
(v) CCqpCqr ≡ CC pqC pr ; substitute into (v): { p/q; q/C pq; r/ p}; it obtains
(vi) CCC pqCqpCCqC pqCqp; apply 103(viii) and (L1); it obtains
(vii) AC pqCqp, i.e. (L5).
Problem 6.11 (Natural implications) Consider the set T = {0, 21 , 1} and let the set
W ⊆ T be either {1} or {1, 21 }. The mapping i(x, y) : T × T → T is called a natural
implication if and only if
(i) the restriction i|{0, 1} is the classical implication of sentential logic;
(ii) if i(x, y) ∈ W and x ∈ w, then y ∈ W ;
(iii) for x, y ∈ T , if x ≤ y, then i(x, y) ∈ W .
Prove: for W = {1}, there exist six distinct natural implications and for W = {1, 21 }
there exist twenty four natural implications.
Problem 6.12 (The Łukasiewicz logic [0, 1] L ) For the sentential logic detach-
ment formula ( p ∧ (q ⊃ p)) ⊃ p, determine its truth function in [0,1] L and decide
whether it is valid.
Problem 6.14 (Łukasiewicz’s logic [0, 1] L ) Prove: for each formula φ of the logic
[0, 1] L , φ is valid in [0, 1] L if and only if φ is valid as a formula of sentential logic.
References
1. Łukasiewicz, J.: Über den Satz von Widerspruch bei Aristoteles. Bulletin Internationale de
l’Académie des Sciences de Cracovie, Classe de Philosophie (1910), 15–38. Also: On the
principle of contradiction in Aristotle. In: Review of Metaphysics 24 (1970/71), 485–509
2. Łukasiewicz, J.: Farewell Lecture at the University of Warsaw, March 7, 1918. The Polish
Review 13(3), 45–47 (1968). University of Illinois Press
3. Łukasiewicz, J.: On three-valued logic (in Polish). Ruch Filozoficzny 5 (1920), 170–171.
English translation. In: Borkowski, L. (ed.) Jan Łukasiewicz. Selected Works. North Holland
- Polish Scientific Publishers, Amsterdam-Warsaw (1970)
4. Menger, K.: Statistical Metrics. Proc. Natl. Acad. Sci. 28, 535–537 (1942)
332 6 Finitely and Infinitely Valued Logics
In this chapter we meet sentential dynamic logic (SDL), epistemic logics, logics of
approximate containment of concepts couched in terms of mereology, and elements
of Data Analysis in the form of Boolean reasoning in the environment of data along
with the logic for functional dependence and the information logic.
Definition 7.1 (Syntax of regular SDL) Due to need for formalization of pro-
grams/actions, SDL imposes on SL additional ingredient which is separate formal-
ization of programs, related to sentential part by actions of programs on formulae.
In SDL, we have also to account for valuation on atomic beings; for atomic formulae,
we can define V ( p) as the set of all states at which p is valid, i.e., V ( p) ⊆ S.
SDL frames
By an SDL frame, simply a frame, we understand the triple (S, A, V ), where S is a
non-empty set of states, A is an assignment on atomic programs, i.e., for each atomic
program a, A(a) ⊆ S 2 , and, V is a valuation on atomic propositions, i.e., V ( p) ⊆ S.
Each choice of a frame determines semantics for formulae and programs. Mean-
ings in that semantics are assigned on lines close to those we have met at logics
SL,FO, SML. Assume a frame (S, A, V ).
Valuations on formulae
(i)V (¬φ) = S \ V (φ);
(ii)V (φ ∨ ψ) = V (φ) ∪ V (ψ);
(iii)V (φ ⊃ ψ) = [S \ V (φ)] ∪ V (ψ);
(iv) V (φ ∧ ψ) = V (φ) ∩ V (ψ);
(v) V (⊥) = ∅, V ( ) = S;
(vi) V ([π]φ) = {s ∈ S : ∀t ∈ S.[if (s, t) ∈ A(π) then t ∈ V (φ)]}.
This renders the meaning:‘after π is executed, it is necessary that φ is true;
(vii) V ( π φ) = {s ∈ S : ∃(s, t) ∈ A(π).t ∈ V (φ)}.
This renders the meaning: ‘there is an execution of π which terminates at a
state in which φ may be true’.
Assignments on programs
(viii) A(π; ρ) = {(s, t) ∈ S 2 : ∃w ∈ S : (s, w) ∈ W (π) ∧ (w, t) ∈ W (ρ)} = A(π)
◦ A(ρ),
where ◦ denotes composition;
(ix) A(π ρ) = A(π) ∪ A(ρ);
(x) A(π ∗ ) = [A(π)]r,t .
The latter
symbol denotes the reflexive and transitive closure of A(π), i.e., the
relation n≥0 A(π)n , A(π)n denoting the composition of n copies of A(π);
(xi) A(φ?) = {(s, s) : s ∈ V (φ)}.
Definition 7.3 (Satisfiability and validity) We denote a frame (S, A, V ) by the sym-
bol F; then
(i) A pointed frame is a pair (F, s) with s ∈ S. A formula φ is true at a pointed
frame (F, s), which is denoted F, s |= φ if and only if s ∈ V (φ);
336 7 Logics for Programs and Knowledge
(i) For each ψi ∈ F LC(φ) and σ ∈ A(φ), σ ψi ∨ σ ¬ψi . By the fact that
ψi or ¬ψi occurs in σ and of the tautology p ∧ q → p;
either
(ii) σψ i σ ≡ ψi ;
(iii) ≡ σ.
The proof is by structural induction and it rests on the axiom schema (A7):
π ∗ φ ⊃ φ ∨ π ∗ (¬φ ∧ π φ),
The first step hs been made in Definition 7.7(ii) for atomic programs a. Next, one
has to considerthe three cases:
(i) π is ρ ξ;
(ii) π is ρ; ξ;
(iii) π is ρ∗ .
For case (i): suppose that σi ∧ ρ ξ σ j is consistent, hence, by (A3),
is consistent or
(c)σi ∧ ξ σ j
(d)σi ∧ ρ ( ξ σ j )
( f ) σi ∧ ρ (σk ∧ ξ σ j )
is consistent. By (A2),
(g) σk ∧ ξ σ j
Lemma 7.2 For each formula π ψ ∈ F LC(φ) and each FLC(φ)-atomic formula
σ, the following equivalence holds: σ ⊃ π ψ if and only if there exists an FLC(φ)-
atomic formula σ such that (σ, σ ) ∈ A(π) and σ ⊃ ψ.
σ ⊃ ρ; ξ ψ.
For case (d): suppose that (σ, σ ) ∈ A(ρ∗ ) so for some sequence σ1 = σ,
σ2 , . . . , σn = σ of states we have (σi , σi+1 ) ∈ A(ρ) for i = 1, 2, . . . , n − 1. Rea-
soning by backward induction from σn we prove that σ ⊃ ρ∗ ψ. This concludes
the proof of Lemma 7.2.
As already observed, for the formula φ, there exists σ with the property that σ ⊃ φ,
hence, σ |= φ. This proves completeness of SDL.
An upshot of this proof of completeness is the fact that φ has the small model property:
F LC(φ) is finite. Hence, SDL is decidable. A more exact evaluation of cardinality
of a small model is obtained by the method of filtration.
The relation ∼ is an equivalence relation on the set S, and we denote by the symbol
S/ ∼ the set of equivalence classes [s]∼ of states in S:
S/ ∼= {[s]∼ : s ∈ S},
(i) (A/ ∼)(a) = {([s], [s ]) : (s, s ) ∈ A(a)} for each atomic program a;
A/ ∼ and V / ∼ defined in (i) and (ii), extend in the familiar way to programs and
formulae.
The quotient Kripke structure ∼ = (S/ ∼, A/ ∼, V / ∼) is the filtration of
by F LC(φ).
The first task is to check that this quotient structure behaves correctly with respect
to formulae in F LC(φ). Postulates for a correct extension to F LC(φ) are brought
for in
(ii) for each formula [π]ψ ∈ F LC(φ), if (s, s ) ∈ A(π), then ([s]∼ , [s ]∼ )
∈ A/ ∼ (π);
(iii) for each formula [π]ψ ∈ F LC(φ), if ([s]∼ , [s ]∼ ) ∈ A/ ∼ (π) and s ∈
A([π]ψ), then s ∈ V (ψ).
Proof of Theorem 7.5 applies structural induction checking all possible cases. We
omit the proof advising interested readers to consult (Harel et al. [4], II.6.2).
The upshot of Theorem 7.5 is the theorem on existence of small structures for
SDL (Fisher and Ladner [3]).
Theorem 7.6 (The small structure (model) theorem) For a formula φ of SDL, if φ is
satisfiable, then there exists a filtered structure of size not greater than 2|φ| in which
φ is satisfiable.
Proof Let be a Kripke model for φ and a state s such that s |= φ; then, in the
filtered structure, [s]∼ |= φ, by Theorem 7.5(i). In the quotient structure / ∼, each
state can be identified with a value assignment on atomic propositions in φ, hence,
size of the quotient structure is not greater than 2|φ| , |φ| being the number of symbols
in φ, i.e., the size of φ.
Theorem 7.7 SDL is decidable: Indeed, it follows from the small model theorem:
for each formula φ, it suffices to check all Kripke structures of sizes not greater than
2|φ| in order to ascertain eventual satisfiability of φ.
notions of knowledge and belief have a wide spectre of applications, for instance, in
reasoning by teams of agents. We begin with epistemic logics for a single reasoning
agent.
Epistemic logic in its present formulation is constructed on the basis of modal
logics. It considers notions of knowledge and belief modelled usually by following
modal logic modelling of necessity and possibility. However, one can model knowl-
edge and belief separately which leads to strictly epistemic logics concerned with the
notion of knowledge (from knowledge = epistêmê in Greek) and to doxastic logics
(from doxa=belief in Greek) concerned with the notion of belief.
From Plato and Aristotle, epistêmê has been regarded as the knowledge of things
that ‘cannot be otherwise’, and this feature would exclude all possibilities of deliber-
ating about them contrary to techné which was encompassing changeable aspects of
reality allowing ‘calculations’ about them. Doxa was encompassing opinions about
reality not founded on its exact features, a kind of ‘knowledge for the laymen’.
Relations between knowledge and belief are studied in logical theories of knowl-
edge and we will give some account of basics in this area. We assume here that we
have read the chapter on modal logics so we are familiar with notation and technical
content of it. In epistemic logic, the necessity operator L is denoted by the symbol K
and the formula K φ is read ‘it is known that φ’. The dual operator ¬K ¬ is denoted
by the symbol K . In doxastic logic, the symbol for belief operator is denoted by B
and its dual is denoted by B . Thus, contrary to the usage in modal logics operators
K and B are not dual to each other but have their own dual forms and, though it is
possible that the two occur jointly in some contexts, yet they form parallel theories.
Both epistemic and doxastic logics are more difficult to be formalized than modal
logics due to the subjective understanding of notions of knowledge and belief. It was
an idea in Hintikka [5] that to be positive about validity of a statement in a certain
state one should check its validity in all achievable states and only the validity in
all those states could corroborate validity in the given state. Though the notion of a
possible state has a long history associated with names like Leibniz and Carnap, yet
the introduction of semantics of possible worlds in Kripke [6] opened up venues for
interpretations of notions of knowledge and belief in rigorous ways.
We concentrate on technical aspects of epistemic and doxastic logics. We recall
modal logics K, T, S4, S5. As knowledge and belief logics are built on the lines of
modal logics, we refer to Chap. 4 for formal introduction to syntax and semantics
of modal logics and we adapt them to the epistemic content by introducing epis-
temic logics, where the symbol (SL) denotes all valid formulae of sentential logic.
Notwithstanding this reservation, we shortly recall the syntax of epistemic logics.
Definition 7.10 (Syntax of epistemic logic II. Logic EK) EK satisfies the axiomatic
schemes (SL) and (EK):
Definition 7.11 (Epistemic logic ET ) The axiomatic schemes for ET are (SL), (EK)
and (ET):
(i) (ET) K φ ⊃ φ.
In the logic ET knowledge satisfies the statement: ‘If it is known that φ then φ is
true’, or, in a paraphrase ‘what is known is true’.
Definition 7.12 (Epistemic logic ES4) The logic ES4 is endowed with axiomatic
schemes (SL), (EK), (ET) and (E4):
(i) (E4) K φ ⊃ K K φ.
In logic ES4 knowledge observes the statement: ‘if it is known that φ then it is
known that it is known that φ’ - the statement witnessing the ‘positive introspection’:
‘they know that they know.’
Definition 7.13 (Epistemic logic ES5) We add one more axiomatic schema (E5) to
(SL), (EK),(ET),(E4):
(i) (E5) K φ ⊃ K K φ.
In logic ES5 knowledge obeys the property: ‘if it is not known that not φ then
it is known that it is not known that not φ’ - the statement witnessing the ‘negative
introspection’.
Definition 7.14 (Rules of inference) They are modal rules of inference with necessity
operator L replaced by the epistemic operator K :
7.2 Epistemic Logics 345
Definition 7.15 (Semantics for epistemic and doxastic logics) Semantics is defined
on lines introduced in Chap. 4, i.e., it is the Kripke semantics of possible worlds. We
recall that a frame F is a pair (W, R), where the set W is a set of possible worlds
and the relation R is a binary accessibility relation on the set W . The meaning of the
instance R(w, w ) is that being in the world w, we check the status of a statement φ
in worlds w which are possible for us to inspect.
Definition 7.16 (The notion of satisfaction) Satisfaction conditions are exactly the
same as for modal logics with already mentioned change of operator symbols.
Epistemic as well as doxastic logics defined above are normal in the sense of Chap. 4
and they inherit all properties of modal logics on whose lines they have been defined.
In particular,
Theorem 7.9 Epistemic logics EK, ET, ES4, ES5 are strongly complete in, respec-
tively, frames that are universal, reflexive, transitive, equivalent. The same holds for
doxastic logics DK, DT, DS4, DS5.
Theorem 7.10 All epistemic and doxastic logics defined above have the small struc-
ture (model) property and are decidable.
Theorem 7.11 Satisfiability decision problems for EK, DK, ET, DT, ES4, DS4 are
PSPACE-complete, satisfiability problems for ES5, DS5 are NP-complete.
346 7 Logics for Programs and Knowledge
Proofs for most NP-statements can be found in Chap. 4. Proofs for PSPACE-
completeness are to be found in Ladner [7] and in (Halpern and Moses [8]).
Epistemic-doxastic logics
It is of course interesting to consider the interaction of both types of logics in common
models. For a structure M = (W, R, S, A), and a world w ∈ W , we recall from
Chap. 4 the notion of an R-neighborhood N F (w) = {w : R(w, w )}, where F is a
frame (W, R). We define in the same manner the notion of an H -neighborhood for
the frame H = (W, S). We recall that truth in case of epistemic or doxastic logic is
understood as respective conditions
(i) M, w |= K φ if and only if M, w |= φ for each world w ∈ N F (w);
Similarly, in case of a doxastic logic we have the condition
(ii) M, w |= Bφ if and only if M, w |= φ for each world w ∈ N H (w).
Basic interrelations between the two types of logics can be expressed in some logics.
We mention hybrid logics due to Hintikka [5] and Lenzen [9].
(KB1) K φ ⊃ Bφ;
This means that one believes in what they know.
(KB2) Bφ ⊃ K Bφ;
Each believer knows that they believe (‘positive introspection’);
(KB3) Bφ ⊃ B K φ;
Anyone who believes, believes that they know;
(KB4) (¬K φ) ⊃ B¬K φ;
Anyone who does not know believes that they do not know (‘negative intro-
spection’).
Theorem 7.12 Mixed logics (KB1)-(KB4) are satisfied under respective conditions:
(i) A sufficient condition for satisfiability of (KB1) in a frame (W, R, S) is S ⊆ R,
i.e., N H (w) ⊆ N R (w) for w ∈ W ;
(ii) A sufficient condition for satisfiability of (KB2) in a frame (W, R, S) is that
R, S satisfy the property RS-Euclidean: if R(w, v) then N H (v) ⊆ N H (w) for
all pairs w, v ∈ W ;
(iii) A sufficient condition for satisfiability of (KB3) in a frame (W, R, S) is that
R, S satisfy the property SR-Euclidean: if S(w, v) then N R (v) ⊆ N H (w) for
all pairs w, v ∈ W ;
(iv) A sufficient condition for satisfiability of (KB4) in a frame (W, R, S) is that
R, S satisfy the property: if S(w, u) and R(w, v) then R(v, u) for all triples
w, v, u ∈ W .
We have of course all modalities from Chap. 4 at our disposal. For the purpose of
quoting the next result we recall axiom schemes:
7.2 Epistemic Logics 347
Theorem 7.13 There exists a structure in which if knowledge satisfies (E5) and
belief satisfies (DD) then together with (KB1) they imply that the formula B K φ ⊃ K φ
is satisfied, i.e., ‘if one believes that knows then they know’.
Proof We outline a proof on semantic lines. Consider the accessibility relation R for
epistemic and S for the doxastic part, with R a Euclidean and S a serial accessibility
relations. Then each model with the union R ∪ S for those R and S satisfies (5) and
(D). In order to satisfy (KB1), there must be S ⊆ R, so R ∪ S = R. We select a
model in which R = S. Then models with R, S = R satisfy B K φ ⊃ K φ.
From Definition 7.17 it follows that the addition of (KB3) to axiom schemes in the
outlined in Theorem 7.13 class of structures, satisfies the schema K φ ≡ Bφ which
means the collapse of knowledge as knowledge and belief coincide.
Epistemic logics for n agents
A simultaneous occurrence of knowledge and belief logics in a structure involves
two accessibility relations, R and S, and we could introduce two beings r, s with r
responsible for R and s for S. In such cases we speak of epistemic agents (agents, for
short). Given n agents, which we denote as 1, 2, . . . , n, we introduce n accessibility
relations R1 , R2 , . . . , Rn , the relation Ri pertaining to the agent i, for i ≤ n.
Kripke structures for this case are tuples of the form Mn = (W, R1 , R2 , . . . ,
Rn , A) where W is a set of worlds, A is an assignment, i.e., A maps the Carte-
sian product P × W into the set of truth values {0, 1}, hence, A( p, w) ∈ {0, 1} for
each pair ( p, w) ∈ P × W .
Definition 7.18 (Epistemic logic EKn) This logic extends the one-agent epistemic
logic EK. Like EK, it consists of two axiomatic schemes and two rules of inference.
Axiomatic schemes are
(i) all valid (tautological) schemes of sentential logic SL;
(ii) (EKi) K i (φ ⊃ ψ) ⊃ [(K i φ) ⊃ (K i ψ)] equivalently (K i φ ∧ K i (φ ⊃ ψ)) ⊃ K i ψ
for i ≤ n.
Proof One proves on the lines for one-agent epistemic (modal) logics that the system
EKn is sound: given a structure Mn , one checks that
(i) Mn |= φ when φ is a valid formula of SL;
(ii) Mn |= ψ whenever Mn |= φ and Mn |= φ ⊃ ψ;
(iii) Mn |= K i (φ ⊃ ψ) ⊃ (K i φ ⊃ K i ψ) for i ≤ n;
(iv) Mn |= K i φ whenever Mn |= φ.
We prove (iii) and (iv) as an example of reasoning in EKn. For (iii), suppose that
Mn , w |= K i (φ ⊃ ψ), hence, Mn , v |= φ ⊃ ψ at each v such that Ri (w, v). Suppose
that M, w |= K i φ so that M, v |= φ. By detachment, M, v |= ψ, hence, M, w |=
K i ψ. For (iv), suppose that Mn |= φ then, for each world w ∈ W , Mn , w |= φ, in
particular if Ri (w, v) then Mn , v |= φ, hence, Mn , w |= K i φ.
Theorem 7.15 We know from Chap. 4 that MaxCon(Γ ) has the following proper-
ties:
(i) if MaxCon(Γ ), then either φ ∈ Γ or ¬φ ∈ Γ for each formula φ of EKn;
(ii) if MaxCon(Γ ), then φ ∧ ψ ∈ Γ if and only if φ ∈ Γ and ψ ∈ Γ for each pair
φ, ψ of formulae of EKn;
(iii) if MaxCon(Γ ), then if φ ∨ ψ ∈ Γ , then either φ ∈ Γ or ψ ∈ Γ for each pair
φ, ψ of formulae of EKn;
(iv) if MaxCon(Γ ), then if φ ∈ Γ and φ ⊃ ψ ∈ Γ , then ψ ∈ Γ for each pair φ, ψ
of formulae of EKn;
(v) if MaxCon(Γ ), then if Γ φ, then φ ∈ Γ for each formula φ of EKn;
(vi) if MaxCon(Γ ), then ∈ Γ .
(∗∗) K i ψ1 → (K i ψ2 → (. . . → (K i ψk → K i φ)))
Definition 7.20 (Epistemic logics ETn, ES4n, ES5n, EKD45n) Following known
cases of logics ET, ES4, ES5, and modal logic D, we extend them to the case of
n agents in the same way in which EK has been extended to EKn, so our Kripke
structures will be of the form Mn = (W , R1 , R2 , . . . , Rn , V ) and K i will be the
epistemic operator for the agent i. By analogy with modal cases, we assign some
rules to operators K i for i ≤ n:
(Tni) K i φ ⊃ φ;
(4ni) K i φ ⊃ K i K i φ;
(5ni) ¬K i φ ⊃ K i ¬K i φ;
(Dni) ¬K i ⊥;
Remark 7.1 Let us notice that the rule (Dni) is equivalent to known to us rule:
K i φ ⊃ ¬K i ¬φ. We offer a proof:
1. K i φ → ¬K i ¬φ;
2. K i ¬φ → ¬K i φ; PL
3. φ/⊥; substitution
4. K i → ¬K i ⊥; verum as ¬⊥
5. K i ; valid
6. ¬K i ⊥ detachment;
For the converse:
7. ¬K i ⊥;
8. ¬K i (φ ∧ ¬φ); PL
9. ¬[(K i φ) ∧ (K i ¬φ)]; property of the system K
10. ¬(K i φ) ∨ (¬K i ¬φ); PL
11. K i φ → ¬K i ¬φ.
With rules (Tni), (4ni), (5ni), and, (Dni), we define other epistemic logics for n agents
as satisfying the sets of axiomatic schemes.
7.2 Epistemic Logics 351
Definition 7.21 The axiom schemes for logics ETn, ES4n, ES5n, EKD45n:
The logic ETn satisfies axiom schemes (Kni),(Tni) for i ≤ n.
The logic ES4n satisfies axiom schemes (Kni, (Tni), (4ni) for i ≤ n.
The logic ES5n satisfies axiom schemes (Kni), (Tni), (4ni), (5ni) for i ≤ n.
The logic EKD45n satisfies axiom schemes (Kni, (4ni), (5ni), (Dni) for i ≤ n.
In analogy to the modal cases of Chap. 4, we check that corresponding results are
true for epistemic logics for n agents.
Theorem 7.17 Let symbols MnT,c , Mn4,c , Mn5,c , MnD,c denote that the canonical model
Mnc , validates, respectively, all instances of ETn, ES4n, ES5n, EKD45n. Then
(i) MnT,c is reflexive, i.e., Ric (Γ, Γ ) for each MaxCon(Γ ) and i ≤ n;
(ii) Mn4,c is transitive, i.e, Ric (Γ, Γ ) and Ric (Γ , Γ ∗ ) imply Ric (Γ, Γ ∗ ) for each
MaxCon{Γ, Γ , Γ ∗ } and i ≤ n;
(iii) Mn5,c is Euclidean, i.e., if Ric (Γ, Γ ) and Ric (Γ, Γ ∗ ) then Ric (Γ , Γ ∗ );
(iv) MnD,c is serial,transitive and Euclidean, i.e., for each i ≤ n and for each world
Γ , there exists a world Γ ∗ such that Ric (Γ, Γ ∗ ) and conditions in (ii), (iii) are
also satisfied.
valid. Then, ETn, ES4n, ES5n, EKD45n are sound and complete with respect to,
c,eq
respectively, Mnc,r , Mnc,tr , Mn , Mnc,e,s,tr . Proofs of these facts parallel the proof for
EKn, with necessary modifications.
We have justified
Theorem 7.18 Epistemic logics ETn, ES4n, ES5n, EKD45n are complete.
Definition 7.22 (Group and common knowledge) There are two basic kinds of col-
lective knowledge for a group of agents: the group knowledge, when each agents
knows a formula φ, expressed as
(E) Eφ ≡ K i φ,
i≤n
Definition 7.23 (Satisfaction for group and common knowledge) Rules for satisfac-
tion for group as well as for common knowledge are as follows:
7.2 Epistemic Logics 353
If we add 2.26 (i),(ii), and (IC) to EKn, ETn, ES4n, ES5n, EKD45n, then we
obtain systems of common knowledge ECKn, ECTn, ECS4n, ECS5n, ECKD45n,
354 7 Logics for Programs and Knowledge
respectively. One can expect that these systems are sound and complete with respect
to models Mn , and it is so.
Theorem 7.21 Systems ECKn, ECTn, ECS4n, ECS5n, ECKD45n are complete.
We insert an outline of a proof for the system ECKn as a pattern for proofs for other
commnon knowledge systems.
Proof The idea for a proof is already familiar: one proves that if a formula φ is
consistent then it is satisfiable and the means for the proof is to construct maximal
consistent sets from φ in a manner resembling the Ladner construction of Chap. 4.
Some details of proof come from (Halpern and Moses [8]).
For a formula φ, we denote by SubC (φ) the set
Theorem 7.22 For a finite model M of size |M|, checking satisfiability of a formula
φ can be done in time O(|M| · |φ|) where |φ| is the length of φ.
Proof We form the set S F(φ) of sub-formulae of φ which we can list in the order
of increasing length. The cardinality |S F(φ)| is not greater than |φ|. We now begin
the labelling procedure: to each world w in M, we assign either ψ ∈ S F(φ) or ¬ψ
depending on which holds at w. In case of K i ψ ∈ S F(φ) we have to check all worlds
connected to w by some Ri . Finally, we check φ at each world. The complexity is of
order |M| · |φ|.
The next step is to show the existence of finite models for EKn consistent formulae
(Halpern and Moses [8]).
356 7 Logics for Programs and Knowledge
From (AO), one can ascertain the characteristic of an individual thing: non-vacuous,
(cεa), one-element ((dεa) ∧ (eεa) ⊃ (dεe), hence, d = e). One can introduce the
relation = of identity by letting d = e if and only if (dεe) ∧ (eεd); in particular
a = a can be equivalently defined as aεa for each a.
We define on a non-empty domain Ω of individual things, the primitive notion of
mereology, the relation of a part π as a single element of the relational vocabulary od
mereology. In addition, we introduce a countable set of individual variables denoted
in practice as x, y, z, . . ..
Mereology
We give here the basic introduction to mereology: theory of concepts based on the
notion of a part. We adhere to the classical scheme of mereology due to Leśniewski
with some slight modifications. This theory concerns a binary predicate π read as
‘being a part of’. Inference rules are detachment and substitution.
(P3) follows by (P1), (P2). Part predicate does express the notion of a proper part.
We postulate the notion of identity of things in terms of part relation.
Definition 7.26 (Identity) For things x, y, x = y if and only if ∀z.π(z, x) ≡ π(z, y).
Then by (P1)-(P3), the predicate = satisfies usual properties of reflexivity, symmetry
and transitivity which follows by (P2).
Definition 7.28 (Postulate (P4)) ∀x, y.[∀z.(I (z, x) ⊃ ∃w.I (w, y) ∧ Ov(z, w))] ⊃
I (x, y).
The first three implicants are false by (P1) and (P2), hence, I (x, y) ∧ I (y, x) ≡
(x = y).
For (ii). By Definition 7.27(i).
For (iii). By transitivity of π (Definition 7.25 (P2)).
For (iv). Suppose that Ov(z, x) ≡ O(z, y) for each thing z. Assume Ov(z, x).
There exists a thing t with I (t, z) and I (t, x). But also Ov(t, x), hence, Ov(t, y) and,
by (P4), I (x, y). By symmetry, I (y, x) follows, and by Definition 7.28(i), x = y.
For (vi), (vii): evident by Definition 7.27(ii).
Definition 7.29 (The notion of a class) For a non-empty collection F of things in
Ω, the notion of a class Cls(F) obeys the conditions.
(Cl1) ∀x.(x ∈ F ⊃ I (x, Cls(F));
(Cl2) ∀x.[I (x, Cls(F)) ⊃ ∀y.(I (y, x) ⊃ ∃w ∈ F.Ov(y, w))].
Definition 7.30 (The class existence axiom (P5)) For each non-empty collection F
of things in any mereological space (Ω, π), there exists a class Cls(F).
Theorem 7.25 For each non-empty collection F of things in any mereological space
(Ω, π), there exists the unique class Cls(F).
Proof Assume that for some collection F there exist two classes Cl1 and Cl2 . Con-
sider a thing t with I (t, Cl1 ). By condition (C2), there exists a thing z such that
Ov(t, z) and I (z, Cl2 ). By property (P3), I (Cl1 , Cl2 ) and by symmetry, I (Cl2 , Cl1 ),
hence, by property (I2), Cl1 = Cl2 .
Theorem 7.26 For each thing x, x = Cls({y : I (y, x)}).
Proof Suppose that I (z, x), hence, I (z, Cls({u : I (u, x)}), hence, I (x, Cls({u :
I (u, x)}). Conversely, if I (u, Cls({u : I (u, x)}), then there exist w, t with I (w, u),
I (w, t), I (t, x), hence, I (w, x) and I (Cls({u : I (u, x)}), x), hence, x = Cls({u :
I (u, x)}).
Definition 7.31 (The universal class) Let Ω be the collection of all things con-
sidered. We define the universal class V by letting V = Cls({u : u ∈ Ω}). Then
x ∈ Ω ≡ I (x, V ). Equivalently, V = Cls{x : x = x ∧ x ∈ Ω}.
7.3 Mereology Based Logic for Granular Computing and Fuzzy Reasoning 359
Theorem 7.27 The universal class V has the following properties: (i) I (x, V ) holds
for each thing x ∈ Ω (ii) for each non-vacuous property F, the relation instance
I (Cls F, V ) holds.
Theorem 7.28 For things x, y, the equivalence holds: el(x, y) ≡ I (x, y).
Proof If I (x, y), then x ∈ F = Cls{z : I (z, y)} and F = y, hence, el(x, y) holds.
If el(x, y), then there exists F such that y = Cls F and x ∈ F, hence, I (x, y).
It follows that each thing is its own element, so there are no empty things in mereo-
logical universes.
The notion of a subset in mereology is defined as follows.
Theorem 7.29 For each pair x, y of things, the equivalence holds : sub(x, y) ≡
I (x, y).
Proof Suppose that sub(x, y) holds; then for z = x, we obtain: I (x, x) ⊃ I (x, y)
and as I (x, x) holds by Property(I1), I (x, y) holds also. Conversely, if I (x, y) holds,
then for each thing z, from I (z, x), I (z, y) holds by property (I3), hence, sub(x, y)
holds.
Definition 7.35 (The notion of a relative complement) For things z, y such that
ingr (y, z), a thing x is the relative complement to y with respect to z, if and only
if x = Cls{t : ingr (t, z) ∧ extr (t, y)}. The complement is denoted by the symbol
comp(y, z). This notion is defined if π(y, z) is defined.
360 7 Logics for Programs and Knowledge
We now follow Tarski [14] in presentation of the complete Boolean algebra with-
out the null element defined in the mereological universe Ω. First, we need additional
notions.
Definition 7.37 (The Tarski Boolean mereological algebra BT M (π)) For things x, y,
we let
(+) x + y = Cls({u : I (u, x) ∨ I (u, y));
(·) x · y = Cls({u : I (u, x) ∧ I (u, y));
(-) −x = comp(x, V );
(1) 1=V ;
(0) 0 is not defined.
Theorem 7.31 The universe Ω with the unit V and operations +, ·, − is a complete
Boolean algebra without the null element as mereology does not admit the empty
thing.
x → y ≡ −x + y.
Proof
(i) ≡ (ii): if I (x, y), then I (x, x) and I (x, y), hence I (x, x · y). Suppose now that
I (z, x · y), hence, there exist t, w such that I (t, z), I (t, w) and Ov(w, x · y), hence,
Ov(w, x) and by (P4), I (x · y, x), hence x · y = x.
(i)≡ (iii): Assume I (x, y), hence x · y = x, thus, x → y = −x + y = −(x · y) +
y = −x + −y + y = −x + V = V . Conversely, if −x + y = V , then (−x + y) ·
x = x · y = V · x = x.
Rough mereology Polkowski [16], (Polkowski and Skowron [17]) adds to mereology
a ternary predicate μ(x, y, r ) defined for triples (x, y, r ), where x, y ∈ Ω, r ∈ (0, 1],
read as ‘x is a part of y to a degree of at least r ’. The predicate μ called rough inclusion
is defined by means of conditions:
(RM1) μ(x, y, 1) ≡ I (x, y);
(RM2) μ(x, y, 1) ⊃ ∀z, r.(μ(z, x, r ) ⊃ μ(z, y, r ));
(RM3) μ(x, y, r ) ∧ (s < r ) ⊃ μ(x, y, s).
Łukasiewicz [18] also in Borkowski [19] gave a logical rendering of classical proba-
bility calculus by assigning to a sentential unary formula on a finite domain a weight
defined as the fraction of the number of elements satisfying the formula to the num-
ber of elements in the universe. We follow up on the idea by considering the notion
of a mass assignment on a universe of things and constructing in this environment a
rough inclusion. The following theory is an abstract rendering of many-valued logic
and its applications in fuzzy computing. For a more detailed look at rough mereol-
ogy and its applications, consult (Polkowski, L.: Approximate Reasoning by Parts.
An Introduction to Rough Mereology, Springer Vlg. (2011)) and (Polkowski, L.:
Mereology in engineering and computer science. In: Calosi, C., Graziani,P.(eds.):
Mereology and the Sciences: Parts and Wholes in Contemporary Scientific Context.
Syntese Library 371. Springer Intl. Publishing, 217-293 (2014)).
We define the basic notion of a mass assignment Polkowski [20].
Definition 7.39 (Mass assignment) Given a mereological space (Ω, π) over the
relational vocabulary {π}, we define a mass assignment m which satisfies the
conditions:
(M1) (56) ∀x ∈ U.m(x) ∈ (0, 1];
We introduce a constant symbol Θ denoting the empty thing not in Ω in order
to be able to assign the mass=0.
(M2) m(Θ) = 0
Definition 7.40 (Axiom schemes for the mass assignment) The following are axiom
schemes Polkowski [20].
(M3) (x = V ) ≡ (m(x) = 1);
(M4) (x = Θ) ≡ m(x) = 0;
(M5) (x → y) ⊃ [m(y) = m(x) + m((−x) · y)].
(T1) I (x, y) ≡ x · y = x;
(T2) I (x, y) ≡ x → y;
(T3) (x · y = x) ≡ (x → y);
(T4) (x = y) ⊃ (m(x) = m(y);
(T5) m(x + y) = m(x) + m((−x) · y);
362 7 Logics for Programs and Knowledge
We now introduce the notion of a rough inclusion: a similarity measure for mass
concepts based on approximate containment. It is the granular computing on an
abstract level.
7.4 Rough Mereology. Rough Inclusions 363
For (T22): by (T8), m(y) = m(x · y) + m((−x) · y). From the premise in (T22)
we infer that m(x) = m(x · y), hence, μm 1 (x, y) = 1 and by (T18) I (x, y);
We now give an abstract version of the form of the Bayes theorem established by
Łukasiewicz. We begin with a simple formulation (T23).
μm
1 (y,x) μm
1 (x,y)
For (T23): μm 1 (x, y) = m(x) , hence, m(y) = m(x · y) = m(x) , hence (T23)
m(x·y)
follows;
364 7 Logics for Programs and Knowledge
We now address the Bayes theorem (T27). First some explanations: for a finite set Y
of things, +Y means the sum of things in Y .
Definition 7.42 (Filters) By a proper filter on the mereological space (Ω, π), we
understand a collection F of things such that
(i) if x, y ∈ F, then x · y ∈ F;
(ii) (ii) if x ∈ F and I (x, y) then y ∈ F;
(iii) Θ ∈ / F.
By the Zorn maximal principle, each filter extends to an ultrafilter, i.e., a maximal
filter with respect to containment.
Proof I (x, y) is equivalent to I (−y, −x), hence, to (−y) · (−x) = (−y), hence,
−(x + y) = (−y), i.e., x + y = y.
Proof For (i), assume that for some thing x ∈ Ω, x ∈ / F and −x ∈/ F. For y ∈ F, was
x · y = Θ then I (y, −x) and −x ∈ F, a contradiction. It follows that x · y = Θ for
each y ∈ F, hence, the collection F ∪ {x} extends to a filter containing F properly,
a contradiction.
For (ii), it follows by (i): was x ∈
/ F and y ∈
/ F, we would have by (i) that −x ∈ F
and −y ∈ F, hence, (−x) · (−y) = −(x + y) ∈ F, a contradiction.
We now state the Stone theorem and we recall the (Gleason [22]) theorem which states
that the space (St (Ω), S(Ω)) is extremely disconnected (see Chap. 1 for definition).
We recall proofs of those results rendering them in the language of mereology.
Proof S(x) ∩ S(y) = S(x · y), hence, S has properties of a base. Each set S(x) is
clopen: S(x) = S(Ω) \ S(−x). Hence, St (Ω) is zero-dimensional.
St (Ω) is compact: let B, a collection of sets of the form of S(x) for x ∈ Δ ⊆ Ω, be
centered, i.e., for each finite sub-collection X ={x1 , x2 , . . . , xk } of Δ, there exists an
ultrafilter F with X ⊆ F. Let us consider a set Γ = Δ ∪ {z ∈ Ω: there exists x ∈
Δ with Π (x, z)}. Then Γ extends to an ultrafilter Ψ and Ψ ∈ B, i.e., St (U ) is
compact.
St (U ) is Hausdorff: let F = G for ultrafilters F, G. Assume, for the attention
sake, that x ∈ F \ G for some thing x. Hence, −x ∈ G and F ∈ S(x), G ∈ S(−x),
and, S(x) ∩ S(−x) = ∅.
Theorem 7.37 The Stone space (St (Ω), S(Ω)) is extremely disconnected. We
remind that Cl denotes the closure operator.
366 7 Logics for Programs and Knowledge
Proof Consider an open set G = {S(x) : x ∈ A ⊆ Ω}. For the class Cls A, con-
sider the clopen set S(Cls A).
As Π (x, Cls A) for each x ∈ A, it follows that G ⊆ S(Cls A), hence,
(i) ClG ⊆ S(Cls A). We claim that S(Cls A) ⊆ ClG.
Let us assume that, to the contrary, S(Cls A) \ ClG = ∅. Let an ultrafilter F
belong in S(Cls A) \ ClG; hence,
(ii) Cls A ∈ F.
There exists a neighborhood S(z) of F, i.e.,
(iii) z ∈ F,
(iv) S(z) ∩ S(x) = ∅
for each x ∈ A. It follows that
(v) z · x = θ for each x ∈ A, hence,
(vi) Π (x, −z) for each x ∈ A.
By (vi), Π (Cls A, −z), which implies that
(vii) −z ∈ F contradicting (iii).
Thus, S(Cls A) ⊆ ClG and finally we obtain that ClG = S(Cls A), i.e., ClG is
open.
Theorem 7.38 Each x = +i∈I (x) x · xi , where + and · are operations in the Tarski
algebra of mereology.
Proof Consider an arbitrary thing y with Π (y, x). Let F(y) be an ultrafilter con-
taining y; hence, x ∈ F(y). Let xi ∈ K be such that F(y) ∈ S(xi ). Then, y · xi = Θ
and i ∈ I (x). As Π (y · xi , x · xi ), it follows Π (x, +i x · xi ) by M3. Contrariwise,
assume for an arbitrary thing z that Π (z, +i x · xi ), hence, Π (z, x · xi ) for some
i ∈ I (x) and thus Π (z, x); by M3, Π (+i x · xi , x) and finally x = +i x · xi .
We call the set K = {x1 , x2 , . . . , xk } a base in Ω. As x · x j = Θ for j ∈ / I (x),
we can represent the thing x as x = +i=1 k
x · xi , or simply, x = +i x · xi .
In our case, tools are features in the set A, and if [o1 ] A = [o2 ] A , then we have to
say that o1 and o2 are identical which we express in the formula I N D A (o1 , o2 ).
Theorem 7.41 We collect the basic statements about the relation I N D X for X ⊆ A.
(i)for sets of features B, C ⊆ A, if B ⊆ C, then I N DC ⊆ I N D B ;
(ii)for sets of features B, C ⊆ A, I N D B∪C = I N D B ∩ I N DC ;
(iii)for sets of features B, C ⊆ A, I N D B = I N D B−C ∩ I N D B∩C ;
(iv) in the setting of (iii), for B = A and C = B, I N D A = I N D A−B ∩ I N D A∩B =
I N D A−B ∩ I N D B ;
(v) if I N D B = I N D A for B ⊆ A, then I N D A = I N D A−B ∩ I N D B = I N D B ,
hence, I N D B ⊆ I N D A−B .
Theorem 7.42 The list that follows contains the basic properties of approximations.
In the topological interpretation, the lower approximation B is the interior and the
upper approximation B is the closure of a concept in the partition topology which has
as a base for open sets the indiscernibility classes. For proofs of properties below,
please see Chap. 1 section Topology.
(i) X ⊆ B(X );
(ii) B(X ∪ Y ‘) = B(X ) ∪ B(Y );
(iii) B(B(X )) = B(X );
(iv) B(∅)1 = ∅;
(v) B(X ∩ Y ) = B(X ) ∩ B(Y );
(vi) B(B(X )) = B(X );
(vii) B(Ω) = Ω;
(viii) B(X ) ⊆ X ;
(ix) B(X ) = B(X ) if and only if X is exact;
(x) for each exact set Y and each set X , Y ∩ B(X ) ⊆ B(X ∩ Y );
(xi) a set X is inexact if and only if B(X ) = X = B(X ).
Definition 7.48 (Indecision sets (boundary sets) For each inexact set X , the set
Bd(X, B) = B(X ) \ B(X ) is the indecision set for X : each thing o ∈ Bd(X, B)
satisfies the condition X ∩ [o] B = ∅ = (Ω \ X ) ∩ [o] A , hence, the thing o has indis-
cernible, i.e., identical things o ∈ X and o" ∈
/ X , and thus the decision problem for
o cannot be solved.
In this way, the theory of rough sets formalizes the notion of vague knowledge.
In terms of knowledge representation, the lower approximation does represent cer-
tainty/necessity of membership in the set, the upper approximation does represent
the possibility of membership in the set. This modal logic is S5.
We have defined above the notion of functional dependence between sets of features.
We now present a logic of functional dependence due to Rauszer [27].
An FD-algebra is any subset M of the set IA closed on the unit 1, relative pseudo-
complement ⇒ and the intersection ∩.
370 7 Logics for Programs and Knowledge
Definition 7.50 (Terms) The set of terms is the smallest set containing each a for
a ⊆ A and closed on set-theoretic operations ∪, ∩, \. Terms of the form a are
called elementary. The empty term is denoted as falsum ⊥. We denote the set of
terms as T .
Definition 7.51 (Formulae) The set of formulae of FD-logic is built from terms: for
a term t, the expression ι(t) is an elementary formula. The intended meaning of ι(t)
is I N Dt . Formulae form the smallest set containing elementary formulae and closed
on conjunction ∧ and implication →.
Definition 7.53 (Axiom schemes and inference rules for FD-logic) Axiom schemes
for FD-logic are:
(A1) a a;
(A2) ⊥ a.
Substitution is among rules of inference. Rules of inference for terms are rules of
Gentzen [28] for sentential logic; included is the cut rule which can be eliminated
but it is kept here to simplify arguments. These rules come from Rauszer [27].
Definition 7.54 (Sequent rules for terms) These rules are as follows
Δ,c,d a,a,Γ Δ,b,b
(i) (str) a,ΓΓ Δ,b
Δ
; a,b,Γ
b,a,Γ Δ,d,c
; a,Γ Δ,b ; these sequents are Gentzen structural
rules of Thinning, Contraction, Interchange;
(ii) (cut) Γ Δ,a;a,Θ
Γ,ΘΔ,
;
Δ;b,Γ Δ
(iii) (∪ ) a,Γa∪b,Γ Δ
;
Γ Δ,a,b
(iv) ( ∪) Γ Δ,a∪b ;
a,b,Γ Δ
(v) (∩ ) a∩b,Γ Δ
;
Γ Δ,a;Γ Δ,b
(vi) ( ∩) Γ Δ,a∩b ;
Γ Δ,a
(vii) (− ) −a,Γ Δ
;
Γ,aΔ
(viii) ( −) Γ Δ,−a .
Inference rules for formulae are Gentzen rules for the fragment of intuitionistic
sentential logic expressible in terms of conjunction and implication.
Definition 7.55 (Sequent rules for formulae) These rules are the following:
β,β,γ,δ,Φ⊃α
(ix) (str*) η,β,δ,γ,Φ⊃α
;
Φ⊃α;α,Ψ ⊃β
(x) (cut*) Φ,Ψ ⊃β ;
α,β,Φ⊃γ
(xi) (∧ ⊃) α∧β,Φ⊃γ ;
(xii) (⊃ ∧) Φ⊃α;Φ⊃β
Φ⊃α∧β
;
7.6 The Logic of Functional Dependence (FD-Logic) 371
Φ⊃α;β,Φ⊃γ
(xiii) (→⊃) α⊃β,Φ⊃γ
;
α,Φ⊃β
(xiv) (⊃→) Φ⊃α→β
The specific rule (FD) provides a link between term rules and formulae rules.
a b, Δ
(FD) ,
Δ∗ , ι(b) ⊃ ι(a)
V AM (α ∧ β) = V AM (α) ∩ V AM (β);
V AM (α → β) = V AM (α) ⇒ V AM (β).
The assignment AM and the valuation V AM extend over sequents of terms as well
as over sequents of formulae.
For a sequence Γ of terms, we denote by the symbol δ(Γ ) the union of terms in
Γ , and by γ(Γ ) the intersection of terms in Γ .
For a sequence Φ of formulae, the symbol σ(Φ) will denote the conjunction of
formulae in Φ. With this notation, we let,
V AM (Φ ⊃ α) = V AM (σ(Φ)) ⇒ V AM (α)).
Rules of Gentzen system preserve validity, so the only rule to be checked in this
respect is the rule (FD). We consider
a b, Δ
(F D) .
Δ∗, ι(b) ⊃ ι(a)
k
(ii) I N D AM (ai ) ∩ I N D AM (b) ⇒ I N D AM (a) .
i=1
k
(iii) I N D AM (ai ) ∩ I N D AM (b) ⇒ I N D AM (a) = I N D⊥ = 1M ,
i=1
The LT-algebra for formulae, LTF, is defined in an analogous way: for formulae
α, β, α ∼ β if and only if ⊃ α → β and ⊃ β → α are provable. LTF-algebra con-
tains classes [α]∼ with [α]∼ ≤ [β]∼ if and only if ⊃ α → β is provable, with the meet
[α]∼ ∩ [β]∼ = [α ∩ β]∼ and the pseudo-complement [α]∼ ⇒ [β]∼ = [α → β]∼ .
We have met with information systems which in the form of data tables record for
us raw knowledge about a given process, state of a system. Knowledge encoded in
information systems is biased by subjectivity of attribute choice, method of record-
ing, errors of measurement, nevertheless it serves as a basis for making decisions.
Contrary to preparing an information system, decisions are made by so called experts
assumed to have a more profound knowledge of the specific topic represented in the
information part of a larger system called the decision system. The decision system
is a tuple DS = (Ω, A, W, d) where (Ω, A, W ) is an information system as defined
above and d is a new feature, not in the feature set A, called the decision. Though we
denote it with a single letter d, yet it may be a many-dimensional vector of decision
attributes, encoded for simplicity by a single letter.
374 7 Logics for Programs and Knowledge
In this section, we discuss information and decision systems with the problem
of indispensability of features on mind, and we offer solutions to this problem for
information and decision systems based on Boolean reasoning.
The idea for Boolean form of reasoning came from Boole [29], the role of impli-
cants was first pointed to in Blake [30].
Example 7.1 Table 7.1 brings seven records from a well-known PLAY data set due
to J.Ross Quinlan. Four features: Outlook, Temperature, Wind, Humidity are features
of a day on which the decision Play is taken whether to play outdoor tennis or not to
play.
Definition 7.57 (Descriptors) The feature-value format of this table calls for an
adequate representation of things, which are days, in a logical format. To this end,
we apply descriptors in the form (q, vq ) where q is a feature and vq ∈ W is a value
of q. For instance, (Outlook, Sunny) is a descriptor. Descriptors are elementary
formulae. Formulae are built from descriptors
by means of sentential connectives
∨, ∧, ⊃, ¬. In particular, the formula q∈A (q, vq ) represents a record in an infor-
mation system (Ω, A, W ) which semantically may denote a thing in Ω or a virtual
thing possibly existing outside Ω. For instance, the formula (Outlook, Sunny) ∧
(T emperatur e, H ot) ∧ (H umidit y, H igh) ∧ (W ind, W eak) is the description of
day no.1. These formulae are called information formulae. Decision on day no.1 is
described by the descriptor (Play, N o).
Definition 7.58 Formulae are interpreted in the set Ω, the meaning [(q, vq )] of a
descriptor (q, vq ) is the set {u ∈ U : q(u) = vq }. In symbolic form of decision rules,
we replace the implication horseshoe ⊃ sign with used in the context of decision rules
implication symbol →. Interpretations of formulae are given by structural induction:
(i) [α ∧ β] = [α] ∩ [β];
(ii) [α ∨ β] = [α] ∪ [β];
(iii) [¬α] = U \ [α];
(iv) [α ⊃ β] = [¬α ∪ β].
In the same way we define the meaning of formulae of the form (d, vd ).
A formula α is valid if and only if [α] = Ω.
7.7 Boolean Reasoning in Data Analysis 375
For instance,
is the decision rule induced by day no.1. In this manner, each row of the decision
system provides a decision rule.
According to our definition of truth, the implication α → β is valid if and only if
[α → β] = Ω if and only if (Ω \ [α]) ∪ [β] = Ω if and only if [α] ⊆ [β].
We obtain
(Step 5) for each prime implicant π = πi1 ,i2 ,...,im : q ∗i1 ∧q ∗i2 ∧ . . . ∧ q∗im read
off the attribute set
r (π) : {qi1 , qi2 , . . . , qim };
Example 7.2 We find reducts for data in Table 7.1. For simplicity let us already
introduce atomic propositions for attributes in Table 1: o for Outlook, t for Temper-
ature, w for Wind, h for Humidity. Then the minimal set of entries into the matrix
M is as follows:
{o}
{w} {o, w}
{t, h} {t, h, w} {o, t, h, w}
{o} {o, t, h} {o, t, h, w} {t, h, w}
{o, t} {o, t} {o, t, h} {o, t, h, w} {o, th, w}
∅ {o, t} {o, t} {o, t, h} {o, t, h, w} {o, t, h, w}
c12 = ∅; c13 = {o, t};c14 = {o, t}; c15 = {o, t, h};c16 = {o, t, h, w}; c17 = {o, t, h, w}
c23 = {o, t}; c24 = {o, t}; c25 = {o, t, h}; c26 = {o, t, h, w}; c27 = {o, t, h, w}
c34 = {o}; c35 = {o, t, h}; c36 = {o, t, h, w}; c37 = {t, h, w}
c45 = {t, h}; c46 = {t, h, w}; c4,7 = {o, t, h, w}
c56 = {w}; c5,7 = {o, w}
c67 = {o}
The full formula f M would be the conjunction of disjunctions for all entries. We
can simplify its form by recalling some valid formulae of sentential logic, viz., the
absorption law: p ∧ ( p ∨ q) ≡ p and the idempotency law: p ∧ p ≡ p. On the basis
of the former, we eliminate any disjunction of length at least 2 containing the variable
o as well as any disjunction of length at least 2 containing the variable w.
Next, we use the idempotency law to retain only one occurrence of o and w. We
get the following equivalent form of the formula f M :
(o) ∧ (t ∨ h) ∧ (w)
f M : (o ∧ t ∧ w) ∨ (o ∧ h ∧ w).
Theorem 7.50 Algorithm B finds correctly all decision-related reducts for any deci-
sion system.
Definition 7.62 (Problem: Find the set of minimal decision rules) We give the algo-
rithm due to Pawlak and Skowron (Pawlak and Skowron [32]).
Example 7.3 From Table7.1, we read off the following local decision-related
reducts and induced minimal rules:
(Rule 1) I1,2 : {Outlook, T emperatur e}; r1,2 : (Outlook = Sunny)∧
(T emperatur e = H ot) → (Play = N o).
7.7 Boolean Reasoning in Data Analysis 379
We have dealt till now with discrete attribute sets. In case attributes are continuous,
one obtains a discrete case by a discretization process which converts each continuous
attribute into a discrete-valued one. The principal notion is that of a cut.
Definition 7.63 (Cuts) We assume that attribute values are real. Reduction of car-
dinalities of value sets is desirable when those cardinalities are large. Discretiza-
tion consists in a partition of value set of each attribute into classes on the basis
of natural ordering of real numbers. Suppose that values of some attribute q are
v1 < v2 < . . . < vk .
The partition process is effected by means of cuts, i.e., values in-between values
v j . A set c1 < c2 < . . . < cm of cuts for an attribute q defines a new
decision system with the feature c(q) whose values are now names of partition classes
usually expressed as consecutive numbers according to the natural ordering on reals,
i.e., c(q)(x) = j if and only if q(x) ∈ [c j , c j+1 ) with c(q)(x) = 0 when q(x) < c1
and c(q)(x) = m + 1 when q(x) > cm . We denote by c(A) the new set of attributes
obtained from the set A.
Definition 7.66 (Problem: Find cut-reducts for a decision system with continuous
values of attributes)
q
Theorem 7.51 (i) if the set I of atomic propositions of the form p j is a prime
DN F
implicant of f cut , then the set of cuts C(I ) defined by the
q q
q v j + v j+1
if p j ∈ I , then the cut ∈ C(I )
2
is a consistent set of cuts; (ii) if I is a prime implicant of minimal length among
DN F
prime implicants of f cut , then the set C(I ) of cuts is optimal.
Intervals and variables for attribute b : [1.0, 1.2), p1b ; [1.2, 1.4), p2b ; [1.4, 1.6),
b
p3 .
7.8 Information Logic (IL) 381
The formula f cut after an application of absorption and idempotency laws becomes:
p2a ∧ p3a ∧ p4a ∧ p1b . Optimal cuts are: 0.7, 0.9, 1.1.
(I) I (u, v) if and only if q(u) = q(v) for each q ∈ A: indiscernibility over the set
A of attributes;
(C) C(u, v) if and only if q(u) ⊆ q(v) for each q ∈ A: informational inclusion;
(T) T (u, v) if and only if q(u) ∩ q(v) = ∅ for each q ∈ A: informational tolerance;
(D) D(u) if and only if |q(u)| = 1 for each q ∈ A. D = {u ∈ U ; D(u)} is the
deterministic set.
Definition 7.68 (Semantics of the information logic IL) For a relational system M =
(U, I, C, T, D), we define an M-valuation VM : V ar → 2U from the set V ar of
variables into the power set of U and relative to VM , we define the satisfaction
relation u |=VM α for u ∈ U and α ∈ F by structural induction:
(S1) u |=VM p if and only if u ∈ VM ( p);
(S2) u |=VM D if and only if u ∈ D;
(S3) u |=VM α ∨ β if and only if u |=VM α or u |=VM β;
(S4) u |=VM α ∧ β if and only if u |=VM α and u |=VM β;
(S5) u |=VM ¬α if and only if u |=VM α is not true;
(S6) u |=VM [R]α if and only if ∀v ∈ U.(R(u, v) ⊃ v |=VM α), for R = I, C, T .
7.8 Information Logic (IL) 383
Inference rules for logic IL are: detachment, substitution and necessitation for
[I ], [C], [T ].
We denote by the symbol T h(I L) the theory of (IL), i.e., the set of provable
formulae of (IL). We impose on T h(I L) a pre-order ≤ on the set F by letting α ≤ β
if and only if α ⊃ β ∈ T h(I L). We define the notion of a filter with respect to the
ordering ≤.
Definition 7.70 (Filters in the information logic IL) A filter F is a subset of the set
F which satisfies the following properties.
(F1) ∈ F;
(F2) α ∈ F, α ≤ β imply β ∈ F;
(F3) α, β ∈ F imply α ∧ β ∈ F;
384 7 Logics for Programs and Knowledge
(F4) ⊥ ∈
/ F.
For a filter F, we let [R]F = {α ∈ F : [R]α ∈ F} for R = I, C, T . We observe
that
Theorem 7.54 For each filter F, [R]F is a filter.
Proof For F1: as ∈ F and, by necessitation, ⊃ [R] , [R] ∈ F, hence, ∈
[R]F. For property (F3), suppose α, β ∈ [R]F. Then [R]α, [R]β ∈ F, hence, by
property (F3), [R]α ∧ [R]β ∈ F and by property of the modal system K, [R](α ∧
β) ∈ F and thus α ∧ β ∈ [R]F, so [R]F satisfies property (F3).
To check on property (F2), suppose that α ∈ [R]F, α ⊃ β ∈ T h(I L). By neces-
sitation, [R](α ⊃ β) ∈ T h(I L), and by formula (K) of the modal system K,
M = (ρ I , ρC , ρT , ρ D )
Proof As proofs of each property (Pi) follow along similar lines, we include after
[34] a proof of the property (P7). Suppose to the contrary that (P7) does not hold.
We thus have prime filters F, G such that (i) F ∈ D (ii) TF ⊆ G (iii) CF ⊆ G not
true. By (i), D ∈ F and by (iii) there exists α ∈ [C]F \ G thus [C]α ∈ F, hence,
D ∧ [C]α ∈ F. By the axiom schema (a7), [T ]α ∈ F, hence, α ∈ [T ]F and (ii)
implies that α ∈ G, a contradiction. Property (P7) is satisfied.
Theorem 7.57 For each prime filter F and a formula α, F V c α if and only if
α ∈ F.
Theorem 7.58 (The completeness theorem for IL) The following are equivalent for
each formula α:
(i) α ∈ T h(I L);
(ii) α is valid.
Proof The implication from (i) to (ii) is true as inference rules preserve validity
and axiom schemas are valid. To prove the implication from (ii) to (i), argue to the
contrary by supposing that α ∈ / T h(I L). Since T h(I L) is a filter, there exists a prime
filter F with the properties (a) T h(I L) ⊆ F (b) α ∈ / F. By Theorem 7.57, it is not
true that F V c α meaning that α is not valid. Hence, (ii) implies (i). This concludes
the proof of completeness of IL.
In Sect. 7.3 and in Sect. 7.4, we have discussed the rough mereological logic of con-
cepts which brought elements of the fuzzy theory of concepts at the same time high-
lighting the motivations which led Jan Łukasiewicz to the choice of his many-valued
connectives. In this passage we outline the basic ingredients of sentential fuzzy logic
scheme due to Pavelka [35]. We consider a complete lattice L = (L , ∪, ∩, ⇒, 0, 1), a
countable set V ar of atomic propositions and sentential connectives ∨, ∧, ⊃. Formu-
lae of the logic form the set F which is the smallest set closed on atomic propositions,
386 7 Logics for Programs and Knowledge
and closed under ∨, ∧, ⊃. We denote by , the l.g.b., respectively, g.l.b. of sub-
sets of l. For a chosen set A ⊆ F called the set of axioms, we consider the mapping
A : F → L.
Each mapping F → L is an L-fuzzy set.
Inference rules are of the form R = (R1 , R2 ) such that for some k ∈ N, R1 : F k ⊇
dom R1 → F, R2 : L k → L, under the proviso that the following conditions hold:
(C) R2 (a1 , a2 , . . . , ai−1 , j {ai j }, ai+1 , . . . , ak ) =
j {R2 (a1 , a2 , . . . , ai−1 , ai j , ai+1 , . . . , ak )}.
For X : F → L, condition
It follows that for a family M of sets satisfying (R), and for x = (x1 , x2 , . . . ,
xk ) ∈ dom R1 ,
χZ (R1 (x)) = {χY (R1 (x)) : Y ∈ M} ≥
CE (X ) = {Y ∈ E : X ≤ Y }.
The semantic consequence denoted X |=E,a x and read ‘x is the semantic con-
sequence of X to the degree of at least a’, for X ∈ L F , x ∈ F, a ∈ L, is defined as
follows:
7.10 Problems
Problem 7.2 (SDL) Hoare triples are expressions of the form {φ}π{ψ} which encode
the statement: ‘if a program π executes in a state satisfying φ, then if it terminates
then it terminates in a state satisfying ψ. In SDL this rule is expressed as φ → [π]ψ.
Prove in SDL the composition rule: if {φ}π{ψ} and {ψ}ρ{ξ}, then {φ}π; ρ{ξ}.
Problem 7.3 (SDL) In SDL, basic block commands of structured programming can
be expressed. Check that expressions below render correctly the block commands:
Problem 7.4 (SDL) (after Manna [36]). The possibility of infinite looping for a
program can be expressed in SDL at the cost of additional notions. A strong notion
of looping for a program a at state s is Ra (s, s). The other way is to introduce
an additional predicate in f (also denoted ∞), the formula in f (a) meaning that a
program a can enter an infinite loop. Prove properties of in f :
(i) inf(a b) ≡ in f (a) ∨ in f (b);
(ii) inf((a; b)) ≡ in f (a) ∨ a b;
(iii) in f (a ∗ ) ≡ a ∗ in f (a) ∨ Δ(a) where Δ(a) is an operator semantically
defined as the set {s ∈ S : ∃{sn : n = 0, 1, ...}.s0 = s ∧ ∀n.Ra (sn , sn+1 )}.
Problem 7.5 (SDL) (after Manna [36]). A program a is correct when on beginning
the execution in a given state, it terminates in a desired state. Verify that the condition
¬in f (a) means that the program a terminates after a finite number of steps. Verify
that the correctness of the program a can be rendered as α ⊃ ¬ inf(a) ∧ [a]β.
Problem 7.6 (SDL) Prove that SDL does not observe the compactness property:
there exists a countable set Φ of formulae which is not satisfiable and yet each finite
subset of Φ is satisfiable. Give an example of Φ with this property. [Hint: eventually,
please consult [4]].
Problem 7.7 (SDL. Downward preservation theorem) Prove: if A(π) ⊆ A(ρ), then
[ρ](φ) ⊃ [π](φ) for any formula φ.
Problem 7.8 (SDL. Upward preservation theorem) Prove: if A(π) ⊆ A(ρ), then
π (φ) ⊃ π (ρ) for any formula φ.
Problem 7.9 (Epistemic logic) Suppose that in a Kripke structure M, the world w
is terminal, i.e., {v : R(w, v)} = ∅. For any formula φ determine the logical truth
value of the formula K φ at w, i.e., is M, w |= K φ true? If yes, does that mean
omniscience?
Problem 7.11 (Epistemic logic) (after Chellas [37]). A formula φ is modally closed
if it contains no occurrence of any free atomic proposition.
Prove: if is a model for the logic ES5 and a formula φ is modally closed, then
|= (φ ≡ K φ).
Problem 7.13 (Common knowledge) Follow the proof in Theorem 7.24 and prove
completeness of logic ECTn. [Hint: In case of need, consult (Halpern and Moses
[8])].
Problem 7.15 (Functional dependence II) For sets X, Y and a family F of functions
from X into Y , the fiber product of F is the function Δ F : X → Π f ∈F Y defined as
Δ F (x) =< f (x) : f ∈ F >.
For families F, G of functions from X into Y , we say that G depends functionally
on F if and only if there exists a function Φ : Π f ∈F Y → Πg∈G Y such that ΔG (x) =
Φ(Δ F (x)) for each x ∈ X . We denote the fact of functional dependence of G on F
with the symbol F ⇒ G.
Prove the following properties of the relation ⇒:
(i) if G ⊆ F, then F ⇒ G;
(ii) if F ⇒ G and G ⇒ H , then F ⇒ H ;
(iii) if F ⇒ G and F ⇒ H , then F ⇒ G ∪ H ;
(iv) if F ⇒ G and H ⇒ K , then F ∪ H ⇒ G ∪ H .
Prove: If φ is a valid formula of SIL, then for each valuation V satisfying (i)-(v),
V (φ) = X .
Problem 7.18 (FOIL) Prove that the formula ¬[∀x.φ(x)] ⊃ ∃x.[¬φ(x)]. is not
valid in FOIL.
390 7 Logics for Programs and Knowledge
References
1. Segerberg, K.: A completeness theorem in the modal logic of programs. Notices AMS 24(6),
A-522, no. 77T-E69 (1977)
2. Kozen, D., Parikh, R.: Note. An elementary proof of the completeness of PDL. Theor. Comput.
Sci. 14, 113–118 (1981). https://doi.org/10.1016/0304-3975(81)90019-0
3. Fischer, M.J., Ladner, R.E.: Propositional modal logic of programs. J. Comput. Syst. Sci. 18,
194–211 (1979)
4. Harel, D., Kozen, D., Tiuryn, J.: Dynamic Logic. The MIT Press, Cambridge (2000)
5. Hintikka, J.K.K.: Knowledge and Belief. Cornell University Press, Ithaca (1962)
6. Kripke, S.: Semantical analysis of modal logic I: Normal modal propositional calculi. Z.
Math. Logik und Grundlagen der Mathematik 9(5–6), 67–96 (1963). https://doi.org/10.1002.
19630090502
7. Ladner, R.E.: The computational complexity of provability in systems of modal propositional
logic. SIAM J. Comput. 6(3), 467–480 (1977)
References 391
8. Halpern, J., Moses, Y.O.: A guide to completeness and complexity for modal logics of knowl-
edge and belief. Artif. Intell. 54(2), 319–379 (1992)
9. Lenzen, W.: Glauben, Wissen und Wahrscheinlichtkeit. Springer, Vienna (1980); see also:
Recent work in epistemic logic. Acta Philosophica Fennica 30, 1–219 (1978)
10. Blackburn, P., de Rijke, M., Venema, Y.: Modal Logic. Cambridge University Press, Cambridge
(2001)
11. Leśniewski, S.: Foundations of General Set Theory (in Polish: Podstawy Ogólnej Teoryi
Mnogos̈ci). Polish Sci. Soc. Moscow (1916); also in: Topoi 2, 7–52 (1982)
12. Srzednicki, J., Surma, S.J., Barnett, D., Rickey, V.F. (eds.): Collected Works of Stanisław
Leśniewski. Kluwer, Dordrecht (1992)
13. Leśniewski, S.: Über die Grundlagen der Ontologie. C.R. Soc. Sci. Lettr. Varsovie Cl.III, 23
Anneé, 111–132 (1930); also: [13]
14. Tarski, A.: Zur Grundlegung der Booleschen Algebra I. Fundam. Math. 24, 177–198 (1935)
15. Lejewski, C.: Consistency of Leśniewski’s Mereology. J. Symb. Logic 34, 321–328 (1969)
16. Polkowski, L.: Approximate Reasoning by Parts. An Introduction to Rough Mereology.
Springer. ISRL 20, Berlin (2011)
17. Polkowski, L., Skowron, A.: Rough mereology: a new paradigm for approximate reasoning.
Int. J. Approx. Reas. 15(4), 333–365 (1997)
18. Łukasiewicz, J.: Die Logischen Grundlagen der Wahrscheinlichtkeitsrechnung. Cracow (1913);
also in [17]
19. Borkowski, L.: Jan Łukasiewicz. Selected Works. North Holland, Amsterdam (1970)
20. Polkowski, L.: Introducing mass-based rough mereology in a mereological universe with rela-
tions to fuzzy logics and a generalization of the Łukasiewicz logical foundations of probability.
Fundam. Inf. 166(3), 227–249 (2019)
21. Polkowski, L.: On the compactness property of mereological spaces. Fundam. Inf. 172(1),
73–95 (2020)
22. Gleason, A.M.: Projective topological spaces. Illinois J. Math. 2, 482–489 (1958)
23. Pawlak, Z.: Rough sets. Int. J. Inform. Comp. Sci. 11, 341–356 (1982)
24. Pawlak, Z.: Rough Sets. Theoretical Aspects of reasoning about Data. Kluwer, Dordrecht
(1991)
25. Fisher, R.A.: The use of multiple measurements in taxonomic problems. Ann. Eugen. 7(2),
179–188 (1936)
26. Loemker, L. (ed. and trans.): G.W. Leibniz: Philosophical Papers and Letters, 2nd ed., Dor-
drecht, Reidel (1969)
27. Rauszer, C.M.: An equivalence between theory of functional dependencies and a fragment of
intuitionistic logic. Bull. Polish Acad. Sci. Math. 33, 571–579 (1985)
28. Gentzen, G.: Untersuchungen über das Logische Schliessen, I, II. Math. Z. 39, 176–210, 405–
431 (1934/5)
29. Boole, G.: The mathematical Analysis of Logic. G. Bell, London (1847). (reprinted from the
original: Philosophical Library, New York, 1948)
30. Blake, A.: Canonical expressions in Boolean algebra. PhD Dissertation. University of Chicago
Libraries (1938)
31. Skowron, A., Rauszer, C.M.: The discernibility matrices and functions in information systems.
In: Intelligent Decision Support. Kluwer (1992)
32. Pawlak, Z., Skowron, A.: Rough sets and Boolean reasoning. Inf. Sci. 177, 41–73 (2007)
33. Nguyen, H.S.: Discretization of real value attributes, Boolean reasoning approach. Ph.D. thesis,
Warsaw University, Warsaw (1997)
34. Vakarelov, D.: Modal logics for knowledge representation systems. LNCS 363, 257–277 (1989)
35. Pavelka, J.: On fuzzy logic I, II, III. Zeit. Math. Logik. Grund. Math. 25, 45–52, 119–134,
447–464 (1979)
36. Manna, Z.: The correctness of programs. J. Comp. Sci. Syst. Sci. 3, 119–127 (1969)
37. Chellas, B.F.: Modal Logic. An Introduction. Cambridge University Press, Cambridge (1980)
38. Polkowski, L.: Rough Sets. Mathematical Foundations. Physica-Verlag. A Springer Company,
Heidelberg (2002)
39. Novotný, M., Pawlak, Z.: Algebraic theory of independence in information systems. Fund.
Inform. 14, 454–476 (1991)
Chapter 8
Beyond FO Within SO
In Sects. 3.19 and 3.20, we discussed problems of expressive power of FO. The
general formulation of the problem for FO was: given a class F of closed formulae
and a class M of FO structures, determine properties which can be expressed by
formulae in F within structures in M. We discussed the problem EVEN and the
problem CONN of connectivity for finite graphs showing that these problems cannot
be expressed within FO.
We deem it useful if we recapitulate in a nutshell tools and results described in
Sects. 3.19, 3.20 as a first step before entering the realm of logics stronger than FO.
We restrict the topic to finite structures.
Finite FO structures miss some properties of FO. For instance compactness prop-
erty: consider the set T = {φn : n ≥ 1} of formulae where φn : ∃x1 , x2 , . . . xn . i< j
(xi = x j ). Each finite subset of T is satisfiable in a finite structure, but T is not.
It follows that not all properties are expressible within FO. An other example
is reachability property REACH: for a graph G and two distinct vertices s and t
decide whether there exists a path which connects s and t. Consider the vocabulary
Σ = {E, c1 , c2 }, where the relational symbol E is interpreted in a set A as the edge
relation e and c1 , c2 are interpreted as s and t respectively. Suppose that a formula φ
expresses the set of graphs in which there is a path joining s and t.
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 393
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4_8
394 8 Beyond FO Within SO
The importance of this notion becomes evident when we state the following result
Ehrenfeucht [1].
Theorem 8.1 The following are equivalent.
(i) Duplicator has the winning strategy in the game G m (A, B);
(ii) A ≡m B.
For a proof please see Sect. 3.20.
Remark 0. We focus on Duplicator because of the following result on the method-
ology of the Ehrenfeucht game (see Sect. 3.20 for a proof): (*) a property Q is not
expressible in FO if and only if there exist for each m structures X, Y such that
X ≡m Y , X |= Q and ¬(Y |= Q) and of its dual.
(**) property Q is definable in FO if and only if there is r such that if structures
A and B are respectively A in Q and B not in Q, then the spoiler has the winning
strategy in the game G r on A and B.
In Sect. 3.20, examples are given of problems EVEN, CONN which are not
expressible in FO on basis of the criterion (*). The statement (*) poses the problem
of means for deciding the relation A ≡m B. We begin with the criterion due to Hanf
[2]. We recall the context in which Hanf criterion is introduced.
Remark 8.1 The decision problem for a given m ∈N whether Duplicator has a
winning strategy in Ehrenfeucht’s game on given finite structures A and B is in P;
the decision problem: given m ∈N and finite structures A and B, decide whether
Duplicator has a winning strategy, is PSPACE-complete, see (Kolaitis [3], 2.4.4,
2.4.5).
Hanf’s criterion is set in the metric structure of Gaifman’s graph Gaifman [5] to
which we now proceed.
Definition 8.6 (The Gaifman graph of a structure) Consider a structure A with the
domain A and with relational symbols Q 1 , Q 2 , . . . , Q k interpreted as R1A , R2A , . . . , RkA .
The Gaifman graph G(A) is the structure with vocabulary E A on the domain A, where
for x, y ∈ A, E A (x, y) holds if and only if
(i) either x = y;
ni
(ii) or, there exists RiA of arity n i and (ai )i=1 such that RiA (a1 , a2 , . . . , ani ) holds
ni
and x, y are elements of (ai )i=1 .
Condition (ii) defines an undirected graph and condition (i) add loops which are not
allowed in undirected graphs, so we get a hybrid graph.
For instance, consider a single binary relation R; the formula φ R (x, y) ≡ (x =
y) ∨ (R(x, y) ∨ R(y, x)) describes in FO the graph G(A).
Definition 8.7 (Topological structures in Gaifman graphs) In a Gaifman graph, one
may define a topological structure by introducing the notion of a neighborhood based
on the notion of distance. The notion of distance is as usual for graphs, i.e, as the
length of the shortest path, which can be defined by induction as
396 8 Beyond FO Within SO
Each ball B(x, r ) can be regarded as a structure B(x, r ) with the universe B(x, r ),
relational symbols P restricted to interpretations restricted to B(x, r ) and constants
within B(x, r ). We denote by τ (B(x, r )) the isomorphism type of B(x, r ) in the sense
that isomorphic structures B(x, r ) and B(y, s) satisfy the condition τ (B(x, r )) =
τ (B(y, s)). In the sequel we denote by the generic symbol τ any isomorphism type
of a closed ball.
A sentence is basic local for a given r if it is of the form:
∃x1 , x2 , . . . , xn . (φ>2r
d (x i , x j )) χ B(xi ,r ) .
i< j i
The distance value 2r comes form the triangle inequality: if y, z ∈ B(x, r ), then
d(y, z) ≤ 2r , hence, the condition d(xi , x j ) > 2r guarantees that xi , x j belong in
disjoint balls. This explains the adjective ‘local’.
We state the first of theorems on locality properties of FO Gaifman [5].
Theorem 8.2 Each FO closed formula is equivalent to Boolean combination of
basic local formulae.
For a proof, please consult, e.g., (Ebbinghaus and Flum [4]).
In this context, the Hanf theorem proposes a criterion for m-equivalence. A type
of a ball B(x, r ) is an isomorphism type of the sub-structure B(x, r ); same for
B(x, r ). This means that balls B(x, r ) and B(y, r ) are of the same type if structures
(B(x, r ), x) and (B(y, r ), y) are isomorphic.
Before addressing the Hanf locality theorem, we recall the notion of witnessing
sequences for Ehrenfeucht games from Chap. 3.
8.1 Introduction: Expressive Power of FO. Recapitulation 397
For structures (A, (a)k1 ) and (B, (b)k1 ), with respective domains A, B and for
j
j ≤ m, we denote by (s)1 elements of the domain A selected by players after the
j
j − th round and we denote by (d)1 elements of the domain B selected by players
after the j − th round. The following statement holds.
(i) if Duplicator has the winning strategy in the game G m (A, (a)k1 ; B, (b)k1 ),
j j
then, for each j ≤ m, the position ((a)k1 (s)1 ; (b)k1 (d)1 ) establishes a partial
isomorphism.
Theorem 8.3 At each stage j < m of each party of the game G m , if Duplicator has
the winning strategy for the game G m , then there are moves extending the winning
strategy from G j to G j−1 , viz.
(i) (forth) for each a ∈ A, there exists b ∈ B such that the pair (a, b) added to the
position of G j provides a partial isomorphism at the position of G j−1 ;
(ii) (back) for each b ∈ B, there exists a ∈ A such that the pair (a, b) added to the
position of G j provides a partial isomorphism at the position of G j−1 .
The next result paves the way from existence of the winning strategy for Duplicator
to m-equivalence of structures.
(i) Balls of radius 3m in either structure contain less than q vertices for each type
τ of 3m -balls;
(ii) Either both structures have the same numbers of 3m balls of each type τ or
each structure has more than qm elements with 3m balls of each type τ .
398 8 Beyond FO Within SO
Proof We apply the Fraïssé theorem and we demonstrate the m-equivalence of struc-
tures by constructing a witnessing m-sequence. This sequence is constructed as
follows:
m− j m− j
(i) I j is f : (ai )i=1 → (bi )i=1 which is a partial isomorphism from A to
B and structures (B({ai : i ≤ m − j}, 3 j ), {ai : i ≤ m − j}) and (B({bi : i ≤ m −
j}, 3 j ), {bi : i ≤ m − j}) are isomorphic.
The element Im = f : ∅ → ∅ satisfies (i), hence, one has to show that the sequence
(I j ) has the extension properties (forth) and (back). As they are symmetric to each
other, it is sufficient to consider the property (forth).
Consider f : (ai )i≤m−( j+1) → (bi )i≤m−( j+1) in I j+1 with isomorphic via an assign-
ment f structures
(B((ai )i≤m−( j+1) , 3 j+1 ), (ai )i≤m−( j+1) )
and
(B((bi )i≤m−( j+1) , 3 j+1 ), (bi )i≤m−( j+1) ).
and
i=m−( j+1)
B((bi )i=1 , 2 · 3j)
contain the same number of balls of radius 3 j isomorphic to the ball B(a, 3 j ). The
number of these balls is not greater than the number of ai ’s times q, i.e, ≤ q · m.
As the number of balls isomorphic to B(a, 3 j ) is by assumption of the theorem
greater than q · m, there exists b ∈ B such that B(b, 3 j ) is isomorphic to B(a, 3 j )
m−( j+1)
/ B((bi )i=1
and b ∈ , 2 · 3 j ). This b = bm− j completes I j .
We now state the theorem by (Fagin et al. [7]) on Hanf-like conditions for winning
strategy by Duplicator.
Theorem 8.6 For each pair q, f of natural numbers, there exist natural numbers
r, m such that if any structures A and B whose elements have degrees bound by f
are r, m-equivalent, then Duplicator has the winning strategy in the game G q (A, B),
i.e., A ∼
=q B. Moreover, r depends only on q.
j
j
( j) A| B(ai , 3q− j ) is isomorphic to B| B(bi , 3q− j ),
i=1 i=1
Case 2: induction step. Suppose that j < q and the condition (j) holds. Let Spoiler
select a j+1 in A. We have to assure that Duplicator selects b j+1 in B in order to
satisfy the condition (j+1). There are some sub-cases.
j
Sub-case 2.1. Suppose that a j+1 ∈ i=1 B(ai , 2 · 3q− j−1 ). As
j
(∗) B(a j+1 , 3q− j−1 ) ⊆ B(ai , 3q− j ),
i=1
Duplicator selects b j+1 corresponding to a j+1 under the isomorphism of case (j).
Sub-case 2.2. Suppose that 2.1 does not hold. Let 3q− j−1 -type of a j+1 be ρ. Let
j
jρ be the number of elements in i=1 B(ai , 2 · 3q− j−1 ) with type ρ.
j
For each a ∈ i=1 B(ai , 2 · 3q− j−1 ), we have
j
(∗∗) B(a, 3q− j−1 ) ⊆ B(ai , 3q− j ).
i=1
j
It follows that jρ is the number of elements with type ρ in i=1 B(ai , 3q− j ). By
j
analogy, jρ is the number of elements in i=1 B(bi , 2 · 3q− j−1 ) having type ρ. Our
claim is now the following.
Claim. jρ < m. As 2 · 3q− j−1 < 3q−1 = r , we have 2 · 3q− j−1 ≤ r − 1. By Remark
8.3, the size of B(ai , 2 · 3q− j−1 ) is less than f r −1 , hence, all j balls have total size
less than j · d r −1 < r · d r −1 = m. Hence, jρ < m.
It follows from Claim, that A contains at least jρ + 1 elements with type ρ (to
jρ of them, we add a j+1 ). By r, m-equivalence of A and B and Remark 8.2, A, B
are 3q− j−1 , m-equivalent as 3q− j−1 < r . As jρ + 1 ≤ m, B contains at least jρ + 1
j
elements with type ρ. As i=1 B(bi , 2 · 3q− j−1 ) contains jρ elements of type ρ, there
j
exists an element b j+1 with type ρ not in i=1 B(bi , 2 · 3q− j−1 ) and let Duplicator
select b j+1 . This choice satisfies the condition (j+1).
By induction, the condition (q) holds, hence Duplicator wins the
game G q .
As r, m-equivalence implies r equivalence and parameter r depends on q only,
the result of Theorem 8.6 can be modified to the theorem.
Theorem 8.7 For each natural number q there exists a natural number r such that
if any two structures A, B are r -equivalent, then Duplicator has the winning strategy
in game G q on A and B.
Combining Theorem 8.7 with Gaifman’s and Ehrenfeucht-Fraïsse’s theorems, we
can assert that two finite structures A, B are isomorphic if and only if they agree on
all closed FO formulae.
To show an application, we include an argument from [7] on non-expressive ness
of connectedness in FO.
8.2 Syntax and Semantics of Second-Order Logic (SO) 401
Definition 8.16 (MSO-definable classes) For an MSO formula φ the class Cls-
mod(φ) of φ-definable structures consists of all MSO-structures A such that A |= φ.
Like with FO-case, the notion of the class Cls-mod(φ) is easier to be characterized
in the negative.
Definition 8.17 (Class EVEN) EVEN is the class of all finite sets having an even
number of elements.
Proof In this case the vocabulary Σ is the empty set. Let sets A, B be given. One
proves by induction that if |A| > 2k and |B| > 2k , then A ≡kM S O B, i.e., Duplicator
has the winning strategy in k moves. Suppose the thesis be true for k and consider
A, B of cardinalities greater than 2k+1 .
Suppose Spoiler selects in its first move a set X ⊆ A.
Case 1. |X | ≤ 2k . Then Duplicator can select a set Y ⊆ B such that |X | = |Y |, hence,
X, Y are isomorphic and thus X ≡kM S O Y . As A \ X, B \ Y are of cardinalities greater
or equal to 2k , hence, by the hypothesis of induction, A \ X ≡kM S O B \ Y .
Playing on pairs X, Y ; A \ X, B \ Y , Duplicator has a winning strategy in k + 1
moves by combining winning strategies on pairs X, Y and A \ X, B \ Y .
Analogous, by symmetry, is the case when |A \ X | ≤ k. So, the only remaining is
Case 2. |X | > 2k and |A \ X | > 2k . Suppose that Duplicator selects a subset Y ⊆ B
with |Y | > 2k and |B \ Y | > 2k .
By the hypothesis of induction, Duplicator has a winning strategy from X, Y as
well as from A \ X, B \ Y in k moves, i.e., A ≡k+1
M SO
B.
404 8 Beyond FO Within SO
∃X.∃Y.∃F.∀x.(x ∈ X ∨ x ∈ Y )∧
∀x, y.(x ∈ X ∧ y ∈ Y ⊃ ¬(x = y)) ∧ ∀x.∃y.(x ∈ X ∧ y ∈ Y ∧
∀x.∃!y(F(x, y) ∧ ∀y.∃!x.F(x, y))
which represents a given set as the disjoint union of two subsets of the same cardi-
nality. We need to this end second-order predicates X, Y, F.
We have shown in Sect. 3.20 that the class of undirected connected finite graphs,
usually denoted CONN, is not FO-definable. With MSO, the situation is twofold:
CONN is not ∃MSO-definable and it is ∀MSO-definable.
The aim of this section is to prove the non-definability in ∃MSO of the property
of finite graphs to be connected. The proof we give rests on the Hanf Theorem 8.5
which in a sense ‘geometrizes’ the logical content.
We now focus on finite graphs. We recall that a graph is connected if and only
if any two vertices are connected by a path; the distance ρ(u, v) between vertices u
and v is the length of the shortest path from u to v (we discuss undirected graphs) if
such a path exists, otherwise the distance is ∞. A (closed) ball about u of radius r is
the set B(u, r ) = {v : ρ(u, v) ≤ r }.
For a finite set C, the ball B(C, r ) is defined as the union c∈C B(c,r ) . A ball B(u, r )
type is the isomorphism type of the ball B(u, r ). Hence, u in A and v in B have the
same isomorphism type of ball or radius r about them if structures (B(u, r ), u) and
(B(v, r ), v) are isomorphic.
The following result is due to Fagin [8].
Theorem 8.11 The class CONN of finite connected graphs is not definable in ∃MSO.
Proof Suppose to the contrary that there exists unary predicates P1 , P2 , . . ., Pk such
that for a formula φ : ∃P1 ∃P2 . . . ∃Pk .ψ, the class CONN of finite connected graphs
is Cls − mod(φ).
The graph structures which are m-equivalent but one is connected and the other is
not, are: a cyclic graph G, and two disjoint cyclic subgraphs G 1 , G 2 obtained from
G. Let X 1 , X 2 , . . . , X k be sets implementing predicates P1 , . . . , Pk in the graph G
we are going to define. Then we claim that G, X 1 , X 2 , . . . , X k |= ψ. Observe that
X i ’s being sets, they do not affect isomorphism types of balls in G. In order to
construct required graphs, we observe that each local structure about any vertex in
a cyclic graph is a linear arc, hence, for a given m, and a ball B(a, 3m ) the ball
contains 2 · 3m + 1 elements. Assuming the cardinality of the cyclic G to be at least
2 · (2 · 3m + 1) (as all 3m -balls are isomorphic), we find in G two ‘antipodal’ vertices
a, b with disjoint and isomorphic 3m balls.
8.3 Graph Structures in MSO 405
The second of many problems studied for graphs with respect to MSO is REACH:
the problem of reachability. For a graph G (undirected or directed), reachability is the
question whether given two vertices s and t, there exists in G a path from s to t in case
of a directed graph or a path between s and t in case of an undirected graph. REACH
discerns between ∃MSO and ∀MSO. We recall that undirected graphs cannot have
loops.
The following fact was announced by (Kanellakis).
Theorem 8.12 REACH is expressible in ∃.MSO for undirected graphs.
Proof (Ajtai and Fagin [9]) Given an undirected graph G and its vertices s, t along
with a unary predicate P (by necessity s = t), we produce three formulae φ, ψ, χ
which express the following
(i) φ does express that P(s) ∧ P(t);
(ii) ψ does express that both s, t are connected each to exactly one vertex satisfied
by P;
406 8 Beyond FO Within SO
We now define Ajtai-Fagin games (Ajtai and Fagin [9]) for ∃MSO.
Definition 8.18 (Ajtai-Fagin games) These games introduce a new ingredient into
Ehrenfeucht’s second-order games: a feature of ’color’. For structures A with the
domain A and B with the domain B over a common finite vocabulary Σ, for selected
natural numbers c, r , we define the c, r -second order game G c,r . Ajtai-Fagin game is
localized on a given class Cls − mod(φ); we recall that it is the class of all structures
which are models for the formula φ. Rules of the game are as follows.
(i)Spoiler selects natural numbers c, r ;
(ii)Duplicator chooses a structure A ∈ Cls − mod(φ);
(iii)Spoiler selects subsets (unary relations) S1 , S2 , . . . , Sc of the domain A;
(iv) Duplicator responds with a choice of a structure B not in Cls − mod(φ) along
with subsets D1 , D2 , . . . , Dc of the domain B;
(v) Spoiler and Duplicator play a party of the Ehrenfeucht game G r on structures
(A, S1 , S2 , . . . , Sc ) and (B, D1 , D2 , . . . , Dc ).
Analysis of the game G c,r requires a new notion of a type t yper,k . We recall that
F O[k] is the set of FO formulae of quantifier rank at most k.
Remark 8.4 For a finite vocabulary Σ, and a given natural number r , there are in
the class FO[k] over Σ finitely many formulae with free variables x1 , x2 , . . . , xr .
The proof of Remark 8.4 goes by induction on k: for k = 0, we have finitely many
atomic formulae and their Boolean combinations are also finite in number. Assuming
hypothesis of induction for k, we find that a formula φ(x1 , x2 , . . . , xr ) in FO[k+1] is
a Boolean combination of formulae of the form ∃xr +1 .ψ(x1 , x2 , . . . , xr ) with ψ in
FO[k], hence, the number of formulae of the form φ is finite.
Definition 8.19 (Typesr,k ) We continue with the vocabulary Σ and a structure A over
Σ. For a tuple a = (ai )ri=1 and r, k, we let t yper,k (A, a)={φ ∈ F O[k] : A |= φ(a}.
A t yper,k (A) is the class of functions in t yper,k (A, a) for a of length r .
Theorem 8.13 The following are equivalent for a class Cls − Mod(φ):
(i) Duplicator has the winning strategy in the Ajtai-Fagin game for Cls − mod(φ);
(ii) Cls − mod(φ) is not definable in ∃MSO.
Let us also state the dual: Cls − mod(φ) is definable in ∃MSO if and only if there
are parameters c, r such that Spoiler has the winning strategy in the Ajtai-Fagin G c,r
for Cls − mod(φ).
8.3 Graph Structures in MSO 407
Proof (On the idea in Immerman [10]) Consider the case of Cls − mod(φ), where
φ is of the form ∃C1 , C2 , . . . , Cc .ψ and ψ is an FO formula of quantifier rank r .
The winning strategy for Spoiler is in the following steps: it chooses c, r , and for
the choice of a structure A ∈ Cls − mod(φ) by Duplicator, Spoiler chooses subsets
S1 , S2 , . . . , Sc in the domain A of A such that (A, S1 , S2 , . . . , Sc ) |= ψ.
Duplicator chooses then a structure B not in Cls − mod(φ). Irrespective of the
choice of subsets D1 , D2 , . . . , Dc of the domain B of the structure B, the structure
(B, D1 , D2 , . . . , Dc ) does not satisfy φ. Hence, Spoiler wins the game.
Suppose Cls − mod(φ) is not expressible by ∃MSO. We have to show that Dupli-
cator wins. Spoiler chooses c, r . By Remark 8.4, The maximal set Γ of pair-wise
non-equivalent formulae of forms ∃C1 , C2 , . . . , Cc .ψ with ψ an FO formula of quan-
tifier rank r is finite.
Consider the set
We know that REACH is expressible in the class of finite undirected graphs cf.
Theorem 8.12. To the contrary, the problem dREACH: to determine whether a path
exists from s to t in a directed graph G is not expressible in ∃MSO (Ajtai and
Fagin [9]). (Arora and Fagin [11]) gave a few proofs for this statement, all based on
characteristics of directed graphs. Due to excessive length of all necessary arguments,
we include a sketch of the proof in (Arora and Fagin [11]). The proof reminds of the
Hanf theorem in requirements for the graph G D which will be chosen by Duplicator.
Let us quote them.
(iii) for each coloring of vertices of G D by spoiler, when an edge e is removed from
the path from s to t, then with the probability 1 − ε each vertex is d, q-colored
in G D − {e} as in G D .
Definition 8.21 (The (d, q)-color) Let L be a language of logic with a finite rela-
tional vocabulary and m be the maximum of arities of relational symbols.
For a vertex v, (d, 0)-color of v is a set of descriptions, for each relational symbol R
of arity k, whether the tuple (v)k1 belongs in R.
For q > 0, (d, q)-color is defined by induction. Then, (d, q + 1)-color of v
includes (d, q)-color of v plus descriptions for each choice of (d, q)-colors c1 , c2 , . . . ,
cm−1 and each m-type T of a tuple of m vertices which does include v of whether
there are from 0 to d choices of tuples < v1 , v2 , . . . , vm−1 > such that the tuple
< v, v1 , v2 , . . . , vm−1 > is of m-type T and each vi has (d, q)-color ci .
Proof (Continued) As with Hanf theorem, the notion of (d, q)-color tries to capture
the inner structure of a graph, but not in geometric terms of distance but in logi-
cal relations encoded in a given logical language. Requirements (i)-(iii) allow for
carrying out the proof.
Consider the class R of directed (s, t)-connected graphs. In the (c, r )-game Dupli-
cator selects a graph G D with a path from s to t as described in the context. For a
forward edge e =< vi , vi+1 > for some i, we consider the graph G eD which is G D
with e removed, which breaks down the path s-t, hence, G eD is not in R.
There exists a G D such that for each coloring by Spoiler, there exists an edge e
such that G eD can be colored in the same way as G D and Duplicator has the winning
strategy in the Ehrenfeucht game G r . Thus, R is not in ∃MSO.
Consider a finite alphabet A (for grammars and languages, see Chap. 1), of cardinality
m. We recall that A∗ denotes the set of finite sequences of elements of A (called
strings, or, words over A when we speak of a language). The empty word is denoted
ε. Subsets of A∗ are called languages, denoted generically as L.
We need to represent words in a language as structures. For each symbol a ∈ A, we
introduce a unary predicate Pa , and the relational vocabulary will be (<, {Pa :∈ A}),
where < represents the relation ordering A.
For a string w, we denote by Aw the structure (w, Paw1 , Paw2 , . . . , Pawm ) where A =
{a1 , a2 , . . . , am } is an ordered alphabet. For w = ai1 ai2 . . . aik , each Paw returns the
positions of the symbol a in w. For instance, for Σ = {a, b, c} and w = abbccaacb,
Paw = {1, 6, 7}, Pbw = {2, 3, 9}, Pcw = {4, 5, 8}.
We can convert these values into a Parikh vector giving the number of occurrences
of the symbol in w, in our case the Parikh vector is [3, 3, 3]. Clearly, if a given symbol
a does not occur in w then the corresponding Paw takes on the value ∅ and the position
in the Parikh vector for a is 0.
Definition 8.24 (Languages defined by formulae) For a formula φ of MSO (or, FO),
over the relational vocabulary Σ, one says that the language L over Σ is defined by
φ if and only if L = {w : Aw |= φ}. We let in that case L = L φ .
Proof (Ladner [13]) We apply here the known to us result that a language is regular
if and only if it is accepted by DFA (deterministic finite automaton), see Chap. 1.
Suppose that the language L is regular and it is accepted by a DFA =(A, Q, q0 , tr, F).
One has to describe actions of DFA on words in L in terms of MSO formulae. Those
actions include beginning in the state q0 , passing from state to state in accordance
410 8 Beyond FO Within SO
but for some a ∈ A, Aw1 a is of type ιi , Aw2 a is of type ι j and (∗∗)ιi = ι j . Type ιi is
defined by the formula φi , type ι j is defined by the formula φ j . By the assumption
(*) (ix), Aw2 |= φ j , hence, ιi = ι j , contrary to the supposition (**). Hence, Ω is a
DFA.
Claim 2. For each word w, the automaton Ω on input w, terminates in the state ιi
which is the type of Aw .
Proof of Claim 2. Proof is by induction, the first step consists in the observation that
on the empty word, Ω terminates on the state ι0 defined as type of Aε . The inductive
step follows by the definition of transition function: if type of Aw is ιi , then type of
Awa is ι j = tr (ιi , a). Finally, Ω accepts a word w if type of Aw is ιi ∈ F, i.e., by
definition of F, ιi is the type of φ, hence, Aw |= φ, i.e., w ∈ L(φ).
(i) L(∅) = ∅;
(ii) L(a) = {a};
(iii) L(u ∪ v) = L(u) ∪ L(v);
(iv) L(−u) = Σ ∗ \ L(u);
(v) L(uv) = L(u)L(v).
Proof (Ebbinghaus and Flum [4]) First, proof that each regular star free language
is FO-definable. It goes by induction on the complexity of regular expression which
defines the language. Empty language is defined by ∅, the singular language {a} is
defined by the expression ∃!x.(x = x) ∧ ∀x.Pa (x). The language −L is defined by
¬φ where φ defines L. The language L 1 ∪ L 2 is defined by the expression φ1 ∨ φ2 ,
where φi defines L i for i = 1, 2.
This leaves concatenation L 1 L 2 . Let φi define L i for i = 1, 2. We need to glue in
some way φ1 and φ2 .
Consider a string s in L 1 L 2 . Let p be the number of the last position in s which has
come from L 1 . Given a sub-formula ∃y.ψ of φ, for a variable x which does not occur
in φ1 or φ2 , replace the quantifier ∃.y with ∃y ≤ x and by analogy, in φ2 replace ∃.y
with ∃y > x. Then, Ms |= ∃x.φ1 (x) ∧ φ2 (x) if and only if s ∈ L 1 L 2 .
412 8 Beyond FO Within SO
The completeness property of FO implies that the set of valid FO formulae is recur-
sively enumerable (see Chap. 1) as one can enumerate all proofs of valid formulae.
The case is different for SO. We say that an SO formula is finitely satisfiable over a
relational vocabulary Σ if and only if it is satisfied by some finite structure. An SO
formula is finitely valid over Σ if it is satisfiable by all finite structures over Σ.
Satisfiability problem for finite structures is resolved in the negative by the fol-
lowing theorem due to Trakhtenbrot [15].
8.5 Theorems of Trakhtenbrot and Fagin 413
Theorem 8.17 (Finite unsatisfiability over SO) For each relational vocabulary Σ
containing a binary predicate symbol, the problem of finite satisfiability over Σ is
undecidable.
Proof (Trakhtenbrot [15]) The idea of the proof is to describe a Turing machine TM
in terms of FO by constructing for each TM a formula ΦT M such that ΦT M is finitely
satisfiable if and only if TM halts on empty initial word.
We represent TM as a tuple (Σ, Δ, Q, δ, q0 , Q acc , Q r ej ), where Σ is the input
alphabet, Δ = {0, 1} is the tape alphabet, Q is the set of states, δ is the set of instruc-
tions of TM, q0 is the initial state, Q acc is the set of accepting states, and, Q r ej is the
set of rejecting states. Blank cells are represented by 0.
The relational vocabulary Σ consists of ordering relation symbol <, min which
is the constant symbol interpreting the first element with respect to <, binary tape
predicates T0 and T1 with arguments being a position p on tape and the number of
computation step t for occurrence of respectively 0 or 1, binary predicates Hq for
each state q, Hq ( p, t) shows the position p of Head when machine is at step t and
in state q.
The formula ΦT M is the conjunction of closed formulae:
(i) formula Φ1 : it does express that ordering < is linear and min is its first element;
(ii) formula Φ2 : Hq0 (min, min) ∧ ∀p.T0 (p, min); the initial state is q0 and the
tape contains only blanks (zeros);
(iii) formula Φ2 : ∀ p, t.(T0 ( p, t) ⊃ ¬T1 ( p, t)); at each position and at each step, the
cell may contain either zero (be blank) or 1;
(iv) formula Φ3 : ∀t.∃!. p.( q∈Q Hq ( p, t)) ∧ ¬∃ p.¬∃t.( q=q (Hq ( p, t) ∧ Hq
( p, t))); at each
position and at each step, TM is in only one state;
(v) a collection Φ4 : I ∈δ Φ I of closed formulae, one for each instruction I of TM
which does express the change in instantaneous description of TM under the
instruction I ; we omit these formulae as they are quite obvious and examples
are given in Chap. 1in section on Computability;
(vi) a formula φ5 : ∃ p, t. q∈Q acc ∪Qr ej Hq ( p, t); it expresses that at ( p, t) TM reaches
a halting state.
Then, TM halts on the empty input if and only if ΦT M has a finite model consisting
of values of the final configuration. As the Halting problem is undecidable so is the
satisfiability problem over finite models.
Corollary 8.1 For each relational vocabulary Σ with at least one binary predicate,
the set of finitely valid closed formulae is not recursively enumerable.
hence, the set of finitely satisfiable closed formulae would be recursive i.e. decidable,
a contradiction.
The interplay between SO and the NP complexity class was discovered by Fagin
[8, 16]. His result brings forth a logical characterization of the complexity class NP.
The context of this result is as follows.
As with MSO, for SO we have an analogous notation: ∃SO is the class of SO
formulae in which second-order quantifiers are exclusively existential ones, and,
∀SO contains formulae in which second-order prefix consists solely of universal
quantifiers.
Theorem 8.18 (Fagin)) ∃SO = NP.
Proof A witness for satisfiability of a formula ∃.C1 , C2 , . . . , Ck .φ with φ a first
order formula along with a selected structure A can be checked in polynomial time
(cf. Immerman [10] for details). This shows that ∃SO ⊆ NP.
The converse is proved on lines similar to those used in the proof of the Trakhten-
brot theorem: we have to render NP in logic ∃SO. We select a natural number k such
that for any structure of n elements, the encoding of it in Turing Machine requires
size of no more than n k .
We owe then information on encodings. Assume a relational vocabulary Σ con-
sisting of elements a1 < a2 < . . . < an , where < is a linear ordering on A.
For a relational symbol Pi of arity pi , we consider all arrangements of elements
of A resulting from ordering <, their number n pi . Let us denote elements of this
ordering as a1 , a2 , . . . , an pi .
For each j ≤ n pi , define the j-th bit of the encoding E(Pi ) as 1 in case a j ∈ Pi ,
else 0. To inform the machine about the size of A, the string 0n 1 is used, hence,
the full encoding of the structure A is the concatenation of all encodings, m pi i.e,
0n 1E(P1 )E(P2 ) . . . E(Pm ). The size of this encoding is (n + 1) + i=1 n . The
parameter k is sufficiently large to make n k greater than the size of the encoding.
Turing machine TM is a non-deterministic one-way polynomial time machine
(Q, Σ, Δ, δ, qo , Q acc , Q r ej ) already introduced in proof of Theorem 8.17.
That TM accepts encodings of structures over Σ is witnessed by a formula Λ of
the form ∃L , T0 , T1 , T2 , Hq0 , Hq1 , . . . , Hqm−1 φ, where Q = {q0 , q1 , . . ., qm−1 } and φ
is a closed formula in the vocabulary Σ ∪ {L , T0 , T1 , T2 } ∪ {Hq : q ∈ Q}.
Let us observe that by the nature of encodings, position p and time t refer to
segments conforming to lengths of a’s.
As with Theorem 8.17 we give interpretation of predicates:
(i) L is a linear order on the domain of the structure;
(ii) T0 , T1 , respectively, indicate at given p, t whether the symbol is 0 or 1, T2
indicates that at ( p, t) is blank;
(iii) Hq ( p, t) tells that at time t, TM is in state q and Head is at position p.
Λ must conform to computation of TM on encoding of the structure and its
halting. We can borrow from proof of Theorem 8.17. the following closed
formulae and define Λ as their conjunction:
8.6 FO+Inductive Definitions. Fixed Point Logics 415
Inductively defined relations give first-order logic more expressive power and locate
first-order logic augmented by them between first-order and second-order logic. This
yields more information about relations of first-order to second-order logic. The idea
of incorporating fixed points into logic was put forth in (Chandra and Harel [18]).
Example 8.2 (Transitive Closure (TC)) We know that the property CONN of a
graph being connected is not expressible in FO. We define the relation TC of tran-
sitive closure on the class of directed finite graphs. The inductive definition of
TC begins with the binary relation E of an edge, and we let T C(x, y) ≡ [(x =
y) ∨ ∃z.E(x, z) ∧ T C(z, y).
Theorem 8.19 TC is not definable in first-order logic.
Proof Indeed, were TC expressible in FO by a formula φ, CONN would be express-
ible by means of the formula ∀x, y.φ(x, y).
Definition 8.25 (Fixed point operators LFP, GFP) We recall the fixed-point the-
orem Theorem 1.2 due to Knaster-Tarski; it asserts the existence of a fixed point a
for an isotone (i.e., monotonically increasing) auto-mapping f : A → A on a com-
pletely ordered lattice (A, ≤).
416 8 Beyond FO Within SO
The fixed point in this case is obtained as the l.u.b. of the sequence
as certainly 0 ≤ f (0), the sequence (*) is increasing and a = l.u.b. of the set { f k (0) :
k ≥ 0} satisfies the condition a = f (a) which defines a fixed point F P0 ( f ). Clearly,
for each x ∈ A such that x ≤ f (x), and this inequality holds in the context of the
Knaster-Tarski theorem, the procedure may be repeated yielding the sequence (∗)x :
( f k (x))∞
k=0 and the fixed point l.u.b.{ f (x) : k ≥ 0} denoted F Px ( f ).
k
In case 0 < x, each term in sequence (*)is smaller than the corresponding term
in the sequence (∗)x , hence, F P0 is not greater than F Px : FP(0) is the least fixed
point denoted LFP(f) or simply LFP. Consider, under same assumptions, for a finite
A, the set (ai )i∈I of fixed points along with a = l.u.b.{ai : i ∈ i}. Were a ≤ f (a),
it would yield a fixed point b ≥ a, hence, b = a and a = f (a) so a is the greatest
fixed point of f , denoted GFP( f ).
This abstract version underwent an adaptation to the particular but most important
case of the complete Boolean field 2 A of the set of all subsets of a set A.
A mapping Φ : 2 A → 2 A is isotone if X ⊆ Y implies Φ(X ) ⊆ Φ(Y ) for X, Y ⊆
A. Then Φ has the least fixed point LFP(Φ) defined as the least upper bound of the
sequence ∅, Φ(∅), Φ 2 (∅), . . ., i.e., as the set ∞n=0 Φ n
(∅).
As shown by Knaster and Tarski, for any isotone Φ, the containment X ⊆ Φ(X )
holds, and beginning with any X , we can define an increasing sequence (Φ n (X ))∞ n=0
of sets with l.u.b.{Φ n (X ) : n ∈ N} being a fixed point of Φ. Hence, we witness the
existence of a non-empty set Fi x(Φ) of fixed points of Φ.
Clearly, LFP(Φ)= {X : Φ(X ) = X }= {X : Φ(X ) ⊆ X }. To see that the last
equality holds, consider the family of sets F(Φ)={X : Φ(X ) ⊆ X } and let Y =
F(Φ). Then Y ⊆ X for each X ∈ F(Φ), hence Φ(Y ) ⊆ Φ(X ) ⊆ X , hence
Φ(Y ) ⊆ Y , and as Φ ( Y ) ⊆ Φ(Y ), Φ(Y ) ∈ F(Φ), hence Φ(Y ) = Y and Y is LFP.
We denote by GLP(Φ) the set {X : Φ(X ) = X }={X : X ⊆ Φ(X )}, the largest
fixed point of Φ. The proof of the last equality follows the lines of the respective
proof for LFP.
The Logic LFP is (FO+LFP+ GFP). As LFP and GLP are dual to each other,
which we demonstrate later on, we focus on LFP, omitting GLP from the styling of
the logic.
Definition 8.26 (Positive occurrences) We say that a relational symbol R occurs
positively in a formula φ if and only if each occurrence of R in φ is in the scope of an
even number of negation signs. This condition secures that formulae with R induce
isotone mappings.
Definition 8.27 (Syntax and semantics of LFP) Consider a relational vocabulary Σ
of a finite structure A over the domain A. For a relational symbol R ∈ / Σ, a formula
φ(R, x), defined over Σ ∪ {R}, in which R is positive, and a tuple x of variables,
of length equal to arity of R, the formula [LFP R,x .φ](t) is a formula of LFP, where
t is a tuple of terms of the same arity as that of x. Similarly, a formula of LFP is
[GFP R,x .φ](t).
8.6 FO+Inductive Definitions. Fixed Point Logics 417
Semantics of LFP
Free variables in the above LFP formulae are those free in φ and in t; variables in
x are bound. Assume that free variables are interpreted in the domain A and t is
A
interpreted as t .
We denote by Φ(φ) the operator on the domain A induced by φ (called the exten-
sion (or update) operator), defined for a subset C of A as Φ(φ)(C) = {x : (A, C, x |=
A
φ}. Then: A |= [LFP R,x .φ](t) if and only if t ∈ LFP(Φ(φ)); the analogous defini-
tion holds for A |= [GFP R,x .φ](t).
We can now address duality between LFP and GFP. This duality is expressed by
the formula
GFP R,x .φ](t ≡ ¬[ LFP R,x .¬φ(R/¬R)]((t).
The familiar to us relation of transitive closure can be defined in LFP:
Proof We include a short argument from (Immerman [10], 4.10), though based on
a few additional facts to be gathered from, e.g., (Immerman [10]).
A more elaborate proof on lines of proofs of Trakhtenbrot and Fagin theo-
rems can be found in Libkin [26]. Proof is divided into few claims. The role
of the alternating reachability a-REACH which is PTIME-complete (see Immer-
man [10], 3.26) calls for introducing it into FO(LFP) via an inductive definition.
Recall that the relational vocabulary in this case consists of an edge relation sym-
bol E, unary relation symbol A for universal vertices. Then, φ(R, x, y) ≡ (x =
y) ∨ (∃z.E(x, z) ∧ R(z, y)) ∧ (A(x) ⊃ ∀w.(x, w) ⊃ R(w, y)).
Then, a-REACH= [LFP R,x,y φ](s, t). As FO(LFP) contains a-REACH, by
PTIME-completeness of a-REACH (see Immerman [10], 3.26), FO(LFP) contains
all P problems and as FO(LFP) is closed on first-order reductions (please see Immer-
man [10], 3.11), it follows that PTIME⊆ FO(LFP). On the other hand, for each
formula [LFP R,X .φ] on a structure A of size n, the iteration φiR,A (∅) must stop up to
418 8 Beyond FO Within SO
We close for the time being the theme of LFP with the result that demonstrates
that FO(LFP) contains FO and is contained in ∃MSO.
There are some other concepts of fixed points. The constructions of those fixed
points rely on some forms of monotonicity extracted from the context of the Knaster-
Tarski theorem.
We begin with the notion of inductive fixed points (Gurevich and Shelah [21]).
Definition 8.29 (Inductive fixed points (IFP)) IFP, inductive fixed point is defined
for any relation symbol R of arity n, new to the relational vocabulary Σ of a structure
A and not necessarily isotone in a formula φ(R, (xi )n1 ).
In [21], a mapping f (R) = {(ai )n1 : φ(R, (ai )n1 ) is called inductive if and only if
the sequence of iterates f i (∅) is increasing. In that case, the g.l.b. of this sequence
is a fixed point called Inductive Fixed Point and denoted IFP. Logic FO endowed
with those operators is denoted (FO+ IFP) or, for short, FO(IFP).
The other feature of the Knaster-Tarski theorem is the relation x ≤ f (x). Such
mappings are called in (Gurevicz and Shelah [21]) inflationary.
Definition 8.31 (Partial fixed points) The final possibility for a finite domain A of
cardinality n is that for a mapping f : 2 A → 2 A the sequence
stabilizes at some k − th step, i.e., X k = X k+1 for some k < 2n . This means that
we have reached stability and we call X k the partial fixed point of f , denoted PFP;
otherwise, when for each k < 2n , we obtain that X k = X k+1 , we declare the absence
of partial fixed points.
Clearly, in the classical case of an isotone mapping f , LFP=IFP=PFP.
There is difference in treatment of LFP in comparison to IFP and PFP. The
Trakhtenbrot theorem implies that the property of being isotone is undecidable.
Steps X i in iteration of the mapping f are called stages. In particular X i is the
i − th stage. The stage comparison theorem (Moschovakis [17]) relates stages of
computation of a fixed point.
For a finite structure A, and a computation f (∅) = X 0 , f 2 (∅) = X 1 , . . ., where
f realizes φ(R, X ) with positive occurrence of R, we denote by [φ] the first k such
that X k = X ∞ = n X n which is the computed fixed point, be it LFP or IFP. For a
tuple x, we denote by the symbol [x]φ the first index k such that x ∈ X k if such k
exists, otherwise [x]φ = [φ] + 1.
Two relations ≺φ and φ defined in this context are:
(i) x ≺φ y ≡ [x]φ < [y]φ ;
(ii) x φ y ≡ [x]φ ≤ y]φ ∧ [x]φ ≤ [φ].
Theorem 8.22 (The stage comparison theorem) For an LFP formula φ, relations
≺φ and φ are LFP-definable.
For proof please see, e.g., (Moschovakis [17]).
In (Gurevich and Shelah [21], Appendix, Theorem 2), we find the following result.
Theorem 8.23 ([21]) For any finite structure, for an FO(LFP) formula φ(R, X ),
there exists a FO(LFP) formula π(φ, X ) which expresses the inductive fixed point of
the operator R → {X : R(X ) ∨ φ(R, X )}.
Corollary 8.2 ([21]) On finite structures IFP=LFP.
This result was strengthened to the full generality in Kreutzer [22].
Theorem 8.24 On any structure, each IFP-formula is equivalent to an LFP-
formula.
The equivalence in 8.24 can be formulated as:
We quote two more results on fixed point logics FO(LFP), FO(IFP) which capture
complexity classes due to Immerman [19] and Vardi [20].
420 8 Beyond FO Within SO
(iii) for a formula φ(y, x, i), the expression ∃≥i y.φ(y, x, i) in which the variable y
is bound, means that the number of elements a substituted for y and satisfying
φ(a, a, i ) for a given x/a and a given i/i is at least i.
The exemplary case is EVEN: the formula expressing the even number of
elements:
As the set I may be infinite, the power of this logic is too great for finite structures: it
is easy to write for each finite structure A a formula φA such that any finite structure
B which satisfies φA is isomorphic to A. Then for a class C of finite structures, the
formula C∈C φC is satisfied by each C ∈ C.
For this reason, the logic (FO+COUNT)in f has to be modified in a sense. On of
the means for modification is the notion of a rank, parallel to the notion of quantifier
rank in FO or in ∃MSO, which curtails the set of available formulae. The other is to
make up by enlarging the numerical domain to the whole set of natural numbers N.
We apply first the second of means.
Definition 8.37 (The logic(FO+Count)in f,ω ) The subscript ω informs about enlarg-
ing the set of numerical symbols to the set N. This causes some changes in syntax
and semantics. In formulae ∃i x.φ, the variable i may now take any numerical value
from N. A new class of numerical terms are terms of the form: #x.φ for a formula φ
and symbolic term x.
Semantics of the term #x.φ in which x is bound is: for φ(x, y, i) and y/b, i/ j the
number #x.φ(x, b, j) is the number of tuples a which satisfy φ(a, b, j).
Logic (FO+Count)in f,ω , can express each property of finite models and its power
has to be diminished by the first of the means: a reduction of the set of allowed
formulae. This is done with help of the notion of a rank.
Definition 8.38 (Rank in infinitary counting logic) Rank is defined by the following
rules.
(i) rank(t)=0 for a term t or numerical symbol k ∈ N;
(ii) rank(φ) = 0 for any symbolic atomic formula;
(iii) rank (t1 = t2 ) = max{rank(t1 ), rank(t2 )} for terms t1 , t2 ;
422 8 Beyond FO Within SO
∗
Definition 8.39 (The logic(FO+Count)in f,ω ) It is the logic with infinitary connec-
tives which is allowed only terms and formulae of finite ranks.
∗
The logic (FO+Count)in f,ω contains FO, (FO+ Count) and it allows to define
cardinalities of subsets of Cartesian products of finitely many copies of N. Actually,
see (Libkin [26], 8.10): every property of finite ordered sets can be expressed in
∗
(FO+Count)in f,ω .
∗
As with FO and MSO, the expressive power of (FO+Count)in f,ω can be charac-
terized by means of a game analogous to Ehrenfeucht games for FO and MSO cf.
Hella [28], Libkin [26].
As with earlier Ehrenfeucht games, the effect of Duplicator’s winning strategy in the
∗
game BGm is an agreement of A and B on closed formulae of (FO+Count)in f,ω of
↔
rank m, denoted A ≡m B.
Proof We include a proof. The proof is close to earlier proofs for Ehrenfeucht games
and we include it to show some new features of the counting logic. We denote by m
the rank of a formula and by q the length of a tuple x.
1. Proof that (i) implies (ii). By induction on m. For m = 0 we have the case of
the Ehrenfeucht game so the implication holds. Suppose that the implication holds
for a given m and consider the case of m + 1.
Assume that (∗) A ∼ =↔m+1 B holds. Consider a closed formula ψ : ∃nx.φ(x) for
some n ∈N and assume that A |= ψ. There exist a1 , a2 , . . . , an ∈ A such that A |=
φ(ai ), each i. By (*),there exists a bijective mapping f : A → B with the property
that (A, a) ∼ =↔ ∼↔
m (B, f (a)) for a ∈ A, hence, in particular, (A, ai ) =m (B, f (ai )) for
i = 1, 2, . . . , n.
By hypothesis of induction, (A, ai ) ≡↔ m (B, f (ai )), each i ≤ n and A |= φ(ai )
implies B |= φ( f (ai )). As all f (ai ) are pairwise distinct, B |= ∃nx.φ(x). The con-
verse is obtained when we replace f with f −1 and repeat the argumentation. As each
closed formula of rank m + 1 is a combination by Boolean and counting operators
of formulae ∃nx.φ(x), the proof from (i) to (ii) is concluded.
2. Proof that (ii) implies (i). We recall the notion of a type of a formula. For a
q
structure A and a tuple a = (ai )i=1 of elements of the domain A of A, and for a
given m, the m, q-type of a, t ypem,q (a), is the set {φ : rank(φ) ≤ m ∧ A |= φ(a)}.
0,q
Returning to the proof, let (ξi (x))i∈N be an enumeration of all formulae that
define types of tuples for x of q elements. Each such formula is the conjunction of
a final set of atomic formulae and their negations valued on x (it is what is called a
complete open description, cf. VIII.11). We proceed by induction on rank m.
m+1,q
We define the enumeration (ξi (x))i∈N all of all extension formulae of the
following form (we recall that ∃!x... means that there exists a unique x satisfying ...):
m,q+1 m,q+1
(∗∗) [∃! f 1 y.ξi1 (x, y) ∧ . . . ∧ ∃! f p y.ξi p (x, y)]∧
p m,q+1
[∀y.∃ j=1 ξi j (x, y)],
where p ∈N, (i 1 , i 2 , . . .
, i p ) ranges over tuples over N.
It follows that |A| = { f i : i ≤ p}. For the pair (A, a ∈ Aq ), there exists a unique
m,q m,q
ξi such that A |= ξi (a).
It is the task now to verify the following Claim.
Claim. If for structures A and B, m ∈N, m-tuples a over A and b over B, there exists
a formula ξi (x) such that A |= ξi (a) and B |= ξi (b), then (A, a) ∼ =↔
m,q m,q m,q
m (B, b).
m,q+1
{a ∈ A : A |= ξi j (aa)}
424 8 Beyond FO Within SO
and
m,q+1
B j = {b ∈ B : B |= ξi j (bb)}.
on a class of directed finite graphs with vocabulary {E}, where E is interpreted as the
relation e of an edge. This archetypal example can be extended to any binary relation
on a (finite) universe. In Theorem 8.19, we found that TC was not FO-definable.
We now introduce a new class of games, called pebble games, which correspond
to logics with finitely many individual variables.
Pebble games Immerman [30], Poizat [31] are a variant of Ehrenfeucht’s games as
the criterion for winning strategy is a partial isomorphism of obtained structures in
each round of each party. The context and rules of the game are similar to those in
Ehrenfeucht’s games.
Definition 8.43 (The setting and moves in pebble games) For two (finite) structures
A and B over domains, respectively, A and B, and for a given parameter k, Spoiler
and Duplicator play parties of the game G kP (A, B) which may last for some number
n of rounds, or go for infinitely many rounds, hence, we have, respectively, games
k,in f
G k,n
P (A, B) or G P (A, B).
Players begin with a set of k pairs of pebbles
Moves by players are as follows: moves by Spoiler consist in taking a pebble for a
chosen index 1 ≤ i ≤ k from either A or B (let us denote the chosen set by X and
the other set by Y) and placing it on an element of the chosen set X in case pi (X )
has not been used yet; otherwise, Spoiler can leave the pebble on the already chosen
element of X or pick it and place on an another element of X ;
Response by Duplicator consists in picking the pebble pi (Y ) and placing it on
some element of the domain Y .
The alternating moves by Spoiler and Duplicator last for some n rounds or go for
infinite number of rounds.
The effect of each round j is a pair (a j , b j ) in A × B, and the effect of a sequence
of m rounds is a partial relation Rm = {(a j , b j ) : j ≤ m}.
The proof is on lines of former proofs for this kind of statements, notably it applies
a version of forth-and-back property, k-forth-and-back property, due to Ion Barwise.
For a proof, due to its length, consult, e.g., (Libkin [26], 11.5). We insert a corollary
to 8.31.
ω
Corollary 8.3 EVEN is not definable in FOin f.
ω
Proof Suppose that a formula φ ∈ F Oin f defines EVEN. For a natural number k
such that φ ∈ F Oin f , consider a set X with |X | = k and a set Y with |Y | = k + 1.
k
We recall the notion of a Gaifman graph. For a structure A with domain A and a
vocabulary of finitely many relational symbols R1 , R2 , . . . , Rk interpreted as rela-
tions R1A , R2A , . . . , RkA , the Gaifman graph G(A) is the graph (A, E) with vertices
as elements of the domain A and edges defined as follows. For x, y ∈ A, E(x, y)
holds if and only if
Thus, G(A) defines an undirected graph and condition (i) add loops.
For instance, consider a single binary relation R; the formula φ R (x, y) ≡ (x =
y) ∨ (R(x, y) ∨ R(y, x)) describes in FO the graph G(A).
Definition 8.46 (Gaifman’s metric structure revisited) In a Gaifman graph, one may
introduce a topological, actually a metric, structure by introducing the notion of a
distance and of a neighborhood. The notion of distance is as usual for graphs, i.e, as
the length of the shortest path, which can be defined by induction as a function d:
Conditions (i), (ii) can be expressed by means of an FO formula, denoted φrd (x, y).
Then, we can define formulae φ≤r ≥r
d (x, y), φd (x, y), and analogously for < r , and
> r . A general form of FO formula φd (x, y) can be
r
(x = y) ∨ φ≤(r
d
−1)
(x, y) ∨(∃R k .∃(a1 , a2 , ...ak ) ∈ R k ∧ ∃i, j.(x = ai ∧ y = a j )).
A Query Q is FO-definable if and only if there exists a formula φ with the property
that Q(A) = {a m : φ(a m )}.
Definition 8.49 (Structures induced within balls) Each ball B(x, r ) does induce the
structure N A (a n , r )}, where the domain is B(a, r ), a n = (a1 , a2 , . . . , an ) interprets
constants ci for i ≤ n, and each relation R A is restricted to B(a, r ).
We now introduce notions of localities based on, respectively, Hanf and Gaifman
theorems.
The numerical parameter hlr plays the role of a rank cf. (Libkin [26]).
Definition 8.52 (The Hanf locality rank hlr) hlr(Q) is the least r which fulfills
Definition 8.51.
8.10 Definability Versus Locality 429
Theorem 8.32 (Hanf locality based criterion for definability) A Query Q in a lan-
guage L is not FO-definable if
(i) each query definable in language L is Hanf-local;
(ii) query Q is not Hanf-local.
The least r with the property in Definition 8.53 is denoted glr(Q) and it is called the
Gaifman locality rank.
A corollary follows.
then
(A, ac) ≡r (B, b f (c))
These laws introduce a probabilistic factor into logic. They resemble, in the FO
entourage, the probabilistic interpretation of satisfiability in sentential logic by
Łukasiewicz, extended by Polkowski to mass assignments in the framework of mere-
ology (see Chap. 7). Let us outline the context. We consider finite models. Let P be
a finite set of relational symbols and let Mn denote the set of all P-structures with
domains of cardinality n. Let Mn be the generic denotation for a structure in Mn .
Consider a Mn -sentence φ. Define an estimate μn (φ) of probability that a ran-
domly selected in Mn structure will satisfy φ. Assuming the uniform probability
distribution, we let
|{Mn ∈ Mn : Mn |= φ}|
μn (φ) = .
|Mn |
Definition 8.54 (Probability μ) For a formula φ over n Mn , we define the prob-
ability of φ as
μ(φ) = lim n μn (φ).
Definition 8.55 (0-1 law) A language L obeys the 0-1 law if for each L-formula φ
either μ(φ) = 0 or μ(φ) = 1.
That FO obeys the 0-1 law was proved independently by (Glebskii et al. [35]) and
by Fagin [36]. We include a proof by Fagin [36].
Definition 8.56 (Complete open descriptions) We denote by the symbol xn an n-
tuple (x1 , x2 , . . . , xn ) of individual variables. We consider vocabulary P, and we
introduce constants 1, 2, . . . , n, . . . interpreted as, respectively, 1, 2, . . . , n with the
proviso that each j for j > n is interpreted as n.
For a set {x1 , x
2 , . . . , x m } of individual variables, denoted as xm , we define a
formula C(xm ) as {χ : χ ∈ C}, where C contains for each relational symbol P in
the vocabulary P and each tuple zk selected from xm either the conjunct P(zk ) or
the conjunct ¬P(zk ) and only one of the two.
The formula C(xm ) is called a complete open description.
Definition 8.57 (Extending formulae) An extension to C(xm ) is the formula
C E(xm , y) in which besides all conjuncts of C(xm ) new conjuncts involving pred-
icates from P on variables {x1 , x2 , . . . , xm , y} and conjuncts y = xi for each i are
present.
We define now extension formulae Gaifman [37].
Definition 8.58 (Extension formulae) An extension formula is of the form,
φG : ∀xm (( xi = x j ) ∧ C(xm )) ⊃ ∃y.(( y = xi ) ∧ C E(xm , y)).
i= j i
We depart for a while from the main track in order to recall the notion of a complete
theory.
The Łoś -Vaught test, see, e.g., Łoś [38] sets a criterion for a theory to be complete.
Proof Suppose that a theory T satisfies assumptions yet it is not complete. hence,
for some formula φ of L it is not true that T |= φ and it is not true that T |= ¬φ,
hence, both sets T ∪ {¬φ} and T ∪ {φ} have models, which must be infinite. By the
upward Löwenheim-Skolem theorem, both sets have models in cardinality κ, which
contradicts the assumption that T is categorical in κ.
We now return to the main track by stating and recalling a proof of the Fagin’s
theorem Fagin [36] leading to the conclusion that FO satisfies the 0-1 law.
Theorem 8.39 (FO satisfies the 0-1 law) For any FO-sentence ψ over the vocabulary
P, if TG |= ψ, then μn (ψ) converges to 1.
Proof Without loss of generality, one may assume that the vocabulary P = {P}. By
maximal consistency of TG , to be proved finally in Theorem 8.42, it is sufficient to
prove the following
Claim. If φ ∈ TG , then μn (φ) →n 1.
The idea of proof is the following: as μ(φ) + μ(¬φ) = 1, if we prove that μ(¬φ =
0), then by compactness property, we find a finite set T = {ψ1 , ψ2 , . . . , ψq } in TG
such that T |= φ, hence, ¬φ ⊃ (¬T ) and then μ(¬φ) ≤ μ(¬ψ1 ) + μ(¬ψ2 ) +
. . . + μ(¬ψq ) = 0 + . . . + 0 = 0, hence, μ(φ) = 1.
Proof of Claim. We pass to negation: let φ∗ (xm ) be the formula
C(xm ) ∧ ∀y.(( i (y = xi ) ⊃ ¬C E(xm , y).
where for i = 1, 2, . . . , m,
(2i-1) α2i−1 is P(i, y) in case P(xi , y) is a conjunct in C E(xm , y);
(2i-1*) α2i−1 is ¬P(i, y) in case ¬P(xi , y) is a conjunct in C E(xm , y);
(2i) α2i is P(y, i) in case P(y, xi ) is a conjunct in C E(xm , y);
(2i)* α2i is ¬P(y, i) in case ¬P(y, xi ) is a conjunct in C E(xm , y);
(2m+1) α2m+1 is P(y, y) in case P(y, y) is a conjunct in C E(xm , y);
(2m+1)* α2m+1 is ¬P(y, y) in case ¬P(y, y) is a conjunct in C E(xm , y).
For n > m and an extension formula φG of 11.5,
μn (¬φG ) =
= μn (∃x1 x2 ...xm ( i= j (xi = x j ) ∧ C(xm ) ∧ ∀y.(( i y = xi ) ⊃ ¬C E(x m , y))))
= μn (∃x1 x2 ...xm ( i= j (xi = x j ) ∧ φ∗ (xm ))) =
≤ all substitutions xi /ai μn (φ(a1 , a2 , . . . , am )) = Πn−m+1
n μn (φ(1, 2, . . . , m))
≤ n μn (φ(1, 2, . . . , m)) ≤ n μn (∀y.(( i y = xi ) ⊃ χ(y)))
m m
(due to provability of (φ(1, 2, . . . , m) ⊃ ∀y.(( i y = xi ) ⊃ χ(y))) =
1
n m Πi=m+1
n
μn (χ(i)) = n m (1 − )n−m
22m+1
(the last estimate due to the number of conjuncts in which xi may appear; let q =
1 − 22m+1
1
)=
n m q n−m →n→∞ 0
(to see this let n = x and apply the l’Hôpital rule with the real number x for m times
to get m!q n after returning to n; q n tends to 0 at infinity).
As μ(¬φ) = 0, μ(φ) = 1. The proof is concluded.
Proof It holds by completeness of TG : suppose that μ(φ) = 1 and ¬(T |= φ). Then,
by completeness, T |= ¬φ and by 11.9, μ(¬φ) = 1, hence, μ(φ) = 0, a contradic-
tion.
Now, we may extends the results of Theorems 8.39 and 8.40 over FO.
Remark 8.5 The Fagin theorem does not hold for FO+ordering, counting possibil-
ities as witnessed by query EVEN. An interesting consequence of the Fagin theorem
is the existence of finite models of almost (i.e., save for a finite of them) any finite
cardinality for finite sets of extension axioms.
Theorem 8.42 (Fagin loc.cit.) For any finite set TG∗ ⊆ TG there exists a natural
number n 0 such that for each n ≥ n 0 TG∗ has a model of cardinality n.
Proof Suppose that |TG∗ | = k. As μ(¬φ) = 0 for each φ ∈ T ∗ , there exists n 0 with
the property that for each n ≥ n 0 and each φ ∈ TG∗ , the inequality μn (¬φ) < k1 . As
it follows that μn ( φ∈T ∗ φ) > 0 for n ≥ n 0 .
It follows by Theorem 8.42 that each extension axiom has models of almost any
finite cardinality with exception of only finitely many finite cardinalities of models.
It is called the co-finite spectrum property.
Definition 8.60 (BIT, random graph) The relation BIT on N×N which interprets
the predicate BIT is BIT(i,j)=1 if and only if the j-th bit in the binary expansion
of i is 1. BIT(i,0) means that i is odd. It is known that (FO+ BIT) = (FO + PLUS,
TIMES), i.e., BIT introduces arithmetical operations into FO structures (and vice
versa) cf. (Immerman [10]).
A random graph (RG) (Erdös, Rényi [39]), Radó [40] is the graph on vertices
in the set V =N and edges are defined by means of BIT as follows: (i, j) ∈ E ≡
BIT(i, j) = 1.Clearly, j < i and RG is directed.
When working with RG, our single relational symbols is E interpreted as the
relation e. Extension axioms acquire the following form: for n > m, the extension
formulae are of the form
n
m
n
φ RG : ∀xn ( (xi = x j )) ⊃ (∃y.( (y = xi ) ∧ E(y, xi ) ∧ (¬E(y, xi ))).
i= j i=1 i=1 i=m+1
We need to prove that the set TRG of extension formulae of the form φ RG is
categorical in ω (the proof will obey TG as well).
Theorem 8.43 TRG is categorical in cardinality ω.
Proof The proof makes use of the known from our discussion of the Ehrenfeucht-
Fraïssé theory forth-and-back technique. This time, our Ehrenfeucht game is to be
infinite.
8.13 Games on Graphs and Transition Systems 435
Let (M, E) be another model for TRG . Suppose that after m moves the players
achieved a partial isomorphism ((ai )m 1 ; (bi )1 ) and Spoiler selects ai+1 ; as RG sat-
m
isfies TRG , Duplicator can select using an appropriate extension formula, bi+1 such
that E(a j , ai + 1) ≡ M |= (b j , bi + 1) for each j ≤ i. In this way, we provide an
isomorphism between RG and M.
As with Theorem 8.39, we have a specialization: T (RG) |= φ ≡ μ(φ) = 1. As
TR G is recursively axiomatizable, being complete, it is decidable.
Decidability of T (RG) implies that: for a sentence φ of FO, the decision problem
whether μ(φ) = 1 is decidable.
Example 8.4 SO does not obey 0-1 law. The following is an example Fagin [36]:
consider an n-structure and a single binary relational symbol P. For the formula
φ : ∃P.[∀x.∃!y.((x = y) ∧ P(x, y) ∧ P(y, x))]. (! means ‘the unique’), we have
(i) μn (φ) = 0 for n odd and
(ii) μn (φ) = 1 for n even.
We have already witnessed the role which strategic games play in the theory of
models: Ehrenfeucht games, bidirectional games, pebble games are vital in studies
of many aspects of finite structures and FO structures. One may call these games
symbolic even if some of them like pebble games visualize their context. Yet, strategic
games from the beginning exploited graphs as witnessed by trees of games in the
sense of von Neumann-Morgenstern. Notions and concepts like that of a strategy, of
deterministic game, value of the game, were elaborated in that milieu.
We have here an occasion to discuss games in a more general fashion, in order to
single out their common features.
The existence of important games on transition systems like Parity games prompts
us to dedicate some space to this topic.
Definition 8.61 (The architecture of a game on a graph) In spite of differences
among various games on graphs, there are basic common solutions to construction
of the stage for the game. First a graph G = (V, E) is given and next two players
enter, player 1 and player 2, so it is a 2-person game. Graph G is directed, pointing
at direction of moves from a position to the next position, and the set V of vertices
is partitioned into two non-empty subsets V1 and V2 , with the intent that player 1
makes moves at vertices in V1 and player 2 makes moves at vertices in V2 .
There is a vertex vinit which is the starting point for a play of the game; a play is
then a sequence vinit , v1 , v2 , . . . of vertices, and each pair (vi , vi+1 ) is an edge in the
set E. Limiting cases are when each player plays solely on own vertices so the play
goes on V1 × V1 ∪ V2 × V2 and when each player may be compelled to select a move
leading into the territory of the opponent so the play goes on V1 × V2 ∪ V2 × V1 .
436 8 Beyond FO Within SO
Definition 8.63 (Winning strategies, positions and regions) Once a criterion for win
in a play is defined, one can discuss the notion of a winning strategy. A player has
a winning move strategy if and only if player wins every party of the game playing
accordingly to the strategy move. A winning position is the position vinit from which
player has a winning strategy. A winning region for a player is the set of its winning
positions.
For the game Γ played on the graph G, we denote as (Γ, v) the party of Γ with
v = vinit . There are Queries about graph games and we address the Query GAME
cf. Grädel [41].
Definition 8.65 (Parity game) A Parity game is a game played on transition systems
and their importance stems from their role in model checking for mu-calculus. Its
signature is (G, V , E, V1 , V2 , P, f ), where the relational symbol P is new and
it denotes a finite set of priorities called also ranks, a subset of N. Additionally,
a function f : P → V is given which is an assignment of priorities to vertices of G.
Theorem 8.44 (Positional Determinacy Theorem) For each Parity game, the set of
positions can be split into two disjoint sets W1 , W2 such that Player 1 has a positional
strategy f winning on W1 and Player 2 has the positional strategy g which is winning
on W2 .
Introduced in Kozen [45], Lμ adds to sentential modal logic SML fixed-point opera-
tors LFP and GFP. We recall that SML is a rendition of FO in a modified guise with
universal operator defined as necessity, denoted by us L, and existential operator
defined as possibility, denoted by us M. Chapter 4 brings a discussion of SML.
The logical language in which we define mu-calculus contains a set P =
{ p, q, r, . . .} of atomic propositions, a set V ar = {X, Y, Z , . . .} of variable names,
both sets potentially infinite, and a set L = {a, b, c, . . .} of labels (often called
actions).
In order to establish a general setting for Lμ , we adopt as our Kripke models of
Chap. 4 labelled transition systems (see Chap. 1). A labelled transition system (alias
a labelled Kripke model), is a structure T = (S, tr, L, A), where S is a set of states,
tr: S × L × S is a transition relation, A is an assignment P → 2 S , and L is a set of
labels. The usual notation for instances of transitions is s −
→a t for a ∈ L and s, t ∈ S.
Second-order variables are mapped to subsets of the set S of states: X → S X .
(iv) if φ, ψ ∈ Fm , then φ ∧ ψ, φ ∨ ψ ∈ Fm ;
(v) if φ is a formula, then ¬φ is a formula;
(v) for modal symbols L , M, and a ∈ L, if φ ∈ Fm , then L a .φ, Ma .φ ∈ Fm ;
(vi) for φ ∈ Fm , X ∈ V ar , and, symbols μ, ν, expressions μX.φ, ν X.φ ∈ Fm .
Instead of and ⊥, in that area symbols tt for and ff for ⊥ are used.
It follows that, intuitively, μX expresses that some event may eventually materi-
alize, i.e., the liveness property. In literature one may find the phrase: ‘mu is finite
looping’ in the sense that μ allows only finitely many steps. In contrast, by duality, ν
is ‘an infinite looping’and it does express the safety property. We know that temporal
logics provide the language in which these properties are expressed, hence, it comes
as no wonder that Lμ contains CTL*, CTL and LTL.
Lμ , by usage of monadic second order variables, belongs in MSO. Let us bring a
few examples on CTL formulae and system properties expressed in Lμ .
Example 8.6 Let us consider some Lμ formulae, cf. (Bradfield and Stirling [46]);
(Bradfield and Walukiewicz [47]).
(1.) ν X. p ∧ L a .X .
(2.) μX. p ∨ L a .X .
(3.) μX. p ∨ (q ∧ Ma .X ).
(4.) μX. p ∨ (q ∧ ML X ).
(5.) ν X.(μY. p ∨ ML .Y ) ∧ L L .X .
Using metaphors of finite or infinite looping, we disentangle the intended meaning
of formulae 1-5.
For formula 1., the meaning is ‘p holds always on each infinite a-path’, i.e. AG p.
For formula 2., the meaning is ‘p eventually holds on each a-path’, i.e., AF p.
For formula 3., the meaning is ‘on an a-path q holds until p holds’.
For formula 4., the meaning is ‘on some path q holds until p holds, i.e. EqU p.
For formula 5., the meaning is ‘on each path it is possible always that p holds’,
i.e. AGEF p.
Theorem 8.46 Modal mu-calculus has the small model property: for each satisfiable
formula there exists a finite model of size exponential in the size of the formula, hence,
mu-calculus is decidable.
We abstain from the proof, carried in the setting of automata (Street, Emerson) or
tableaux (Bradfield, Stirling).
Our metaphor of looping tells that the formula μX.L a X means that there are only
finite length a-indexed paths. We may see approximations over ω:
(1) μ0 X.L a X : ∅, ⊥ (or, ff);
(2) μ1 X.L a X : L a .∅, s in this set if and only if s has no a-edge;
(3) μ2 X.L a X : L a .L a .∅, s in this set if and only if s has no a-path of length 2;
(4) ....
Definition 8.69 (Well-named formulae. Alternation depth) A formula is well-named
if and only if bound and free variables are distinct and if each variable can be bound
in a formula at most once. For a formula φ, and variables X, Y , we write X ≤φ Y if
X is free in a sub-formula (.)Y.ψ(Y ) with μ or ν in place of dot (.).
The alternation depth of a mu-variable X in a formula φ is the maximum of lengths of
linearly ordered by the relation ≤φ sequences (X i )i such that X 1 = X , even indexed
X i s are ν-variables and odd-indexed variables are μ-variables. For ν-variables the
definition mirrors that for mu-variables. The alternation depth of a formula φ, denoted
ald(φ), is a maximal alternation depth of variables bound in φ.
This definition is explained simply in [47], ald(X) is the number of alternations
between mu and nu in the prefix of the formula. In [47] we find examples, e.g., the
formula
μ.X (νY.( p ∧ Ma .Y )) ∨ Ma .X has ald(X)=1
and for the formula
νY.μX.( p ∧ Ma .Y ) ∨ Ma .X , ald(X)=2.
Definition 8.70 (Parity games in model checking via L μ ) We return to parity games.
For the purpose of the next section, we introduce a bit more general and at the same
time better adjusted to mu-calculus case notion of a graph game played by two players
on the graph G. The signature of the game is
(V, V1 , V2 , →⊆ V × V, Acc),
T , V, s |= μα X.φ(X ).
8.16 DATALOG
We have met Horn clauses on many occasions and now we meet them in a logical
structure of DATALOG.
Heads of rules do not occur in the vocabulary Σ, each of the formulae γi is an atomic
formula R(x, y) for a relational symbol R ∈ Σ or an atomic formula P(x, y) for P
a head of some rule. A set of rules is a DATALOG program along with a head Q of
a rule in the program which is the predicate computed by the program.
Definition 8.72 (Semantics of DATALOG) Consider a DATALOG program:
In this program heads P j may be each a head to few rules. Suppose that a head P j is
a head to rules
ju
n
Z j = {a ∈ An j : A, Y1 , Y2 , . . . , Yk |= ∃yu . γu, j (x, yu ).}
u=1 j=1
Let us denote for precision’s sake the program as PROG. Then the opera-
tor F will be denoted more precisely as F(PROG) and it will induce the fixed
point LFP(F(PROG)) as the limit of the sequence F(PROG)(∅), F(PROG)2 (∅), . . .
LFP(F(PROG))=(LFP(P1 ), …, LFP(Pk )).
We have obtained a simultaneous fixed point LFPsim . It turns out that LFPsim
is equivalent to a single LFP. The argument for this statement bears the name of
the Bekić lemma. The context is usually set in the case of two operators for trans-
parency’sake. We consider first the case of set operators.
444 8 Beyond FO Within SO
G LFP(F) (LFP(G)) =
we have
It follows that
LFP(Ψ )⊆ LFP(F) because of (ii) and the known to us definition
LFP(Ψ ) = {Z : Ψ (Z ) ⊆ Z }. It remains to prove the converse inclusion. The proof
that LFP(F)⊆ LFP(Ψ ) is by induction on stages F α of construction of LFP(F).
For ordinal number α = 0, the inclusion holds. Suppose that hypothesis of induc-
tion for α holds and consider α + 1.
We have F α+1 =F(F α , G α ) ⊆ F(LFP(Ψ ), LFP(G LFP(Ψ ) ) = LFP(Ψ ).
Similarly,
As for limit ordinals, we have the union, the inclusion holds. We conclude the proof
of the Claim.
Returning to DATALOG, we consider the case of relation operators. Again, it is
sufficient to restrict ourselves to the case of two operators. We consider the system
A and two formulae (a) R(x = φ(R, Q), (b) Q(y) = ψ(R, Q).
The system Γ : (a), (b), induces over A two operators:
(i) F : (R, Q) → {a : A |= φ(R, Q, a)};
(ii) G : (R, Q) → {a : A |= ψ(R, Q, a)}.
In the notation of Claim, we have A |=LFP(R)(a) if and only if (a) ∈LFP(F). Fol-
lowing the notation of Claim, we define the mapping G R : Q → G(R, T ) and the
mapping Ψ : R → F(R, LFP(G R )) defined via the formula φ(R, [LFP Q,y .ψ]).
8.17 Problems 445
It follows that A |= [LFP R,x .φ(R,[LFP Q,y .ψ])](a) if and only if, by Claim,
a ∈ LFP(Ψ ) = LFP(F.)
Finally, [LFP R ](a) is equivalent to [LFP R,x .φ(R,[LFP Q,y .ψ])](a) and analogously
[LFP Q ](b) is equivalent to [LFP Q,y .ψ(R,[LFP R,x .φ])](b).
Thus, DATALOG programs can be expressed in LFP. As for complexity of DAT-
ALOG, and of LFP it is known the following, (cf. Grädel [41]). The input structure
for a program Π is the collection of predicates that appear only in the bodies of
rules along with constants. DATALOG programs can be evaluated in PTIME with
respect to the size of the input structure and the problem of program evaluation is
EXPTIME-complete.
8.17 Problems
The first two problems come from (Boolos, Burgess, Jeffrey. Computability and
Logic 4th.ed. Cambridge UK (2002)).
Problem 8.1 (SO rendering of the Leibniz Principle) We recall the Leibniz Identitas
of Indiscernibilium Principle from Chap. 7: if all available properties give the same
value true or false on things x, y then x and y are to be regarded as identical.
Show that the following formula of SO: ∀X.(X (x) ≡ X (y)) ≡ (x = y) gives the
formal rendering of the Leibniz Principle.
Problem 8.3 The compactness principle is obeyed by FO: a set Γ of formulae is sat-
isfiable if and only if each finite subset Δ ⊆ Γ is satisfiable. Prove that compactness
property is not valid in the realm of finite models.
Problem 8.5 Define in FO the property of a finite undirected graph being complete.
Problem 8.6 Prove that the following queries are FO-definable in the class of all
graphs.
(a) There exists in the graph G an isolated vertex;
(b) There exists a vertex in the graph G with at leat k adjacent vertices for k ≥ 2;
(c) There is a path of length 2 between vertices u, v in the graph G.
Problem 8.7 Prove that the following queries are definable in ∃MSO in the class of
all graphs.
446 8 Beyond FO Within SO
Problem 8.8 (Ebbinghaus and Flum [4]) Consider the set Q of rational numbers
in (0, 1) and the set Z of integers with their natural orderings. Prove that in the
Ehrenfeucht 3-move game G 3 on Q, Z Spoiler has the winning strategy.
Problem 8.9 (The Łoś-Tarski theorem) Cf. (Ebbinghaus and Flum [4]). The Łoś-
Tarski theorem states: if a closed formula φ is extension-invariant, i.e., if A |= φ and
A ⊆ B, then B |= φ, then φ is expressible as a formula built from literals with use
of ∨, ∧ and ∃.
Prove: The Łoś-Tarski theorem fails over finite models of FO.
Problems 8.10 and 8.11 are from (Gurevich, Y.: Toward logic tailored for com-
putational complexity. In: Computation and Proof Theory, Richter, M. et al., eds.,
Springer. Lecture Notes in Mathematics 1104, 175–216 (1984)).
Problem 8.10 (Beth definability) The Beth definability theorem cf. Sect. 3.22 states
that in FO implicit definability is equivalent to explicit definability.
Prove: Beth theorem fails over finite models for FO. [Hint: Consider a query P on
finite structures: P is unary and it returns the number of evenly indexed elements in
a linear order].
Problem 8.11 (Craig interpolation) Prove: The Craig interpolation theorem cf.
Sect. 3.22 does not hold over finite models for FO.
Problem 8.12 Prove: the property of a finite graph to be acyclic is not expressible
in FO. [Hint: Apply Ehrenfeucht’s games].
Problem 8.13 (Libkin [26], 3.17) A block world is a finite union of finite disjoint
linearly ordered structures. Apply Ehrenfeucht games to show that theory of block
worlds is decidable, in other wording, it is expressible in FO that a structure is a
block world.
Problem 8.14 Prove: transitive closure TC is not FO-definable. [Hint: apply Hanf
locality].
Problem 8.15 Prove the estimate: lr (Q) ≤ 3 · hlr (Q) + 1. [Hint: (Libkin [26],
4.11)].
Problem 8.16 (Balanced binary trees). Cf. (Libkin [26], p. 53). A tree (T, <) is
binary when each non-leaf node has at most 2 children. A tree is balanced when all
branches (i.e., maximal linearly ordered subsets) have the same length. Apply the
Hanf locality test to prove that the query whether a graph is a binary balanced tree
is non-FO-definable.
8.17 Problems 447
Problem 8.17 (Same distance from the node (same generation)) Given a node c in
an undirected graph, decide for two nodes a, b whether they are at the same distance
from c.
Prove: the Query Q(samedistance) is non-FO-definable by applying the Gaifman
locality test. [Hint: cf. (Libkin [26], p. 53)].
Problem 8.18 (MSO and finite trees) Prove: the MSO theory of finite trees is
decidable.
Problem 8.19 (0-1 law) We consider the set Mn of all finite structures with domain
of n elements over a common relational vocabulary Σ.
For a property P, we define the quotient
|{A ∈ S : A |= P}|
μn (P) = .
|S|
This is the probability that a randomly chosen structure in S has P. The asymptotic
probability μ(P) = lim n→∞ πn (P). A logic L satisfies the 0-1 law if for each Boolean
Query (a property P) either π(P) = 0 or π(P) = 1.
Prove: (a) The property EVEN for sets can not be defined;
(b) over a vocabulary {P 1 } with a single unary relational symbol P 1 , the Query
PARITY(P 1 )(A) meansthat |{a ∈ A : P 1 (a)}| is even. For structures in Mn , prove
that μn (PARITY(P 1 ))= k even,k≤n bn(n, k) and π(PARITY(P 1 ))= 21 ; bn is the bino-
mial coefficient;
(c) the property ISOL(G): ‘there is an isolated node in a graph G on n nodes’
bn(n−1,2)
holds with μn ≤ n·22bn(n,2) , hence μ(I S O L(G)) = 0.
Problem 8.20 (0-1 law) If the vocabulary for a class of finite structures contains
function or constants symbols, then 0–1 law may not hold. Prove it by showing that
for a constant a and a unary relational symbol P one has μ(P(a)) = 21 .
Problem 8.22 (Pebble games) Consider the structure Am = (A, ≤) which is the
linearly ordered set of m elements.
(a) Prove that for m < n, Spoiler has the winning strategy on the pair Am , An
in the 2-pebble game (recall that the isomorphism in the pebble game means that
448 8 Beyond FO Within SO
the corresponding pebbles are on the corresponding places with respect to the linear
order).
(b) Prove that for each k and adequately large m, n, Duplicator wins in the Ehren-
feucht game on Am , An . [Hint: cf. Kolajtis [3]].
A couple of problems that follow concern SO. Some are suggested in (Enderton. A
Mathematical Introduction to Logic. Harcourt, Academic Press (2001)).
References
1. Ehrenfeucht, A.: An application of games to the completeness problem for formalized theories.
Fund. Math. 49, 129–141 (1961)
2. Hanf, W.: Model-theoretic methods in the study of elementary logic. In: Addison, J.W., Henkin,
L., Tarski, A. (eds.) The Theory of Models. North-Holland, Amsterdam (1965)
3. Kolaitis, P.G.: On the expressive power of logics on finite models. In: Grädel, E. et al. (eds.)
Finite Model Theory and its Applications, pp. 27–124. Springer, Berlin (2007)
4. Ebbinghaus, H.-D., Flum, J.: Finite Model Theory. Springer, Berlin (2006)
5. Gaifman, H.: On local and non-local properties. In: Proceedings of the Herbrand Symposium,
Logic Colloquium’81. North-Holland (1982)
References 449
6. Fraïssé, R.: Sur quelques classifications des systèmes des relations. Univ. d’Alger Publ. Sci. A
1, 35–182 (1954)
7. Fagin, R., Stockmeyer, L., Vardi, M.Y.: On monadic NP vs monadic co-NP. Inf. Comput. 120,
78–92 (1994)
8. Fagin, R.: Monadic generalized spectra. Zeitschrift für Mathematische Logik und Grundlagen
der Mathematik 21, 121–134 (1975)
9. Ajtai, M., Fagin, R.: Reachability is harder for directed than for undirected graphs. J. Symb.
Log. 55, 113–150 (1990)
10. Immerman, N.: Descriptive Complexity. Springer, New York (1999)
11. Arora, S., Fagin, R.: On Winning Strategies in Ehrenfeucht-Frai’sse Games. Theoret. Comp.
Sci. 174(1–2), 97–121 (1997)
12. Büchi, R.: Weak second-order arithmetic and finite automata. Zeitschrift für Mathematische
Logik und Grundlagen der Mathematik 6, 66–92 (1960)
13. Ladner, R.E.: Application of model theoretic games to discrete linear orders and finite automata.
Inf. Control 33, 281–303 (1971)
14. McNaughton, R., Papert, S.: Counter-Free Automata. MIT Press, Cambridge (1971)
15. Trakhtenbrot, B.A.: The impossibility of an algorithm for the decision problem in finite models.
Doklady AN SSSR 70, 569–572 (1950). (Eng. transl.: Amer. Math. Soc. Translations, Series
2(23), 1–5 (1963)
16. Fagin, R.: Generalized first-order spectra and polynomial-time recognizable sets. In: Karp, R.,
(ed.) Complexity of Computation. SIAM-AMS Proceedings, vol. 7, pp. 43–73 (1974)
17. Moschovakis, Y.N.: Descriptive Set Theory. AMS (2009)
18. Chandra, A., Harel, D.: Structure and complexity of relational queries. In: 21st IEEE Sympo-
sium on Foundations of Computer Science, pp. 333–347 (1980)
19. Immerman, N.: Relational queries computable in polynomial time. Inf. Control 68, 86–104
(1986); (first version in: 14thACM STOC Symposium, pp 147–152 (1982)
20. Vardi, M.Y.: Complexity of relational query languages. In: 14th Symposium on Theory
o/Computation, pp. 137–146 (1982)
21. Gurevich., Y, Shelah., S.: Fixed-point extensions of first-order logic. Ann. Pure Appl. Logic
32, 265–280 (1986)
22. Kreutzer, S.: Expressive equivalence of least and inflationary fixed point logics. In: I": Pro-
ceedings of the 17th IEEE Symposium on Logic in Computer Science LICS02, pp. 403–410
(2002)
23. Immerman, N., Lander, E.: Describing graphs: a first order approach to graph canonization.
In: Complexity Theory Retrospective. Springer, Berlin (1990)
24. Mostowski, A.: On a generalization of quantifiers. Fundam. Math. 44(1), 12–36 (1957)
25. Etessami, K.: Counting quantifiers, successor relations and logarithmic space. J. Comput. Syst.
Sci. 54, 400–411 (1997)
26. Libkin, L.: Elements of Finite Models Theory. Springer, Berlin (2012)
27. Libkin, L.: On counting logics and local properties. ACM Trans. Comput. Log. 1, 33–59 (2000)
28. Hella, L.: Logical hierarchies in PTIME. Inf. Comput. 129, 1–19 (1996)
29. Immerman, N.: Languages that capture complexity classes. SIAM J. Comput. 16, 760–778
(1983)
30. Immerman, N.: Lower bounds for first order expressibility. J. Comput. Syst. Sci. 25, 76–98
(1982)
31. Poizat, B.: Deux or trois choses que je sais de L n . J. Symb. Logic 47, 641–658 (1982)
32. Barwise, J.: On Moschovakis closure ordinals. J. Symb. Logic 42, 292–296 (1977)
33. Kolaitis, P., Vardi, Y.M.: Fixpoint logic vs. infinitary logic in finite-model theory. In: IEEE
Symposium on Logic in Computer Science, pp. 146–57 (1992)
34. Libkin, L.: Logics capturing local properties. ACM Trans. Comput. Log. 2, 135–153 (2001)
35. Glebskii, Y.V., Kogan, D.I., Liogonki, M.I., Talanov, V.A.: Range and degree of realizability
of formulas in the restricted predicate calculus. Cybernetics 5, 142–154 (1969)
36. Fagin, R.: Probabilities on finite models. J. Symb. Logic 41(1), 17–21 (1976)
450 8 Beyond FO Within SO
37. Gaifman, H.: Concerning measures in first-order functional calculi. Israel J. Math. 2, 1–17
(1964)
38. Łoś, J.: On the categoricity in power of elementary deductive systems and some related prob-
lems. Colloq. Math. 3, 58–62 (1954)
39. Erdös, P., Rényi, A.: On the evolution of random graphs. Matematikai Kutató Intézet
Közleményei 5, 17–60 (1960)
40. Radó, R.: Universal graphs and universal functions. Acta Arith 9, 331–340 (1964)
41. Grädel, E.: Finite model theory and descriptive complexity. In: Grädel, E., et al. (eds.) Finite
Model Theory and Its Applications, pp. 125–230. Springer, Heidelberg (2007)
42. Emerson, A., Jutla, C.: Tree automata, mu-calculus and determinacy. In: Proceedings of the
32nd IEEE Symposium on Foundations of Computer Science, pp. 368–377 (1991)
43. Mostowski, A.W.: Games with forbidden positions. Technical Report 78, Gdansk University
(1991)
44. Dahlhaus, E.: Skolem normal forms concerning the least fixed point. In: Börger,E. (ed.). Com-
putation Theory and Logic. LNCS, vol. 270, pp. 101–106. Springer, Berlin (1987)
45. Kozen, D.: Results on the propositional mu-calculus. Theoret. Comp. Sci. 27, 333–354 (1983)
46. Bradfield, J., Stirling, C.: Modal logics and mu-calculi: an introduction. In: Bergstra, J.A.,
Ponse, A., Smolka, S.A. (eds.) Handbook of Process Algebra, 293–332. Elsevier, Amsterdam
(2001)
47. Bradfield, J., Walukiewicz, I.: The mu-calculus and model checking. In: Clarke, E.M., Hen-
zinger, T., A., Veith, H., Bloem, R. (eds.): Handbook of Model Checking, pp. 871–920. Springer
Intl. Publishing AG (2018)
48. Streett, R.S., Emerson, E.A.: An automata-theoretic decision procedure for the propositional
mu-calculus. Inform. Comput. 81, 249–264 (1989)
49. Wolper, P.: Temporal logic can be more expressive. Inf. Control 56(1–2), 72–99 (1983)
Author Index
F
C Fagin, R., 399, 406, 407, 412, 415, 433
Carnap, R., 182 Faucett, W.M., 309
Carroll, L., 97 Fisher, M.J., 242, 342
Chaki, S., 273 Fisher, R.A., 367
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer 451
Nature Switzerland AG 2023
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4
452 Author Index
L
H Ladner,R.E., 202, 242, 246, 342, 346, 355,
Hadamard, J., 329 409
Hájek, P., 326 Lander, E., 420
Haken, A., 99, 108 Landweber, C.H., 21
Halpern, J., 205, 257, 346, 354, 355 Lange, M., 244
Halvorson, H., 167 Leblanc, H., 291
Hanf, W., 396 Lei,C.-L., 246
Harel, D., 342, 415 Leiserson, C.E., 262
Hasenjaeger, G., 145 Lejewski, C., 360
Hausdorf, F., 12 Lenzen, W., 346
Hayashi, T., 264 Leśniewski, S., 356
Hella, L., 422 Levin, A., 42
Henkin, L., 145, 199 Lewis, C.I., 179
Libkin, L., 417, 420, 422, 429
Henzinger, Th.A., 259
Li, J., 257
Herbrand, J., 73, 139, 145
Ling, C.-H., 305
Heyting, A., 213
Liogonki, M.I., 431
Hilbert, D., 71, 88
Loemker, L., 368
Hintikka, K.J.J., 82, 121, 343, 346
Łoś, J., 432
Hoover, J., 102
Löwenheim, L., 125
Horn, A., 132
Łukasiewicz, J., 61, 62, 71–73, 76, 77, 88,
89, 231, 284, 297, 310, 330, 362
I
Immerman, N., 409, 414, 417, 419, 425, 434 M
Indrzejczak, A., 77, 117 Manna, Z., 136, 137
Author Index 453
A Axiom, 2
Acceptance Church’s system, 72
Büchi, 19 Frege’s system, 71
Algebra Hilbert-Ackerman’s system, 71
BL, 289 Hilbert’s H2 system, 71
Boolean, 54 Kalish-Montague’s system, 152
Lindenbaum-Tarski, 75 Łukasiewicz’s system, 72
MV, 316 Mendelson’s system, 166
Tarski Boolean mereological, 360 Meredith’s, 72
Wajsberg, 314 modal system K, 180
Algorithm modal system S4, 188
(A) for DNF, 70 modal system S5, 188
(B1) for CNF, 70 modal system T, 187
(B2) for CNF, 70 of choice, 2
Davis-Logemann-Loveland, 101 of infinity, 2
Davis-Putnam, 101 Polkowski’ system for mass assignment,
Nguyen H.S. for optimal cuts, 380 361
Pawlak-Skowron, 378 Rauszer’s system for FD-logic, 370
perceptron learning, 104 Rosser-Tourquette’s system for n L , 298
Skowron-Rauszer for reducts, 375 R. Robinson’s system, 156
for decision-related reducts, 377 Segerberg’s system for SDL, 336
Approximation, 368 Vakarelov’s system for logic IL, 384
lower, 368 Wajsberg’s system for 3 L , 291
upper, 368
Automaton
alternating, 262
on trees, 267 B
on trees–weak, 268 Bisimulation, 205
Büchi, 19 BIT, 434
generalized, 258 Boolean algebra, 54
non-deterministic, 257 Bound, 4
DFA, 16 g.l.b, l.u.b, 4
NFA, 16 upper, lower, 4
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer 455
Nature Switzerland AG 2023
L. T. Polkowski, Logic: Reference Book for Computer Scientists,
Intelligent Systems Reference Library 245,
https://doi.org/10.1007/978-3-031-42034-4
456 Index
C NL, 40
Chaining NP, 41
backward, 97 NPSPACE, 42
forward, 98 P, 38
Chang group, 322 PSPACE, 42
Class, 358 X-hard, 38
CLS-Mod(φ), 406 Computation, 22
FO[k], 406 Concept/set, 368
MSO[k], 403 definable, 368
universal, 358 non-definable, 368
Clause, 69 Connective, 62
Horn, 96, 132 composition of programs, 334
Complement, 50 infinitary, 421
pseudo, 51 modal L, M, 180
relative, 359 necessity [.], 334
relative pseudo, 51 non-deterministic choice , 334
Completeness non-deterministic program iteration (.)*,
basic logic BL, 290 334
epistemic logics, 346 of sentential logic, 62
common, 353 Peirce’s, 64
n agents, 348 Sheffer’s, 64
FD-logic, 373 strong conjunction, 282
FO, 145 strong disjunction, 282
FOIL, 223 temporal operators F,G,X,U, 235
infinite-valued logic [0, 1] L , 325 test ?, 334
Gödel, 326 Consistency, 85, 198
Goguen, 326 Herbrand, 143
information logic IL, 376 maximal, 86
predicate logic, 120 Cut rule, 118
predicate sequent calculus, 126
SDL logic, 338
sentential logic, 88 D
sentential sequent calculus, 84 DATALOG, 443
sentential tableau calculus, 83 Decidability
strong for K, T, S4, S5, 210 of modal logic S5, 206
strong for SL, 88 of modal logics K, T, S4, 205
strong for three-valued logic 3L, 293 of temporal LTL, 243
tableau for CTL, 257 Decomposition diagram, 79, 118
tableau for LTL, 254 Detachment rule (MP), 72
tableau for modal logics, 195
tableau for predicate logic, 124
tableau for QML K, 213 E
tableau for SIL, 217 Element, 359
Complete open description, 431 Equipollence, 6
Complexity class, 38 Expressibility, 35
co-X, 45 Expression
DTIME, 38 diagonal, 35
E, 45 ω-regular, 19
EXPTIME, 45 regular, 18
L, 40 Extended closure, 265
NDTIME, 44 Extending formula, 431
NE, 45 Extension formula, 431
NEXPTIME, 45 Exterior thing, 359
Index 457
F bijective, 422
Falsity, 65 MSO, 402
falsum, 65 Parity, 436
Filter, 48 in model checking, 440
maximal, 48 Pebble, 425
prime, 49 Good sequence, 322
Filtration, 202 Grammar, 16
for SDL, 341 regular, 16
Fisher-Ladner closure, 242, 337 Graph, 13
Fixed point, 4 alternating, 408
GFP, 415 dag, 14
IFP, 418 directed, 14
LFP, 415 Gaifman’s, 395
PFP, 419 random, 434
FO-definability, 161 undirected, 13
Formula
atomic, 113
Barcan, 207 H
Barcan converse, 207 Herbrand expansion, 141
Łukasiewicz for many-valued logic, 281 Hintikka family, 212, 217, 221
provable, 73 Hintikka saturated sets, 222
purely propositional, 333 Hintikka structure for CTL, 257
refutable, 35 Hintikka traces, 253
size of, 67 Homomorphism, 48
sub-, 66 MV-algebras, 320
well-formed, 62, 113, 180
well-named, 440
Function, 3 I
arithmetic, 151 Ideal, 48
bijective, 3 in MV-algebra, 320
busy beaver, 26 maximal, 48
computable, 23 prime, 49
counter-image, 3 Implicant, 69
diagonal, 35, 151 Indiscernibility, 368
domain, 3 Induction
image, 3 mathematical, 6
injective, 3 structural, 67
isotone, 4 transfinite, 10
lower (upper) semi-continuous, 308 Inference rule
mapping, 56 detachment, 72, 146, 336
continuous, 56 epistemic necessitation, 345
range, 3 FD-rules, 370
recursive, 24 generalization, 146, 336
partial, 23 necessitation, 180
primitive, 24 replacement, 72
total, 3 substitution, 72
Functional dependence, 368, 369 Ingredient, 357
Instruction, 22
Interpolant, 92, 168
G
Game
Ajtai-Fagin, 406 J
Ehrenfeucht, 161, 394 Join, 4
458 Index
P
Pair Q
ordered, 3 Quantifier rank, 160, 394
unordered, 2 Query, 428
Part, 356
Polish notation, 75
Predicate R
Kleene, 27 Reducibility, 38
recursively enumerable, 31 Karp, 38
undecidable, 33 log-space, 41
Problem (also under language) Reduct, 368
aREACH, 409 decision-related, 377
CNF-Contra-UR, 38 semi-reduct, 368
CONN, 165, 404 Relation
DGA, 41 arithmetic, 150
dREACH, 407 binary, 3
EVEN, 164, 403 directed, 3
EVEN(LO), 164 Euclidean, 3
GAME, 436 functional, 3
Post’s PCP, 136 linear, 3
REACH, 405 reflexive, 3
SAT(3-CNF), 41 serial, 3
SAT(BSR), 45 symmetric, 3
SAT(CNF), 41 transitive, 3
SAT(Gödel), 327 closure, 3, 352, 424
SAT(Goguen), 327 Residual implication, 285
SAT(Luk), 327 residuum, 306
SAT(i ), 47 Resolution rule, 95, 131
460 Index
refutation, 95 consistent, 36
satisfiability, 67, 116 formal, 34
SLD, 133 L E , 148
unsatisfiability, 67 L P E , 152
Rough rewriting, 15
concept/set, 368
inclusion, 361
mereology, 361 T
Tableau, 81
branch of, 82
S closed, 82
Sentence intuitionistic FOIL rules, 220
decidable, 36 intuitionistic sentential rules, 216
Gödel, 36, 151 modal ε rules, 195
Rosser, 158 modal logic K rules, 189
undecidable, 33 modal logic S4 rules, 190
Sequent, 77 modal logic S5 rules, 191
calculus for FO, 117 modal logic T rules, 189
modal sequent calculus, 197 modal quantified rules, 210
system K, 77 open, 81
Set, 1 predicate rules, 123
algebra, 2 prefixed tableau rules, 211
arithmetic, 150 sentential rules, 92
boundary, 56 temporal CTL rules, 254
closed, 55 temporal LTL rules, 249
computable, 23 T-co-norm, 286
containment, 1 Term in FO, 113
diagonal, 35 Theorem
Hintikka’s, 82, 124, 142, 193 Bekić Lemma, 444
identity, 2 Beth definability, 171
open, 55 Bradfield-Walukiewicz, 441
recursively enumerable, 32 Büchi, 409
Stone, 364 Cantor, 6
Structure, 5 Cantor-Bernstein, 7
domain quad, 5 Chang completeness, 321
assignment, 115 Chang completeness for [0, 1] L , 326
Herbrand, 141 Chang representation, 320
FO structure, 115 Choueka, 259
domain of, 115 Church, 136
finite, 159, 393 compactness of mereological spaces, 366
finite—pointed, 159 completeness of FOIL, 223
finite–pointed—isomorphism, 160 completeness of modal tableau calculus,
finite–pointed—isomorphism– 193
partial, 160 completeness of temporal CTL tableau
interpretation, 115 calculus, 257
Kozen-Parikh, 338 completeness of temporal LTL tableau
periodic, 241 calculus, 254
topological, 55 Craig interpolation, 94, 167
Hausdorff, 56 Dedekind-McNeille, 5
vocabulary, 5 deduction for FO, 166
Substitution rule, 72, 115 deduction for many-valued logic, 288
System Demri, Goranko, Lange, 244
complete, 36 Ehrenfeucht, 163
Index 461