Limited expressivity of propositional Physics of the Wumpus World: Modeling is difficult with Propositional Logic Schemas: TDDC17 Seminar 6 First-Order Logic Resolution Nonmonotonic Reasoning ( Bx,y ⇔ (Px,y+1 ∨ Px,y-1 ∨ Px+1,y ∨ Px-1,y ))# Def. of breeze in pos [x,y] ( Sx,y ⇔ (Wx,y+1 ∨ Wx,y-1 ∨ Wx+1,y ∨ Wx-1,y ))# Def. of stench in pos [x,y] (W1,1 ∨ W1,2 ∨ … ∨ W4,4 ))" ..., etc. Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Ontological Commitment of 1st-order logic Higher-Order Logic 2nd-Order Logic There is only one wumpus! Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Spectrum of Logics and Languages Circumscription There is at least one wumpus! Facts Objects Relations Default Logic Modal Logics: Epistemic, Doxastic, Temporal,... 1st-Order Logic + Fixpoints Inductive Definitions Datalog 1st-Order Logic Description Logic Model with: • 5 objects • 2 binary relations • brother • on-head • 3 unary relations • person • crown • king • 1 unary function • left-leg() Definite Clauses Horn Clauses Compile! Propositional Logic Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Language and Syntax: Terms FOL: Language and Syntax: Components Name individuals in a domain of discourse Name relations between objects Refer to some or all objects with particular constraints • Object Constants - Infinite set of object constants. • Convention: Begin with capital letters or numerals • Examples: Aa, 125, Q, Battery1 •Variables – Infinite set of variables • Convention: Use lower case letters • Examples: p,q,r,s,t,…, p1,p2, and so on. Terms and separated by commas, is a term. • Examples: fatherOf(John, p), onTopOf(B1), armOf(R1) • Function Constants - Infinite set of function constants of all arities. • Convention: Begin with lower case letters and have an arity • Examples: presidentOf, onTopOf (arity 1), times, plus (arity 2) •Relation Constants - Infinite set of relation constants of all arities. • Convention: Begin with capital letters and have an arity. • Examples: Large, Clear (arity 1), Parent (arity 2) •Quantifier symbols -- ∀and ∃. • ∀ is called the universal quantifier. ∃ is called the existential quantifier Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Connectives and Delimiters Propositional connectives: ∧, ∨, ⊃, and, ¬$ Delimiters: [, ], (, ). Separator: , Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Language and Syntax: wffs • Atoms: a relation constant of arity n followed by n terms in parentheses and separated by commas is an atom. An atom is a wff. • Examples: P(A,B,c), IsBlock(onTopOf(B1)) • Propositional wffs: Any expression formed out of predicate calculus wffs in the same way that the propositional calculus forms wffs out of other wffs is a wff, called a propositional wff. • Examples: P(A,B1,C) ⊃ (IsBlock(onTopOf(B1)) ∧ Heavy(C)) # • An object constant is a term • Examples: Aa, 125, Q, Battery1 • A variable symbol is a term. • Examples: p,q,r,s,t,…, p1,p2, and so on. • A function constant of arity n, followed by n terms in parentheses Semantics: Restricted to propositional wffs + Boolean combinations atoms Boolean combinations of ground atoms • If ω is a wff and ν is a variable symbol, then both (∀ν)ω and (∃ν)ω are wffs. The language restricted to propositional wffs can be used to refer to objects in the world as well as propositions (with internal structure) about objects (properties and relations). Using the language, we can refer to: • an infinite number of objects (or individuals) in the world. (but not sets of objects!) • an infinite number of functions on individuals • an infinite number of relations on individuals Language IsBlock(onTopOf(B)) P(A,B,C) Interpretation • ν is the variable quantified over and ω is said to be within the scope of the quantifier. • If all variable symbols besides ν in ω are quantified over, then (Qν)ω is called a closed wff. (Q can be ∀or ∃. ) Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden 3 World P: {<A,B,C>, <D,F,E>} Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden A C 1 B onTopOf: {<B>-->A <C> -->B <A> -->Floor} Semantics of Quantification Interpretations An Interpretation of an expression in the predicate calculus is an assignment that maps: • object constants into constants (objects) in the world • n-ary function constants into n-ary functions • n-ary relation constants into n-ary relations • The set of objects to which the object constants assignments are made is called the domain of the interpretation. (∀ν)ω has the value True (under a given interpretation), just in case ω has the value True for all assignments of the variable symbol ν to objects in the domain. (∃ν)ω has the value True (under a given interpretation), just in case ω has the value True for at least one assignment of the variable symbol ν to objects in the domain. A Extended Interpretation is an interpretation that also maps all variables into the domain (an assignment) Every object on the floor is clear There is at least one object on the floor Some objects are big Given an extended interpretation for its component parts, an atom has value True just in case the denoted relation holds for those individuals denoted by its terms, otherwise the atom has value False. (∀ x) [On(x, Floor) ⊃ Clear(x)] # The values of non-atomic wffs can be determined in the same way as for the propositional formulas using truth tables. Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden An Example On(B,A) On(A, Floor) On(C,Floor) Clear(B) Clear(C) KB1 On(B,A) On(C,Floor) Clear(B) Clear(C) Clear(B) ∧ Clear(C) ⊃ On(A,Floor) KB2 Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Another Example Object Constants: A, B, C, Floor Relation Constants: On, Clear B A Floor A --> A B --> B C --> C Floor --> Floor On --> {<A, Floor>,<B,A>, <C,Floor>} Clear --> {<B>, <C>} Interpretation C On(B,A) On(C,Floor) Clear(B) Clear(C) Object Constants: A, B, C, Floor Relation Constants: On, Clear Clear(B) ∧ Clear(C) ⊃ On(A,Floor) Are these sentences True using the interpretation to the right? (∃x)On(x,Floor) Find one extended interpretation where On(x, Floor) is true. (∀x) Clear(B) ∧ Clear(C) ⊃ On(x,Floor) Make sure the non-quantified part of the formula is true for all extended interpretations. Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden B A Floor A --> A B --> B C --> C Floor --> Floor On --> {<A, Floor>,<B,A>, <C,Floor>} Clear --> {<B>, <C>} Interpretation C On Domains and Models • Language with 2 constants, R,J and one binary relation On Domains and Models • Language with 2 constants, R,J and one binary relation Some models Some models Naming individuals: • More than one name • No name Database Semantics Many applications assume UNA, DC Naming individuals: •Unique Names Assumptions •Domain Closure Under-constrained in FOL! Richard has two brothers? Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Substitutions Resolution and Unification Recall that terms of an expression can be object constants, variables or functional expressions which include function constants and terms. Propositional Case: {R} {P} {¬P, ¬R} Resolve on P {¬R} Resolve on R {} Matching a positive and negative literal is more or less trivial because the atom in question has no structure. In First-Order Logic Case: {P(f(y),A), Q(B,C)} {¬P(x,A), R(x,C)} {?} Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden A substitution instance of an expression is obtained by substituting terms for variables in that expression. We denote a substitution instance by ωs, where ω is an expression and s a substitution. P[z, f(w), B] Alphabetic Variant P[x, f(y), B] P[g(z), f(A), B] Matching the internal structure of atoms is more complex and involves generating substitutions P[C, f(A), B] Ground instance {x/z, y/w} {x/g(z), y/A} {x/C, y/A} A substitution is represented by a set of ordered pairs s = {ψ1/τ1, ψ2/τ2, . . ., ψn/τn }, where the pair ψi/τi means that term τi is substituted for every occurrence of the variable ψi throughout the scope of the substitution. Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Substitution Properites The composition of two substitutions s1 and s2, denoted by s1s2, is obtained by first applying s2 to the terms of s1 and then adding any pairs of s2 having variables not occurring among the variables of s1. s1= { z/g(x,y) } s2= { x/A, y/B, w/C, z/D} s1s2= { z/g(A,B) , x/A, y/B, w/C} Most General Unifiers (MGU) Denote the set of substitution instances of a set {ωi} of expressions by {ωi}s. A set of expressions is unifiable if there exists a substitution s such that ω1 s = ω2 s = ω3 s . . . . In such a case , s is said to be a unifier of {ωi} since its use collapses the set to a singleton. s= {x/A, y/B} unifies {P[x, f(y), B], P[x, f(B), B]} yielding {P[A, f(B), B]} s binds too much! We do not need to bind x to A to unify the 2 expressions. (ω s1)s2 = ω (s1s2) s1(s2s3) = (s1s2)s3 Associative s1s2 ≠ s2s1 Not Commutative Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Unification Algorithm The most general (or simplest) unifier ( mgu), g of {ωi} , has the property that if s is any unifier of {ωi} yielding {ωi}s, then there exists a substitution s´ such that {ωi}s = {ωi}gs´. Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Skolemization: Required for CNF Form Let ω be a quantified sentence of the form (∀ν1) . . . (∀νn)(∃y)ω(νi, y), where the variables ν1 . . . νn are universally quantified, the variable y is existentially quantified, and these variables appear in the component sentence ω. The Skolemization of (∀ν1) . . . (∀νn)(∃ y)ω(νi, y) is the sentence (∀ν1) . . . (∀νn)ω(νi,f(ν1, . . , νn)), where y has been replaced with f(ν1, . . , νn), in the subexpression ω. f must be a new function symbol that does not already appear in the theory. (∃x)(∀y)[ Mother(x) ∧ Mother-of(x,y)] (∀y) (∃x) [Mother(x) ∧ Mother-of(x,y)] Skolemization x is the mother of everyone any y has a mother (∀y) [Mother(f(y)) ∧ Mother-of(f(y),y)] (∃x) Mother(x) Mother(M1) Skolem constant The point is to remove all existential quantifiers leaving only universal quantifiers. Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Example CNF Form for First-Order Logic 1. Eliminate implication signs (using the ∨ form). 2. Reduce the scopes of negation signs. (using DeMorgan Laws, double negation) 3. Standardize the variables. Rename quantified variables so that each quantifier has its own variable symbol. 4. Eliminate existential quantifiers (replace with Skolem functions or constants) 5. Convert to prenex form. (move all ∀ quantifiers to front of the formula). 6. Eliminate universal quantifiers (all variables are universally quantified). 7. Put the matrix (quantifier free part of 5) into conjunctive normal form using DeMorgan’s rules, etc. Eliminate Implications: Reduce the scope of negation: 3-6: Additions for FOL Deal with quantifiers and variable names Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Standardize/rename Variables Skolemize: Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Drop Universal Quantifiers: Put into CNF form using DeMorgan’s rules, etc.: Finished! Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Example (∀h)[[Big(h) ∧ House(h) ⊃ Work(h)] ∨% [(∃m) Cleans(m,h) ∧ ¬(∃g) Garden(g,h)]]% Resolution for First-Order Logic Suppose γ1 ∪{φ} and γ2 ∪ {¬ψ} are two clauses and φ and ¬ψ are positive and negative literals, respectively. Then, % γ1 ∪{φ} γ2 ∪ {¬ψ}% where φµ = ψµ% [γ1 ∪ γ2]µ% and µ is the mgu of φ and ψ . Binary Resolution: resolves on 2 literals clause 1 clause 2 {Q(x), R(x)} ∪{P(x,x)} {¬Q(B), S(y)} ∪{¬P(A, z)} {Q(A), R(A), ¬Q(B), S(y)} resolvant {z/A, x/A} Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Soundness and Completeness First-Order Logic Resolution is Sound! First-Order Logic Resolution is not refutation complete using the current resolution rule. It can be made complete with the addition of Factoring: the removal of redundant literals Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden An Example: Package Delivery Robot All of the packages in room 27 are smaller than any of the packages in room 28: 1. (∀x,y){[Package(x)∧ Package(y) ∧ Inroom(x,27) ∧ Inroom(y,28) ]# ⊃ Smaller(x,y)}# A is a package and B is a package: 2. Package(A)# 3. Package(B) Inroom(A,27) ? 4. Inroom(A,27) ∨ Inroom(A,28) In which room is package A? Package B is in room 27: 5. Inroom(B,27) # Package B is not smaller than package A: 6. ¬Smaller(B,A) Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Is package A in room 27? Package A is either in room 27 or room 28: Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden ∃u Inroom(A,u) ?" Resolution example Robot’s Situation Room 27 Robot’s current Location. (7) Negate the query: (7’) Put 1-6 into CNF form Robot’s Goal: Fetch Package A and bring it to the current location. 2-6 are already in CNF form. Call them 2’-6’ Room 28 Where is package A? Is package A in room 27? Put 1 into CNF form: Go there, pick it up, go back (generate a plan) Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden CNF form CNF form Standardize/rename variables: Eliminate implications: Drop universals: 1’ Reduce scope of negation sign: Simplify: Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Finished! Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Resolution Resolution Proof Theory is in CNF form: 1’ 2’ Resolve 7’ and 4’ 3’ 4’ 5’ 6’ 7’ 8: Resolve 8 and 1’ 9: Resolve 9 and 2’ 10: Resolve 10 and 3’ Negated query: Continued next slide...... Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Resolution Proof 10: Resolve 10 and 3’ 11: Resolve 11 and 6’ 12: Resolve 12 and 5’ Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Reasoning About Action and Change Nonmonotonic Logics Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Reasoning about action and change • Reasoning about Action and Change How do we represent and develop efficient inference mechanisms for dynamic behaviors of agents in incompletely specified environments? One of the most difficult problems in formal knowledge representation! • • • • Late 60’s and 70’s: difficulties in modeling Invention of nonmonotonic logic in 70’s Great progress in 80’s and 90’s Need for scalable, efficient solutions for incomplete environments in the 00’s. (WWW, Robotics) Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Knowledge Processing Lab Actions & Effects Epistemics & Causality Temporal & Spatial Reasoning Sensing & Observation Planning & Plan Execution Prediction and Explanation Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Knowledge Processing Lab Some More Problems Some Problems [t1 ]inpocket(agent, bubblegum) ?? [t1 ]at(gold, 2, 3) ?? Is the gold still at 2,3 after the agent moves to 1,2 ? The Ramification Problem Are the pits in the same place after the agent moves to 1,2 ? [t1 ]at(agent, 1, 2) [t1 ]at(agent, 1, 2) [t,t1 ]Goto(agent, 1, 1, 1, 2) [t]at(agent, 1, 1) [t]at(gold, 2, 3) The Frame Problem The world tends to remain inert. Most actions are local and do not disturb the larger frame. Most features in the world do not change. [t,t1 ]Goto(agent, 1, 1, 1, 2) [t]at(agent, 1, 1) [t]at(gold, 2, 3) [t]inpocket(agent, bubblegum) How can this rule of thumb be represented succinctly in logic? Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Knowledge Processing Lab Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden There are many ramifications to an action, causal dependencies that become true when an action is executed How can one succinctly represent these ramified effects without making action specifications overly detailed? KPLAB Knowledge Processing Lab Some Formalisms More Problems Goto Action [at(agent, x, y) ^ ad jacent(x, y, x1 , y1 ) ^ Sa f e(x1 , y1 )] ! [at(agent, x1 , y1 ) ^ ¬at(agent, x, y)] But what if ...... A giant bird flies by and drops a turd and blocks the path? The Wumpus breaks the rules and goes on the move? The Gold falls off a shelf and hits the agent in the head knocking it unconscious? The agent is wearing red-white and blue and a virtual Usama Bin Ladin enters the game as a virus and exterminates anything with those colors? The Qualification Problem All actions have exceptions (possibly infinite). How can we succinctly represent that actions work most of the time but there are exceptions, and we can add them to the theory in a manner that doesn’t force us to go into the action rules and change them all the time? Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Knowledge Processing Lab P 1 2 3 Situation Calculus (Revised) -- Reiter et al Event Calculus -- Kowalski (logic programming) Fluent Calculus -- Thielscher The A Family - Lifschitz, Gelfond, Baral Features and Fluents -- Sandewall Temporal Action Logics (TAL) -- Doherty et al KPLAB Knowledge Processing Lab #obs [0] Safe(1,1) & !Wumpus(1,1) & !Pit(1,1) & Alive(agent1) #occ [0,1] goto(agent1,1,1,1,2) #dep I([1] sense(agent1, breeze)) …. ….. #obs [10] Wumpus(1,3) & !Alive(agent1) 4 2 1 • Using Narratives for Explanation #obs [0] Safe(1,1) & !Wumpus(1,1) & !Pit(1,1) & Alive(agent1) #occ [0,1] goto(agent1,1,1,1,2) #dep I([1] sense(agent1, breeze)) #occ [1,2] goto(agent1, 1,2,1,1) #occ [2,3] goto(agent1, 1,1,2,1) #dep I([3] sense(agent1, stench)) 4 3 • • • • • Situation Calculus -- McCarthy (1959-63) Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Using TAL Narratives for Projection Given that I execute these actions and sense these percepts, what can I say about the wumpus world? • 4 Given that the agent executed these actions and sensed these percepts and given the following observations at time 10, how can we explain them? 3 P 2 1 1 Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Knowledge Processing Lab Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden 2 3 KPLAB Knowledge Processing Lab 4 Multi-Agent Iphone Game Using TAL Narratives to Plan #obs [0] Safe(1,1) & !Wumpus(1,1) & !Pit(1,1) & Alive(agent1) Initial State Specification ? #obs [t] Winner(agent1) & Gold(1,1) TALPlanner Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Goal Generate a sequence of actions which make the observations at t true given the initial state observations at time 0. KPLAB Knowledge Processing Lab Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden Techniques for solving A&C Problems Open & Closed World Assumptions Predicate Completion Negation as Failure to Prove Circumscription Default Logic Common thread: • Make assumptions about incomplete information. • Do this by refering to meta-theoretic concepts. • The entailment relation becomes nonmonotonic. If an atom is not in a database, assume it is false. The sufficient conditions for a predicate in a theory are also the necessary conditions. If I can’t prove a literal is true, assume it is false. The objects or tuples that can be shown to satisfy a relation are the only ones that do. If a formula is consistent with a theory then assume it is true Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Knowledge Processing Lab KPLAB Knowledge Processing Lab Monotonicity Classical Logic: IF THEN Practical Reasoning is often not as conservative. We often “jump” to conclusions or assume something is true if there is no reason to believe otherwise. (ceteris paribus in law) XX Nonmonotonic Logics do not have the property of monotonicity Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden KPLAB Knowledge Processing Lab 90 5 Non-Monotonic Reasoning Sufficient and Necessary Conditions the sequel, we will not distinguish between a theory T and the sentence denoting the conjunction of all members of T . We write T (P1 , . . . , Pn ) to indicate that some (but not necessarily all) of the relation symbols occurring in T are among P1 , . . . , Pn . Circumscription Informally Narrative Theory in L(FL) An n-ary relation expression is an expression of the form λx1 . . . xn . A(x1 , . . . , xn ) (n ≥ 0) P is a sufficient condition Q wherefor x1 ,something . . . , xn arebeing individual variables and A(x1 , . . . , xn ) is any formula Make those sufficient conditions for change the only conditions Narrative Theory in L(FL) + Circumscription Axiom No spurious change! of first- or second-order logic. We identify an n-ary relation symbol P with the relation expression λx1 . . . xn . P (x1 , . . . , xn ). Similarly, an n-ary relation variable X is identified with the relation expression λx1 . . . , xn .X(x1 , . . . , xn ). The following are relation expressions (below X is a relation variable): P is a necessary condition λxy. (X(x) ∨ P (y)); for something being Q λx. P (x); Models for the narrative Sufficient conditions for change λx. False. An n-ary relation expression U is intended to represent an n-ary relation which is usually referred to as the extension of U . By Minimizing Occludes we minimize unnecessary change. 5.3 Circumscription 91 If a feature does not have to change value relative to the axioms Observe that (5.3) can be rewritten as it won’t! In the sequel, an n-ary relation expression λx1 . . . , xn . A(x1 , . . . , xn ) will often be written as λx̄. A(x̄), where x̄ stands for a tuple ⟨x1 , . . . , xn ⟩. The only things that are Q are P. P Let U be a relation expression of the form λx̄. A(x̄), where x̄ = ⟨x1 , . . . , xn ⟩, is both necessary and sufficient and suppose that t̄ = ⟨t1 , . . . , tn ⟩ is an n-tuple of terms. The application of U toArtificial t̄, written U (t̄),Computer is the A(t̄). For instance, the application of Intelligence & Integrated Systemsformula Division KPLAB of Computer and Information Science λxy. Department (P (x)University, → Q(y)) to t̄ = ⟨a, z⟩ is the formula P (a) → Q(z). Knowledge Processing Linköping Sweden T (P̄ , S̄) ∧ ∀X̄∀Ȳ . {[T (X̄, Ȳ ) ∧ [X̄ ≤ P̄ ]] → [P̄ ≤ X̄]} which, in turn, is an abbreviation for Artificial Intelligence & Integrated Computer Systems Division i=1 i=1 ! Example 5.3.3. Let T consist of the following formulas: Definition 5.3.1. Let P̄ = ⟨P1 . . . , Pn ⟩ be a tuple of distinct relation symbols, S̄ = ⟨S1 , . . . , Sm ⟩ be a tuple of distinct relation symbols disjoint with P̄ , and let T (P̄ , S̄) be a theory. The circumscription of P̄ in T (P̄ , S̄) with varied S̄, written Circ(T ; P̄ ; S̄), is the sentence Let P̄ = ⟨Ab⟩ and S̄ = ⟨F lies⟩. i=1 Bird(Tweety) ∀x.[(Bird(x) ∧ ¬Ab(x)) → F lies(x)]. (5.3) ∀x.[X(x) → Ab(x)] ] → ∀x.[Ab(x) → X(x)] } . 91 Note that U ≤ V means that the extension is a subset Observe that (5.3) can of beUrewritten as of the extension of V . T (X̄, Ȳ ) is the sentence obtained from T (P̄ , S̄) by replacing all occurrences P̄ ,nS̄) ∧ ∀X̄∀Ȳ . {[T (X̄, ∧ [X̄ ≤ P̄ ]] → [P̄ of ≤ X̄]} , respectively, andȲ )all occurrences S1 . . . , Sm by of P1 . . . , Pn by X1 . . T. ,(X Y1 . . . , Ym , respectively. Intuition: Minimizes Extensions of selected Predicates ∀X̄∀Ȳ . T (X̄, Ȳ ) ∧ n # i=1 $ ∀x̄.(Xi (x̄) → Pi (x̄)) → n # i=1 {∀x.[(Bird(x) ∧ ¬False) → Bird(x)] ∧ ∀x.[False → Ab(x)]} → ∀x.[Ab(x) → False]. % Since A can be simplified to the logically equivalent sentence ∀x̄.(Pi (x̄) → Xi (x̄)) . ! Example 5.3.3. Let T consist of the following formulas: KPLAB Bird(Tweety) ∀x.[(Bird(x) ∧ ¬Ab(x)) → F lies(x)]. Let P̄ = ⟨Ab⟩ and S̄ = ⟨F lies⟩. Knowledge Processing Lab (5.4) where A is Definition 5.3.2. A formula A is said to be a consequence of the circumscription of P̄ in T (P̄ , S̄) with variable S̄ if and only if Circ(T ; P̄ ; S̄) |= A.12 Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden In its basic form, the idea is to find relational expressions for X and Y that when substituted into the theory T , will result in strengthening the theory so additional inferences can be made. For example, substituting λx.False for X and λx.Bird(x) for Y , one can conclude that Circ(T ; P̄ ; S̄) |= T ∧ A which, in turn, is an abbreviation for T (P̄ , S̄)∧ !" A Famous Example! Circ(T ; P̄ ; S̄) = T (P̄ , S̄) ∧ ∀X∀Y. { [Bird(Tweety) ∧ ∀x.[(Bird(x) ∧ ¬X(x)) → Y (x)]∧ where X̄ = ⟨X1 . . . , Xn ⟩ and Ȳ = ⟨Y1 , . . . , Ym ⟩ are tuples of relation variables 5.3 Circumscription ! similar to P̄ and S̄, respectively.11 11 Knowledge Processing Lab Definition 5.3.2. A formula A is said to be a consequence of the circumscription of P̄ in T (P̄ , S̄) with variable S̄ if and only if Circ(T ; P̄ ; S̄) |= A.12 Circumscription for (Ū ≤ V̄ ) ∧ (V̄ ≤ Ū ), and Ū < V̄ for (Ū ≤ V̄ ) ∧ ¬(V̄ ≤ Ū ). 10 KPLAB T (P̄ Department , S̄)∧ of Computer and Information Science Linköping $ % !" University, Swedenn n # # ∀x̄.(Xi (x̄) → Pi (x̄)) → ∀x̄.(Pi (x̄) → Xi (x̄)) . ∀X̄∀Ȳ . T (X̄, Ȳ ) ∧ Lab If U and V are relation expressions of the same arity, then U ≤ V stands for ∀x̄. (U (x̄) → V (x̄)).10 Similarly, if Ū = ⟨U1 , . . . , Un ⟩ and V̄ = ⟨V1 , . . . , Vn ⟩ are similar tuples of relation expressions, i.e., for 1 ≤ i ≤ n, Ui and Vi are of the n ! [Ui ≤ Vi ]. We write Ū = V̄ same arity, then Ū ≤ V̄ is an abbreviation for T (P̄ , S̄) ∧ ∀X̄∀Ȳ . ¬[T (X̄, Ȳ ) ∧ X̄ < P̄ ] Intended set of preferred Models for the narrative ∀x.[Ab(x) → False], which in turn is equivalent to ∀x.¬Ab(x), one can infer by (5.4) that Circ(T ; P̄ ; S̄) |= F lies(Tweety). 12 Artificial Intelligence & Integrated Computer Systems Division Here |= denotes the relation of the Department of Computer andentailment Information Science Linköping University, Sweden ! second-order logic. KPLAB Knowledge Processing Lab What to Know! • • Propositional and First-Order Logic Resolution Theorem Proving for both. • You should be able to model and solve a problem using resolution • This implies knowing transformation to CNF forms • You should understand problems associated with reasoning about action and change and intuitions behind circumscription. • Look at the Situation Calculus in the book Artificial Intelligence & Integrated Computer Systems Division Department of Computer and Information Science Linköping University, Sweden