Informatics 1 - Computation & Logic: Tutorial 5 v:1.12 1st November :36:40

Similar documents
Informatics 1 - Computation & Logic: Tutorial 1

Informatics 1 - Computation & Logic: Tutorial 1

Informatics 1 - Computation & Logic: Tutorial 3

Computation and Logic Definitions

Supplementary exercises in propositional logic

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

CSE 20 DISCRETE MATH WINTER

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

ECE473 Lecture 15: Propositional Logic

Deductive Systems. Lecture - 3

Comp487/587 - Boolean Formulas

Advanced Topics in LP and FP

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Language of Propositional Logic

Normal Forms of Propositional Logic

Propositional Resolution

Propositional Logic: Models and Proofs

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

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

Propositional Resolution

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

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

Logic: Propositional Logic (Part I)

Part 1: 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

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Propositional Resolution Part 1. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

Logic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Logic and Inferences

6. Logical Inference

Propositional Resolution Introduction

3 Propositional Logic

Maximum 3-SAT as QUBO

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Discrete Mathematics and Its Applications

PL: Truth Trees. Handout Truth Trees: The Setup

Propositional Logic Language

MAT2345 Discrete Math

Lecture 9: The Splitting Method for SAT

Logic: Propositional Logic Truth Tables

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Artificial Intelligence Chapter 7: Logical Agents

Introduction to Intelligent Systems

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

Philosophy 220. Truth-Functional Equivalence and Consistency

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

Inference in Propositional Logic

A. Incorrect! This inequality is a disjunction and has a solution set shaded outside the boundary points.

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

CS 512, Spring 2017, Handout 10 Propositional Logic: Conjunctive Normal Forms, Disjunctive Normal Forms, Horn Formulas, and other special forms

First-Degree Entailment

Propositional logic. Programming and Modal Logic

Proof Methods for Propositional Logic

Logic and Truth Tables

Propositional and First Order Reasoning

CS156: The Calculus of Computation

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Critical Reading of Optimization Methods for Logical Inference [1]

The statement calculus and logic

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

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Introduction to Intelligent Systems

Propositional Logic. Yimei Xiang 11 February format strictly follow the laws and never skip any step.

Tecniche di Verifica. Introduction to Propositional Logic

Introduction to Metalogic

CS156: The Calculus of Computation Zohar Manna Autumn 2008

Propositional logic. Programming and Modal Logic

ON1 Big Mock Test 4 October 2013 Answers This test counts 4% of assessment for the course. Time allowed: 10 minutes

AI Programming CS S-09 Knowledge Representation

Part 1: Propositional Logic

Solutions for the fourth week s homework Math 131

Foundations of Artificial Intelligence

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

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

We last time we began introducing equivalency laws.

Warm-Up Problem. Is the following true or false? 1/35

Truth-Functional Logic

NP-Completeness Part II

Natural Deduction for Propositional Logic

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

Course Staff. Textbook

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Web Science & Technologies University of Koblenz Landau, Germany. Models in First Order Logics

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Conjunctive Normal Form and SAT

Propositional logic (revision) & semantic entailment. p. 1/34

2.2: Logical Equivalence: The Laws of Logic

Inference Methods In Propositional Logic

Mathematical Logic Propositional Logic - Tableaux*

Propositional Reasoning

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Compound Propositions

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Transcription:

Informatics 1 - Computation & Logic: Tutorial 5 v:1.12 1st November 2017 16:36:40 Satisfiability and Resolution Week 7: 30 October 3 November 2017 Please attempt the entire worksheet in advance of the tutorial, and bring all work with you. Tutorials cannot function properly unless you study the material in advance. Attendance at tutorials is obligatory; please let the ITO know if you cannot attend. You may work with others, indeed you should do so; but you must develop your own understanding; you can t phone a friend during the exam. If you do not master the coursework you are unlikely to pass the exams. We say that Γ = iff every state that satisfies every expression in Γ satisfies at least one expression in. In particular, = (the LHS is empty) iff is a tautology, and Σ = (the RHS is empty) iff Σ is not satisfiable. We represent a state as (the conjunction of) the set V of literals true in that state. For any formula φ either V = φ or V = φ as V makes φ either true or false. So, Γ = iff for all states V. ( (for all ϕ Γ. V = ϕ) (for some ψ. V = ψ) ) Homework Γ = iff there is a counterexample V such that (for all ϕ Γ. V = ϕ) and, (for all ψ. V = ψ) 1. Which of the following statements are true? In each false case give a counterexample (specify values for Γ, that make one entailment valid, then give values for ϕ, ψ that show the other is invalid). (a) Γ =, ϕ iff Γ, ϕ = true (b) Γ =, ϕ iff Γ, ϕ = true (c) Γ =, ϕ ψ iff Γ =, ϕ, ψ Γ = = ; ϕ = ; ψ = (d) Γ =, ϕ ψ iff Γ =, ϕ, ψ true (e) Γ, ϕ ψ = iff Γ, ϕ, ψ = Γ = ; = {ψ}; ϕ = ; ψ = (f) Γ, ϕ ψ = iff Γ, ϕ, ψ = true 1

