0% found this document useful (0 votes)
8 views

Knowledge Representation 14Nov

The document provides an introduction to artificial intelligence (AI) with a focus on knowledge representation and logic. It covers various topics including knowledge vs search, production rules, semantic networks, ontologies, and uncertainty in knowledge representation. The document emphasizes the importance of using knowledge to guide AI processes and the different methods for representing and reasoning with knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Knowledge Representation 14Nov

The document provides an introduction to artificial intelligence (AI) with a focus on knowledge representation and logic. It covers various topics including knowledge vs search, production rules, semantic networks, ontologies, and uncertainty in knowledge representation. The document emphasizes the importance of using knowledge to guide AI processes and the different methods for representing and reasoning with knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

14/11/24

Introduction to AI Contents
1. Motivation: Knowledge vs Search
2. Knowledge Representation and Logic
Production rules
KNOWLEDGE
3. ideal
4. Semantic networks and frames world

REPRESENTATION 5.
6.
Ontologies
Default reasoning
Pedro Meseguer
7. Metaknowledge real
Institut d’Investigació en Intel·ligència Artificial (IIIA) 8. Uncertainty world
Consejo Superior de Investigaciones Científicas (CSIC)
9. Knowledge Engineering
10. Some names
2
11. Wrap-up

1 2

1. Knowledge: AI takes another route 1.How far can you go with plain search?
u Medical diagnosis (AI task, MYCIN)
u Hundred of symptoms
u If considered as a whole à huge state-space
u Data:
u All information from the patient before any deduction
u Silly or illogical questions (imagine asking a man for pregnancy)
u Change of paradigm: use knowledge to guide and limit search
u In the same way humans do to narrow possibilities
u Focus on what is relevant
u Perform search in a different way
3 4
u Generative AI does not use this approach

3 4

1
14/11/24

1.Information and knowledge 1.Knowledge: Representation and Types


u Information: set of basic data without interpretation (of a problem) Representation: knowledge represented in data structures to be
u Knowledge: automatically operated by a computer program.
u high level description of that model that u Declarative: expressed in a way that is directly accesible
structure the experience from a domain by humans
and allows the interpretation of the basic data. u Inheritable: concepts are organized in a hierarchical structure
u symbolic and inference is based on inheritance (ontologies)
u Logical: expressed by logical formulas and derived
by inference (rules)
u Example: the blood test
u Information: the numerical data from the test u Procedural: hidden in particular procedures (algorithms)
executed on knowledge data structures
u Knowledge: the concepts and the reasoning that allows (simple relations in semantic nets)
to interpret these values as normal or problematic for 5 (complex procedures among facts) 6
a particular person (anaemia, leukopenia…)

5 6

1.What is symbolic KR about? 2. Knowledge Representation and Logic


u Logic:
Symbols Producing new knowledge
u branch of mathematics about legal deductions and
Propositions Modus ponens (expressed as propagation of truth
A — yesterday rained logical implications) u Georg Boole, Bertrand Russell…
A is true
B — I will learn a lot at the UAB
C — that person loves me A à B is true u Knowledge Representation:
it is legal to conclude that B is true static declarative knowedge + current problem instance =
Given a problem, concepts could
produce new knowledge that allows to solve the problem
be expressed as propositions Inheritance persons with
facial hair
Propositions have two possible
truth values: true and false subclass u You want to operate knowledge to derive new knowledge
persons with
moustache
u Logic appears as a natural language for declarative KR
u Because of that, logic is in all AI textbooks
7 8
is_a
D’Artagnan

7 8

2
14/11/24

2. Propositional logic 2.KR: Propositional logic — Truth tables


negation disjunction (or, v) conjunction (and, ^)
u Propositions: A, B, C…
A ¬A A B AvB A B A^B
A: today is sunny
B: we enjoy a walk in nature 1 0 1 1 1 1 1 1
0 1 1 0 1 1 0 0
C: my tailor is rich 0 1 1 0 1 0
0 0 0 0 0 0
u Truth values: true (1), false (0) A B AàB A B AßàB
implication equivalence
1 1 1 1 1 1
(imp, à ) (equiv, ßà )
u Logical operators: negation (¬A), conjunction (A^B), 1 0 0 1 0 0
disyunction (AvB), implication (AàB), equivalence (AßàB) 0 1 1 0 1 0
9
0 0 1 0 0 1 10

