Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Inference and Resolution for Problem Solving
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Introduction to Logic for Artificial Intelligence Lecture 1 Erik Sandewall 2010.
CSE (c) S. Tanimoto, 2007 Unification 1 Unification Predicate calculus rules are sometimes so general that we need to create specializations of.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Section 1.3: Predicates and Quantifiers
1st-order Predicate Logic (FOL)
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
First Order Predicate Logic
2.3Logical Implication: Rules of Inference From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Reasoning using First-Order Logic
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
1 Section 8.3 Higher-Order Logic A logic is higher-order if it allows predicate names or function names to be quantified or to be arguments of a predicate.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Introduction to Logic for Artificial Intelligence Lecture 2
Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20.
Discussion #14 Predicate Calculus
Introduction to Logic for Artificial Intelligence Lecture 1
Horn Clauses and Unification
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus Discussion #14 Chapter 2, Section 1.
1st-order Predicate Logic (FOL)
Horn Clauses and Unification
Horn Clauses and Unification
CSE (c) S. Tanimoto, 2004 Unification
CSE S. Tanimoto Unification
Horn Clauses and Unification
CSE (c) S. Tanimoto, 2002 Unification
Horn Clauses and Unification
Predicates and Quantifiers
Encoding Knowledge with First Order Predicate Logic
Encoding Knowledge with First Order Predicate Logic
CS201: Data Structures and Discrete Mathematics I
RESOLUTION.
Predicate Calculus. Predicate Calculus Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables.
Encoding Knowledge with First Order Predicate Logic
Resolution Proof System for First Order Logic
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010

Relational Logic, Datalog (a Restricted Predicate Logic) Use the operators not, and, or, etc like for propositional logic, but: The elements of the logic expressions can consist of a predicate with its arguments, and are not restricted to proposition symbols Proposition symbols are considered as predicates with zero arguments The arguments of predicates may be constant symbols or variables Examples (in CKL): constant symbol may be London, apple-3, variable may be written.a3 or a3

Relational Logic: Quantifiers Use the operators not, and, or, etc like for propositional logic, but also: [all.v P] where.v is a variable and P is a formula [exists.v P] where.v is a variable and P is a formula Evaluation rule: consider for example evaluation in an episode, i.e. an instance of a microworld that has a specific set of entities associated with it. [all.v P] is true in that episode if P is true for all values of.v among the associated entities [exists.v P] is true in that episode if P is true for some value of.v among the associated entities Compare the operator 'some' that is used in the introductory example in lab2b.

Equivalence rules for quantifiers The rules from propositional logic continue to hold Choice of variable may be changed, by substitution throughout [all x [all y P]] == [all y [all x P]] and same for exists [not [all x P]] == [exists x [not P]] and similar for exists/all [and [all x P][all x Q]] == [all x [and P Q]] [or [exists x P][exists x Q]] == [exists x [or P Q]] [or [all x P] Q] == [all x [or P Q]] if no x in Q [and [exists x P] Q] == [exists x [and P Q]] if no x in Q [exists x P] == P == [all x P] if no x in P Actually, 'no x in Q' means 'no free x in Q' A quantified expression encapsulates its variable so that it is not 'free' outside. Substitution within that scope is OK.

Some terms Vocabulary for a logic formula: set of predicate symbols containing all those that occur in the formula (and maybe some more], with an indication of arity (i.e. its number of arguments] for each of them, even 0 arity Domain: non-empty set of objects Interpretation for a predicate: mapping from the set of all argument sequences over the domain, to T or F Interpretation for a logic formula: an assignment of an interpretation to each predicate in its vocabulary Model for a logic formula: an interpretation where the value of the formula is T Joint vocabulary: like before p == q holds if they have the same value for all interpretations in all their joint vocabularies

Relevance Interpretation for a logic formula: an assignment of an interpretation to each predicate in its vocabulary Model for a logic formula: an interpretation where the value of the formula is T Joint vocabulary: like before p == q holds if they have the same value for all interpretations in all their joint vocabularies This definition for == is what one shall use in order to validate the correctness of the equivalence rules for the quantifiers.

Domains Vocabulary for a logic formula: set of predicate symbols containing all those that occur in the formula (and maybe some more], with an indication of arity (i.e. its number of arguments] for each of them, even 0 arity Domain: non-empty set of objects Interpretation for a predicate: mapping from the set of all argument sequences over the domain, to T or F Recall e.g.: [not [all x P]] == [exists x [not P]] This rule is sound since the two sides obtain the same truth-value regardless of the choice of domain and the choice of the expression P.

Resolution for Relational Clause Logic Convert given formulas to clause form like for propositional logic, making sure that quantifiers are outermost The following applies if the resulting clauses only use 'all' and none of them uses 'exists' Remove all quantifiers Use a modified resolution rule where variable substitutions can be made. Examples: [P.x.y] unifies with [-P a b] with.x = a,.y = b [P.x b] unifies with [-P a.y] with the same bindings [P.x] unifies with [-P.y] with.x =.y [P a] does not unify with [-P b] (continued)

