Presentation is loading. Please wait.

Presentation is loading. Please wait.

9/28/98 Prof. Richard Fikes First-Order Logic Knowledge Interchange Format (KIF) Computer Science Department Stanford University CS222 Fall 1998.

Similar presentations


Presentation on theme: "9/28/98 Prof. Richard Fikes First-Order Logic Knowledge Interchange Format (KIF) Computer Science Department Stanford University CS222 Fall 1998."— Presentation transcript:

1 9/28/98 Prof. Richard Fikes First-Order Logic Knowledge Interchange Format (KIF) Computer Science Department Stanford University CS222 Fall 1998

2 2 Knowledge Systems Laboratory, Stanford University Language 1 Language 2 Language n K I F KB Library... Interlingua for Multi-Use Knowledge KIF u Knowledge Interchange Format (KIF) ä First order predicate logic with set theory ä Logically comprehensive ä Model-theoretic semantics

3 3 Knowledge Systems Laboratory, Stanford University KR Language Components logical formalism u A logical formalism ä Syntax for wffs ä Vocabulary of logical symbols ä Interpretation semantics for the logical symbols E.g., (=> (Person ?x) (= (Gender (Mother ?x)) Female))) ontology u An ontology ä Vocabulary of non-logical symbols › Relations, functions, constants ä Axioms restricting the interpretations of the symbols E.g., (=> (Person ?x) (= (Gender (Mother ?x)) Female))) proof theory u A proof theory ä Specification of the reasoning steps that are logically sound E.g., (=> S 1 S 2 ) and S 1 entails S 2

4 4 Knowledge Systems Laboratory, Stanford University ConceptualizationConceptualization u Universe of discourse Set of objects about which knowledge is being expressed u Object ä Concrete Clyde, my car ä Abstract Justice, 2 ä Primitive Resister ä Composite Electric circuit ä Fictional Sherlock Holmes

5 5 Knowledge Systems Laboratory, Stanford University a b c d e Blocks World Objects - a, b, c, d, e, table

6 6 Knowledge Systems Laboratory, Stanford University Relations and Functions u Relation ä Set of finite lists of objects E.g., Parent: {(Richard Earl) (Richard Polly) (Debbie Don) … }  Mapping:  u Function ä Relation that associates a unique nth element with a given n-1 elements E.g, +: {(1 3 4) (17 23 40) (2 7 10 12 31) …} ä Referred to as (arg1, arg2, …,argk, value)  Mapping: 

7 7 Knowledge Systems Laboratory, Stanford University a b c d e Blocks World u Objects a, b, c, d, e, table u Relations ä Above: {(a b) (a c) (b c) (d e)} ä Clear: {(a) (d)} ä Table: {(c) (e)} u Functions ä On: {(a b) (b c) (d e)}

8 8 Knowledge Systems Laboratory, Stanford University Predicate Calculus - KIF u Knowledge Base - Collection of sentences u Sentence - Expression denoting a statement u Term - Expression denoting an object u Objects always in the conceptualization ä Words ä Complex numbers lists ä All finite lists of objects sets ä All sets of objects   (bottom)

9 9 Knowledge Systems Laboratory, Stanford University Declarative Semantics u Interpretation -     (  ) u Variable assignment -    Semantic value -  ä Defined in terms of an interpretation and variable assignment  Truth value -  {true, false} ä Defined in terms of an interpretation and variable assignment u Version of a variable assignment V’ is a version of a variable assignment V with respect to variables var 1,…,var n if and only if V’ agrees with V on all variables except for var 1,…,var n.

10 10 Knowledge Systems Laboratory, Stanford University Constants, Individual Variables, Function Terms u Constant - Word E.g., Fred, Block-A, Justice S IV ( ) = I( ) u Individual Variable - Word beginning with “?” E.g, ?x, ?The-Murderer S IV ( ) = V( ) u Function Term ä ( * [ ]) E.g., (plus 2 3) (Father-Of Richard) ä S IV ((fn term 1 … term n )) = I(fn)[S IV (term 1 ) … S IV (term n )] ä S IV ((fn term 1 … term n @var)) = I(fn)[S IV (term 1 ) … S IV (term n ) | V(@var)]

11 11 Knowledge Systems Laboratory, Stanford University List Terms and Set Terms u List Term ä (listof * [ ]) E.g., (listof A B C) (listof A ?second @rest)  S IV ((listof term 1 … term n )) =  S IV (term 1 ), …, S IV (term n )  ä S IV ((listof term 1 … term n @var)) =  S IV (term 1 ), …, S IV (term n ) | V(@var)  u Set Term ä (setof * [ ]) E.g., (setof A B C) (setof A ?X @Z)  S IV ((setof term 1 … term n )) =  S IV (term 1 ), …, S IV (term n )} ä S IV ((setof term 1 … term n @var)) =  S IV (term 1 ), …,S IV (term n )} U {x | (  i) x = S IV (nth(@var i))}

