CS 4700: Foundations of Artificial Intelligence

Slides:



Advertisements
Similar presentations
Propositional Satisfiability (SAT) Toby Walsh Cork Constraint Computation Centre University College Cork Ireland 4c.ucc.ie/~tw/sat/
Advertisements

Boolean Satisfiability
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)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Intro to Logic (Reading R&N: Chapter.
Methods of Proof Chapter 7, second half.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Instance Hardness and Phase Transitions.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
Logic - Part 2 CSE 573. © Daniel S. Weld 2 Reading Already assigned R&N ch 5, 7, 8, 11 thru 11.2 For next time R&N 9.1, 9.2, 11.4 [optional 11.5]
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Quasigroups Defaults Foundations of AI. Given an N X N matrix, and given N colors, color the matrix in such a way that: -all cells are colored; - each.
Boolean Satisfiability and SAT Solvers
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
3/11/2002copyright Brian Williams1 Propositional Logic and Satisfiability Brian C. Williams /6.834 October 7 th, 2002.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
HW #1. Due Mar 22 Midnight Verify the following program using SAT solver 1. Translate the program into a SSA form 2. Create a Boolean formula from.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
HW #2. Due Mar 27 23:59 Do NOT forget to submit both a hardcopy solution to the HW box and a softcopy solution to TA (Youngjoo Kim):
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 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
9/18/2000copyright Brian Williams1 Propositional Logic Brian C. Williams J/6.834J October 10, 2001.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
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.
Optimized SAT Encoding For Sudoku Puzzles Will Klieber and Gi-Hwon Kwon Sept 27, 2007 rev. 2 Changes from v1: Added a new slide after “A Better Encoding.
1 P NP P^#P PSPACE NP-complete: SAT, propositional reasoning, scheduling, graph coloring, puzzles, … PSPACE-complete: QBF, planning, chess (bounded), …
Chapter 7. Propositional and Predicate Logic
Inference in Propositional Logic (and Intro to SAT)
Inference and search for the propositional satisfiability problem
CS 4700: Foundations of Artificial Intelligence
Richard Anderson Lecture 26 NP-Completeness
Planning as Satisfiability
CS 4700: Foundations of Artificial Intelligence
EA C461 – Artificial Intelligence Logical Agent
Dr. Rachel Ben-Eliyahu – Zohary
Intro to Computational Complexity
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
ARTIFICIAL INTELLIGENCE
CS 4700: Foundations of Artificial Intelligence
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21
Logical Inference: Through Proof to Truth
Intro to Theory of Computation
Intro to Theory of Computation
CS 416 Artificial Intelligence
Emergence of Intelligent Machines: Challenges and Opportunities
Introduction to the Boolean Satisfiability Problem
ECE 667 Synthesis and Verification of Digital Circuits
Logics for Data and Knowledge Representation
Artificial Intelligence: Agents and Propositional Logic.
Introduction to the Boolean Satisfiability Problem
Chapter 11 Limitations of Algorithm Power
HW #2. Due Apr 25 23:59 Do NOT forget to submit both a hardcopy solution to the HW box and a softcopy solution to TA.
Methods of Proof Chapter 7, second half.
Instructor: Aaron Roth
Presentation transcript:

CS 4700: Foundations of Artificial Intelligence Bart Selman selman@cs.cornell.edu Logical Agents --- Intro Knowledge Representation & SAT encodings R&N: Chapter 7

A Model-Based Agent Requires: Knowledge and Reasoning

Knowledge and Reasoning humans are very good at acquiring new information by combining raw knowledge, experience with reasoning. AI-slogan: “Knowledge is power” (or “Data is power”?) Examples: Medical diagnosis --- physician diagnosing a patient infers what disease, based on the knowledge he/she acquired as a student, textbooks, prior cases Common sense knowledge / reasoning --- common everyday assumptions / inferences. e.g., (1) “lecture starts at four” infer pm not am; (2) when traveling, I assume there is some way to get from the airport to the hotel.

Logical agents: Agents with some representation of the complex knowledge about the world / its environment, and uses inference to derive new information from that knowledge combined with new inputs (e.g. via perception). Key issues: 1- Representation of knowledge What form? Meaning / semantics? 2- Reasoning and inference processes Efficiency.

Knowledge-base Agents Key issues: Representation of knowledge  knowledge base Reasoning processes  inference/reasoning Knowledge base = set of sentences in a formal language representing facts about the world (*) (*) called Knowledge Representation (KR) language

Knowledge Representation language candidate: logical language (propositional / first-order) combined with a logical inference mechanism Why not use natural language (e.g. English)? We want clear syntax & semantics (well-defined meaning), and, mechanism to infer new information. Soln.: Use a formal language.

Semantics P V Q True True False True True!

Satisfiability

Propositional Satisfiability problem Satifiability (SAT): Given a formula in propositional calculus, is there a model (i.e., a satisfying interpretation, an assignment to its variables) making it true? We consider clausal form, e.g.: ( a  b   c ) AND ( b   c) AND ( a  c) possible assignments SAT: prototypical hard combinatorial search and reasoning problem. Problem is NP-Complete. (Cook 1971) Surprising “power” of SAT for encoding computational problems Modern SAT Solvers use this langauge.

SAT Solvers Modern Satisfiability (SAT) solvers operating on the clausal form are surprisingly *much* more efficient than other logic-based approaches (e.g., pure resolution that will be discussed later) The SAT solvers treat the set of clauses as a set of constraints (disjunctions) on Boolean variables, i.e., a CSP problem! Current solvers are very powerful. Can handle 1 Million+ variables and several millions of clauses. Systematic: Davis Putnam (DPLL) + series of improvements Stochastic local search: WalkSAT (issue?) See R&N 7.6. “Ironically,” we are back to semantic model checking, but way more clever than basic truth assignment enumeration (exponentially faster)!

Satisfiability as an Encoding Language

SAT Translation of Graph Coloring Variables NxK vars Ci,k node i has color k Total # colors: K. Total # nodes: N. At least one of K colors per node i : (Ci,1 v Ci,2 v Ci,3 v ... V Ci,K) At most one color per node i : (~Ci,k v ~Ci,k’ ) for all k =/= k’ If node i and node j (=/= i) share an edge, need to have different colors: (~Ci,l v ~Cj,l) for all 1 <= I <= K Note: Translation from “problem” into SAT. Reverse of usual translation to show NP-completeness. Works also for (easy) polytime problems!

Encoding Latin Square Problems in Propositional Logic n x n square Variables: Each variables represents a color assigned to a cell. Clauses: Some color must be assigned to each cell No color is repeated in the same row No color is repeated in the same column (clause of length n); n2 (sets of negative binary clauses); n(n-1)/2 n n (example Row i Color k) (sets of negative binary clauses); n(n-1)/2 n n (example Colum j Color k)

3D Encoding or Full Encoding This encoding is based on the cubic representation of the quasigroup: each line of the cube contains exactly one true variable; Variables: Same as 2D encoding. Clauses: Same as the 2 D encoding plus: Each color must appear at least once in each row; Each color must appear at least once in each column; No two colors are assigned to the same cell;

Dimacs format At the top of the file is a simple header. p cnf <variables> <clauses> Each variable should be assigned an integer index. Start at 1, as 0 is used to indicate the end of a clause. The positive integer a positive literal, whereas a negative interger represents a negative literal. Example -1 7 0  ( x1  x7)

Extended Latin Square 2x2 order 2 -1 -1 p cnf 8 24 -1 -2 0 -3 -4 0 -5 -6 0 -7 -8 0 -1 -5 0 -2 -6 0 -3 -7 0 -4 -8 0 -1 -3 0 -2 -4 0 -5 -7 0 -6 -8 0 1 2 0 3 4 0 5 6 0 7 8 0 1 5 0 2 6 0 3 7 0 4 8 0 1 3 0 2 4 0 5 7 0 6 8 0 A cell gets at most a color No repetition of color in a column No repetition of color in a row 1/2 3/4 5/6 7/8 A cell gets a color 1 – cell 11 is red 2 – cell 11 is green 3 – cell 12 is red 4 – cell 12 is green 5 – cell 21 is red 6 – cell 21 is green 7 – cell 22 is red 8 – cell 22 is green A given color goes in each column A given color goes in each row

Underlying Latin Square structure characterizes many real world applications 1 2 3 4 5 6 1 2 3 4 5 6 R2 X R4 R1 R3 R5 teams A D E B C C B A E D D C B A E E A C D B B E D C A Design of Scientific Experiments Scheduling and timetabling CONFLICT FREE LATIN ROUTER Input ports Output ports 3 1 2 4 Input Port Output Port Sudoku Routing in Fiber Optic Networks Many more applications…

Latin Square Completion (Order 4) Critically constrained area 42% 50% 20% Complexity of Latin Square Completion EASY AREA EASY AREA Percentage of unsolvable instances NP-Complete Better characterization beyond worst case? Time: 150 1820 165 35% 42% 50%

SAT Solvers in the Real World

NASA Deep Space One Spacecraft: Remote Agent Remote Agent (remote intelligent self-repair software) (RAX), developed at NASA and JPL, was the first artificial-intelligence control system to control a spacecraft without human supervision. Remote Agent successfully demonstrated the ability to plan onboard activities and correctly diagnose and respond to faults in spacecraft components through its built-in REPL environment

NASA Deep Space One: Remote Agent Autonomous diagnosis & repair “Remote Agent” Compiled systems schematic to 7,000 var SAT problem Started: January 1996 Launch: October 15th, 1998 Experiment: May 17-21

Deep Space One a failed electronics unit Remote Agent fixed by reactivating the unit. a failed sensor providing false information Remote Agent recognized as unreliable and therefore correctly ignored. an altitude control thruster (a small engine for controlling the spacecraft's orientation) stuck in the "off" position Remote Agent detected and compensated for by switching to a mode that did not rely on that thruster.

Significant progress in Satisfiability Methods Software and hardware verification – complete methods are critical - e.g. for verifying the correctness of chip design, using SAT encodings Applications: Hardware and Software Verification Planning, Protocol Design, etc. Going from 50 variable in, 200 constraints to 1,000,000+ variables and 5,000,000+ constraints in the last 20 years

Progress in Last 20 years Significant progress since the 1990’s. How much? Problem size: We went from 100 variables, 200 constraints (early 90’s) to 1,000,000+ variables and 5,000,000+ constraints in 20 years Search space: from 10^30 to 10^300,000. [Aside: “one can encode quite a bit in 1M variables.”] Is this just Moore’s Law? It helped, but not much… – 2x faster computers does not mean can solve 2x larger instances – search difficulty does *not* scale linearly with problem size! In fact, for O(2^n), 2x faster, how many more vars? handles 1 more variable!! Mainly algorithmic progress. Memory growth also key. Tools: 50+ competitive SAT solvers available (e.g. Minisat solver) See http://www.satcompetition.org/

Model Checking

Turing Award Source: Slashdot

A “real world” example

Bounded Model Checking instance: i.e. ((not x1) or x7) and ((not x1) or x6) and … etc.

clauses / constraints are getting more interesting… 10 pages later: … (x177 or x169 or x161 or x153 … or x17 or x9 or x1 or (not x185)) clauses / constraints are getting more interesting…

4000 pages later: !!! a 59-cnf clause… …

this instance in less than one minute. Finally, 15,000 pages later: Note that: … !!! MiniSAT solver solves this instance in less than one minute.