Upload
fe3adzim
View
237
Download
0
Embed Size (px)
Citation preview
8/11/2019 Chapter 02 Sak 4610
1/46
Chapter 2:
Knowledge
Representation
8/11/2019 Chapter 02 Sak 4610
2/46
8/11/2019 Chapter 02 Sak 4610
3/46
Expert Systems: Principles and Programming, Fourth Edition 3
Why is Logic Important
We use logic in our everyday livesshould I
buy this car, should I seek medical attention.
People are not very good at reasoning because
they often fail to separate word meanings with
the reasoning process itself.
Semantics refers to the meanings we give to
symbols.
8/11/2019 Chapter 02 Sak 4610
4/46
Expert Systems: Principles and Programming, Fourth Edition 4
The Goal of Expert Systems
We need to be able to separate the actual
meanings of words with the reasoning process
itself.
We need to make inferences w/o relying on
semantics.
We need to reach valid conclusions based on
facts only.
8/11/2019 Chapter 02 Sak 4610
5/46
Expert Systems: Principles and Programming, Fourth Edition 5
Knowledge vs. Expert Systems
Knowledge representation is key to the success of
expert systems.
Expert systems are designed for knowledge
representation based on rules of logic called
inferences.
Knowledge affects the development, efficiency,
speed, and maintenance of the system.
8/11/2019 Chapter 02 Sak 4610
6/46
Expert Systems: Principles and Programming, Fourth Edition 6
Arguments in Logic
An argument refers to the formal way facts and
rules of inferences are used to reach valid
conclusions.
The process of reaching valid conclusions is
referred to as logical reasoning.
8/11/2019 Chapter 02 Sak 4610
7/46Expert Systems: Principles and Programming, Fourth Edition 7
How is Knowledge Used?
Knowledge has many meaningsdata, facts,
information.
How do we use knowledge to reach conclusions
or solve problems?
Heuristics refers to using experience to solve
problemsusing precedents.
Expert systems may have hundreds / thousands ofmicro-precedents to refer to.
8/11/2019 Chapter 02 Sak 4610
8/46Expert Systems: Principles and Programming, Fourth Edition 8
Epistemology
Epistemology is the formal study of knowledge .
Concerned with nature, structure, and origins of
knowledge.
8/11/2019 Chapter 02 Sak 4610
9/46Expert Systems: Principles and Programming, Fourth Edition 9
Categories of Epistemology
TacitDeclarative
ProceduralA posteriori
A prioriPhilosophy
8/11/2019 Chapter 02 Sak 4610
10/46Expert Systems: Principles and Programming, Fourth Edition 10
A Priori Knowledge
That which precedes
Independent of the senses
Universally true
Cannot be denied without contradiction
8/11/2019 Chapter 02 Sak 4610
11/46Expert Systems: Principles and Programming, Fourth Edition 11
A Posteriori Knowledge
That which follows
Derived from the senses
Now always reliable
Deniable on the basis of new knowledge w/o
the necessity of contradiction
8/11/2019 Chapter 02 Sak 4610
12/46
Expert Systems: Principles and Programming, Fourth Edition 12
Procedural Knowledge
Knowing how to do something:
Fix a watch Install a window
Brush your teeth
Ride a bicycle
8/11/2019 Chapter 02 Sak 4610
13/46
Expert Systems: Principles and Programming, Fourth Edition 13
Declarative Knowledge
Knowledge that something is true or false
Usually associated with declarative statements
E.g., Dont touch that hot wire.
8/11/2019 Chapter 02 Sak 4610
14/46
Expert Systems: Principles and Programming, Fourth Edition 14
Tacit Knowledge
Unconscious knowledge
Cannot be expressed by language
E.g., knowing how to walk, breath, etc.
8/11/2019 Chapter 02 Sak 4610
15/46
Expert Systems: Principles and Programming, Fourth Edition 15
Knowledge in Rule-Based
Systems
Knowledge is part of a hierarchy.
Knowledge refers to rules that are activated by
facts or other rules.
Activated rules produce new facts or conclusions.
Conclusions are the end-product of inferenceswhen done according to formal rules.
8/11/2019 Chapter 02 Sak 4610
16/46
Expert Systems: Principles and Programming, Fourth Edition 16
Expert Systems vs. Humans
Expert systems inferreaching conclusions
as the end product of a chain of steps called
inferencing when done according to formal
rules.
Humans reason
8/11/2019 Chapter 02 Sak 4610
17/46
Expert Systems: Principles and Programming, Fourth Edition 17
Metaknowledge
Metaknowledge is knowledge about knowledgeand expertise.
Most successful expert systems are restricted to
as small a domain as possible.
In an expert system, an ontology is the
metaknowledge that describes everything known
about the problem domain.
Wisdom is the metaknowledge of determining
the best goals of life and how to obtain them.
8/11/2019 Chapter 02 Sak 4610
18/46
Expert Systems: Principles and Programming, Fourth Edition 18
Figure 2.2 The Pyramid
of Knowledge
8/11/2019 Chapter 02 Sak 4610
19/46
Expert Systems: Principles and Programming, Fourth Edition 19
Productions
A number of knowledge-representation techniques
have been devised:
Rules Semantic nets
Frames
Scripts Logic
Conceptual graphs
8/11/2019 Chapter 02 Sak 4610
20/46
Expert Systems: Principles and Programming, Fourth Edition 20
Figure 2.3 Parse Tree
of a Sentence
8/11/2019 Chapter 02 Sak 4610
21/46
Expert Systems: Principles and Programming, Fourth Edition 21
Semantic Nets
A classic representation technique for
propositional information
Propositionsa form of declarative knowledge,
stating facts (true/false)
Propositions are called atoms cannot be
further subdivided.
Semantic nets consist of nodes (objects, concepts,situations) and arcs (relationships between them).
8/11/2019 Chapter 02 Sak 4610
22/46
Expert Systems: Principles and Programming, Fourth Edition 22
Common Types of Links
IS-Arelates an instance or individual to a
generic class
A-KIND-OFrelates generic nodes to generic
nodes
8/11/2019 Chapter 02 Sak 4610
23/46
Expert Systems: Principles and Programming, Fourth Edition 23
Figure 2.4 Two Types of Nets
8/11/2019 Chapter 02 Sak 4610
24/46
Expert Systems: Principles and Programming, Fourth Edition 24
Figure 2.6: General Organization
of a PROLOG System
8/11/2019 Chapter 02 Sak 4610
25/46
Expert Systems: Principles and Programming, Fourth Edition 25
PROLOG and Semantic Nets
In PROLOG, predicate expressions consist of the
predicate name, followed by zero or more
arguments enclosed in parentheses, separated by
commas.
Example:
mother(becky,heather)
means that becky is the mother of heather
8/11/2019 Chapter 02 Sak 4610
26/46
Expert Systems: Principles and Programming, Fourth Edition 26
PROLOG Continued
Programs consist of facts and rules in thegeneral form of goals.
General form: p:- p1, p2, , pNp is called the rules head and thepirepresents the subgoals
Example:
spouse(x,y) :- wife(x,y)
xis the spouse of yif xis the wife of y
8/11/2019 Chapter 02 Sak 4610
27/46
8/11/2019 Chapter 02 Sak 4610
28/46
Expert Systems: Principles and Programming, Fourth Edition 28
Problems with Semantic Nets
To represent definitive knowledge, the link and
node names must be rigorously defined.
A solution to this is extensible markup language(XML) and ontologies.
Problems also include combinatorial explosion of
searching nodes, inability to define knowledgethe way logic can, and heuristic inadequacy.
8/11/2019 Chapter 02 Sak 4610
29/46
Expert Systems: Principles and Programming, Fourth Edition 29
Schemata
Knowledge Structurean ordered collection of
knowledgenot just data.
Semantic Netsare shallow knowledge
structuresall knowledge is contained in nodes
and links.
Schema is a more complex knowledge structure
than a semantic net. In a schema, a node is like a record which may
contain data, records, and/or pointers to nodes.
8/11/2019 Chapter 02 Sak 4610
30/46
Expert Systems: Principles and Programming, Fourth Edition 30
Frames
One type of schema is a frame (or scripttime-
ordered sequence of frames).
Frames are useful for simulating commonsense
knowledge.
Semantic nets provide 2-dimensional knowledge;
frames provide 3-dimensional.
Frames represent related knowledge aboutnarrow subjects having much default knowledge.
8/11/2019 Chapter 02 Sak 4610
31/46
Expert Systems: Principles and Programming, Fourth Edition 31
Frames Continued
A frame is a group of slots and fillers that defines
a stereotypical object that is used to represent
generic / specific knowledge.
Commonsense knowledge is knowledge that is
generally known.
Prototypes are objects possessing all typical
characteristics of whatever is being modeled. Problems with frames include allowing
unrestrained alteration / cancellation of slots.
8/11/2019 Chapter 02 Sak 4610
32/46
Expert Systems: Principles and Programming, Fourth Edition 32
Logic and Sets
Knowledge can also be represented by symbols
of logic.
Logic is the study of rules of exact reasoning
inferring conclusions from premises.
Automated reasoninglogic programming in thecontext of expert systems.
8/11/2019 Chapter 02 Sak 4610
33/46
Expert Systems: Principles and Programming, Fourth Edition 33
Figure 2.8 A Car Frame
8/11/2019 Chapter 02 Sak 4610
34/46
Expert Systems: Principles and Programming, Fourth Edition 34
Forms of Logic
Earliest form of logic was based on the syllogism
developed by Aristotle.
Syllogismshave two premises that provide
evidence to support a conclusion.
Example:
Premise: All cats are climbers.
Premise: Garfield is a cat. Conclusion:Garfield is a climber.
8/11/2019 Chapter 02 Sak 4610
35/46
8/11/2019 Chapter 02 Sak 4610
36/46
Expert Systems: Principles and Programming, Fourth Edition 36
Figure 2.13 Venn Diagrams
8/11/2019 Chapter 02 Sak 4610
37/46
Expert Systems: Principles and Programming, Fourth Edition 37
Propositional Logic
Formal logic is concerned with syntax of
statements, not semantics.
Syllogism: All goons are loons.
Zadok is a goon.
Zadok is a loon.
The words may be nonsense, but the form is
correctthis is a valid argument.
8/11/2019 Chapter 02 Sak 4610
38/46
Expert Systems: Principles and Programming, Fourth Edition 38
Boolean vs. Aristotelian Logic
Existential importstates that the subject of the
argument must have existence.
All elves wear pointed shoes. not allowed
under Aristotelian view since there are no elves.
Boolean view relaxes this by permittingreasoning about empty sets.
8/11/2019 Chapter 02 Sak 4610
39/46
Expert Systems: Principles and Programming, Fourth Edition 39
Figure 2.14 Intersecting Sets
8/11/2019 Chapter 02 Sak 4610
40/46
8/11/2019 Chapter 02 Sak 4610
41/46
Expert Systems: Principles and Programming, Fourth Edition 41
Other Pioneers of Formal Logic
Whitehead and Russell published Principia
Mathematica, which showed a formal logic as
the basis of mathematics.
Gdelproved that formal systems based on
axioms could not always be proved internally
consistent and free from contradictions.
8/11/2019 Chapter 02 Sak 4610
42/46
Expert Systems: Principles and Programming, Fourth Edition 42
Features of Propositional Logic
Concerned with the subset of declarative
sentences that can be classified as true or false.
We call these sentences statements or
propositions.
Paradoxesstatements that cannot be classified
as true or false.
Open sentencesstatements that cannot beanswered absolutely.
8/11/2019 Chapter 02 Sak 4610
43/46
Expert Systems: Principles and Programming, Fourth Edition 43
Features Continued
Compound statementsformed by using logical
connectives (e.g., AND, OR, NOT, conditional,
and biconditional) on individual statements.
Material implicationp q states that ifpis
true, it must follow that qis true.
Biconditionalp qstates thatpimplies qand
qimpliesp.
8/11/2019 Chapter 02 Sak 4610
44/46
Expert Systems: Principles and Programming, Fourth Edition 44
Features Continued
Tautologya statement that is true for all
possible cases.
Contradictiona statement that is false for all
possible cases.
Contingent statementa statement that is neithera tautology nor a contradiction.
8/11/2019 Chapter 02 Sak 4610
45/46
Expert Systems: Principles and Programming, Fourth Edition 45
Truth Tables
8/11/2019 Chapter 02 Sak 4610
46/46