Unifying Theories of Logics with Undefinedness
Total Page:16
File Type:pdf, Size:1020Kb
Unifying Theories of Logics with Undefinedness Victor Petru Bandur PhD University of York Computer Science September, 2014 Abstract A relational approach to the question of how different logics relate formally is described. We consider three three-valued logics, as well as classical and semi-classical logic. A fundamental representation of three-valued predicates is developed in the Unifying Theories of Programming (UTP) framework of Hoare and He. On this foundation, the five logics are encoded semantically as UTP theories. Several fundamental relationships are revealed using theory linking mechanisms, which corroborate results found in the literature, and which have direct applicability to the sound mixing of logics in order to prove facts. The initial development of the fundamental three-valued predicate model, on which the theories are based, is then applied to the novel systems-of-systems specification language CML, in order to reveal proof obligations which bridge a gap that exists between the semantics of CML and the existing semantics of one of its sub-languages, VDM. Finally, a detailed account is given of an envisioned model theory for our proposed structuring, which aims to lift the sentences of the five logics encoded to the second order, allowing them to range over elements of existing UTP theories of computation, such as designs and CSP processes. We explain how this would form a complete treatment of logic interplay that is expressed entirely inside UTP. ii Contents Abstract ii Contents iii List of Figures vi Acknowledgments vii Author's Declaration viii 1 Background 1 1.1 Introduction . .1 1.2 Logic in Software Rationale . .3 1.3 Multi-Valued Logics . .4 1.3.1 Strict Three-Valued Logic . .5 1.3.2 McCarthy's Left-Right Three-Valued Logic . .6 1.3.3 Kleene's Three-Valued Logic . .7 1.4 Unifying Theories of Programming . .7 1.5 Related Work . .8 1.5.1 Two-Valued Reasoning . .8 1.5.2 Multi-Valued Reasoning . 10 1.5.3 Relating Multi-Valued Logics . 11 1.5.4 Specific Comparisons . 11 1.5.5 Comparisons of Increasing Generality . 14 1.6 Related Work on Fully General Comparisons . 15 1.6.1 Work Based on Institutions . 15 1.7 Concluding Remarks . 16 2 Technical Preliminaries 18 2.1 Introduction . 18 2.2 Unifying Theories of Programming . 18 2.2.1 Alphabetized Relational Calculus . 18 2.2.2 Expression Language for Alphabetized Predicates . 19 2.2.3 Fundamental Operators . 19 2.2.4 Theories . 21 2.2.5 Complete Lattice of Predicates . 23 2.2.6 Signature Morphisms . 23 iii CONTENTS iv 2.2.7 Galois Connections . 24 2.3 Rose Pairs . 25 2.4 The COMPASS Modelling Language . 26 2.5 Category Theory and Institutions . 29 2.5.1 Categories . 29 2.5.2 Institutions . 31 2.6 Unifying Theories of Undefinedness . 34 2.7 Summary . 36 3 Classical Models of Three-Valued Predicates 38 3.1 Introduction . 38 3.2 The Undefined Truth Value . 38 3.3 Three-Valued Predicate Model . 39 3.4 What is in the Space HD of Relations? . 41 3.5 Strict and Definite Predicates and Functions . 44 3.6 The Effect of Classical Operators . 46 3.7 The Lattice of Three-Valued Predicate Models . 48 3.7.1 Refinement Relation for Three-Valued Predicates . 49 3.7.2 Lattice Operators . 50 3.7.3 Weakest and Strongest Elements . 52 3.7.4 The Complete Lattice of Three-Valued Predicate Models . 52 3.8 Concluding Remarks . 53 4 Theories of Three-Valued Logic 54 4.1 Introduction . 54 4.2 Atomic Predicates . 55 4.3 Theory of Strict Three-Valued Logic . 56 4.3.1 Atomic Predicates Revisited . 57 4.4 Theory of Left-Right Three-Valued Logic . 58 4.5 Theory of Kleene's Three-Valued Logic . 58 4.6 Theory of Classical Logic . 59 4.7 Theory of Semi-classical Logic . 60 4.8 Theory Bijections . 62 4.9 Closure of HD w.r.t. the Theory Operators . 63 4.10 Example . 63 4.11 Concluding Remarks . 64 5 Relating Unifying Theories of Logic 65 5.1 Theory Subsets . 65 5.1.1 Theories HF and HFT ............................... 65 5.1.2 Theories SC and C ................................. 66 5.1.3 The Theory C and the Theories S, LR and K .................. 66 5.1.4 The Theory SC and the Theories S, LR and K .................. 66 5.2 Syntax and Semantics . 67 5.3 Relationships Based on Syntax . 69 5.4 Relative Resilience of Operators to Undefinedness . 69 CONTENTS v 5.5 Recovering from Undefinedness . 70 5.6 Emulation . 72 5.7 Concluding Remarks . 73 6 Proof Obligations for CML 75 6.1 Introduction . 75 6.2 Denotational Proof Obligations . 75 6.2.1 VDM Expressions . 77 6.2.2 CSP-Derived Language Constructs . 83 6.3 Consistency Proof Obligations . 86 6.4 Concluding Remarks . 87 7 UTP Theories of Specification 89 7.1 Introduction . 89 7.2 Three-Valued Predicates as Specifications . 89 7.3 Valid Specifications . 91 7.4 Healthiness Conditions as Requirements . 92 7.5 Model Theory . 93 7.5.1 UTP Designs as Models of Specifications . 93 7.5.2 Other Models of Behaviour . 95 7.5.3 Foundations . 96 7.6 Concluding Remarks . 97 8 Conclusions 98 8.1 Future Work . 99 A Proofs 101 Chapter 3 . 101 Chapter 4 . 111 Chapter 5 . 115 References 123 List of Figures 1.1 Strict logical operators. .5 1.2 McCarthy left-right logical operators. .6 1.3 Kleene's three-valued logical operators. .7 2.1 Representation (V; D) of three-valued predicate P over its universe U.......... 25 2.2 Rose's three-valued logical operators. 25 2.3 S lupecki's logical system. ..