Download presentation
Presentation is loading. Please wait.
1
Knowledge Representation
Chapter 3 Knowledge Representation
2
Knowledge Representation
'A representation is a set of conventions about how to describe a class of things.' (Winston 1992:16). 'Good representations make important objects and relations explicit, expose natural constraints, and bring objects and relations together' (ibid: 45) The representation principle: Once a problem is described using an appropriate representation, the problem is almost solved. Convention: قرارداد Ibid: in the same place, different page
3
Starting with an Example
The Farmer, The Fox, The Goose and The Grain: The farmer must get a fox, a goose and a sack of grain across a river, however his boat is small and he can only carry one thing at a time. His problem is that if he leaves the fox with the goose the goose will be eaten, and if he leaves the goose with the grain, the grain will be eaten… A good representation makes it easier for us to solve the problem: Draw possible safe combinations in a diagram. Arrange appropriate combinations in order. Link appropriate arrangements to represent boat trips. Problem is solved!
4
Grain Fox Farmer Goose
5
Categories of Knowledge
6
Procedural Knowledge Knowing how to do something: Fix a watch
Install a window Brush your teeth Ride a bicycle
7
Declarative Knowledge
Knowledge that something is true or false Usually associated with declarative statements Don’t put your finger in the boiled water
8
The Pyramid of Knowledge
9
Knowledge Types Example
Group numbers by twos. Ignore any two-digit number less than 32. Substitute the rest by ASCII equivalent GOLD + The price of the gold is rising, SO buy.
10
Knowledge Representation Techniques
Object-Attribute-Value Triple Rules Semantic nets Frames Logic Propositional logic First-order logic
11
Object-Attribute-Value Triple
12
OAV Triple (Object with multiple attribute)
13
OAV with Certainty Factor
14
Fuzzy Facts Crisp fact: Tom’s height is 6 feet.
Fuzzy fact: Tome’s height is tall (CF:0.5) IF The person's height is tall THEN The person's weight is heavy
15
Knowledge Representation Techniques
Object-Attribute-Value Triple Rules Semantic nets Frames Logic Propositional logic First-order logic
16
Rules and Facts Rules: Facts: The meaning of firing a rule:
IF the car doesn’t run and the fuel gauge reads empty THEN fill the gas tank. IF there is flame, THEN there is a fire. IF there is smoke, THEN there may be a fire. IF there is a siren, THEN there may be a fire. Facts: The car doesn’t run There is a flame There is smoke There is a siren The meaning of firing a rule: Condition is true => Generating the conclusion
17
Example: Reasoning with rules
يادآوري
18
Types of Rules Relationship Rules: Recommendation Rules:
if the battery is dead, then the car will not start Recommendation Rules: If the car will not start, then take a cab Directive Rules: If the car will not start AND the fuel system is OK, then check out the electrical system Strategy Rules: If the car will not start, then first check out the fuel system then check out the electrical system Heuristic Rules: If the car will not start AND the car is a 1957 Ford, then check the float
19
Types of Rules Pattern matching rules (Rules with variables):
If ?x is employee AND ?x age > 65, then ?x can be retired Uncertain Rules If the car will not start, then the probability that the electrical system operate normally is 50%. Meta Rules If the car will not start AND the electrical system operating normally, then use rule concerning the fuel system
20
Knowledge Representation Techniques
Object-Attribute-Value Triple Rules Semantic nets Frames Logic Propositional logic First-order logic
21
Semantic Networks Two Types of Nets:
22
Semantic Networks A classic representation technique for propositional information Rooted from Human Associative Memory Semantic nets consist of nodes (objects, concepts, situations) and arcs (relationships between them). The OAV triple can be used to characterize all the knowledge in a semantic net.
23
Common Types of Links IS-A – relates generic nodes to generic nodes
A-KIND-OF – relates an instance or individual to a generic class
24
Semantic Net Example Inheritance Exception handling (OO) (override)
Living Organism Plant Animal isa ako Fly Swim Penguin Eagle Sparrow walk Cat family Morris Locomotion Eats House Cats Mice rodents Fred Mammal … Bird ako: a kind of Exception handling (override) Inheritance (OO)
25
Semantic Net Example “The dog bit the mail carrier” ako ako
Bite Mail-carrier ako ako ako d b m assailant (attacker) victim ako: a kind of b: يك عمل گاز گرفتن
26
Semantic Net Example “John gives Mary a book” ako ako Give Book agent
object John g b beneficiary give(John, Mary, book) Mary
27
Semantic Net Example ako Mammal isa has-part Person Nose uniform color
team Red Owen Liverpool
28
PROLOG and Semantic Nets
UniformColor(Owen,Red). Team(Owen, Liverpool). AKO(Owen, Person). HasPart(Person, Nose). ISA(Person, Mammal). Mammal isa has-part Person Nose ako uniform color team Red Owen Liverpool
29
Problems with Semantic Nets
One problem with semantic nets is lack of standard definitions for link names (IS-A, AKO, etc.). Solution: OAV To represent definitive knowledge, the link and node names must be rigorously defined. Solution: Extensible markup language (XML) and ontologies. Problems also include combinatorial explosion of searching nodes. Ex. What’s the name of Pluto planet’s football team? Inability to define knowledge the way logic can 'An ontology is an explicit specification of a conceptualization. The term is borrowed from philosophy, where an Ontology is a systematic account of Existence. For AI systems, what "exists" is that which can be represented. When the knowledge of a domain is represented in a declarative formalism, the set of objects that can be represented is called the universe of discourse. This set of objects, and the describable relationships among them, are reflected in the representational vocabulary with which a knowledge-based program represents knowledge. Thus, in the context of AI, we can describe the ontology of a program by defining a set of representational terms. In such an ontology, definitions associate the names of entities in the universe of discourse (e.g., classes, relations, functions, or other objects) with human-readable text describing what the names mean, and formal axioms that constrain the interpretation and well-formed use of these terms. Formally, an ontology is the statement of a logical theory.' (Cited from ‘www-ksl.stanford.edu/kst/what-is-an-ontology.html; site visited 12/09/05)
30
Knowledge Representation Techniques
Object-Attribute-Value Triple Rules Semantic nets Frames Logic Propositional logic First-order logic
31
Frames Semantic nets provide 2-dimensional knowledge; frames provide 3-dimensional. Semantic Nets + Procedures = Frames Data (Properties) + Procedures = objects (like in OO) A frame is a group of slots and fillers that defines a stereotypical object that is used to represent generic / specific knowledge.
32
A Car Frame
33
Frame Examples
34
Frame Examples (in combination with semantic nets)
Animals Alive Flies T F Birds Legs 2 Mammals 4 Penguins Cats Bats Opus Name Friend Bill Pat AKO isa isa isa isa
35
Knowledge Representation Techniques
Object-Attribute-Value Triple Rules Semantic nets Frames Logic Propositional logic First-order logic
36
Propositional logic Logical constants: true, false
Propositional symbols: P, Q,... (atomic sentences) Sentences are combined by connectives: and [conjunction] or [disjunction] implies [implication / conditional] is equivalent [biconditional] not [negation] Literal: atomic sentence or negated atomic sentence P, P
37
Truth Tables
38
Implies (P Q) When is PQ true? Check all that apply P=Q=true
P=Q=false P=true, Q=false P=false, Q=true
39
Implies (P Q) When is PQ true? Check all that apply P=Q=true
P=Q=false P=true, Q=false P=false, Q=true ✔ ✔ ✔
40
Examples of PL sentences
(P Q) R “If it is hot and humid, then it is raining” Q P “If it is humid, then it is hot” Q “It is humid.” We’re free to choose better symbols, btw: Ho = “It is hot” Hu = “It is humid” R = “It is raining”
41
PL: Advantages and Disadvantages
Simple KR language sufficient for some problems Lays the foundation for higher logics (e.g., FOL) Reasoning is decidable, though NP complete, and efficient techniques exist for many problems Disadvantages Not expressive enough for most problems Hard to identify “individuals” (e.g., Mary, 3) Can’t directly talk about properties of individuals or relations between individuals (e.g., “Bill is tall”) Generalizations, patterns, regularities can’t easily be represented (e.g., “all triangles have 3 sides”)
42
First-order logic Whereas propositional logic assumes the world contains facts, first-order logic (like natural language) assumes the world contains Relations: red, round, prime, brother of, bigger than, part of, comes between, … Functions: father of, best friend, one more than, plus, …
43
Syntax of FOL: Basic elements
Constants KingJohn, 2, NUS,... Predicates Brother, >,... Functions Sqrt, LeftLegOf,... Variables x, y, a, b,... Connectives , , , , Equality = Quantifiers ,
44
Atomic sentences Atomic sentence:
predicate (term1,...,termn) Term: function (term1,...,termn) or constant or variable E.g., Brother(KingJohn,Richard) > (Length(LeftLegOf(Richard)), Length(LeftLegOf(KingJohn)))
45
Complex sentences Complex sentences are made from atomic sentences using connectives S, S1 S2, S1 S2, S1 S2, S1 S2, E.g. Sibling(KingJohn,Richard) Sibling(Richard,KingJohn) >(1,2) ≤ (1,2) >(1,2) >(1,2)
46
Universal quantification
Everyone at IAUDA is smart: x At(x,IAUDA) Smart(x) equivalent to the conjunction of instantiations of P At(KingJohn,IAUDA) Smart(KingJohn) At(Richard,IAUDA) Smart(Richard) At(Maryam,IAUDA) Smart(Maryam) ...
47
Existential quantification
<variables> <sentence> Someone at IAUDA is smart: x At(x,IAUDA) Smart(x) equivalent to the disjunction of instantiations of P At(KingJohn,IAUDA) Smart(KingJohn) At(Richard,IAUDA) Smart(Richard) At(Maryam,IAUDA) Smart(Maryam) ...
48
Assignment 1:Knowledge Representation
Due date: 93/12/21 to: Subject: ES_Assignment 1
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.