Resolution for Relational Clause Logic Use a modified resolution rule where variable substitutions can be made. Examples: [P.x.y] unifies with [-P a b] with.x = a,.y = b [P.x b] unifies with [-P a.y] with the same bindings [P.x] unifies with [-P.y] with.x =.y [P a] does not unify with [-P b] To resolve two clauses, one must find substitutions whereby one pair of literals unify, and the same substitutions are applied to the rest of the clauses. Examples: {[P a]}, {[-P.x], [Q.x]} resolve to {[Q a]} {[P a.x], [R.x c]}, {[-P.y b], [-R d.y]} resolve to {[R b c], [-R d a]} Notice that the same also resolve to {[P a d], [-P c b]}

Standard Predicate Logic (No types, no equality) Arguments of predicates may be arbitrary terms, formed from variables and constant symbols by composition using function symbols. Vocabulary for a logic formula: set of predicate symbols and function symbols containing all those that occur in the formula (and maybe some more], with an indication of arity (i.e. its number of arguments] for each of them, even 0 arity Domain: non-empty set of objects Interpretation for a predicate: mapping from the set of all argument sequences over the domain, to T or F Interpretation for a function symbol: mapping from the set of all argument sequences over the domain, to the a member of the domain Interpretation for a logic formula: an assignment of an interpretation to each predicate and function symbol in its vocabulary Model for a logic formula: an interpretation where the value of the formula is T Constant symbols may be considered as functions of arity zero

Equivalence rules The same rules apply as for the case of relational predicate logic. No additions needed.

Resolution: Examples of Unification [P.x.y] unifies with [-P (f a) b] with.x = (f a),.y = b [P.x (f.y)] unifies with [-P (f a).z] with.x = (f a),.y =.y,.z = (f.y) but also with e.g..x = (f a),.y =.w,.z = (f.w) [P.x (f.y)] unifies with [-P (f.x).y], but only using different substitutions in the two given literals, for example:.x = (f.z),.y = w in the first one,.x =.z,.y = (f.w) in the second one But also e.g..x = (f.x),.y =.y resp..x =.x,.y = (f.y) [P (f.x)] does not unify with [-P (g.y)], nor with [-P (g.x)]

Resolution: Examples Consider (imp [P.x] [P (+ 1.x)]) and [P 0] Rewrite these as {[-P.x] [P (+ 1.x)]} and {[P 0]} Resolution gives {[P (+ 1 0)]} How can this be simplified? Use additional clauses {[= (+.a 0).a]} {[-P.a] [/=.a.b] [P.b]} where /= is negation of = The first of these gives {[= (+ 1 0) 1]} by substitution Two resolution steps give {[P 1]} Therefore, there is a need for two inference rules: resolution and substitution Resolution is always done with built-in substitution (i.e. unification), but in principle it's sufficient to use primitive resolution + substitution.

Equality Recall the axiom that was used above: {[-P.a] [/=.a.b] [P.b]} In order to use equality throughout, one needs one axiom similar to this for each predicate of one argument, One needs two for each predicate of two arguments (one for each arg) This is called an axiom schema. Notice that for a given vocabulary there is a fixed number of instances of the axiom schema. Alternative 1: Second-order logic [all.P (or (not [.P.a]) [/=.a.b] [.P.b])] i.e. [-.P.a] [/=.a.b] [.P.b] Alternative 2: Consider = as a part of the logic, just like quantifiers. Advantage: avoid messing up proofs with trivial uses of equality.

Equality Important: equality is a predicate like all the others (unless one extends the logic considerably) Equality axioms: [all.x [=.x.x]] [all.x [all.y (imp [=.x.y][=.y.x])]] [all.x [all.y [all.z (imp (and [=.x.y][=.y.z]) [=.x.z])]]] Schema for argument equality like in the example above Also, if a and b are two different constant symbols, this does not in itself mean that [/= a b]. Some interpretations can assign the same value to them. Applications may make separate statement of unique names assumption: different constant symbols have different values Applications may also make separate statement of closed world assumption: each member of the domain is the value of some constant symbol.

Equality Applications may make separate statement of unique names assumption: different constant symbols have different values Expressed as a schema [all.x (not (and [=.x a][=.x b]))] that is instantiated for all combinations of different constant symbols a and b in the chosen vocabulary. Applications may also make separate statement of closed world assumption: each member of the domain is the value of some constant symbol. Expressed as a schema [all.x (or [=.x c1][=.x c2]... [=.x cn])] listing all the constant symbols in the minimal vocabulary of the given premises.

Skolemization In order to use the resolution method for a given set of premises, they shall be converted to conjunctive normal form preceded only by universal quantifiers (all), not by existential quantifiers. What if the given set of premises do produce an expression with existential quantifiers as well?? Method, example: [all.x [exists.y [P.x.y]]] is replaced by [all.x [P.x (g.x)]] where g is a 'new' function symbol i.e. one that is not already in the vocabulary For [all.x [all.y [exists.z ----]]] replace.z by (g.x.y) Intuitively reasonable Formally nonobvious since the rewritten formula is not equivalent to the given one

Skolemization In order to use the resolution method for a given set of premises, they shall be converted to conjunctive normal form preceded only by universal quantifiers (all), not by existential quantifiers. What if the given set of premises do produce an expression with existential quantifiers as well?? Method, example: [all.x [exists.y [P.x.y]]] is replaced by [all.x [P.x (g.x)]] where g is a 'new' function symbol i.e. one that is not already in the vocabulary Intuitively reasonable Formally problematic since the rewritten formula is not equivalent to the given one But: the first formula is inconsistent if and only if the second one is. Therefore, if resolution is used for proof by contradiction, this is a technique that works, but only then.