Equational Logic and Term Rewriting: Lecture I

Similar documents
Truth-Functional Logic

Lecture 4. Algebra, continued Section 2: Lattices and Boolean algebras

cis32-ai lecture # 18 mon-3-apr-2006

1 Propositional Logic

185.A09 Advanced Mathematical Logic

The semantics of propositional logic

First Order Logic: Syntax and Semantics

Logic: Propositional Logic (Part I)

Topic 1: Propositional logic

Propositional Logics and their Algebraic Equivalents

Lecture 7. Logic. Section1: Statement Logic.

First Order Logic: Syntax and Semantics

CHAPTER 11. Introduction to Intuitionistic Logic

cse541 LOGIC FOR COMPUTER SCIENCE

CS1800: Hex & Logic. Professor Kevin Gold

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

CprE 281: Digital Logic

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only

= x ( x 2 4 ) [factor out x] (2)

Introduction to Logic and Axiomatic Set Theory

Propositional Logic: Semantics and an Example

Groups. s t or s t or even st rather than f(s,t).

CSE 20. Lecture 4: Introduction to Boolean algebra. CSE 20: Lecture4

Equational Logic. Chapter Syntax Terms and Term Algebras

Propositions. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 5.1, Page 1

Chapter 4: Classical Propositional Semantics

irst we need to know that there are many ways to indicate multiplication; for example the product of 5 and 7 can be written in a variety of ways:

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra

Lecture 2: Syntax. January 24, 2018

A non-turing-recognizable language

Natural Deduction for Propositional Logic

Symbolic Logic Outline

Lecture 4: Constructing the Integers, Rationals and Reals

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Propositional Logic Language

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC

CM10196 Topic 2: Sets, Predicates, Boolean algebras

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Propositional Logic and Semantics

Reasoning Under Uncertainty: Introduction to Probability

Modal and temporal logic

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

Chapter 2: Introduction to Propositional Logic

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra.

cse371/mat371 LOGIC Professor Anita Wasilewska Fall 2018

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Propositional and Predicate Logic

Tecniche di Verifica. Introduction to Propositional Logic

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

MA103 STATEMENTS, PROOF, LOGIC

Propositional and Predicate Logic

Gödel s Incompleteness Theorems

#26: Number Theory, Part I: Divisibility

03 Review of First-Order Logic

Lecture 9. Model theory. Consistency, independence, completeness, categoricity of axiom systems. Expanded with algebraic view.

ABSTRACT ALGEBRA 1, LECTURE NOTES 4: DEFINITIONS AND EXAMPLES OF MONOIDS AND GROUPS.

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Logic. Propositional Logic: Syntax. Wffs

Semantics and Pragmatics of NLP

Boolean Algebra CHAPTER 15

chapter 11 ALGEBRAIC SYSTEMS GOALS

Mathematical Logic for Mathematicians

Linear algebra and differential equations (Math 54): Lecture 10

Lecture Notes on Inductive Definitions

Lecture 1: Overview. January 24, 2018

5.2 Infinite Series Brian E. Veitch

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS

First Degree Entailment

Logic Synthesis and Verification

Binary addition example worked out

Math Lecture 18 Notes

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

15-424/ Recitation 1 First-Order Logic, Syntax and Semantics, and Differential Equations Notes by: Brandon Bohrer

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Introduction to Algebra: The First Week

One-to-one functions and onto functions

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Propositional and Predicate Logic - VII

Propositional Logic: Syntax

Guide to Proofs on Discrete Structures

KB Agents and Propositional Logic

Propositional Logic Review

Doc112: Hardware. Department of Computing, Imperial College London. Doc112: Hardware Lecture 1 Slide 1

Axiomatic systems. Revisiting the rules of inference. Example: A theorem and its proof in an abstract axiomatic system:

CMPSCI 601: Tarski s Truth Definition Lecture 15. where

Lecture 5: closed sets, and an introduction to continuous functions

Syllogistic Logic and its Extensions

CS 2800: Logic and Computation Fall 2010 (Lecture 13)

Boolean bunched logic: its semantics and completeness

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Week 3: Reductions and Completeness

Set Theory Basics of Set Theory. mjarrar Watch this lecture and download the slides

Binary Logic and Gates

PageRank: The Math-y Version (Or, What To Do When You Can t Tear Up Little Pieces of Paper)

Discrete Structures Proofwriting Checklist

