Review of Propositional Logic Syntax

Slides:



Advertisements
Similar presentations
Agents that reason logically Tuomas Sandholm Carnegie Mellon University Computer Science Department.
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.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
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.
Generating Hard Satisfiability Problems1 Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Propositional Logic. Negation Given a proposition p, negation of p is the ‘not’ of p.
Knowledge Representation I (Propositional Logic) CSE 473.
Methods of Proof Chapter 7, second half.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Instance Hardness and Phase Transitions.
Let remember from the previous lesson what is Knowledge representation
Knowledge Representation II (Inference in Propositional Logic) CSE 473.
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]
Propositional Calculus Math Foundations of Computer Science.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
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.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Normal Forms, Tautology and Satisfiability 2/3/121.
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)
Logical Agents Logic Propositional Logic Summary
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.:
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
First-Order Logic and Inductive Logic Programming.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
/425 Declarative Methods - J. Eisner 1 Random 3-SAT  sample uniformly from space of all possible 3- clauses  n variables, l clauses Which are.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
28.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
NPC.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Local Search Methods for SAT Geoffrey Levine March 11, 2004.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
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:
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Propositional Logic (a.k.a. Sentential Logic)
Inference in Propositional Logic (and Intro to SAT)
Fast Propositional Algorithms for Planning
Knowledge Representation and Reasoning
The Propositional Calculus
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
ARTIFICIAL INTELLIGENCE
First-Order Logic and Inductive Logic Programming
Logical Inference: Through Proof to Truth
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Back to “Serious” Topics…
PROPOSITIONAL LOGIC - SYNTAX-
Methods of Proof Chapter 7, second half.
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

Review of Propositional Logic Syntax Propositional variables: x1, x2, …, xn (or may use other symbols such as a, b, c, p, q, r). Logical connectives: ^ (and), v (or), ¬ (not, also sometimes represented as ~ ), ← (left implication), → (right implication). A proposition (propositional formula) is any propositional variable ¬ α where α is any proposition α ^ β where α and β are any propositions likewise for all other logical connectives ¬ has higher precedence than binary connectives; parentheses are used elsewhere to clarify precedence

Review of Propositional Logic Semantics A truth assignment is a mapping of each propositional variable to True (1) or False (0) The “meaning” of any proposition is the set of truth assignments that satisfy it, i.e. make it true… these assignments are its models

Satisfaction A truth assignment A satisfies a proposition iff (if and only if): The proposition is a variable that A maps to True The proposition is of the form ¬ α and A does not satisfy α The proposition is of the form α ^ β and A satisfies α and β α v β and A satisfies α or β α → β and if A satisfies α then it satisfies β (i.e., A satisfies β or does not satisfy α, possibly both)

Truth Tables A truth table for a propositional formula shows all truth assignments for the variables in the formula, and the truth of the formula under each assignment. An example: p q r (pvq)→r 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1

More Definitions Two propositions are equivalent iff they have the same models, and hence the same truth tables One proposition entails a second iff every model of the first is a model of the second

Some Equivalences ¬ ¬ α = α (α → β) = (¬α v β) DeMorgan’s Law: ¬(α ^ β) = (¬α v ¬β) Distributivity of ^ over v: α ^ (β v γ) = (α ^ β) v (α ^ γ) Can show analogous equivalences for distributivity of v over ^ and for commutativity and associativity of ^ and v Exercise: Show these using truth tables and also show you can swap ^ and v in DeMorgan’s Law.

Clausal Form or Conjunctive Normal Form (CNF) A literal is a propositional variable or its negation A clause is a disjunction of literals A CNF formula is a conjunction of clauses Can convert any formula into CNF form by rewriting using the preceding equivalences

Review of Satisfiability A problem instance is a Boolean conjunctive normal form (CNF) formula, that is, a conjunction of propositional clauses, over some set X1,…,Xn of propositions. Goal is to find an assignment to the propositions (variables) that satisfies the CNF formula.

Satisfiability Review (Continued) Satisfiability is important for several reasons, including It is at the foundation of NP-completeness It’s the canonical example of constraint satisfaction problems (CSPs) Many interesting tasks, including planning tasks, can be encoded as satisfiability problems. Broadly speaking, CSPs grow easier with

Satisfiability (Continued) (Continued)… more variables but harder with more constraints. In the case of satisfiability, each clause is a constraint. Kautz, Levesque, Mitchell, and Selman showed that the critical measure of hardness of satisfiability is the fraction of the number of clauses over the number of variables. For a large fraction, it’s almost always easy

Satisfiability (Continued) (Continued)… to answer “no” quickly, and for a small fraction it’s almost always easy to answer “yes” quickly. There’s a relatively slim phase transition area in between these extremes where most of the hard problems are located. GSAT and WSAT were created (by subsets of the preceding authors) to address these.

GSAT Input: CNF formula and integers Max_flips (e.g. 100) and Max_climbs (e.g. 20). Output: Yes (satisfiable) or No (couldn’t find a satisfying assignment). Might also output the best assignment found. Assignments are scored by the number of clauses they satisfy. GSAT performs a beam search with random restarts and beam size set to 1.

GSAT Algorithm For i from 1 to Max_Climbs: Randomly draw a truth assignment over the variables in the CNF formula (e.g. flip a coin for each variable to decide whether to make it 0 or 1 -- in practice, use pseudo-random number). If assignment satisfies formula, return “Yes”. For j from 1 to Max_Flips: For each variable, calculate the score of the truth assignment that results when we flip the value of

GSAT Algorithm (Continued) (Continued)… that variable. Make the flip that yields the highest score (need not be greater than or equal to the score of the previous assignment). If the new assignment satisfies the formula, return “Yes”. Return “No” (no satisfying assignment found, although one might still exist).

Key Points about GSAT Cannot tell us a formula is unsatisfiable (but we can just run propositional resolution in parallel). Random re-starts help us find multiple local optima -- the hope is that one will be global. “Sideways” (or even “downward”) moves help us get off a plateau -- can bounce us off a local optimum. Significant practical advance over standard greedy approach.

WalkSAT (WSAT) To further get around the problems of local optima, we can occasionally choose to make a random flip rather than a GSAT flip (as in a random walk). WSAT differs from GSAT as follows: One additional input: a probability p of a random move at any step. A random move will involve flipping a variable in some unsatisfied clause (efficacious flip).

WSAT (Continued) (Continued)… This change will satisfy some currently unsatisfied clause (even if the net result of the flip is a decrease in score). For each move, draw a pseudo-random number between 0 and 1. If less than p, make a random move; otherwise, make a GSAT move. WSAT outperforms GSAT, Simulated Annealing, and a Genetic Algorithm on random trials.