CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) February, 27, 2009.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
CPSC 322, Lecture 20Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Computer Science cpsc322, Lecture 20 (Textbook.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logical Agents Logic Propositional Logic Summary
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
1 Logical Inference Algorithms CS 171/271 (Chapter 7, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material.
First-Order Logic and Inductive Logic Programming.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
Review of Propositional Logic Syntax
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Slide 1 Propositional Logic Intro, Syntax Jim Little UBC CS 322 – CSP October 17, 2014 Textbook § – 5.2.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
UBC Department of Computer Science Undergraduate Events More
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Logic: TD as search, Datalog (variables)
Inference in Propositional Logic (and Intro to SAT)
Computer Science cpsc322, Lecture 20
EA C461 – Artificial Intelligence Logical Agent
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
First-Order Logic and Inductive Logic Programming
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21
Logical Inference: Through Proof to Truth
CS 416 Artificial Intelligence
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Artificial Intelligence: Agents and Propositional Logic.
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 22
Assignment-2 due now Enterprise Architecture Conference Sat. Oct 27
CS 416 Artificial Intelligence
Computer Science cpsc322, Lecture 20
Methods of Proof Chapter 7, second half.
Bottom Up: Soundness and Completeness
Bottom Up: Soundness and Completeness
Bottom Up: Soundness and Completeness
Presentation transcript:

CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart Russell (Berkeley), some from Prof. Carla P. Gomes (Cornell)

CPSC 422, Lecture 212 Lecture Overview Finish Resolution in Propositional logics Satisfiability problems WalkSAT Encoding Example

CPSC 422, Lecture 213 Full Propositional Logics DEFs. Literal: an atom or a negation of an atom Clause: is a disjunction of literals Conjunctive Normal Form (CNF): a conjunction of clauses INFERENCE: Convert all formulas in KB and in CNF Apply Resolution Procedure

Resolution Deduction step Resolution: inference rule for CNF: sound and complete! * “If A or B or C is true, but not A, then B or C must be true.” “If A is false then B or C must be true, or if A is true then D or E must be true, hence since A is either true or false, B or C or D or E must be true.” Simplification CPSC 322, Lecture 19

The resolution algorithm tries to prove: is converted in CNF Resolution is applied to each pair of clauses with complementary literals Resulting clauses are added to the set (if not already there) Process continues until one of two things can happen: 1.We find which is unsatisfiable. i.e. query is entailed 2.We find no contradiction: there is a model that satisfies the sentence and hence we cannot entail the query. Resolution Algorithm CPSC 322, Lecture 195

The resolution algorithm tries to prove: is converted in CNF Resolution is applied to each pair of clauses with complementary literals Resulting clauses are added to the set (if not already there) Process continues until one of two things can happen: 1.Two clauses resolve in the empty clause. i.e. query is entailed 2.No new clauses can be added: We find no contradiction, there is a model that satisfies the sentence and hence we cannot entail the query. Resolution Algorithm CPSC 422, Lecture 216

Resolution example KB = (A  (B  C))  A α =  B False in all worlds True! CPSC 422, Lecture 21Slide 7

CPSC 422, Lecture 21Slide 8

CPSC 422, Lecture 219 Lecture Overview Finish Resolution in Propositional logics Satisfiability problems WalkSAT Hardness of SAT Encoding Example

Satisfiability problems Consider a CNF sentence, e.g., (  D   B  C)  (B   A   C)  (  C   B  E)  (E   D  B)  (B  E   C) Is there an interpretation in which this sentence is true (i.e., that is a model of this sentence )? CPSC 422, Lecture 21Slide 10 Many combinatorial problems can be reduced to checking the satisfiability of propositional sentences (example later)

How can we solve a SAT problem? Consider a CNF sentence, e.g., (  D   B  C)  (A  C)  (  C   B  E)  (E   D  B)  (B  E   C) Each clause can be seen as a constraint that reduces the number of interpretations that can be models Eg (A  C) eliminates interpretations in which A=F and C=F CPSC 422, Lecture 21Slide 11 So SAT is a Constraint Satisfaction Problem: Find a possible world that is satisfying all the constraints (here all the clauses)

CPSC 422, Lecture 2112 WalkSAT algorithm (Stochastic) Local Search Algorithms can be used for this task! Evaluation Function: number of unsatisfied clauses WalkSat: One of the simplest and most effective algorithms: Start from a randomly generated interpretation Pick randomly an unsatisfied clause Pick a proposition/atom to flip (randomly 1 or 2) 1.Randomly 2.To minimize # of unsatisfied clauses

WalkSAT: Example (  D   B  C)  (A  C)  (  C   B )  (E   D  B)  (B  C ) CPSC 422, Lecture 21Slide 13

Pseudocode for WalkSAT CPSC 422, Lecture 21Slide 14 pw pw = possible world / interpretation 1 2

The WalkSAT algorithm If it returns failure after it tries max-flips times, what can we say? CPSC 422, Lecture 21Slide 15 A. The sentence is unsatisfiable Typically most useful when we expect a solution to exist C. The sentence is satisfiable B. Nothing

WalkSAT: Example (  D   B  C)  (A  C)  (  C   B )  (E   D  B)  (B  C ) CPSC 422, Lecture 21Slide 16

Hard satisfiability problems Consider random 3-CNF sentences. e.g., (  D   B  C)  (B   A   C)  (  C   B  E)  (E   D  B)  (B  E   C) m = number of clauses (5) n = number of symbols (5) Under constrained problems: Relatively few clauses constraining the variables Tend to be easy E.g. For the above problem16 of 32 possible assignments are solutions –(so 2 random guesses will work on average) CPSC 422, Lecture 21Slide 17

Hard satisfiability problems What makes a problem hard? Increase the number of clauses while keeping the number of symbols fixed Problem is more constrained, fewer solutions You can investigate this experimentally…. CPSC 422, Lecture 21Slide 18

P(satisfiable) for random 3-CNF sentences, n = 50 CPSC 422, Lecture 21Slide 19 Hard problems seem to cluster near m/n = 4.3 (critical point) m = number of clauses n = number of symbols

CPSC 422, Lecture 2120 Lecture Overview Finish Resolution in Propositional logics Satisfiability problems WalkSAT Encoding Example

Encoding the Latin Square Problem in Propositional Logic In combinatorics and in experimental design, a Latin square is an n × n array filled with n different symbols, each occurring exactly once in each row and exactly once in each column. Here is an example: ABC CAB BCA Here is another one:

Encoding Latin Square in Propositional Logic: Propositions Variables must be binary! (They must be propositions) Each variables represents a color assigned to a cell. Assume colors are encoded as integers Assuming colors are encoded as follows (black, 1) (red, 2) (blue, 3) (green, 4) (purple, 5) True or false, ie. 0 or 1 with respect to the interpretation represented by the picture? How many vars/propositions overall?

Encoding Latin Square in Propositional Logic: Clauses Some color must be assigned to each cell (clause of length n); No color is repeated in the same row (sets of negative binary clauses); How many clauses?

Encoding Latin Square in Propositional Logic: Clauses Some color must be assigned to each cell (clause of length n); No color is repeated in the same row (sets of negative binary clauses); How many clauses?

Encoding Latin Square Problems in Propositional Logic: FULL MODEL Variables: Each variables represents a color assigned to a cell. Clauses: Some color must be assigned to each cell (clause of length n); No color is repeated in the same row (sets of negative binary clauses); No color is repeated in the same column (sets of negative binary clauses);

CPSC 422, Lecture 21Slide 26 Logics in AI: Similar slide to the one for planning Propositional Logics First-Order Logics Propositional Definite Clause Logics Semantics and Proof Theory Satisfiability Testing (SAT) Description Logics Cognitive Architectures Video Games Hardware Verification Product Configuration Ontologies Semantic Web Information Extraction Summarization Production Systems Tutoring Systems

CPSC 422, Lecture 21Slide 27 Relationships between different Logics (better with colors)

CPSC 422, Lecture 21 Learning Goals for today’s class You can: Specify, Trace and Debug the resolution proof procedure for propositional logics Specify, Trace and Debug WalkSat Explain differences between Proposition Logic and First Order Logic Slide 28

Announcements Midterm Avg 72 Max 103 Min 13 If score below 70 need to very seriously revise all the material covered so far You can pick up a printout of the solutions along with your midterm CPSC 422, Lecture 1929

Next class Mon First Order Logic Extensions of FOL CPSC 422, Lecture 2130 Assignment-3 will be posted next week!