Dynamic Logic David Harel, The Weizmann Institute Dexter Kozen, Cornell University Jerzy Tiuryn, University of Warsaw The MIT Press, Cambridge, Massachusetts, 2000 Among the many approaches to formal reasoning about programs, Dynamic Logic enjoys the singular advantage of being strongly related to classical logic. Its variants constitute natural generalizations and extensions of classical formalisms. For example, Propositional Dynamic Logic (PDL) can be described as a blend of three complementary classical ingredients: propositional calculus, modal logic, and the algebra of regular events. In First-Order Dynamic Logic (DL), the propositional calculus is replaced by classical rst-order predicate calculus. Dynamic Logic is a system of remarkable unity that is theoretically rich as well as of practical value. It can be used for formalizing correctness specications and proving rigorously that those specications are met by a particular program. Other uses include determining the equivalence of programs, comparing the expressive power of various programming constructs, and synthesizing programs from specications. This book provides the rst comprehensive introduction to Dynamic Logic. It is divided into three parts. The rst part reviews the appropriate fundamental concepts of logic and computability theory and can stand alone as an introduction to these topics. The second part discusses PDL and its variants, and the third part discusses DL and its variants. Examples are provided throughout, and exercises and a short historical section are included at the end of each chapter. Contents I Fundamental Concepts...1 1 Mathematical Preliminaries... 3 1.1 Notational Conventions...3 1.2 Sets...3 A Note on Foundations...4 Sets and Classes....5 1.3 Relations.... 5 Binary Relations...6 Equivalence Relations...8 Functions....9 Partial Orders....10 Well-Foundedness and Induction.... 12 1.4 Graphs and Dags....13 1.5 Lattices...13 1.6 Transnite Ordinals...13 Set-Theoretic Denition of Ordinals...14 Transnite Induction.... 15 Zorn's Lemma and the Axiom of Choice...16 1.7 Set Operators...16 Monotone, Continuous, and Finitary Operators... 17 Prexpoints and Fixpoints...18 Closure Operators...19
The Knaster{Tarski Theorem...20 1.8 Bibliographical Notes.... 22 Exercises...22 2 Computability and Complexity...27 2.1 Machine Models.... 27 Deterministic Turing Machines... 27 Nondeterministic Turing Machines...33 Alternating Turing Machines...34 Universal Turing Machines and Undecidability...37 2.2 Complexity Classes.... 38 Time and Space Complexity...38 Oracle Machines and Relative Computability...40 Recursive and R.E. Sets...42 The Arithmetic Hierarchy...42 The Analytic Hierarchy...45 2.3 Reducibility and Completeness....53 Reducibility Relations.... 53 Completeness....57 Tiling Problems...58 2.4 Bibliographical Notes.... 63 Exercises...64 3 Logic...67 3.1 What is Logic?....67 Languages...68 Models, Satisfaction, and Validity...68 Deduction....69 3.2 Propositional Logic...71 Syntax...71 Semantics...73 Set-Theoretic Representation...76 A Deductive System....77 The Deduction Theorem...79 Completeness....79 Compactness...81 An Equational System...82 3.3 Equational Logic...86 Syntax...86 Semantics...88 The Quotient Construction.... 96 A Deductive System....99 The HSP Theorem....100 3.4 Predicate Logic...102 Syntax...102 Scope, Bound and Free Variables....104 Semantics...105 A Deductive System...111
Completeness with Equality...115 Compactness...115 The Lowenheim{Skolem Theorem...116 Undecidability...117 3.5 Ehrenfeucht{Frasse Games....119 3.6 Innitary Logic....120 Syntax...121 An Innitary Deductive System...122 The Downward Lowenheim{Skolem Theorem.... 126 Complexity...126 3.7 Modal Logic...127 Propositional Modal Logic...127 Multimodal Logic...130 Unwinding...132 Modal Logic and Programs...133 3.8 Bibliographical Notes....134 Exercises....134 4 Reasoning About Programs...145 4.1 What are Programs?... 145 4.2 States and Executions...146 4.3 Programming Constructs...147 While Programs...147 Regular Programs...148 Recursion...149 R.E. Programs...150 Nondeterminism... 151 4.4 Program Verication...152 Partial and Total Correctness...154 Hoare Logic...156 4.5 Exogenous and Endogenous Logics... 157 4.6 Bibliographical Notes....157 Exercises....158 II Propositional Dynamic Logic.... 161 5 Propositional Dynamic Logic...163 5.1 Syntax...164 5.2 Semantics...167 5.3 Computation Sequences...170 5.4 Satisability and Validity...171 5.5 A Deductive System...173 5.6 Basic Properties.... 174 Properties Inherited from Modal Logic... 174 Properties of [, ;, and?...175 The Converse Operator,... 177 The Iteration Operator...181 Reexive Transitive Closure and Induction... 182
5.7 Encoding Hoare Logic.... 186 5.8 Bibliographical Notes....187 Exercises....188 6 Filtration and Decidability... 191 6.1 The Fischer{Ladner Closure.... 191 6.2 Filtration and the Small Model Theorem...195 6.3 Filtration over Nonstandard Models...199 6.4 Bibliographical Notes....201 Exercises....202 7 Deductive Completeness...203 7.1 Deductive Completeness...203 7.2 Logical Consequences...209 7.3 Bibliographical Notes....209 Exercises....209 8 Complexity ofpdl...211 8.1 A Deterministic Exponential-Time Algorithm....211 8.2 ALower Bound... 216 8.3 Compactness and Logical Consequences... 220 8.4 Bibliographical Notes....224 Exercises....225 9 Nonregular PDL...227 9.1 Context-Free Programs...227 9.2 Basic Results.... 228 9.3 Undecidable Extensions... 232 Two-Letter Programs...232 One-Letter Programs...235 9.4 Decidable Extensions.... 237 Tree Models...239 Pushdown Automata on Innite Trees...242 Decidability for Simple-Minded Languages...244 Other Decidable Classes.... 249 9.5 More on One-Letter Programs.... 250 A Decidable Case... 250 Cases with no Finite Model Property...251 9.6 Bibliographical Notes....255 Exercises....256 10 Other Variants of PDL...259 10.1 Deterministic PDL and While Programs...259 10.2 Restricted Tests...263 10.3 Representation by Automata.... 266 10.4 Complementation and Intersection...268 10.5 Converse.... 270 10.6 Well-Foundedness and Total Correctness...271
10.7 Concurrency and Communication....276 10.8 Bibliographical Notes....277 III First-Order Dynamic Logic....281 11 First-Order Dynamic Logic...283 11.1 Basic Syntax...283 11.2 Richer Programs...287 Seqs and R.E. Programs...287 Arrays and Stacks...288 Wildcard Assignment...290 11.3 Semantics...291 States as Valuations....291 Assignment Statements...293 Programs and Formulas...295 11.4 Satisability and Validity...297 11.5 Bibliographical Notes....298 Exercises....298 12 Relationships with Static Logics.... 301 12.1 The Uninterpreted Level... 301 Uninterpreted Reasoning: Schematology.... 301 Failure of Classical Theorems....302 Expressive Power...304 12.2 The Interpreted Level...307 Interpreted Reasoning: Arithmetical Structures.... 307 Expressive Power over N...308 12.3 Bibliographical Notes....311 Exercises....311 13 Complexity...313 13.1 The Validity Problem...313 The Uninterpreted Level: Validity...313 The Interpreted Level: Validity over N...317 13.2 Spectral Complexity...317 Coding Finite Structures.... 318 Spectra....320 13.3 Bibliographical Notes....324 Exercises....325 14 Axiomatization...327 14.1 The Uninterpreted Level... 327 Completeness for Termination Assertions.... 327 Innitary Completeness for the General Case...329 14.2 The Interpreted Level...333 Relative Completeness for Correctness Assertions.... 334 Arithmetical Completeness for the General Case...335 14.3 Bibliographical Notes....341
Exercises....341 15 Expressive Power...343 15.1 The Unwind Property...344 15.2 Spectra and Expressive Power...347 15.3 Bounded Nondeterminism.... 355 Regular Programs...355 Boolean Stacks...364 Algebraic Stacks and Beyond...368 15.4 Unbounded Memory...369 Polyadic Vocabulary...370 Monadic Vocabulary...375 15.5 The Power of a Boolean Stack...376 15.6 Unbounded Nondeterminism... 377 15.7 Bibliographical Notes....378 Exercises....380 16 Variants of DL...383 16.1 Algorithmic Logic.... 383 16.2 Nonstandard Dynamic Logic... 384 16.3 Well-Foundedness...386 16.4 Dynamic Algebra...389 16.5 Probabilistic Programs...391 16.6 Concurrency and Communication....393 16.7 Bibliographical Notes....394 17 Other Approaches...397 17.1 Logic of Eective Denitions...397 17.2 Temporal Logic... 398 The Inductive Assertions Method...399 The Temporal Approach...400 Expressiveness... 404 The Until Operator...405 Concurrency and Nondeterminism.... 405 Complexity and Deductive Completeness...407 Embedding TL in DL...408 17.3 Process Logic... 408 Axiomatization...411 17.4 The -Calculus.... 415 17.5 Kleene Algebra...418 Kleene Algebra with Tests....421 References.... 425 Notation and Abbreviations.... 439 Index....449