You should have found that 1(a) is true: Γ =, ϕ iff Γ, ϕ =. For example (in this example = ), D (A B), E (C? A : B), (B? E D : C E) = (D C) (B E) iff D (A B), E (C? A : B), (B? E D : C E), ( (D C) (B E) ) = In general, if we write for { ψ ψ }, Γ = iff Γ, = This means that, Γ = iff Γ, is inconsistent. Resolution is a procedure used to search for a state that satisfies a given set of constraints, Σ. If there is no state satisfying Σ which means that Σ is inconsistent then resolution will produce the empty clause. So, we can test whether Γ = by converting Σ = Γ, to CNF and then using resolution. If resolution of Σ produces the empty clause then the entailment is valid; otherwise a satisfying valuation for Σ provides a counterexample to the entailment. In the examples below there is only one conclusion is a singleton. 2. Use resolution to determine whether the following entailment is valid. A (B C), D (B C) = A D (a) First convert each assumption and the negation of each conclusion to clausal form. i. A (B C) { A, B, C} ii. D (B C) { B, C, D} iii. (A D) {A},{ D} (b) Check whether this set of constraints is consistent: When our constraints include singleton clauses (also known as unit clauses), then the literals they include must be true in any satisfying assignment. We can simlify our clauses by making these literals true. For example, here,{a} and { D} are unit clauses. AD B { A, B, C} {B, C} { B, C, D}} { B, C} {C, C} {A} { D} 2

The constraints are consistent so the entailment is invalid. To make the unit clauses true, we made A true and D false; this makes the conclusion of the entailment false To construct a counterexample, we can choose any value for C, and make B = C; it is easy to check that this makes the assumptions true 3

3. Determine whether the following entailment is valid (D (A B)), (E (C? A : D)), (B? C E : A C) = (B C) (D E) (a) First convert each assumption and the negation of each conclusion to clausal form. i. D (A B) {A, B, D} ii. E (C? A : D) { A, C, E}, {D, C, E} iii. (B? C E : A C) { B, C, E},{ A, B, C} iv. ( (B C) (D E) ) { B, C}, {D}, { E} (b) Check whether this set of constraints is consistent: First, make unit literals true,. DE A B C D {A, B, D} A {A, B} E { A, C, E} A { A, C} B {B, C} C { C} D {D, C, E} { B, C, E} B { B, C} A { A, B, C} B {B, C} C {C} {} B { B, C} D {D} E { E} The constraints are inconsistent so the entailment is valid. You should now be able to tackle many of the questions on past papers. These can be found at https://www.inf.ed.ac.uk/teaching/exam_papers/ Here are some questions you should be able to answer: Dec 2014 Q1, Q3 Dec 2015 Q1, Q3(a,b) Aug 2016 Q1, Q3(a,b) Dec 2016 Q1, Q2, Q4 4. Try these and bring any questions you may have to your tutorial, or visit InfBase. 4

Entailment Γ = iff for all states V. ( (for all ϕ Γ. V = ϕ) (for some ψ. V = ψ) ) Γ = iff there is a counterexample V such that (for all ϕ Γ. V = ϕ) and, (for all ψ. V = ψ) We will normally omit the set-brackets {}, and other set-notation, when writing entailments. For example, if ϕ, ψ, θ are expressions, we write Γ = ϕ for Γ = {ϕ} Γ, θ = ϕ, ψ for Γ {θ} = {ϕ, ψ} Now consider what this definition of = means in some special cases. The case where is empty. Γ = (Γ = ) means that the conjunction Γ of all expressions in Γ is contradictory. The case where Γ is empty. = ( = ) means that the disjunction of all expressions in is a tautology. The case in which Γ is a non-contradictory set of literals. A non-contradictory set of literals determines a truth valuation of the atoms it mentions. In this case, Γ = ϕ means that the valuation determined by Γ makes ϕ true. If both Γ and are sets of literals, and Γ is non-contradictory, we can view Γ as representing a valuation V and as representing a clause Γ = iff Γ is non-empty: (Γ ), which means that V satisfies. 5

Tutorial Activity 1. As usual, you should start by working as a group to identify and resolve any problems with the homework. 2. Consider the simple Traffic Light, introduced in class, with a cycle of four states. The four legal states of the light are captured by the four states of the variables R, A representing the red and amber lights. The Green light is on only in the state represented by R A. In this question, you will extend the model by adding one more state variable C, representing the presence of a car there is normally a sensor in the road that indicates a car is passing or waiting at the light, C could be the output of this sensor. The new system will have eight states each each legal state of the lights, with a car present C or absent C. (a) Assume that the lights cycle through the proper sequence, and that cars always obey the traffic regulations, draw a diagram of the legal state transitions. Give a logical description of the legal transitions. (b) Can you remove some transitions to describe a system in which the lights will not change to green unless there is a car waiting? Give a logical description of the transitions you allow. (c) How might you model an intersection with two pairs of lights? What should be the states of this system? What conditions on the states and transitions do we need to specify a safe and efficient system? 3. Modify the PIN-checking section of the ATM to allow more than one attempt to enter the PIN. Your machine should retain the card after three wrong PIN entries. A B D C current A B C D wrong PIN ATM insert card B C D A next current ard A G take money amount no ok? 0 G0 next choose a/c withdraw R0 A withdraw nce bala return c R PIN ok return card yes 5 4 This tutorial exercise sheet was written by Dave Cochran and Michael Fourman, drawing on material from an earlier tutorials produced by Paolo Besana, Thomas French, and Areti Manataki. Send comments to Michael.Fourman@ed.ac.uk 6