Mathematical Logic. Truth Tables. Truth Tables: Example. Practical Class: Formalization in Propositional Logic. Chiara Ghidini

Similar documents
Practice assignment 2

Proving logical equivalencies (1.3)

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming

CHAPTER 6 - THINKING ABOUT AND PRACTICING PROPOSITIONAL LOGIC

Tautologies, Contradictions, and Contingencies

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

Propositional Calculus. Problems. Propositional Calculus 3&4. 1&2 Propositional Calculus. Johnson will leave the cabinet, and we ll lose the election.

Logic: Propositional Logic Truth Tables

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:

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

INTRODUCTION TO LOGIC 3 Formalisation in Propositional Logic

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

About the relationship between formal logic and complexity classes

Propositional Logic: Semantics and an Example

Turing Machines Part Three

Maryam Al-Towailb (KSU) Discrete Mathematics and Its Applications Math. Rules Math. of1101 Inference 1 / 13

THE LOGIC OF COMPOUND STATEMENTS

a. ~p : if p is T, then ~p is F, and vice versa

Chapter 7 Propositional Satisfiability Techniques

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

Gödel s Incompleteness Theorem. Overview. Computability and Logic

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC

Symbolic Logic Outline

First Order Logic: Syntax and Semantics

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini FBK-IRST, Trento, Italy. May 2, 2013

Agents that reason logically

First Order Logic: Syntax and Semantics

MAT 101 Exam 2 Logic (Part I) Fall Circle the correct answer on the following multiple-choice questions.

Logic and Propositional Calculus

PUZZLE. You meet A, B, and C in the land of knights and knaves. A says Either B and I are both knights or we are both knaves.

Math.3336: Discrete Mathematics. Propositional Equivalences

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

CSCI3390-Lecture 16: NP-completeness

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Propositional Language - Semantics

Revisit summer... go to the Fitzwilliam Museum!

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

Your quiz in recitation on Tuesday will cover 3.1: Arguments and inference. Your also have an online quiz, covering 3.1, due by 11:59 p.m., Tuesday.

Propositional Logic 1

Unary negation: T F F T

Chapter 7 Propositional Satisfiability Techniques

Lecture 5 : Proofs DRAFT

~ p is always false. Based on the basic truth table for disjunction, if q is true then p ~

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Chapter Finding parse trees

PHIL12A Section answers, 16 February 2011

CIS 375 Intro to Discrete Mathematics Exam 1 (Section M004: Blue) 6 October Points Possible

Notes for Recitation 1

Propositional Equivalence

UNIT-I: Propositional Logic

Logic of Sentences (Propositional Logic) is interested only in true or false statements; does not go inside.

Semantics and Pragmatics of NLP

Definition 2. Conjunction of p and q

1.1 Statements and Compound Statements

Artificial Intelligence Knowledge Representation I

EECS 1028 M: Discrete Mathematics for Engineers

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

Propositional Logic Review

Truth, Subderivations and the Liar. Why Should I Care about the Liar Sentence? Uses of the Truth Concept - (i) Disquotation.

Practice Exam 2. You MUST show all your work, and indicate which value is the main operator value.


The Foundations: Logic and Proofs. Part I

1 Propositional Logic

1 Propositional Logic

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents

Knowledge-based Agents. CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents. Outline. Knowledge-based Agents

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

A Quick Lesson on Negation

Logic and Proofs. Jan COT3100: Applications of Discrete Structures Jan 2007

Natural deduction for truth-functional logic

PHIL 422 Advanced Logic Inductive Proof

Logic. Quantifiers. (real numbers understood). x [x is rotten in Denmark]. x<x+x 2 +1

Logical Agents. Outline

Truth-Functional Logic

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

CSE 20: Discrete Mathematics

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

Chapter 3: Propositional Calculus: Deductive Systems. September 19, 2008

Only one of the statements in part(a) is true. Which one is it?

Propositional Logic: Bottom-Up Proofs

Chapter 4: Classical Propositional Semantics

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

Week 3: Reductions and Completeness

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

Introduction Propositional Logic

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

DERIVATIONS AND TRUTH TABLES

DEDUCTIVE REASONING Propositional Logic

Completeness for FOL

Section 3.1 Statements, Negations, and Quantified Statements

Propositional Logic George Belic

Logic & Logic Agents Chapter 7 (& Some background)

Logic I - Session 10 Thursday, October 15,

CSC Discrete Math I, Spring Propositional Logic

Announcements CompSci 102 Discrete Math for Computer Science