Boolean Algebra and Digital Logic

Transcription:

Why so many logics? You all know classical propositional logic. Why would we want anything more? Equational Logic and Term Rewriting: Lecture I One reason is that we might want to change some basic logical property, such as our possible truth values: With classical logic, propositions are either true or false; Logic Summer School Ranald Clouston Australian National University 5 9 December 2011 With fuzzy logic, propositions might be true, false, or any number of values in between! Alternatively, we might have noticed that some piece of grammar (from natural language, say, or a computer programming language) has logical structure. We then define a logical connective for this piece of grammar, along with proof rules to reason about it, and perhaps mathematical semantics to precisely express its meaning. LSS Equational Logic and Term Rewriting 1 LSS Equational Logic and Term Rewriting 2 Logical connectives Equational logic - not so easy Once you start searching for grammar with logical structure, you find it all over the place. Example: modal logic, which you ll learn about from Wednesday, is about grammar that modifies propositions: certainly, possibly, eventually, I believe that... We end up with a whole zoo of logical connectives - you need to pick and choose! Over the next five lectures, we re going to make things a bit easier by discussing a logic with one connective only: The equals sign In fact, this logic with equals only equational logic is quite interesting: It s powerful enough to express propositional logic - both classical and intuitionistic varieties; It underlies the mathematical field of universal algebra; Many mathematicians spend their career studying subfields of universal algebra, such as group theory; It s used as the basis of programming and specification languages; The proof rules seem simple, but equational logic is undecidable; The most popular algorithm for reasoning about equational logic, term rewriting, is one of the most prominent topics in computational logic. LSS Equational Logic and Term Rewriting 3 LSS Equational Logic and Term Rewriting 4

Abstract and Universal Algebra Example I - Monoids The mathematical field of abstract algebra tries to abstract out the underlying algebraic rules of various mathematical systems. For example, how is multiplication of real numbers like multiplication of matrices? Can we apply the same algebraic manipulations to both, or are different rules needed? Once we have found these rules, we can prove theorems using only these rules. Because this point of view is so abstract, our theorems might then apply to a whole bunch of very different mathematical structures! Often (but not always) the rules can be presented in the form of equations. The main tool for reasoning about them is then equational logic. The study of mathematical structures defined by equations is called universal algebra. A monoid is a set M equipped with a distinguished element e M and a function : M M M... (For readability, we ll write (x,y) infix as x y.)... such that the following equations hold: (x y) z = x (y z) (Associativity) e x = x (Left identity) x e = x (Right identity) Example: numbers (N,Z,Q,R, etc.) with addition - e is 0. Example: numbers with multiplication - e is 1. Non-example: numbers with subtraction - not associative, no left identity. LSS Equational Logic and Term Rewriting 5 LSS Equational Logic and Term Rewriting 6 Example II - Groups A group is a monoid (G,e, ) with an extra function 1 : G G... (We ll write 1(x) postfix and superscripted as x 1.)... obeying the additional equations: x 1 x = e (Left inverse) x x 1 = e (Right inverse) (This gives a five equation definition. In fact there exists an equivalent three equation definition, but this will do for now). What about commutativity? All the examples we ve seen so far also obey the equation: x y = y x (Commutativity) This isn t part of the standard definition because there are interesting examples where it doesn t hold, e.g. matrix multiplication. A monoid with commutativity is called (surprise!) a commutative monoid. A group with commutativity is called an Abelian group, after Neils Henrik Abel (1802-1829), one of the founders of group theory: Example: Z,Q,R with addition - x 1 = x. Example: Q,R with multiplication - x 1 = 1 x. Non-examples: N with addition; N, Z with multiplication. LSS Equational Logic and Term Rewriting 7 LSS Equational Logic and Term Rewriting 8

