Lecture 3: Semantics of Propositional Logic

Similar documents
Comp487/587 - Boolean Formulas

Lecture 5: Introduction to Complexity Theory

02 Propositional Logic

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

COMP 409: Homework 2

Tecniche di Verifica. Introduction to Propositional Logic

Propositional Logic and Semantics

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

A brief introduction to Logic. (slides from

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Introduction to first-order logic:

Expressive Power, Mood, and Actuality

Truth-Functional Logic

Proofs Propositions and Calculuses

What is logic, the topic of this course? There are at least two answers to that question.

Filtrations and Basic Proof Theory Notes for Lecture 5

INF3170 Logikk Spring Homework #8 For Friday, March 18

Structural Induction

Propositional logic. First order logic. Alexander Clark. Autumn 2014

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

An Introduction to Modal Logic III

T Reactive Systems: Temporal Logic LTL

Lecture 13: Soundness, Completeness and Compactness

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

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

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

Propositional and Predicate Logic - VII

PHIL 50 - Introduction to Logic

Modal Dependence Logic

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

GÖDEL S COMPLETENESS AND INCOMPLETENESS THEOREMS. Contents 1. Introduction Gödel s Completeness Theorem

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

NP-Complete problems

Reversed Squares of Opposition in PAL and DEL

First-order logic Syntax and semantics

Propositional Logics and their Algebraic Equivalents

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

1. Propositional Calculus

Lecture 7. Logic. Section1: Statement Logic.

Discrete Mathematics

Ahmad KARIMI A NON-SELF-REFERENTIAL PARADOX IN EPISTEMIC GAME THEORY

Lecture 16: Relevance Lemma and Relational Databases

Propositional Logic: Part II - Syntax & Proofs 0-0

Reasoning with Probabilities. Eric Pacuit Joshua Sack. Outline. Basic probability logic. Probabilistic Epistemic Logic.

Chapter 4: Classical Propositional Semantics

Propositional Logic. Spring Propositional Logic Spring / 32

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

Logic Propositional logic; First order/predicate logic

Introduction to Theoretical Computer Science

ECE473 Lecture 15: Propositional Logic

UNIT-I: Propositional Logic

Classical First-Order Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

10 Propositional logic

A Logic Primer. Stavros Tripakis University of California, Berkeley. Stavros Tripakis (UC Berkeley) EE 144/244, Fall 2014 A Logic Primer 1 / 35

Relational Reasoning in Natural Language

cse541 LOGIC FOR COMPUTER SCIENCE

Propositional and Predicate Logic - II

TABLEAU SYSTEM FOR LOGIC OF CATEGORIAL PROPOSITIONS AND DECIDABILITY

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

A Logic Primer. Stavros Tripakis University of California, Berkeley

Towards A Multi-Agent Subset Space Logic

The semantics of propositional logic

Timo Latvala. February 4, 2004

CS 375/CS M75 Logic for Computer Science

Lecture 6: Formal Syntax & Propositional Logic. First: Laziness in Haskell. Lazy Lists. Monads Later. CS 181O Spring 2016 Kim Bruce

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

C. Modal Propositional Logic (MPL)

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

Logic for Computer Science - Week 2 The Syntax of Propositional Logic

Syntax of propositional logic. Syntax tree of a formula. Semantics of propositional logic (I) Subformulas

Introduction to Metalogic 1

CS 173 Lecture 2: Propositional Logic

Mathematical Logic. An Introduction

Lecture 4: Proposition, Connectives and Truth Tables

NON-DETERMINISTIC SEMANTICS FOR LOGICAL SYSTEMS

1 Completeness Theorem for First Order Logic

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Propositional Language - Semantics

1 PSPACE-Completeness

Alternating-Time Temporal Logic

Introduction to Metalogic

2 Truth Tables, Equivalences and the Contrapositive

Fundamentals of Programming Languages I Introduction and Logics

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Digital Logic Design: a rigorous approach c

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Epistemic Informativeness

Canonical Calculi: Invertibility, Axiom expansion and (Non)-determinism

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION

Propositional Dynamic Logic

ICS141: Discrete Mathematics for Computer Science I

BETWEEN THE LOGIC OF PARMENIDES AND THE LOGIC OF LIAR

Logical Structures in Natural Language: First order Logic (FoL)

Handout: Proof of the completeness theorem

Formal Verification Methods 1: Propositional Logic

Partial model checking via abstract interpretation

Restricted truth predicates in first-order logic

Transcription:

Lecture 3: Semantics of Propositional Logic 1 Semantics of Propositional Logic Every language has two aspects: syntax and semantics. While syntax deals with the form or structure of the language, it is semantics that adds meaning to the form. The words or expressions of the language are interpreted with respect to some world. Semantics is a mapping from the language to that world. In the case of propositional logic, the words of the language are the formulas in FORM and the world in which the formulas should be interpreted is given by a truth assignment τ : PROP {0, 1}, which is a function that assigns true or false to each atomic proposition in PROP. Now a function that assigns 0 or 1 to each element of a set can also be viewed as selecting a subset of the set: if an element is assigned value 1 then add it to the subset, otherwise leave it out. Thus, such a function can be uniquely identified with a subset of its domain. With this intuition, which we formalize below, each subset of PROP can be viewed as a truth assignment. The set of all truth assignments, which is also called the set of possible worlds, the semantical domain, or the domain of discourse, is 2 PROP. Semantics is the relation between FORM, the set of all formulas, and 2 PROP, the set of all worlds. We call this relation satisfaction, denoted by =, where = 2 PROP FORM. Definition 1. A truth assignment, τ, is an element of 2 PROP. There are two ways to think of truth assignments: 1. 2 PROP can be thought of as the power set of all propositions, and a truth assignment X is an element of it, that is, X PROP. Accordingly, a proposition is true if it is in the subset X of 2 PROP and is otherwise false. 2. Or, we can think of 2 PROP as the set of all functions from PROP to the set {0, 1}. Then, a truth assignment is a map τ : PROP {0, 1}. A proposition is true if it maps to 1. These notions are equivalent since given X PROP, we can define τ X : PROP {0, 1} by τ X (p) = { 1 if p X 0 if p / X 1

which is the characteristic function of X. Conversely, given τ : PROP {0, 1}, we can take X τ = {p τ(p) = 1}. Recall from the first lecture, that logic is used in many different fields including philosophy, foundational mathematics, computer science and electrical engineering. Each of these fields bring their own approach to logic based upon their different needs and motivations. For example, while philosophers use logic to reason about fundamental concepts such as truth and knowledge, electrical engineers use logic to build a mathematical foundation for their theory of electronic circuits. Here we look at how the semantics of propositional logic are defined by different fields that use logic. We will look at three different perspectives: 1. philosopher s view 2. electrical engineer s view 3. software engineer s view We will see that despite their very different approaches to the subject, the different definitions are equivalent. 2 Philosopher s view For a philosopher, semantics is a binary relation = between structures and formulas. τ = ϕ means: 1. τ satisfies ϕ or 2. τ is true of ϕ or 3. ϕ holds at τ or 4. τ is a model of ϕ. Example: object τ: table formular ϕ: this table is round τ = ϕ can be either true of false Definition 2. = (2 PROP FORM) is a binary relation, between truth assignments and formulas. = is called the satisfaction relation, semantical relation, or the truth relation. We define it inductively as follows: τ = p, for p PROP, if τ(p) = 1, meaning that p holds if p is true. τ = ( ϕ) if it is not the case that τ = ϕ, that is, if τ = ϕ (Note: this is so only in 2-valued world). 2

τ = (ϕ ψ) if τ = ϕ or τ = ψ. τ = (ϕ ψ) if τ = ϕ and τ = ψ. τ = (ϕ ψ) if τ = ϕ implies τ = ψ, i.e. if τ = ϕ or τ = ψ. τ = (ϕ ψ) if τ = ϕ iff τ = ψ. It is important to realize that the semantics is well defined because of the Unique Readability Theorem. The definition above relies on the fact that, given a formula, we can talk about its primary connective and its immediate subformula(s) without ambiguity. Without unique readability, we would not have well-defined semantics. Suppose for example that we do not require parentheses, and consider the formula p q r. Let τ be a truth assignment such that τ(p) = 0, τ(q) = 1, and τ(r) = 1. Since the example formula does not have a unique primary connective, its meaning may be defined in the following two ways: τ = p q r iff τ = p and τ = q r. Since τ = p, we have that τ = p q r. τ = p q r iff τ = p q and τ = r. Since τ = r, τ = p q r. According to the above example, a formula could have two different truth values if it did not have a unique primary connective. A similar kind of ambiguity exists also in natural languages. Consider the following English phrase: John hates Jim and he likes Jill. Who is he? It is ambiguous. This points out an important feature of this definition, the compositionality of =. An example is τ = (ϕ ψ). All that is needed is information about τ = ϕ and τ = ψ and those answers are independent of each other. This is alot like modularity in programming. 3 Electrical Engineer view To an electrical engineer the truth assignment is simply a mapping of voltages on a wire: τ : P rop {0, 1} Operations are carried out by gates, which represent logical connectives. The value of the voltage along the wire is continuous, hence a zero value is assigned to an interval of voltages and a one is assigned to a non-overlapping interval of voltage. An AND gate takes in two voltages and returns a voltage representing 1 if and only if both input voltages represented a 1. In general, a k-ary gate g is a mapping g : {0, 1} k {0, 1}. It takes in voltages and returns a voltage as dictated by its logical specification. Here are some examples: : {0, 1} {0, 1} (0) = 1 and (1) = 0 : {0, 1} 2 {0, 1} 3

(0, 0) = (1, 0) = (0, 1) = 0 and (1, 1) = 1 : {0, 1} 2 {0, 1} (1, 1) = (1, 0) = (0, 1) = 1 and (0, 0) = 0 : {0, 1} 2 {0, 1} (1, 1) = (0, 0) = (0, 1) = 1 and (1, 0) = 0 : {0, 1} 2 {0, 1} (1, 1) = (0, 0) = 1 and (1, 0) = (0, 1) = 0 We can now think of a formula as a circuit, which maps truth assignments to Boolean values: ϕ : 2 P rop {0, 1}. The logical operands, defined previously in the section on logic in philosophy, can be alternatively defined as gates that take in the inputs ϕ and ψ and returns the specified output. ϕ, ψ ( ϕ) (ϕ ψ) (ϕ ψ) (ϕ ψ) (ϕ ψ) 0 0 1 1 0 1 1 the takes a single 1 0 0 1 0 0 0 immediate subformula 0 1 1 0 1 0 and has only two 1 1 0 1 1 1 possible inputs. Definition 3. Let p P rop, τ 2 P rop. Then the semantics is defined according to the following rules: p(τ) = τ(p) (a proposition viewed as a circuit is just a wire) ( ϕ)(τ) = (ϕ(τ)) (ϕ ψ)(τ) = (ϕ(τ), ψ(τ)) The first rule says that τ maps a proposition to its truth value. The second and third rule say that with a given τ the value of a formula can be determined from the truth values of its immediate subformulae by applying the primary connective, its functionality defined in the above table, to the values of the immediate subformulas under the same τ. Next we prove that these two semantic formulations are equivalent. The transition between each step in the proof uses equivalence, meaning that the steps can be reversed to prove the only if part of the lemma. Notice the almost mechanical pattern of the proof. In each case the philosopher s definition is applied first, followed by the inductive hypothesis, followed by application of the above table, followed by application of the electrical engineer s definition of the connective. Lemma 1. Let ϕ F orm and τ 2 P rop. Then τ = ϕ iff ϕ(τ) = 1. Proof. Proof by structural induction: 4

Basis : ϕ = p, for p PROP. Then τ = ϕ iff τ(p) = 1 iff p(τ) = 1. Inductive Step : 1. ϕ = ( ψ). Then τ = ( ψ) iff τ = ψ iff ψ(τ) = 0 iff (ψ(τ)) = 1 iff ( ψ)(τ) = 1. 2. ϕ = (ψ θ). Then τ = (ψ θ) iff (τ = ψ and τ = θ) iff ψ(τ) = 1 and θ(τ) = 1 iff (ψ(τ), θ(τ)) = 1 iff (ψ θ)(τ) = 1. 3. ϕ = (ψ θ). Then τ = (ψ θ) iff (τ = ψ or τ = θ) iff ψ(τ) = 1 or θ(τ) = 1 iff (ψ(τ), θ(τ)) = 1 iff (ψ θ)(τ) = 1. 4. ϕ = (ψ θ). Then τ = (ψ θ) iff (τ = ψ or τ = θ) iff ψ(τ) = 0 or θ(τ) = 1 iff (ψ(τ), θ(τ)) = 1 iff (ψ θ)(τ) = 1. 5