1 / 29

74.419 Artificial Intelligence 2004 - First-Order Predicate Logic -

74.419 Artificial Intelligence 2004 - First-Order Predicate Logic -. First-Order Predicate Logic (FOL or FOPL), also called First-Order Predicate Calculus Formal Language Semantics through Interpretation Function Axioms Inference System. FOPL - Formal Language / Syntax -.

bartell
Download Presentation

74.419 Artificial Intelligence 2004 - First-Order Predicate Logic -

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 74.419 Artificial Intelligence 2004 - First-Order Predicate Logic - • First-Order Predicate Logic (FOL or FOPL), also called First-Order Predicate Calculus • Formal Language • Semantics through Interpretation Function • Axioms • Inference System

  2. FOPL- Formal Language / Syntax -

  3. Formal Language A Formal Language is specified as L = (NT, T, P, S) NT Set of Non-Terminal Symbols T Set of Terminal Symbols P Set of Production or Grammar Rules S Start Symbol (top-level node in syntax tree / parse tree) A formal language specifies the syntactically correct or well-formed expressions of a language.

  4. Terminals and Non-Terminals • NT Non-Terminals • wff (well-formed formula), atomic-formula; Predicate, Term, Function, Constant, Variable; Quantifier, Connective • T Terminals • Predicate (Symbols) P, Q, married, ..., T, F • Function (Symbols) f, g, father-of, ... • Variables x, y, z, ... • Constants Sally, block-1, c • Connectives , , ,  • Negation Symbol  • Quantifiers ,  • Equality Symbol = • Parentheses ( , ) • Other Symbols : Domain Specifc General

  5. Production / Grammar Rules Non-terminal Rules wff ::= atomic-formula |(wff)|  wff | wff Connective wff|Quantifier Variablewff atomic-formula ::= Predicate (Term, ...)*| Term = Term Term ::= Function (Term, ...)*| Variable | Constant Terminal Rules Connective ::=  |  |  |  Quantifier ::=  |  *Note: n-ary functions and predicates go with n terms

  6. Domain-Specific Terminal Rules • Terminal Rules for the specific Domain • Predicate ::= on(_,_) |near(_,_)| ... • Function ::= distance(_,_) | location(_)| ... • Variable ::= x|y | ... • Constant ::= Flakey|John-Bear | Karen| Alan-Alder | The-File | Kurt

  7. Quantifiers and Binding A variable in a formula can be bound by a quantifier. bound variable x: married (Sally, x) open formula: a variable in the formula is not bound by a quantifier x: married (Sally, x)  happy (y) closed formula: all variables in the formula are bound by quantifiers: x y: married (x, y) Most authors regard quantified formulas only as wffs if • all quantified variablesappear in the formula. Some authors regard quantified formulas only as wffs if • all variables arebound by quantifiers.

  8. FOPL- Semantics / Interpretation -

  9. Semantics - Overview • Define the Semantics of FOPL expressions (formulae): • Interpretation – Maps symbols of the formal language (predicates, functions, variables, constants) onto objects, relations, and functions of the “world” (formally: Domain, relational Structure, or Universe) • Valuation - Assigns domain objects to variables* • Constructive Semantics – Determines the semantics of complex expressions inductively, starting with basic expressions • * The Valuation function can be used for describing value assignments and constraints in case of nested quantifiers. • The Valuation function otherwise determines the satisfaction of a formula only in case of open formulae.

  10. Semantics – Domain, Interpretation I Domain, relational Structure, Universe D set of Objects R, S, ... set of Relations over D f, g, ... set of Functions in D Basic Mapping / Interpretation constants I [c] = dD functions I [f]= F: Dn →DFunction predicates I [P] = RDn Relation (set of n-tuples) Valuation V variables V(x) = dD

  11. Semantics –Interpretation Next, determine the semantics for complex terms and formulae constructively - regarding the syntax - from the basic interpretation above.

  12. Semantics - Interpretation II • Term with function • I [f(t1,...,tn)) = I [f] (I [t1],..., I [tn]) = F(I [t1],..., I [tn]) D • atomic Formula • I [P(t1,...,tn)] true if(I [t1],..., I [tn]) I [P] = R • negated Formula • I []true if I []is not true • complex Formula • I [] true ifI [] or I []true • I []true if I [] and I []true • I []ifI [] not true or I []true

  13. Semantics - Interpretation III quantified Formula (relative to Valuation function) I [x.]true if istrue with V’(x)=d for some dDwhere V’ is otherwise identical to the prior V. I [x.] true if  is true with V’(x)=d for all dD and where V’ is otherwise identical to the prior V. Note: The order of quantifiers plays a role for the semantic interpretation and evaluation: x y. is different from y x.  In the first case, we go through all values for x, and for each value of x we pick a suitable value for y. In the second case, we have to find one value for y which is good for all values of x.

  14. Semantics - Model • Model • Given a set of formulaeand a domain D with an interpretation I. Then • D is a model of if • I[]is truefor all * • That means the interpretation I into the domain D makes every formula  in  true. • * for every possible valuation, in case  has open formulae.

  15. Semantics – Logical Consequence • Logical Consequence • Given a set of formulaeand aformulaα. • αis a logical consequence of if • αis true in every model of . • Notation: • |=α • That means that for every model (interpretation into a domain) in which  is true, α must also be true.

  16. FOPL- Inference System -Axioms & Inference Rules

  17. FOPL Axioms A1      A2      A3        A4 (  )  ((  )  (  )) A5 x: (x)  (y) A6 (x)  y: (y)

  18. Formal Inference - Overview • Derive new formulae by syntactic manipulation of existing formulae: • given set of formulae  •  describes your KB, or a Theory, ... (FOPL axioms + your own "proper" axioms) • apply inference rule (based on  ) • new formula αis derived • add new formula to KB or Theory • new KB or Theory is α

  19. Formal Inference Formal Inference, Theorem Given a set of formulae  and a set of inference rules IR. A new formula αcan begenerated based on using inference rules in IR. We say that α is formally inferred or derived from  or αis a Theorem (of ) Notation: |– α

  20. IR Modus Ponens Modus Ponens   ,   States that  can be concluded provided we know that the formulae    and  are true in our knowledge base.

  21. IR Universal Instantiation Universal Instantiation x: (x) (c) where (x) is any formula containing the variable x, and (c) is the formula (x) where every occurrence of the quantified variable x is substituted with the arbitrary constant c.

  22. IR Existential Generalization Existential Generalization (c) x: (x) where (c) is any formula containing the arbitrary constant c, and (x) is the same formula as (c) but with every occurrence of the constant c replaced by a variable x.

  23. IR Replacement Rules Replacement Rules                (  ) (  )   

  24. FOPL Inference System • The Axioms and the Inference Rules above constitute a formal inference system for FOPL. • This system - we call it FS1 - is complete and sound.

  25. Soundness and Completeness Soundness An Inference System is sound iff  |– α |= α every formula which can be derived by formal inference from  is a also logical consequence of . Completeness An Inference System is complete iff  |= α |– α every formula which is a logical consequence of  can be derived by formal inference from  .

  26. FOPL - Sound and Complete 2 The above inference system for FOPL is sound and complete. Thus, every formula which can be derived in FOPL using FS1 (|– α) is also a logical consequence of the given axioms (|= α) : |–αiff |= α Thus, there is a correspondence between formal Inference and semantic Interpretation.

  27. Semantics - Example A1 Predicate Logic Language constants Bill-1, John-3, Sally-1, Mary-1, Mary-2 predicates happy-together, hate-each-other Structure D objects: Uncle-Bill, Uncle-John, Aunt-Sally, The-woman-I-don't-like, Mary relations: Married, Divorced (Uncle-Bill, Aunt-Sally)  Married, (Uncle-John, Mary)  Married (Uncle-John, The-woman-I-don't-like)  Divorced Interpretation I(Bill-1)=Uncle-Bill, I(John-3)=Uncle-John, I(Sally-1)=Aunt-Sally, I(Mary-1)=The-woman-I-don't-like, I(Mary-2)=Mary I(happy-together)=Married, I(hate-each-other)=Divorced True or false? hate-each-other (Bill-1, John-3) happy-together(Bill-1, Sally-1) hate-each-other(John-3, Mary-1) happy-together(John-3, Mary-2)

  28. Semantics -Example A2 Structure D objects: Uncle-Bill, Uncle-John, Aunt-Sally, The-woman-I-don't-like, Mary relations: Married, Divorced (Uncle-John, The-woman-I-don't-like)  Divorced (Uncle-Bill, Aunt-Sally)  Married, (Uncle-John, Mary)  Married (or: {(Uncle-Bill, Aunt-Sally), (Uncle-John, Mary)} = Married) Interpretation I I(Bill-1) = Uncle-Bill, I(John-3) = Uncle-John, I(Sally-1) = Aunt-Sally, I(Mary-1) = Mary, I(Mary-2) = The-woman-I-don't-like I(happy-together) = Married, I(hate-each-other) = Divorced True or false? hate-each-other (Bill-1, John-3) hate-each-other (John-3, Mary-1) happy-together (Bill-1, Sally-1)  happy-together (John-3, Mary-2) x: happy-together(Uncle-Bill, x)) x,y,z: happy-together(x,y)  hate-each-other (x,z) What if you want to add a formula? x,y: happy-together(x,y)  happy-together(y,x)

  29. Additional References • Frost, Richard: Introduction to Knowledge Base Systems. Collins Professional and Technical Books, William Collins Sons & Co. Ltd, London, 1986. • Nilsson, Nils J.: Artificial Intelligence - A new synthesis. Morgan Kaufmann Publishers, San Francisco, CA, 1998.

More Related