3 AtomicPropositionalRelationalFirst order Expressiveness of RepresentationsAtomicPropositionalRelationalFirst orderAtomic representations: States as blackboxes..Propositional representations: States as made up of state variablesRelational representations: States made up of objects and relations between themFirst-order: there are functions which “produce” objects.. (so essentially an infinite set of objectsPropositional can be compiled to atomic (with exponential blow-up)Relational can be compiled to propositional (with exponential blo-up) if there are no functionsWith functions, we cannot compile relational representations into any finite propositional representation“higher-order” representationscan (sometimes) be compiled to lower order
4 Why FOPC If your thesis is utter vacuous Use first-order predicate calculus.With sufficient formalityThe sheerest banalityWill be hailed by the critics: "Miraculous!"
10 Important facts about quantifiers Forall and There-exists are related through negation..~[forall x P(x)] = Exists x ~P(x)~[exists x P(x)] = forall x ~P(x)Quantification is allowed only on variablescan’t quantify on predicates; can’t say[Forall P Reflexive(P) forall x,y P(x,y) => P(y,x) —you have to write it once per relation)Order of quantifiers matters
11 Family Values: Falwell vs. Mahabharata According to a recent CTC study,“….90% of the men surveyed said they will marry the same woman..”“…Jessica Alba.”Intuitively, x depends on yas it is in the scope ofthe quantification on y(foreshadowing Skolemization)English is Expressive but Ambiguous.
12 Caveat: Order of quantifiers matters Loves(x,y) meansx loves yIntuitively, x depends on yas it is in the scope ofthe quantification on y(foreshadowing Skolemization)“either Fido loves both Fido and Tweety; or Tweety loves both Fido and Tweety”“ Fido or Tweety loves Fido; and Fido or Tweety loves Tweety”
13 Caveat: Decide whether a symbol is predicate, constant or function… Make sure you decide what are your constants, what are your predicates and what are your functionsOnce you decide something is a predicate, you cannot use it in a place where a predicate is not expected! In the previous example, you cannot say
14 More on writing sentences Forall usually goes with implications (rarely with conjunctive sentences)There-exists usually goes with conjunctions—rarely with implicationsEveryone at ASU is smartSomeone at UA is smart
15 Apt-pet An apartment pet is a pet that is small Dog is a pet Cat is a petElephant is a petDogs and cats are small.Some dogs are cuteEach dog hates some catFido is a dog
16 Notes on encoding English statements to FOPC Since you are allowed to make your own predicate and function names, it is quite possible that two people FOPCizing the same KB may wind up writing two syntactically different KBsIf each of the KBs is used in isolation, there is no problem. However, if the knowledge written in one KB is supposed to be used in conjunction with that in another KB, you will need “Mapping axioms” which relate the “vocabulary” in one KB to the vocabulary in the other KB.This problem is PRETTY important in the context of Semantic WebYou get to decide what your predicates, functions, constants etc. are. All you are required to do is be consistent in their usage.When you write an English sentence into FOPC sentence, you can “double check” by asking yourself if there are worlds where FOPC sentence doesn’t hold and the English one holds and vice versaThe “Semantic Web” Connection
19 Two different Tarskian Interpretations This is the same as the one onThe left except we have green guyfor RichardProblem: There are too darned many Tarskian interpretations.Given one, you can change it by just substituting new real-world objects Substitution-equivalent Tarskian interpretations give same valuations to theFOPC statements (and thus do not change entailment) Think in terms of equivalent classes of Tarskian Interpretations(Herbrand Interpretations)We had this in proplogic too—The realWorld assertioncorresponding to aproposition
20 Connection to propositional logic: Think of “atomic sentences” as propositions…
21 Herbrand Interpretations Let us think of interpretations for FOPC that are morelike interpretations for prop logicHerbrand InterpretationsHerbrand UniverseAll constantsRao,PatAll “ground” functional termsSon-of(Rao);Son-of(Pat);Son-of(Son-of(…(Rao)))….Herbrand BaseAll ground atomic sentences made with terms in Herbrand universeFriend(Rao,Pat);Friend(Pat,Rao);Friend(Pat,Pat);Friend(Rao,Rao)Friend(Rao,Son-of(Rao));Friend(son-of(son-of(Rao),son-of(son-of(son-of(Pat))We can think of elements of HB as propositions; interpretations give T/F values to these. Given the interpretation, we can compute the value of the FOPC database sentencesIf there are n constants; andp k-ary predicates, then--Size of HU = n--Size of HB = p*nkBut if there is even one function,then |HU| is infinity and so is |HB|.--So, when there are no functionsymbols, FOPC is really justsyntactic sugaring for a (possiblymuch larger) propositional database
23 But what about Godel? In First Order Logic We have finite set of constantsQuantification allowed only over variables…Godel’s incompleteness theorem holds only in a system that includes “mathematical induction”—which is an axiom schema that requires infinitely many FOPC statementsIf a property P is true for 0, and whenever it is true for number n, it is also true for number n+1, then the property P is true for all natural numbersYou can’t write this in first order logic without writing it once for each P (so, you will have to write infinite number of FOPC statements)So, a finite FOPC database is still semi-decidable in that we can prove all provably true theorems
24 Proof-theoretic Inference in first order logic For “ground” sentences (i.e., sentences without any quantification), all the old rules work directly (think of ground atomic sentences as propositions)P(a,b)=> Q(a); P(a,b) |= Q(a)~P(a,b) V Q(a) resolved with P(a,b) gives Q(a)What about quantified sentences?May be infer ground sentences from them….Universal Instantiation (a universally quantified statement entails every instantiation of it)Existential instantiation (an existentially quantified statement holds for some term (not currently appearing in the KB).Can we combine these (so we can avoid unnecessary instantiations?) Yes. Generalized modus ponensNeeds UNIFICATION
25 UI can be applied several times to add new sentences--The resulting KB isequivalent to the old oneEI can only applied once--The resulting DB isnot equivalent to theold oneBUT will be satisfiableonly when the old one is
28 How about knows(x,f(x)) knows(u,u)? x/u; u/f(u)leads to infinite regress (“occurs check”)
29 GMP can be used in the “forward” (aka “bottom-up”) fashion where we start from antecedents, and assert the consequentor in the “backward” (aka “top-down”) fashion where we startfrom consequent, and subgoal on proving the antecedents.
30 Apt-pet An apartment pet is a pet that is small Dog is a pet Cat is a petElephant is a petDogs, cats and skunks are small.Fido is a dogLouie is a skunkGarfield is a catClyde is an elephantIs there an apartment pet?
33 Efficiency can be improved by re-ordering subgoals adaptively e.g., try to prove Pet before Small in Lilliput Island; andSmall before Pet in pet-store.
34 Forward (bottom-up) vs. Backward (top-down) chaining Suppose we haveP => QQ & R =>SS => ZZ & Q => WQ => JP RWe want to prove JForward chaining allows parallel derivation of many factstogether; but it may derive facts that are not relevant for the theorem.Backward chaining concentrates on proving subgoals that are relevantto the theorem. However, it proves theorems one at a time.Some similarity with progression vs. regression…Forward chaining fires rules starting from factsUsing P, derive QUsing Q & R, derive SUsing S, derive ZUsing Z, Q, derive WUsing Q, derive JNo more inferences. Check if J holds. It does. So provedBackward chaining starts from the theorem to be provedWe want to prove J.Using Q=>J, we can subgoal on QUsing P=>Q, we can subgoal on PP holds. We are done.
35 Datalog and Deductive Databases Connection to Progression becoming goal directed w.r.t.P.G. reachability heuristics Datalog and Deductive DatabasesA deductive database is a generalization of relational database, where in addition to the relational store, we also have a set of “rules”.The rules are in definite clause form (universally quantified implications, with one non-negated head, and a conjunction of non-negated tails)When a query is asked, the answers are retrieved both from the relational store, and by deriving new facts using the rules.The inference in deductive databases thus involves using GMP rule.Since deductive databases have to derived all answers for a query, top-down evaluation winds up being too inefficient.So, bottom-up (forward chaining) evaluation is used (which tends to derive non-relevant facts A neat idea called magic-sets allows us to temporarily change the rules (given a specific query), such that forward chaining on the modified rules will avoid deriving some of the irrelevant facts.?R(z)R(c); R(b)..RulesP(x,y),Q(y)=>R(y)Base factsP(a,b),Q(b)R(c)..RDBMS
36 Similar to “Integer Programming” or “Constraint Programming”
37 Generate compilablematchers for eachpattern, and use them
42 Example of FOPC Resolution.. Everyone is loved by someoneIf x loves y, x will give a valentine card to yWill anyone give Rao a valentine card?z/SK(rao);x’/raoy/z;x/Rao~loves(z,Rao)
43 Finding where you left your key.. Atkey(Home) V Atkey(Office) 1Where is the key?Ex Atkey(x)NegateForall x ~Atkey(x)CNF ~Atkey(x) 2Resolve 2 and 1 with x/homeYou get Atkey(office) 3Resolve 3 and 2 with x/officeYou get empty clauseSo resolution refutation “found”that there does exist a placewhere the key is…Where is it?what is x bound to?x is bound to office onceand home once.so x is either home or office
44 Existential proofs..Are there irrational numbers p and q such that pq is rational?This and the previous examples show that resolution refutation is powerful enough to model existential proofs.In contrast, generalized modus ponens is only able to model constructive proofs..RationalIrrational
45 Existential proofs..The previous example shows that resolution refutation is powerful enough to model existential proofs. In contrast, generalized modus ponens is only able to model constructive proofs..(We also discussed a cute example of existential proof—is it possible for an irrational number power another irrational number to be a rational number—we proved it is possible, without actually giving an example).
46 GMP vs. Resolution Refutation While resolution refutation is a complete inference for FOPC, it is computationally semi-decidable, which is a far cry from polynomial property of GMP inferences.So, most common uses of FOPC involve doing GMP-style reasoning rather than the full theorem-proving..There is a controversy in the community as to whether the right way to handle the computational complexity is toa. Develop “tractable subclasses” of languages and require the expert to write all their knowlede in the procrustean beds of those sub-classes (so we can claim “complete and tractable inference” for that class) ORLet users write their knowledge in the fully expressive FOPC, but just do incomplete (but sound) inference.See Doyle & Patil’s “Two Theses of Knowledge Representation”