9 10

2.KR: Propositional logic — Truth tables (II) 2 KR: Predicate Logic (First-order Logic)
u Predicates over variables that run on a (finite) domain
both have the same
truth tables u Two quatifiers, universal and existential
u Perfect way to check the legal inferences:
u Example: for all x man(x) à mortal(x) // exists x teaches (x,Intro AI)
u (AàB) ßà(¬AvB) (??)

A B AàB ¬AvB (AàB)ßà(¬AvB) u For KR:


u Substitution and unification: replace variable by ground terms
1 1 1 1 1
Tautology: a sentence (without variables)
1 0 0 0 1
0 1 1 1 1 that is always true u Propositionalization
0 0 1 1 1 u Inference like in propositional logic

u Theorems are tautologies. 11 12

11 12

3
14/11/24

3. Modus ponens — Production rules 3. Production rules


u Rules:
u Modus ponens (since Aristotle):
u Two parts: left hand side (conjunction of conditions on facts),
u If A is true, and
righ hand side (a conclusion on a fact); condition — action pairs
u Aà B is true, then it is legal to deduce that
u Interpreted by an inference engine (that performs chaining)
u B is true
A B AàB u With a solid theoretical (logical) base
u Firing: when condition is true, action is added to the fact base
u A single line of the truth table 1 1 1 u A rule:
1 0 0
u codifies a simple (elemental) inference step
0 1 1
u Production rules: to be used for u solution: involves a sequence of firing rules
0 0 1
modus ponens inference only
(A=>B) [in logical terms, they are Horn clauses] u Declarative knowledge: although attractive, it is difficult to maintain
13
u Monotonicity: always adds new facts 14

13 14

3. Production rules in expert systems 3. Production rules: example


Internal deductive space divided in two: PREMISE ($AND(SAME CNTXT INFECT PRIMARY-BACTEREMIA)
(MEMBF CNTXT SITE STERILESITES)
u Facts base:
(SAME CNTXT PORTAL GI))
u facts that are data of the current case
ACTION (CONCLUDE CNTXT IDENT BACTEROIDES TALLY .7)
u they can be: initial, derived If (1) the infection is primary-bacteremia, and
age=48 pain=yes blurry vision=yes meningitis=may_be (2) the site of the culture is one of the sterilesites, and
(3) the suspected portal of entry of the organism is the gastro-intestinal tract,
u Rule base: static knowledge on a particular domain, codified in rules then there is suggestive evidence (.7)
that the identity of the organism is bacteroides.
u If gramnegative and rod and anaerobic => bacteroides [0.6]

A rule from the MYCIN knowledge base. $AND and $OR are the
multivalued analogues of the standard Boolean AND and OR.
15 16

15 16

4
14/11/24

3. Production rules: chaining 3. Production rules: chaining


u Forward chaining
Rules are always fired fron condition (IF) to action (THEN); u Repeat until all aplicable rules have been processed
however, the strategy of the inference engine could be: u Match the facts in the set of facts against the conditions of the rules
u Forward chaining: from the facts, any rule is fired as soon as satisfied u Those rules whose conditions are fulfilled are potentially applicable

u Backward chaining: from the goals, as follows u Select one of these rules

u Apply the rule by adding the conclusión to the set of facts


u A goal is established
u Backward chaining:
u Firing is limited to: (i) the rules that conclude that goal, u Select a goal or every goal has been pursued
(ii) the rules that conclude the conditions of (i), etc.
u Repeat until the goal is achieved or no rule remains to be tried
u Inference is more focused on the system objectives u Look for rules whose conclusion match the goal

u If external conditions are asked, ES behaviour is more u All matched rules become potentially aplicable
meaningful for the human operator u One of these rules is selected
17 18
u Its conditions are new subgoals to be achieved

17 18

4. Semantic networks 4. Semantic networks: example


Directed graph:
u nodes are concepts
u arcs are labelled with relations

u Codify some static knowledge of the problem domain

