Lecture 7: Propositional logic"

Similar documents
Logic in general. Inference rules and theorem proving

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Logical Agents. Explorations in Artificial Intelligence. Knowledge-based Agents. Knowledge-base Agents. Outline. Knowledge bases

CS510 Software Engineering

Correspondence analysis for strong three-valued logic

CHAPTER 7 GENERAL PROOF SYSTEMS

Resolution. Informatics 1 School of Informatics, University of Edinburgh

Handout #1: Mathematical Reasoning

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Beyond Propositional Logic Lukasiewicz s System

DISCRETE MATH: LECTURE 3

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

Computational Logic and Cognitive Science: An Overview

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

196 Chapter 7. Logical Agents

Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

Lecture 8: Resolution theorem-proving

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Satisfiability Checking

Math 3000 Section 003 Intro to Abstract Math Homework 2

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

Algorithmic Software Verification

Lecture 17 : Equivalence and Order Relations DRAFT

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Artificial Intelligence

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

A first step towards modeling semistructured data in hybrid multimodal logic

Introduction to Logic in Computer Science: Autumn 2006

A Propositional Dynamic Logic for CCS Programs

Generating models of a matched formula with a polynomial delay

EQUATIONAL LOGIC AND ABSTRACT ALGEBRA * ABSTRACT

Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets.

2. The Language of First-order Logic

6.080/6.089 GITCS Feb 12, Lecture 3

p: I am elected q: I will lower the taxes

INTRODUCTORY SET THEORY

npsolver A SAT Based Solver for Optimization Problems

Plan-Space Search. Searching for a Solution Plan in a Graph of Partial Plans

Sudoku as a SAT Problem

Computational Methods for Database Repair by Signed Formulae

facultad de informática universidad politécnica de madrid

CS MidTerm Exam 4/1/2004 Name: KEY. Page Max Score Total 139

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

Many-valued Intuitionistic Implication and Inference Closure in a Bilattice-based Logic

EFFICIENT KNOWLEDGE BASE MANAGEMENT IN DCSP

Introduction to Logic: Argumentation and Interpretation. Vysoká škola mezinárodních a veřejných vztahů PhDr. Peter Jan Kosmály, Ph.D

CSE 459/598: Logic for Computer Scientists (Spring 2012)

FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE KNOWLEDGE REPRESENTATION AND NETWORKED SCHEMES

Lecture 13 of 41. More Propositional and Predicate Logic

General Information and Communication Technology. Second module of this course: Boolean logic. Some elements of computational complexity

Formal Engineering for Industrial Software Development

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Monitoring Metric First-order Temporal Properties

Version Spaces.

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Optimizing Description Logic Subsumption

High Integrity Software Conference, Albuquerque, New Mexico, October 1997.

Predicate Logic Review

Foundational Proof Certificates

Lecture 7: NP-Complete Problems

Extending Semantic Resolution via Automated Model Building: applications

Example: Backward Chaining. Inference Strategy: Backward Chaining. First-Order Logic. Knowledge Engineering. Example: Proof

Certamen 1 de Representación del Conocimiento

Ensuring Consistency in Long Running Transactions

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

Relational Databases

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Copyright 2012 MECS I.J.Information Technology and Computer Science, 2012, 1, 50-63

Bounded Treewidth in Knowledge Representation and Reasoning 1

Predicate logic. Logic in computer science. Logic in Computer Science (lecture) PART II. first order logic

Rigorous Software Development CSCI-GA

CSC 373: Algorithm Design and Analysis Lecture 16

NP-Completeness and Cook s Theorem

Fuzzy-DL Reasoning over Unknown Fuzzy Degrees

SQL INJECTION ATTACKS By Zelinski Radu, Technical University of Moldova

MAT Program Verication: Exercises

Examination paper for MA0301 Elementær diskret matematikk

Cartesian Products and Relations

Bindings, mobility of bindings, and the -quantifier