Example III - Lattices Example III - Lattices ctd. A lattice is a set L equipped with a partial order (reflexive, transitive, antisymmetric relation) L L, where every finite set of objects has a greatest lower bound (or meet), and a least upper bound (or join). On the left we have a lattice; on the right we do not: A lattice is a set L equipped with two functions, : L L L, which we will write infix and call the meet and join repectively, obeying: (x y) z = x (y z), (x y) z = x (y z) (Associativity) x y = y x, x y = y x (Commutativity) x (x y) = x, x (x y) = x (Absorption) It may not be obvious, but this definition exactly agrees with that of the previous slide. We recover our partial order by x y iff x y = x iff x y = y It turns out we can specify this lattice requirement exactly via equations! LSS Equational Logic and Term Rewriting 9 LSS Equational Logic and Term Rewriting 10 Example IV - Heyting Algebras A Heyting Algebra (after Arend Heyting (1898-1980)) is a mathematical model for intuitionistic propositional logic, defined via equations. Take a lattice (H,, ) and add two distinguished elements 0,1 H, a function : H H H written infix, a function : H H, and the equations: x 1 = x Identity / Top of the Lattice x 0 = x Identity / Bottom - defines a bounded lattice x x = 1 x (x y) = x y y (x y) = y x (y z) = (x y) (x z) (equations for implication) x = x 0 (definition of negation) Example V - Boolean Algebras A Boolean Algebra (after George Boole (1815-1864)) is a mathematical model for classical propositional logic, got by adding to Heyting Algebra the single equation x = x or equivalently, x x = 1 There are other ways to present Boolean Algebra as well (if you look up some textbooks and Wikipedia, you ll find a range); they should all be equivalent, although this might not be immediately obvious! Hopefully, you are persuaded by now that equations can define some pretty interesting structure. But what exactly is equational logic? LSS Equational Logic and Term Rewriting 11 LSS Equational Logic and Term Rewriting 12

Signatures Before we get to equations, we need to ask what the things are that we are equating. To get to them, we need to introduce signatures. A signature Σ is a pair (F Σ, Σ ), where F Σ is a set, whose elements we call function symbols; Σ is a function F Σ N, called the arity function. We ll generally leave the subscripts off the arity function. If f = 0 then f is a constant; if 1 then f is unary; if 2 then binary, etc. e.g. the signature G for groups has F G = {e,, 1} (for identity, multiplication, and inverse), with e = 0, = 2, and 1 = 1. Terms Say we have a signature Σ and an infinite set Var of variables. Then the Σ-terms are defined by t ::= x f t...t }{{} n terms where x Var, f F Σ and f = n. e.g. this is a G-term: 1x 1y x where x,y Var. However this is not a G-term: 1x 1y Both look like gibberish - how can we tell which is acceptable? LSS Equational Logic and Term Rewriting 13 LSS Equational Logic and Term Rewriting 14 Parsing Terms The G-term 1x 1y x parses unambiguously as x 1 1 x y The putative G-term 1x 1y doesn t parse at all (go ahead; try!). Equations and Theories An equation over a signature Σ is simply a pair of Σ-terms with the symbol between them: t t (From now we ll use the squiggly for the logical connective equals, and the normal = for real equality.) A Σ-theory is simply a set of equations over Σ. We call equations in this context axioms. Our well-defined term still isn t very attractive - we ll often use infix and postfix notation, operator precedence and brackets, to get something more like (x 1 y 1 ) x LSS Equational Logic and Term Rewriting 15 LSS Equational Logic and Term Rewriting 16

A Note on Equational Theories Structures One simple but important point to make is that we are only interested in equational logic in the presence of a theory. Why? Because as you might imagine, t and t will be provably equal in the empty theory if and only if they re literally the same term - not a very interesting property. Conversely, if we introduce equational axioms for, say, groups, we get a situation interesting enough to have sustained generations of mathematicians for almost two hundred years! This isn t true of all logics - it is genuinely interesting that, say, (p p) q is true in the empty theory for propositional logic. So much for syntax; what are our semantics? A Σ-structure M is a pair (M,M ), where M is a set, called a carrier set; M is a map, called an interpretation, from function symbols in F Σ to functions on M so that f = n M f : M n M. We ll usually write M f as f. If f is a constant then its interpretation f is an element of M ; if f is unary then f is a function M M, and so forth. LSS Equational Logic and Term Rewriting 17 LSS Equational Logic and Term Rewriting 18 Structures ctd. Let s try to find a structure for the group signature G, where the carrier set is some two element set {a,b}. e {a,b}, so let s arbitrarily set it to be a. 1 is a function {a,b} {a,b}; there are four to choose from. Only one will end up giving rise to a group (which one?) but for the moment we don t care about the equational axioms so any will do. : {a,b} {a,b} {a,b} is best presented as a Cayley table (after Arthur Cayley (1821-1895)), e.g. a b a a b b b a LSS Equational Logic and Term Rewriting 19