Transcription:

Practical Class: Formalization in Propositional Logic 1 2 FBK-IRST, Trento, Italy 2014/2015 3 : Example F G F F G F G F G T T F T T T T F F F T F F T T F T T F F T F F T Truth tables of some propositional logical symbols. Compute the truth table of (F G) (F G). F G F G F G (F G) (F G) (F G) T T T T F F T F T F T T F T T F T T F F F F T F Intuitively, what does this formula represent?

: Example (2) Recall some definitions Two formulas F and G are logically equivalent (denoted with F G) if for each interpretation I, I(F ) = I(G). Let F and G be formulas. G is a logical consequence of F (denoted with F = G) if each interpretation satisfying F satisfies also G. Let F be a formula: F is valid if every interpretation satisfies F F is satisfiable if F is satisfied by some interpretation F is unsatisfiable if there isn t any interpretation satisfying F Use the truth tables method to determine whether (p q) (p q) is valid. p q p q q p q (p q) (p q) T T T F F T T F F T T T F T T F T T F F T T T T The formula is valid since it is satisfied by every interpretation. : Example (3) : Example (4) Use the truth tables method to determine whether ( p q) (q r p) (p r) (denoted with F ) is satisfiable. Use the truth tables method to determine whether p q p q is a logical consequence of p. p q r p q r p q r p (p r) F T T T T F F T F T T F T F F T F T F T F F T T F T F F F F T T F F T T T F F T F F T F T T T F F F F T T F T T T F F F T T T F F p q p p q p q p q p q T T F F T T T F F T F F F T T F F T F F T F F T There exists an interpretation satisfying F, thus F is satisfiable.

: Example (5) : s Use the truth tables method to determine whether p (q q) and p are logically equivalent. p q q q p (q q) p T T F F F T F F F F F T F T T F F F T T Compute the truth tables for the following propositional formulas: (p p) p p (p p) p q p q p (q r) (p r) q p (q p) (p q) (p q) : s : s Use the truth table method to verify whether the following formulas are valid, satisfiable or unsatisfiable: (p q) q p (p q) (p q) (p q r) p q (p q) (p r q) (q r p) (p (q r)) ((p q) (p r)) (p q) ( q p) ( p q) ((p r) q) (p q) (p q) (p (q r)) (r p) Use the truth table method to verify whether the following logical consequences and equivalences are correct: (p q) = p q (p q) q = p p q r = (p q) r p ( q r) = q r p (p q) p q (p q) ( p q) q (p q) r (p q) r (p q) ( p q) p ((p q) q) q p q

Let s consider a propositional language where p means Paola is happy, q means Paola paints a picture, and r means Renzo is happy. Formalize the following sentences: 1 if Paola is happy and paints a picture then Renzo isn t happy p q r 2 if Paola is happy, then she paints a picture p q 3 Paola is happy only if she paints a picture (p q) which is equivalent to p q!!! The precision of formal languages avoid the ambiguities of natural languages. Let A = Angelo comes to the party, B = Bruno comes to the party, C = Carlo comes to the party, and D = Davide comes to the party. Formalize the following sentences: 1 If Davide comes to the party then Bruno and Carlo come too 2 Carlo comes to the party only if Angelo and Bruno do not come 3 If Davide comes to the party, then, if Carlo doesn t come then Angelo comes 4 Carlo comes to the party provided that Davide doesn t come, but, if Davide comes, then Bruno doesn t come 5 A necessary condition for Angelo coming to the party, is that, if Bruno and Carlo aren t coming, Davide comes 6 Angelo, Bruno and Carlo come to the party if and only if Davide doesn t come, but, if neither Angelo nor Bruno come, then Davide comes only if Carlo comes - Solution 1 If Davide comes to the party then Bruno and Carlo come too D B C 2 Carlo comes to the party only if Angelo and Bruno do not come C A B 3 If Davide comes to the party, then, if Carlo doesn t come then Angelo comes D ( C A) - Solution 1 Carlo comes to the party provided that Davide doesn t come, but, if Davide comes, then Bruno doesn t come (C D) (D B) 2 A necessary condition for Angelo coming to the party, is that, if Bruno and Carlo aren t coming, Davide comes A ( B C D) 3 Angelo, Bruno and Carlo come to the party if and only if Davide doesn t come, but, if neither Angelo nor Bruno come, then Davide comes only if Carlo comes (A B C D) ( A B (D C))