12 12 Knowledge Systems Laboratory, Stanford University Logical Terms u (if [ ]) E.g, (if (Above A B) A B) ä S IV ((if sent term)) = › S IV (term) when T IV (sent) = true ›  otherwise ä S IV ((if sent term 1 term 2 )) = › S IV (term 1 ) when T IV (sent) = true › S IV (term 2 ) otherwise u (cond ( ) … ( )) E.g., (cond ((Above A B) A) ((Above B A) B)) ä S IV ((cond (sent 1 term 1 ) … (sent n term n ))) = › S IV (term 1 ) when T IV (sent 1 ) = true... › S IV (term n ) when T IV (sent n ) = true ›  otherwise

13 13 Knowledge Systems Laboratory, Stanford University Quantified Terms u Set-Forming Term - (setofall ) E.g, (setofall ?block (Above ?block A)) ä S IV ((setofall term sent)) = {S IV’ (term) | T IV’ (sent) = true} for all versions V’ of V wrt the variables in term u Designator - (the ) E.g., (the ?block (Above ?block A)) ä S IV ((the term sent)) = › S IV’ (term) when V’ is a version of V wrt the variables in term, and T IV’ (sent) = true, and S IV’’ (term) = S IV’ (term) for all versions V’’ of V such that T IV’’ (sent) = true ›  otherwise

14 14 Knowledge Systems Laboratory, Stanford University Logical Constants, Equations, Inequalities u Logical constant ä T iv (constant) = I(constant) ä T iv (true) = true ä T iv (false) = false u Equations - (= ) E.g, (= (Father Richard) Earl) (= A B) ä T IV ((= term 1 term 2 )) = › true when S IV (term 1 ) and S IV (term 2 ) are the same object › false otherwise u Inequalities - (/= ) E.g, (/= (Father Richard) (Father Bob)) (/= A B) ä T IV ((/= term 1 term 2 )) = T IV ((not (= term 1 term 2 )))

15 15 Knowledge Systems Laboratory, Stanford University Relational Sentences u ( * [ ]) E.g, (Parent Richard Earl) (Clear A) (Set-Partition Set1 @Sets) ä T IV ((rel term 1 … term n )) = › true when I(rel)[S IV (term 1 ), …, S IV (term n )] is true › false otherwise ä T IV ((rel term 1 … term n @var)) = › true when I(rel)[S IV (term 1 ), …, S IV (term n ) | S IV (@var)] is true › false otherwise u ( * ) E.g, (Father Richard Earl) (Plus 2 5 7) ä T IV ((fun arg 1 … arg n val)) = › true when I(fun)[S IV (arg 1 ), …, S IV (arg n )] = S IV (val) › false otherwise

16 16 Knowledge Systems Laboratory, Stanford University Logical Sentences: not, and, or u Negation - (not ) E.g., (not (On A D)) (not (On B B)) ä T IV ((not sent)) = › true when T IV (sent) is false › false otherwise u Conjunction - (and *) E.g., (and (On A B) (On B C)) ä T IV ((and sent 1 … sent n )) = › true when T IV (sent i ) is true for all i=1,…,n › false otherwise u Disjunction - (or *) E.g., (or (On A D) (On A B)) ä T IV ((or sent 1 … sent n )) = › true when T IV (sent i ) is true for some i=1,…,n › false otherwise

17 17 Knowledge Systems Laboratory, Stanford University Logical Sentences: => Logical Sentences: => u Implication - (=> * ) E.g., (=> (On A B) (On B C)) ä T IV ((=> ante 1 … ante n conse)) = › true when: T IV (ante i ) is false for some i=1,…,n; or T IV (conse) is true › false otherwise E.g., (=> (On A D) (On D D)) ä T IV ((=> a 1 … a n c)) = T IV ((or (not a 1 ) … (not a n ) c)) u Implication - ( *) u Equivalence - ( ) ä T IV ((sent 1 sent 2 )) = › true when T IV (sent 1 ) = T IV (sent 2 ) › false otherwise ä T IV (( s 1 s 2 )) = T IV ((and (=> s 1 s 2 ) (=> s 2 s 1 )))

