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

Similar documents
Propositional Reasoning

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

A brief introduction to Logic. (slides from

Propositional Resolution

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

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

Inference in Propositional Logic

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

CS 4700: Foundations of Artificial Intelligence

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Introduction to Artificial Intelligence. Logical Agents

Logic: Propositional Logic (Part I)

Comp487/587 - Boolean Formulas

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

Formal Verification Methods 1: Propositional Logic

Foundations of Artificial Intelligence

CS156: The Calculus of Computation

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

02 Propositional Logic

Intelligent Agents. Pınar Yolum Utrecht University

Kecerdasan Buatan M. Ali Fauzi

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope)

Advanced Topics in LP and FP

CS:4420 Artificial Intelligence

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

Learning Goals of CS245 Logic and Computation

Chapter 4: Classical Propositional Semantics

Class Assignment Strategies

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

Part 1: Propositional Logic

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

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

CS 380: ARTIFICIAL INTELLIGENCE

Logical Agents. Chapter 7

Logic and Inferences

Tecniche di Verifica. Introduction to Propositional Logic

Deliberative Agents Knowledge Representation I. Deliberative Agents

Artificial Intelligence Chapter 7: Logical Agents

Propositional and First Order Reasoning

Proof Methods for Propositional Logic

LOGIC PROPOSITIONAL REASONING

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

CS 730/730W/830: Intro AI

CS 188: Artificial Intelligence Spring 2007

Propositional Logic Language

Artificial Intelligence. Propositional logic

Language of Propositional Logic

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

Logical Agents. Outline

Tutorial 1: Modern SMT Solvers and Verification

Lecture 2 Propositional Logic & SAT

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Propositional logic II.

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

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

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Artificial Intelligence

Propositional Logic: Evaluating the Formulas

Decision Procedures for Satisfiability and Validity in Propositional Logic

CS 4700: Artificial Intelligence

Propositional Calculus

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Inference Methods In Propositional Logic

Artificial Intelligence

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Satisfiability Modulo Theories

ECE473 Lecture 15: Propositional Logic

Propositional Logic: Methods of Proof (Part II)

Knowledge based Agents

Deductive Systems. Lecture - 3

CS 771 Artificial Intelligence. Propositional Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Propositional Logic Part 1

CS156: The Calculus of Computation Zohar Manna Autumn 2008

Propositional Logic: Methods of Proof (Part II)

Lecture 1: Logical Foundations

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

Propositional Logic: Models and Proofs

Maximum 3-SAT as QUBO

NP and Computational Intractability

Foundations of Artificial Intelligence

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

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

Reasoning with Quantified Boolean Formulas

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

Inference Methods In Propositional Logic

Foundations of Artificial Intelligence

Logical Agents. Santa Clara University

Foundations of Artificial Intelligence

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional Resolution

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Propositional and Predicate Logic - V

Propositional Resolution Introduction

Transcription:

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

Today Representation in Propositional Logic Semantics & Deduction Axioms and Facts Boolean Algebras Generate and Test Checking Satisfiability (SAT) using DPLL

Representing Knowledge Propositional symbols represent facts under consideration: there_is_rain, there_are_clouds, door1_open, robot_in_pos_56_210 Not propositions: is_there_rain? location_of_robot Dan_Roth

Truth Values Logical formulas: atoms, connectives, sentences Truth Assignments Evaluating the truth value of a formula Truth tables

Propositional Logic Semantics: Truth assignments that satisfy KB/formula I 1 I 2 I 3 I 4 -a -b a -b -a b a b Interpretations: I 1 [a]=false I 1 [b]=false assign truth values to propositional symbols

Propositional Logic Semantics: Truth assignments that satisfy KB/formula I 1 -a -b I 2 a -b M 1 = I 3 -a b M 2 = I 4 a b Models of f: Interpretations that satisfy f

Propositional Logic Semantics: Truth assignments that satisfy KB/formula M 1 = I 3 M 2 = I 4 Models of f: Interpretations that satisfy f

Propositional Logic Semantics: Truth assignments that satisfy KB/formula M 1 M 2 = I 4 Models of f: Interpretations that satisfy f

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment M 1

Examples Double negation, double disjunction De-Morgan s law Distributivity of conjunction and disjunction

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment

Propositional Logic Semantics: Truth assignments that satisfy KB/formula Logical Entailment Deduction (inference)

Notations Interpretations ~ Models Axioms formulae that are assumed Signature the symbols used by a KB Theory ~ KB (a set of axioms), or Theory ~ the complete set of sentences entailed by the axioms The value that symbol p takes in model M: M[p] Clauses: {lit1, lit2, lit3, } or lit1 lit2 lit3...

Representing Knowledge Knowledge bases are sets of formulae There_is_rain there_are_clouds Robot_in_pos_3_1 Position_3_1_empty Has_drink coffee tea

Knowledge Engineering Select a language: set of features Examine cases Decide on dependencies between features Write dependencies formally Test

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples (by Distributivity):

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples (by Distributivity): ( a a)

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples (by Distributivity): ( a a) ( a b)

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples (by Distributivity): ( a a) ( a b) ( b a)

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples (by Distributivity): ( a a) ( a b) ( b a) ( b b)

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples: Face_door_t1 ^ turn_cl_90_t1 -> ~face_door_t2 ~Face_door_t1 v ~turn_cl_90_t1 v ~face_door_t2