Summary of Last Lecture. Automated Reasoning. Outline of the Lecture. Definition. Example. Lemma non-redundant superposition inferences are liftable

Borne inférieure de circuit : une application des expanders

A Theorem Prover for Boolean BI

Predicate Logic. For example, consider the following argument:

Updating Action Domain Descriptions

OHJ-2306 Introduction to Theoretical Computer Science, Fall

Automated Theorem Proving - summary of lecture 1

SPARQL: Un Lenguaje de Consulta para la Web

Lecture 2: Universality

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Neighborhood Data and Database Security

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Journal of Mathematics Volume 1, Number 1, Summer 2006 pp

SEARCHING AND KNOWLEDGE REPRESENTATION. Angel Garrido

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

The Classes P and NP

Software Modeling and Verification

Factoring General Games using Propositional Automata

Transcription:

CS440/ECE448: Intro to Artificial Intelligence Lecture 7: Propositional logic Prof. Julia Hockenmaier juliahmr@illinois.edu http://cs.illinois.edu/fa11/cs440 Thursdayʼs key concepts Combining CSP search and inference: Ordering variables (minimum remaining value, degree heuristics) Ordering values (forward checking, MAC) Global constraints: Constraint hypergraph; auxiliary variables Continuous domains: bounds consistency CS440/ECE448: Intro AI 2 Path consistency and arc consistency X is arc consistent with respect to Y if for every value of X there exists some value of Y such that C(X,Y) is satisfied. X and Y are path consistent with respect to Z if for every pair of values of X and Y that satisfy C(X, Y), there exists some value of Z such that C(X,Z) and C(Y,Z) is satisfied. CS440/ECE448: Intro AI 3 Global (n-ary) constraints: Constraint Hypergraph F T U W R O C 1000 C 100 C 10 TWO + TWO = FOUR CS440/ECE448: Intro AI 4

Propositional logic Propositional logic Syntax: What is the language of well-formed formulas of propositional logic? Semantics: What is the interpretation of a well-formed formula in propositional logic? Inference rules and algorithms: How can we reason with propositional logic? Syntax: the building blocks Variables: Constants: p q r (true), (false) Unary connectives: (negation) Binary connectives: (conjunction) (disjunction) (implication) Syntax: well-formed formulas WFF Atomic Complex Atomic% % Constant Variable WFF Atomic (Complex) Complex % WFF WFF WFF WFF WFF WFF WFF