u Simple concepts

u Simple inferences are made traversing the graph


19 20

19 20

5
14/11/24

4. Frames 4. Frames: example


u Structured objects (slot-and-filler architectures)

u Very close to recods in Computer Science SLOTS VALUES


Title Artificial Intelligence
u Stereotypical situations Genre Computer Science
Author Peter Norvig
u Same motivation as semantic nets, but for complex objects Edition Third Edition
Year 1996
u Relations of semantic nets à appear as attributes in frames
Page 1152

21 22

21 22

5. Ontologies 5. Ontologies (cont.)


u Definition: An explicit, machine-readable specification of a u Operationally, an ontology is a hierarchy of categories
shared conceptualization
u Relations:
u Motivation:
u Class—subclass—member à inheritance
u Desire to share structure of domains across applications
u To separate operational knowledge (rules) from static domain
u Part_of, composed_objects
conceptualization
u Some ontologies:
u Developed for:
u Dbpedia
u domain specific
u ambition: a general ontology u TextRunner
u with the help of Wikipedia u OpenMind
u inference: inheritance
23 24

23 24

6
14/11/24

Ontology Engineering
5. Ontologies: example 6. Default reasoning
Representation Does Tweety fly?
ontology engineering
Property u Tweety is a bird (belongs to the BIRD category)
type
Class ontology
RoadSign type type
u and birds fly, so Tweenty flies (simple inheritance)

approximation
subClassOf
correctness
completeness
B domainC A
ProhibitorySignD B shape
subClassOf
This is Tweety,
DangerWarningSign
subClassOf D C range
it has a broken wing à Tweety does not fly
subClassOf

reality model representation


PrioritySign StandardProhibitorySign Figure

type type

u Default reasoning:
ontologist roadsign_345 ontologist equilateral_triangle
shape u Inherit values
(philosopher) (informatician) 25
u Unless other some more specific information is available 26

25 26

6. Default reasoning (cont.) 7. Metaknowledge


Knowledge about knowledge:
u What happens if, after performing reasoning, one knows that
Tweety has a broken wing? u Control knowledge:
u How deduction is made
u Non-monotonic reasoning:
u Usually local to KB (knowledge base) parts
u Capacity to remove previous deductions when new facts are
known that contradict old ones: u Special rules (metarules)
u Humans are very good at that; this is not the case for machines u Establishing goals and strategies

u Inferred facts do not grow monotonically u Focusing deduction on a group of rules


u Assumption-based Truth Maintenance Systems (ATMS) u Have preference on normal rules
u Circumscription (logical approach) u Execution:
u Rules: at the domain level
27 28
u Metarules: at metalevel

27 28

7
14/11/24

7. Metaknowledge (cont.) 8. Uncertainty


u Our knowledge of the world is always incomplete:
u Example:
u Causal inferences are not 100% valid
u KB = group of KB modules
u Odd cases, exceptions
u KB module = goals, rules, metarules
u Especially in the medical realm
u KB module goal: pursued by the rules of module
u Facts are partially known, often qualitative:
u KB modules are activated according to metarules
u Weather report: partially cloudy, little rain,
u There is an INIT module, that activates first
u (Real) Knowledge representation has to be extended to haldle
uncertainty for all its types: facts / rules /metarules
u Two basic forms to handle uncertainty:
u Probabilities
29 30
u Fuzzy logic

29 30

8. Uncertainty: probability (frequentist) 8. Uncertainty: conditioned probability


u Prior probability:
u Probability is applied to well-defined propositions:
only makes sense true or false. Ex. Are you pregnant? u Before an event happens
u Frequentist approach: u Usually based on reasons of regularity, symmetry…
Ideal
u Pr (event i) = #favourable cases/#possible cases
world
u Conditioned probability:
u Applied to cards games, balls, etc. u After an event E that changes probabilities
u Not of much use in AI u Pr(X|E) = probability of X given that we observed E
u Posteriori or conditioned probability
u Bayes’
formula connects prior and conditioned
probabilities
31 32

31 32

8
14/11/24

8. Uncertainty: conditioned probability example 8. Uncertainty: fuzzy logic