18 18 Knowledge Systems Laboratory, Stanford University Universally Quantified Sentences u (forall ) E.g, (forall ?b (not (On ?b ?b))) ä T IV ((forall ?var sent)) = › true when T IV’ (sent) = true for all versions V’ of V with respect to variable ?var › false otherwise u (forall ( *) ) E.g., (forall (?b 1 ?b 2 ) (=> (On ?b 1 ?b 2 ) (Above ?b 1 ?b 2 ))) ä T IV ((forall (?var 1 … ?var n ) sent)) = › true when T IV’ (sent) = true for all versions V’ of V with respect to ?var 1 … ?var n › false otherwise

19 19 Knowledge Systems Laboratory, Stanford University Existentially Quantified Sentences u (exists ) E.g, (forall ?b1 (or (on ?b1 table) (exists ?b2 (On ?b1 ?b2)))) ä T IV ((exists ?var sent)) = › true when T IV’ (sent) = true for some version V’ of V with respect to variable ?var › false otherwise u (exists ( *) ) E.g., (exists (?b 1 ?b 2 ) (and (On ?b 1 ?A) (Above ?A ?b 2 ))) ä T IV ((exists (?var 1 … ?var n ) sent)) = › true when T IV’ (sent) = true for some version V’ of V with respect to ?var 1 … ?var n › false otherwise u forall not in the scope of an exists may be omitted E.g, (or (on ?b1 table) (exists ?b2 (On ?b1 ?b2)))

20 20 Knowledge Systems Laboratory, Stanford University Digital Circuit C 1 Russell and Norvig, Figure 8.1 Sum Out Carry Out Addends In Carry In

21 21 Knowledge Systems Laboratory, Stanford University Domain Conceptualization u Objects ä Circuits ä Terminals ä Signals ä Gates ä Gate types ä Signal values u Relations ä Connected: ( ) u Functions  Type:   In: ( )   Out: ( )   Signal: 

22 22 Knowledge Systems Laboratory, Stanford University Electronic Circuit Domain Theory u Connected terminals have the same signal (=> (Connected ?t1 ?t2) (= (Signal ?t1) (Signal ?t2))) u Signal at terminal is either on or off (or (= (Signal ?t) On) (= (Signal ?t) Off)) (or (Signal ?t On) (Signal ?t Off))) (not (= On Off)) u Connected is commutative ( (Connected ?t1 ?t2) (Connected ?t2 ?t1))

23 23 Knowledge Systems Laboratory, Stanford University OR and AND Gates u OR gate’s output is on when any of its inputs are on (=> (= (Type ?g) OR) ( (= (Signal (Out 1 ?g)) On) (exists ?i (= (Signal (In ?i ?g)) On))) u AND gate’s output is off when any of its inputs are off (=> (= (Type ?g) AND) ( (= (Signal (Out 1 ?g)) Off) (exists ?i (= (Signal (In ?i ?g)) Off)))

24 24 Knowledge Systems Laboratory, Stanford University XOR and NOT Gates u XOR gate’s output is on when its inputs are different (=> (= (Type ?g) XOR) ( (= (Signal (Out 1 ?g)) On) (not (= (Signal (In 1 ?g) (Signal (In 2 ?g)))))) u NOT gate’s output is different from its inputs (=> (= (Type ?g) NOT) (not (= (Signal (Out 1 ?g)) (Signal (In 1 ?g)))))

25 25 Knowledge Systems Laboratory, Stanford University Circuit C 1 Representation u Gates (= (Type X 1 ) XOR)(= (Type X 2 ) XOR) (= (Type A 1 ) AND)(= (Type A 2 ) AND) (= (Type O 1 ) OR) u Connections (Connected (Out 1 X 1 ) (In 1 X 2 ))(Connected (In 1 C 1 ) (In 1 X 1 )) (Connected (Out 1 X 1 ) (In 2 A 2 ))(Connected (In 1 C 1 ) (In 1 A 1 )) (Connected (Out 1 A 2 ) (In 1 O 1 ))(Connected (In 2 C 1 ) (In 2 X 1 )) (Connected (Out 1 A 1 ) (In 2 O 1 ))(Connected (In 2 C 1 ) (In 2 A 1 )) (Connected (Out 1 X 2 ) (Out 1 C 1 ))(Connected (In 3 C 1 ) (In 2 X 2 )) (Connected (Out 1 O 1 ) (Out 2 C 1 ))(Connected (In 3 C 1 ) (In 1 A 2 ))

26 26 Knowledge Systems Laboratory, Stanford University Readings for 10/5 u Proofs and inference rules for first order logic u Primary Readings ä Russell and Norvig › 9.1-3 - Inference in First-Order Logic


Download ppt "9/28/98 Prof. Richard Fikes First-Order Logic Knowledge Interchange Format (KIF) Computer Science Department Stanford University CS222 Fall 1998."

Similar presentations


Ads by Google