Semantics: truth values The interpretation v of a well-formed formula under a model v is a truth value: v {true, false}. A model (=valuation) v is a complete* assignment of truth values to variables: v(p) = true v(q) = false, *each variable is either true or false With n variables, there are 2 n different models Models of (ʻM() ): set of models where is true Interpretation v of Interpretation of constants: v = true, v = false Interpretation of variables defined by v p v = v(p) Interpretation of connectives given by truth tables if.then: if.then: p v p v p v q v p q v p q v p q v true false true true true true true false true true false false true false false true false true true false false false false true Validity and satisfiability is valid in a model m ( m ) iff m M() = the model m satisfies ( is true in m) is valid ( ) iff m: m M() ( is true in all possible models. is a tautology.) Inference in propositional logic is satisfiable iff m: m M() ( is true in at least one model, M() # )

Entailment Definition: entails $ ( $ ) iff M() M($) Entailment is monotonic: If $, then % $ for any % Proof: M( %) M() M($) We also write,% $ or {,%} $ for % $ Logical equivalence is equivalent to $ ( $ ) iff M() = M($) $ $ Commutativity $ $ ( $) % ($ %) Associativity ( $) % ($ %) ($ %) ( $) ( %) Distributivity ($ %) ( $) ( %) Entailment and implication entails $ ( $ ) iff $ is valid ( $) Proof: If v M(): v = true by definition. % %So $ v = true only if $ v = true (v M($)) Thus, v M() implies v M($). If v M(): v = false by definition. % %So $ v = true regardless of $ v Thus, when v M(), v M($) or v M($). More logical equivalences ( $) $ DeMorgan ( $) $ $ $ Implication elimination $ $ Contraposition

Biconditional (equivalence) We can also define a binary connective : $ ( $) ($ ) ( $) ( $ ) (( $) $) ( $) ) (( $) ($ $)) (( ) ($ )) % % % ( $) ($ ) Literals and clauses Literal: p, p, q, q, an atomic formula, or a negated atomic formula Clause: p, p, p q, q p, a literal (= unit clause), or a disjunction of literals CS440/ECE448: Intro AI 17 Normal Forms Every formula in propositional logic has two equivalent normal forms: Conjunctive Normal Form (CNF) a conjunction of clauses (p 11 p 1n ) (p 21 p 2m ) Disjunctive Normal Form (DNF) a disjunction of conjoined literals (q 11 q 1n ) (q 21 q 2m ) Inference in propositional logic We often have prior domain knowledge. Given a knowledge base KB = {& 1,, & n } (a set of formulas that are true), how do we know is valid given KB? Validity: KB (shorthand for & 1 & n ) Satisfiability: m: m M(KB) m M() ( M(KB) shorthand for M(& 1 & n )

Inference in propositional logic How do we know whether is valid or satisfiable given KB? Model checking: (semantic inference) Enumerate all models for KB and. Theorem proving: (syntactic inference) Use inference rules to derive from KB. Modus ponens $ '''''''''''''''' $ And-elimination $ '''''''''' $ Inference rules Inference rules: equivalences $ $ Commutativity $ $ As inference rules: $ $ $ $ '''' '''' '''' ''''' $ $ $ $ Theorem proving as search Proving from KB: States: sets of formulas that are true. Initial state: KB Goal state: any state that contains Actions: a set of inference rules

Inference procedures A procedure P that derives from KB KB P is sound if it only derives valid sentences: if KB P, then KB (soundness) is complete if it derives any valid sentence: if KB, then KB P (completeness) The resolution rule Unit resolution: p 1 p i-1 p i p i+1 p n p i '''''''''''''''''''''''''''' p 1 p i-1 p i+1 p n Full resolution: p 1 p i p n q 1 p i q m '''''''''''''''''''''''''''''''' p 1 p n q 1 q m Final step: factoring (remove any duplicate literals from the result A A A) Proof by contradiction How do we prove that $? entails $ ( $ ) iff $ not satisfiable. Proof: $ not satisfiable iff ( $) Assume ( $). $) % % % % % % $. Thus, ( $) $. A resolution algorithm Goal: prove $ by showing that $ is not satisfiable (false) Observation: Resolution derives a contradiction (false) if it derives the empty clause: p i p i ''''''' CS440/ECE448: Intro AI 28

function PLresolution(, $) input: formula, // knowledge base formula $ // query clauses := CNF( $) new := {} while true: for each c1, c2 in clauses do resolvents := resolve(c1, c2) if in resolvents then return true; new := new resolvents if new clauses then return false; clauses := clauses new CS440/ECE448: Intro AI 29 Completeness of Resolution Resolution closure RC(S): The set of all clauses that can be derived by resolution from a set of clauses S. If S is finite, RC(S) is finite. Ground resolution theorem: If RC(S) contains, S is not satisfiable. If RC(S) does not contain, S is satisfiable. CS440/ECE448: Intro AI 30 If RC(S) doesnʼt contain Todayʼs key concepts S is satisfiable, because we can build a model for its variables p 1.p n : For i from 1.n: if a clause in RC(S) contains p i and all its other literals are false, then assign false to p i otherwise assign true to p i CS440/ECE448: Intro AI 31 Syntax of propositional logic: propositional variables, connectives, well-formed formulas Semantics of propositional logic: interpretations, models, truth tables Inference with propositional logic: model-checking, resolution CS440/ECE448: Intro AI 32

Your tasks Reading: 7.3-7.5.2 Compass quiz: due Thursday at 2am. CS440/ECE448: Intro AI 33