Introduction to Logic for Artificial Intelligence Lecture 2

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Artificial Intelligence 8. The Resolution Method
1 First order theories (Chapter 1, Sections 1.4 – 1.5)
First Order Logic Logic is a mathematical attempt to formalize the way we think. First-order predicate calculus was created in an attempt to mechanize.
Resolution Proof System for First Order Logic
Biointelligence Lab School of Computer Sci. & Eng.
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
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
Resolution.
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.
Logic Use mathematical deduction to derive new knowledge.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
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.
Predicate Calculus.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
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.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
First Order Predicate Logic
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
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.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 8.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
CS104:Discrete Structures Chapter 2: Proof Techniques.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Chapter 1 Logic and proofs
Chapter 7. Propositional and Predicate Logic
Knowledge Representation and Reasoning
Proposition & Predicates
Introduction to Logic for Artificial Intelligence Lecture 1
Horn Clauses and Unification
CS201: Data Structures and Discrete Mathematics I
Logic Use mathematical deduction to derive new knowledge.
Resolution And yet Another Example:
Horn Clauses and Unification
Horn Clauses and Unification
Back to “Serious” Topics…
MA/CSSE 474 More Math Review Theory of Computation
Horn Clauses and Unification
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Horn Clauses and Unification
This Lecture Substitution model
CS201: Data Structures and Discrete Mathematics I
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
RESOLUTION.
Introduction to Computational Linguistics
Resolution Proof System for First Order Logic
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Representations & Reasoning Systems (RRS) (2.2)
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 [all .x (or [= .x c1][= .x c2] ... [= .x cn])] 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. [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.