Clausal Form Every formula can be reformulated into an equivalent CNF formula (conjunction of clauses). Examples: face_door_t1 ^ move_fwd_t1 -> at_corridor_t2 ^ ~face_door_t2 ~face_door_t1 v ~move_fwd_t1 v ~at_corridor_t2 ~face_door_t1 v ~move_fwd_t1 v ~face_door_t2

Application: Hardware Verification x 1 x 2 AND f 1 not f 3 not f 2 AND f 5 x 3 OR f 4

Application: Hardware Verification x 1 x 2 AND f 1 not f 3 not f 2 AND f 5 x 3 OR f 4 Question: Can we set this boolean cirtuit to TRUE?

Application: Hardware Verification x 1 x 2 AND f 1 not f 3 not f 2 AND f 5 x 3 OR f 4 Question: Can we set this boolean cirtuit to TRUE? f 5 (x 1,x 2,x 3 ) = a function of the input signal

Application: Hardware Verification x 1 x 2 AND f 1 not f 3 not f 2 AND f 5 x 3 OR f 4 SAT(f 5 )? Question: Can we set this boolean cirtuit to TRUE? f 5 (x 1,x 2,x 3 ) = f 3 f 4 = f 1 (f 2 x 3 ) = (x 1 x 2 ) ( x 2 x 3 ) M[x 1 ]=FALSE M[x 2 ]=FALSE M[x 3 ]=FALSE

Hardware Verification Questions in logical circuit verification Equivalence of circuits Arrival of the circuit to a state (required a temporal model, which gets propositionalized) Achieving an output from the circuit

SATisfiability of Logical Formulas

SATisfiability of Logical Formulas Given KB in CNF If we have a truth table of KB, then we can check that KB satisfiable by looking at it.

SATisfiability of Logical Formulas Given KB in CNF If we have a truth table of KB, then we can check that KB satisfiable by looking at it. Problem: n propositional symbols 2 n rows in truth table Checking truth table with KB takes time O( KB ) Generating table is expensive: O(2 n KB ) time

SATisfiability of Logical Formulas Given KB in CNF If we have a truth table of KB, then we can check that KB satisfiable by looking at it. Problem: n propositional symbols 2 n rows in truth table Checking truth table with KB takes time O( KB ) Generating table is expensive: O(2 n KB ) time Observation: SAT requires us to look only for one model

DPLL (1960) Procedure for CNF 1. If KB is empty: True 2. If KB has empty clause: False 3. If KB has a unit clause ( a literal ) propagate literal to simplify clauses 4. else: Choose a variable heuristically Set var True, Recurse Set var False, Recurse Return value of recursion Simplify if possible. Search for satisfying assignment. Just a recursive search.

Propagating a Truth-Value KB in CNF, and we observe a=true Then, removing clauses with a positive from KB gives an equivalent theory. Example: KB

Propagating a Truth-Value KB in CNF, and we observe a=true Then, removing clauses with a positive from KB gives an equivalent theory. Example: KB Observe

Propagating a Truth-Value KB in CNF, and we observe a=true Then, removing clauses with a positive from KB gives an equivalent theory. Example: KB Observe

Propagating a Truth-Value KB in CNF, and we observe a=true Then, removing clauses with a positive from KB gives an equivalent theory. Example: KB Observe

Propagating a Truth-Value KB in CNF, and we observe a=true Then, removing negative instances of a from KB gives an equivalent theory. Example: KB Observe

Propagating a Truth-Value KB in CNF, and we observe a=true Then, removing negative instances of a from KB gives an equivalent theory. Example: KB Observe

DPLL Example

DPLL Example p XOR q = (p v q) & (-p v -q)

DPLL Example p XOR q = (p v q) & (-p v -q) p IFF q = (p XOR q)

DPLL Example p XOR q = (p v q) & (-p v -q) p IFF q = (p XOR q) Not SAT

DPLL Example p XOR q = (p v q) & (-p v -q) p IFF q = (p XOR q) (p XOR q) & (p XOR -q) Not SAT

DPLL Example p XOR q = (p v q) & (-p v -q) p IFF q = (p XOR q) (p XOR q) & (p XOR -q) Not SAT ( ((p1 XOR p2) XOR p3) XOR p4 ) &

DPLL Example p XOR q = (p v q) & (-p v -q) p IFF q = (p XOR q) (p XOR q) & (p XOR -q) Not SAT ( ((p1 XOR p2) XOR p3) XOR p4 ) & ( ((p1 XOR p2) XOR p3) XOR -p4 )

DPLL Example p XOR q = (p v q) & (-p v -q) p IFF q = (p XOR q) (p XOR q) & (p XOR -q) Not SAT ( ((p1 XOR p2) XOR p3) XOR p4 ) & ( ((p1 XOR p2) XOR p3) XOR -p4 ) DPLL takes O(2 n ) time, sometimes

SAT Solving Topics Order of selection of variables Stochastic local search Binary Decision Diagrams Strategies other than unit 2-SAT is solvable in linear time Smart backtracking Clauses/Vars in Random SAT SAT via probabilistic models