u Example: breaking the code of Enigma (SWW): u Intuitive approach to handle uncertainty;
adequated for graded propositions
u Enigma machine: encription/decription of messages
u Imagine: Fred is Young (he could be very young, half young, not young)
u British (Turing) broke the encription
u True if Fred is 19 (Fred belongs completely to the fuzzy set YOUNG)
u Prior probability of each letter: uniform
u False if Fred is 50 (Fred does not belong to the fuzzy set YOUNG)
u Common subsentences in messages + the Enigma failure
u In between if Fred is 30 (Fred belogs partially to the fuzzy set YOUNG)
u Weather report no letter could be
u How Fred belongs to the fuzzy set YOUNG
u Heil Hitler! transformed in itself
u Membership function: Instead of 0 or 1 (as for classical sets),
= it is a number in the interval [0, 1]
u modify the probability of each letter: no longer uniform u Fuzzy logic also allows graded qualifiers of natural language:
(a posteriori, conditioned probability)
u Fred is very young
33 34

u Intermediate degrees of truth between [false, true]

33 34

8. Uncertainty: certainty factors 9.Knowledge Engineering


u In expert systems, the degree of confidence represented u Develop the procedures to interpret the declarative knowledge
by certainty factors in: u Rule inference
u Facts u Inheritance
u Rules u Organize the declarative/procedural knowledge for:
u Performance

u Combination: u Validation
degree of confidence of condition u Maintenance (hard task!)
degree of confidence of rule
u Generate the adequate data structures for handling
to produce
knowledge at run time
degree of confidence in conclusion
u Facts base

35 u Goals in backward chaining 36

35 36

9
14/11/24

10.KR names: John McCarthy 10.KR names: Marvin Minsky

u (1927 — 2011)
u (1927 — 2016)
u MIT, full profesor Stanford
u Full professor MIT
u One of the big old names
u One of the founders (conference of Darmouth)
u Father of AI (conference of Darmouth)
u Worked on perceptrons
u Proposed circumscription (nonmonotonic reasoning) 37 38

u Proposed frames (complex objects in semantic networks)

37 38

10.KR names: Bruce Buchanan 10.KR names: Ronald Branchman

u (?)
u (?) u University / Company ??
u Full profesor Carnegie-Mellon (Pittsburg) u Many contributions to knowledge representation
u Many contributions to expert systems u KL-ONE
u MYCIN (Univ. Stanford) 39 40

39 40

10
14/11/24

10.KR names: Hector Levesque 10.KR names: MYCIN

u Diagnoses blood infections (in the 70s)


u Early ES in medicine
u Rules

u Centainty factors
u Forward and backward chaining
u Usability by doctors
u (?) Canadian
u Ethical issues unsolved
u Full profesor Toronto univ.
u Caused an early ES shell: EMYCIN
u Many contributions to knowledge representation
u Theoretical work 41 42

41 42

10.KR names: KL-ONE 10.KR names: CYC


KL-ONE (80s)
u Knowledge representation Language:
u Semantic networks
u Frames
u 80’s
u Inheritance
u An attempt to make a massive symbolic artificial intelligence
u Developed by Ronald Branchman and others
u Capture common sense knowledge
u It was unfinished
u May of KR issues were reworked
43 44

43 44

11
14/11/24

11.Wrap-up 11.Wrap-up (cont.)


u Symbolic Knowledge Representation
u Logic
u Symbolic Knowledge Representation
u Rules
u Main reserch topic in 80s, 90s
u Semantic networks
u Somehow, now is not in the AI main stream
u Frames
u Nevertheless, it is useful to know the achievements and
u Ontologies
contributions on this topic
u To understand current symbolic AI systems u Default reasoning
u Metaknoeledge
u To get familiar with existing AI tools
u Uncertainty
45
u Knowledge engineering 46

45 46

Further reading
u Russel & Norvig 3rd ed :

7.1, 7.3, 7.4, 7.5, 12.1, 12.2, 12.5, 12.6


Bibliographical Notes chapters 7 and 12

u Ginsberg, Essentials of Artificial Intelligence


2.3, 9.3, 11.1, 12.1
Further Reading chapters 2, 9, 10, 12

47

47

12

You might also like