Knowledge Representation References Rich and Knight, Artificial Intelligence, 2nd ed. McGraw-Hill, 1991 Russell and Norvig, Artificial Intelligence: A modern approach, 2nd ed. Prentice Hall, 2003
Outline KR and natural language KR and Data Bases KR and Logic Semantic networks and frames
KR and Natural Language
KR and natural language Natural language pros: Very expressive: probably everything that can be expressed symbolically can be expressed in natural language (pictures, content of art, emotions are hard to express) Much more expressive than state-of-the-art KR formalisms Natural language cons: Often ambiguous Syntax and semantics not fully understood Little uniformity in the structure of sentences
KR and Data Bases
KR and databases An example of typical DB record: Person record = name : max 20 characters age : 3 digits in range 000-120 sex : { male, female } status : { married,bachelor,spinster,divorced,widowed,engaged } first_names_of_children : up to 10 names (each max 15 chars)
KR and DBMSs: an instance of Person
KR and DBMSs: Discussion Properties of traditional DB systems Only simple aspects of some universe of discourse We can represent entities and relationships between entities, but not much more Well suited to efficiently represent large amounts of data
KR and Logic: Propositional Logic
KR and propositional logic Syntax The syntax of a propositional language describes the possible configurations that can constitute sentences, based upon the concept of fact and sentence (which can be a fact or a combination of facts obtained b y applying to facts suitable connectives) Semantics Without semantics, a sentence is just an arrangement of terms that fulfill syntactic constraints The semantics is aimed at determining the facts in the world to which the sentences refer, so that a truth value can be assigned to each of them
KR and propositional logic Syntax Propositions (e.g., A, B,...) Connectives (e.g.,,,,...) Derivation rules (e.g. modus ponens) Modus ponens simply asserts that: { X, X Y } Y (it is a meta-rule, meaning that for every X and for every Y such that both X and X Y hold, then Y can be asserted) Syntactic entailment can be defined according to the selected derivation rules
KR and propositional logic Semantics Semantics in propositional logic is based on the concept of truth assignment; i.e. a function F is supposed to assign a truth value to each proposition e.g. true(a), false(b), false(c) Semantic entailment can be defined according to the concept of truth assignment
KR and propositional logic Inference: an example Facts (2): cold, snow Rules (1): (cold (snow rain)) Deduction (1): ice ice
KR and propositional logic Soundness Yes, propositional logic is sound (i.e., for any set of wffs S such that S syntactically entails a wff A then S semantically entails A) Completeness Yes, propositional logic is complete (i.e., the other way around, meaning that for any set of wffs S such that S semantically entails wff A then S syntactically entails A)
KR and propositional logic Propositional logic is decidable Starting from wffs, a truth-assignment function, and some deductiove apparatus, all sentences can be determined as being false or true
KR and propositional logic Properties of propositional logic (summary) Rather general representation formalism Unambiguous, syntax and semantics No generally efficient procedure for processing knowledge (inference) Decidable (we can decide in finite time whether a proposition is true or not)
KR and Logic: First-Order Logic
KR and propositional logic Properties of propositional logic General representation formalism Decidable (we can decide in finite time whether a proposition is true or not) Reasoning about sets of objects is difficult (e.g. concept hierarchies)
KR and first-order logic Syntax The syntax of a first-order logic language describes the possible configurations that can be labelled as well-formed formulas wffs)
KR and first-order logic Terms Constants [ e.g. A ] Variables [ e.g. x ] Functions [ e.g. f(x, y) ] Atomic formulas Predicates defined over terms [ e.g. on(x, y) ] Well-formed formulas (wff) Atomic formulas or wff to which connectives and quantifiers are applied [ e.g. x: on(x, table1) red(x) ]
KR and first-order logic
KR and first-order logic Semantics The semantics is aimed at determining which wffs are true or false, according to the interpretation given to terms and predicates
KR and first-order logic Soundness Yes, first-order logic is sound (i.e., for any set of formulas S such that S syntactically entails A then S semantically entails A) Completeness Yes, first-order logic is complete (i.e., the other way around, meaning that for any set of formulas S such that S semantically entails A then S syntactically entails A)
KR and first-order logic First-order logic is semi-decidable Starting from wffs, a suitable interpretation, and some deductiove apparatus, in general, not all sentences can be determined as being false or true In other words: - if a wff is true, sooner or later we will come up with a corresponding theorem - if a wff is false there is no guarantee that we will be able to verify it (an infinite loop in our deductive apparatus may occur)
KR and first-order logic Properties of first-order logic (summary) General representation formalism (more general than propositional logic) Very expressive, and unambiguous, syntax and semantics No generally efficient procedure for processing knowledge (inference) Semi-decidable (we can decide in finite time whether a wff is true or not)
KR and Logic: Other Logic Formalisms
Other logic formalisms Second order logic Second-order logic is an extension of first-order logic which contains variables in predicate positions (rather than only in term positions, as in first-order logic), and quantifiers binding them Modal and temporal logics Operators: necessity and possibility Fuzzy logic degrees of membership in a set (instead of T or F) Other: Multivalued, non-monotonic,...
Semantic Networks and Frames
Semantic Networks The important thing with any representation language is to understand the semantics and the proof theory; the details related with syntax are less important Whether the language uses strings (syntactic, logic-based representation) rather than nodes and links (graphical, graph-oriented representation) has no effect on the meaning or on its implementation by a computer program
Semantic networks The basic idea is that one cannot understand the meaning of a single word without access to all the essential knowledge that relates to that word
Semantic networks For instance, one would not be able to understand the word "sell" without knowing anything about the situation of commercial transfer, which also involves, among other things, a seller, a buyer, goods, money, the relation between the money and the goods, the relations between the seller and the goods and the money, the relation between the buyer and the goods and the money and so on
Semantic Networks Slot-filler representation was introduced by Quillian in 1968 (formerly from Pierce, 1896): Directed graph Nodes represent objects Labeled arcs: binary relationships between objects, which can represent a predicate with two arguments Semantic network formalisms have a very simple execution model (i.e. they are rather easy to implement)
Semantic Nets: Some semantics relations is-a relationship - Hyponymy (A is subordinate of B A is kind of B) - Hypernymy (A is superordinate of B) part-of relationship - Meronymy (A is part of B) - Holonymy (B has A as a part of itself) identity relationship - Synonymy (A denotes the same as B) - Antonymy (A denotes the opposite of B)
Semantic networks: Pros... Easy to represent objects, attributes, and values (conceptual networks) Case grammar (Fillmore, 1968): there is a verb for each simple sentence with a set of characteristics or cases: agent, object, result, instrument, origin, place, time, [see E. Rich's AI book or wikipedia]
Semantic networks: Cons... Quantification, negation, implication and disjunction are difficult to represent Difficult to represent different kinds of relationships Difficult to represent non binary relationships (e.g. actions)
Semantic networks: An example
Semantic networks: Inference Intersection search Who is the Brooklyn Dodgers fielder? Property inheritance How tall is Pee-Wee Reese? What is Pee-Wee Reese s batting average? Matching What is the batting average of the Brooklyn Dodgers fielder?
Semantic networks: Intersection search Intersection search Who is the Brooklyn Dodgers fielder? Property inheritance How tall is Pee-Wee Reese? What is Pee-Wee Reese s batting average? Matching What is the batting average of the Brooklyn Dodgers fielder?
Semantic networks: Intersection search
Semantic networks: Property inheritance Intersection search Who is the Brooklyn Dodgers fielder? Property inheritance How tall is Pee-Wee Reese? What is Pee-Wee Reese s batting average? Matching What is the batting average of the Brooklyn Dodgers fielder?
Semantic networks: Property inheritance
Semantic networks: Matching Intersection search Who is the Brooklyn Dodgers fielder? Property inheritance How tall is Pee-Wee Reese? What is Pee-Wee Reese s batting average? Matching What is the batting average of the Brooklyn Dodgers fielder?
Semantics networks: Matching x z
Semantic networks: Properties Allow to structure the knowledge to reflect the structure of the part of the universe which is being represented Very strong representation facilities for procedural attachment
Semantic networks: Properties So far we have seen a very general notion To be useful a clear syntax and semantics must be given to semantic networks: frames arise with the need to assign more structure to nodes and links
Semantic networks and frames A word activates, or evokes, a frame of semantic knowledge relating to the specific concept it refers to (or highlights, in frame semantic terminology) A semantic frame is defined as a coherent structure of related concepts Frames are based on recurring experiences e.g. the commercial transaction frame is based on recurring experiences of commercial transaction
Semantics networks and frames A frame consists of a collection of slots which can be filled with values or pointers to other frames Viewing a semantic network node as a frame: Baseball player isa cardinality: *height: *bats: *batting-average: *team: Adult-male 624 195 =handed.252 PS =handed replaces a concrete value (e.g. left, right), which is supposed to be specified by another entry
Semantic networks and frames Classes and subclasses, instances Attributes are represented as slots (fields) Slot values can be objects Facets: attributes of an attribute Slots can be frames because they have attributes (value, classes to which value belongs, default value, rules by which it can be inherited, ) Inheritance Methods: procedures associated to classes Daemons: procedures that watch for events (set, delete, ) Ontologies: formal representations of domain knowledge What things exist, what are their properties
KR: An example up, right Let us consider, for instance, the 8-puzzle problem - Lists (1,2,3,0,5,6,4,7,8) - Predicate logic cell(1,1,1), cell(3,1,4), - Frames Cell31 InstanceOf: Cell Attribute *x: *y: *value: Possible values/value 3 1 4 (v11, v12, v13, v21, ) cell(x, y, value) Cell Isa: Attribute Possible values/value *x: {1,2,3} *y: {1,2,3} *value: {1,2,..9}