Formalize the following arguments and verify whether they are correct: If you play and you study you ll pass the exams, while if you play and don t study you won t pass. Thus, if you play, either you study and you ll pass the exams, or you don t study and you won t pass. If you play and you study you ll pass the exams, while if you play and don t study you won t pass. Thus, if you play, either you study and you ll pass the exams, or you don t study and you won t pass. 1 p s e 2 p s e 3 p (s e) ( s e) We need to prove that 1. 2. = 3. Use truth tables The 3 doors The 3 doors: Solution Kyle, Neal, and Grant find themselves trapped in a dark and cold dungeon (HOW they arrived there is another story). After a quick search the boys find three doors, the first one red, the second one blue, and the third one green. Behind one of the doors is a path to freedom. Behind the other two doors, however, is an evil fire-breathing dragon. Opening a door to the dragon means almost certain death. On each door there is an inscription: freedom freedom freedom is behind is not behind is not behind this door this door the blue door Given the fact that at LEAST ONE of the three statements on the three doors is true and at LEAST ONE of them is false, which door would lead the boys to safety? Language r: freedom is behind the red door b: freedom is behind the blue door g: freedom is behind the green door 1 behind one of the door is a path to freedom, behind the other two doors is an evil dragon (r b g) ( r b g) ( r b g) 2 at least one of the three statements is true r b 3 at least one of the three statements is false r b

The 3 doors: Solution (2) 1 (r b g) ( r b g) ( r b g) 2 r b 3 r b Solution r b g 2 3 2 3 T F F T F F F T F F T F F F T T T T Define a propositional language which allows to describe the state of a traffic light on different instants. With the language defined above provide a (set of) formulas which expresses the following facts: the traffic light is either green, or red or orange; the traffic light switches from green to orange, from orange to red, and from red to green; it can keep the same color over at most 3 successive states. Freedom is behind the green door! Solution gk = traffic light is green at instant k, rk = traffic light is red at instant k and ok = traffic light is orange at instant k. Let s formalize the traffic light behavior: 1 the traffic light is either green, or red or orange (gk ( rk ok)) (rk ( gk ok)) (ok ( rk gk)) 2 the traffic light switches from green to orange, from orange to red, and from red to green (gk 1 (gk ok)) (ok 1 (ok rk)) (rk 1 (rk gk)) 3 it can keep the same color over at most 3 successive states (gk 3 gk 2 gk 1 gk) (rk 3 rk 2 rk 1 rk) (ok 3 ok 2 ok 1 ok) Provide a propositional language and a set of axioms that formalize the graph coloring problem of a graph with at most n nodes, with connection degree m, and with less then k + 1 colors. node degree: number of adjacent nodes connection degree of a graph: max among all the degree of its nodes Graph coloring problem: given a non-oriented graph, associate a color to each of its nodes in such a way that no pair of adjacent nodes have the same color.

: Propositional Formalization Example Language For each 1 i n and 1 c k, coloric is a proposition, which intuitively means that the i-th node has the c color For each 1 i j n, edge ij is a proposition, which intuitively means that the i-th node is connected with the j-th node. for each 1 i n, k c=1 coloric each node has at least one color for each 1 i n and 1 c, c k, coloric color ic every node has at most 1 color for each 1 i, j n and 1 c k, edge ij (coloric colorjc) adjacent nodes do not have the same color for each 1 i n, and each J {1..n}, where J = m, j J edge ij j J edge ij every node has at most m connected nodes Example: Solution is a placement puzzle. The aim of the puzzle is to enter a numeral from 1 through 9 in each cell of a grid, most frequently a 9 9 grid made up of 3 3 subgrids (called regions ), starting with various numerals given in some cells (the givens ). Each row, column and region must contain only one instance of each numeral. Its grid layout is like the one shown in the following schema Provide a formalization in propositional logic of the sudoku problem, so that any truth assignment to the propositional variables that satisfy the axioms is a solution for the puzzle. Example: Solution Language For 1 n, r, c 9,define the proposition in(n, r, c) which means that the number n has been inserted in the cross between row r and column c. 1 A raw contains all numbers from 1 to 9 9 9 9 in(n, r, c) r=1 n=1 c=1 2 A column contains all numbers from 1 to 9 9 9 9 in(n, r, c) c=1 n=1 r=1 3 A region (sub-grid) contains all numbers from 1 to 9 for any 0 k, h 2 9 3 3 in(n, 3 k + r, 3 h + c) n=1 r=1 c=1 4 A cell cannot contain two numbers for any 1 n, n, c, r 9 and n n in(n, r, c) in(n, r, c)