Knowledge-Based Agents. Jacques Robin. Introductory Example: Is West criminal?. Is West criminal? “US law stipulates that it is a crime for a US citizen to sell weapons to a hostile country. Nono owns missiles, all of them it bought from Captain West, an american citizen”
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Knowledge-Based Agents
Jacques Robin
Ask
Tell
Retract
Environment
Automated Reasoning
Sensors
Domain-Specific
Knowledge
Base
Generic
Domain-Independent
Inference
Engine
Knowledge Representation
and Acquisition
Effectors
Given B as axiom, formula f is a theorem of L?
B |=L f ?
Environment
Sensors
Ask
Inference
Engine:
Theorem
Prover
for Logic L
Knowledge
Base B:Domain Model
in Logic L
Tell
Retract
Actuators
From the knowledge:
1. It is crime for a US citizen to sell weapons to a hostile nation
2. Nono own missiles
3. Nono bought all its missiles from Captain West
4. West is a US Citizen
5. Nono is a nation
6. Nono is an enemy of the USA
7 . A missile is a weapon
8. Enmity is the highest form of hostilty
9. The USA is a nation
Can we infer the knowledge Q:
0. West is a criminal?
Representing this knowledge in CFOL KB:
( P,W,N american(P) weapon(W) nation(N) hostile(N) sells(P,N,W) criminal(P)) //1
( W owns(nono,W) missile(W)) //2
( W owns(nono,W) missile(W) sells(west,nono,W)) //3
american(west) //4
nation(nono) //5
enemy(nono,america) //6
W missile(W) weapon(W) //7
N enemy(N,america) hostile(N) //8
nation(america) //9
A CFOL theorem prover can be usedto answer the query:
KB |= criminoso(west) //0
FCLUnaryConnective
FCLBinaryConnective
Arg
Arg
Connective: enum{}
Connective: enum{, , , }
1..*
1..*
Functor
Arg
FCLConnective
FCFOLAtomicFormula
FCFOLTerm
1..2
Functor
*
FCFOLNonFunctionalTerm
FCFOLFunctionalTerm
PredicateSymbol
Functor
Arg
1..*
FunctionSymbol
FOLVariable
ConstantSymbol
QuantifierExpression
Quantifier: enum{,}
FCFOLFormula
Example formula: X,Y (p(f(X),Y) q(g(a,b))) ((U,V Z ((X = a) r(Z)) (U = h(V,Z)))))
Premisse
*
*
Arg
Arg
INFCFOLFormula
1..*
1..*
Functor =
Conclusion
*
FCFOLAtomicFormula
FCFOLTerm
Functor
FCFOLFunctionalTerm
FCFOLNonFunctionalTerm
PredicateSymbol
*
Functor
FunctionSymbol
INFCFOLClause
INFCLPLHS
INFCLPRHS
FOLVariable
ConstantSymbol
Functor =
Functor =
Functor =
Example INF formula: ((p(f(X),Y) q(g(a,b)) c) ((X = a) r(Z)))
((p(U,V) q(a,U)) (d e p(c,f(V)))
X/b
X/b
p
p
p
p
p
p
p
p
p
fail
X/a
Y/a
a
b
a
a
a
a
a
a
X
X
X
X
X
X
Y
X
b
b
X/f(c,Z)
X/f(c,d)
Y/a
Y/a
Z/d
p
p
p
p
X/p(a,X)
X
X
X/p(a,X)
p
fail
Y
Y
f
f
a
a
f
f
a
p
Guarantees termination
c
c
Z
Z
c
c
Z
d
c
p
Failure by Occur-Check
Refutation proof: showing that following KB’ = KB Q
( P,W,N american(P) weapon(W) nation(N) hostile(N) sells(P,N,W) criminal(P)) //1
( W owns(nono,W) missile(W)) //2
( W owns(nono,W) missile(W) sells(west,nono,W)) //3
american(west) //4
nation(nono) //5
enemy(nono,america) //6
W missile(W) weapon(W) //7
N enemy(N,america) hostile(N) //8
nation(america) //9
criminoso(west)//0
is inconsistent, i.e., that false can be derived from it
Step1: generate the implicative normal form KB’’ or KB’
(american(P) weapon(W) nation(N) hostile(N) sells(P,N,W) criminal(P)) // 1
T owns(nono,m1) // skolemização 2a
T missile(m1) // 2b
(owns(nono,W) missile(W) sells(west,nono,W)) //3
T american(west) //4
T nation(nono) //5
T enemy(nono,america) //6
missile(W) weapon(W) //7
enemy(N,america) hostile(N) //8
T nation(america) //9
criminoso(west) F//0
Step 2: repeatedly apply resolution rule to pair of clauses (A,B) where A’s premise unifies with B’s conclusion
(american(P) weapon(W)
nation(N) hostile(N)
sells(P,N,W) criminal(P)) //1
(T owns(nono,m1)) //2a
(T missile(m1)) //2b
(owns(nono,W) missile(W) sells(west,nono,W)) //3
(T american(west)) //4
(T nation(nono)) //5
(T enemy(nono,america)) //6
(missile(W) weapon(W)) //7
(enemy(N,america) hostile(N)) //8
(T nation(america)) //9
(criminal(west) F)//0
Resolve 0 with 1 unifying P/west:
american(west) weapon(W) nation(N)
hostile(N) sells(west,N,W) F //10
2. Resolve 10 with 4:
weapon(W) nation(N) hostile(N)
sells(west,N,W) F //11
3. Resolve 11 with 7:
missile(W) nation(N) hostile(N)
sells(west,N,W) F //12
4. Resolve 12 with 2b unifying W/m1:
nation(N) hostile(N) sells(west,N,m1) F //13
5. Resolve 13 with 5 unifying N/nono:
hostile(nono) sells(west,nono,m1) F //14
6. Resolve 14 with 8 unifying N/nono:
enemy(nono,america) sells(west,nono,m1) F //15
7. Resolve 15 with 6:
sells(west,nono,m1) F //16
8. Resolve 16 with 3 unifying W/m1:
owns(nono,m1) missile(m1) F //17
9. Resolve 17 with2a:
missile(m1) F //18
10. Resolve 18 with 2b: F
Intentional knowledge: about classes of entities and their generic relationships
Domain concept hierarchy:
ex, X, wumpus(X) monster(X).
Domain integrity constraints:
ex, X,Y wumpus(X) wumpus(Y) X = Y.
Domain behavior laws:
ex, X,Y smelly(X,Y) (loc(wumpus,X+1,Y) loc(wumpus,X-1,Y) loc(wumpus,X,Y+1) loc(wumpus,X,Y-1).
Database schema
Object-Oriented Programming (OOP) classes
Universally quantified CFOL formulas
Document Schema (XML schema)
Extensional knowledge: about specific entity instances and their particular relationships
Facts, propositions about concept instances
ex, loc(wumpus,2,1) loc(wumpus,1,2) loc(wumpus,2,3)alive(wumpus,4)
ex,alive(wumpus,7).
Data (databases)
Examples (machine learning)
Cases (case-base reasoning)
OOPobjects
Ground CFOL formulas
Classical Propositional Logic (CPL) formula
Document (XML)
(A,C,T,X,Y,O agent(A) loc(C,[(X,Y)]) time(T) in(A,C,T) horizCoord(X) verticCoord(Y) in(O,C,T) treasure(O) chooseAction(A,T+1,pick(O))).
Knowledge Representation Language
Ontological Commitment
High-Order OO
High-Order
Relational
First-Order OO
First-Order
Relational
Propositional
Deduction
Abduction
Inheritance
Belief
Revision
Belief
Update
Constraint
Solving
Planning
Optimization
Induction
Analogy
Fuzzy
?
Boolean Logic CWA
Boolean Logic OWA
Ternary Logic CWA
Ternary Logic OWA
Reasoning Task
Probabilistic
Plausibilistic
Possibilistic
Knowledge Representation Language
Epistemological Commitment
Deduction
Abduction
Inheritance
Belief
Revision
Planning
Belief
Update
Constraint
Solving
Optimization
Induction
Analogy
From: X,Y p(X,a) q(b,Y) r(X,Y)
p(1,a) q(b,2)
Deduce: r(1,2)
From: A si(A) do(A,k) sj(A)
p(A) si(A)
p(a)
Initially believe: si(a)
But after executing do(a,k)
Update belief si(a) into sj(a)
From: X,Y,Z N X+Y=Z 1X XZ XY YZ Z 7w/ utility(X,Y,Z) = X + Z
Derive optimum: X=2 Y=4 Z=6
From: X,Y p(X,a) q(b,Y) r(X,Y) p(X,c) n(Y) r(X,Y)
p(1,a) r(1,2) p(1,c)
w/ bias: q(A,B)
Abduce: q(b,2)
From: p(1,a) q(b,2) r(1,2) p(1,c) n(2)
...
p(3,a) q(b,4) r(3,4) p(3,c) n(4)
w/ bias: F(A,B) G(C,D) H(A,D)
Induce: ~X,Y p(X,a) q(b,Y) r(X,Y)
From: A sa(A) do(A,i) sb(A) ... sh(A) do(A,k) sg(A) sa(a) goal(a) = sg(a)
Plan to execute: [do(a,i), ... , do(a,k)]
From: G G instanceOf g p(G)
s subclassOf g s1 instanceOf s
Inherit: p(s1)
From: a ~1 b a ~2 c a ~11 d
p(b,x) p(c,x) p(d,y)
Derive by analogy: p(a,x)
From: X p(X) ~ r(X) q(X) n(X) (r(X) n(X)) p(a)
Believe by default: r(a)
But from new fact: q(a)Revise belief r(a) into n(a)
Solve: X,Y,Z N X+Y=Z 1X XZ XY YZ Z 7
Into: X=2 3Y Y 4 5 Z Z6
or (X=2 Y=3 Z=5) (X=2 Y=4 Z=6)
Reasoning Task
Probabilistic
Plausibilistic
Possibilistic
Ternary Logic OWA
Boolean Logic OWA
Ternary Logic CWA
Boolean Logic CWA
Probabilistic
Plausibilistic
Possibilistic
Ternary Logic OWA
Boolean Logic OWA
Ternary Logic CWA
Boolean Logic CWA
High-Order
OO
High-Order
Relational
First-Order
OO
First-Order
Relational
Propositional
High-Order
OO
High-Order
Relational
First-Order
OO
First-Order
Relational
Propositional
A KBA is a:
Reflex Agent?
Automata Agent?
Goal-Based Agent?
Planning Agent?
Hybrid Agent?
Utility-Based Agent?
Adaptive Agent?
Layered Agent?
Can be anyone !
Is there any constraint between the reasoning performed by the inference engine and the agent architecture?
Adaptive agent requires analogical or inductive inference engine
Environment
Persistent Knowledge Base (PKB):
rules, classes, logical formulas or probabilities
representing generic laws about environment class
Sensors
Ask
Inference Engine for Deduction, Abduction,
Inheritance, Belief Revision, Belief Update,
Planning, Constraint Solving or Optimization
Non-Monotonic
Engine
Ask
Tell
Retract
Volatile Knowledge Base (VKB):
facts, objects, constraints, logical formulas or probabilities
representing environment instance in current agent execution
Effectors
Environment
Persistent Knowledge Base (PKB):
facts, objects, constraints, logical formulas or probabilities
representing environment instances in past agent executions
structured by similarity measure
Sensors
Ask
Inference Engine for Analogy
Tell
Ask
Retract
Volatile Knowledge Base (VKB):
facts, objects, constraints, logical formulas or probabilities
representing environment instance in current agent execution
Effectors
Environment
(Past and)Current
Environment
Model
Percept Interpretation
Rules: percept(t) model(t) model’(t)
Sensors
Model Update
Rules:model(t-1) model(t)
model’(t) model’’(t)
Goal Update
Rules:model’’(t) goals(t-1) goals’(t)
Goals
Prediction of Future Environments
Rules: model’’(t) model(t+n)
model’’(t) action(t) model(t+1)
Hypothetical
Future
Environment
Models
Action Choice
Rules: model(t+n) = result([action1(t),...,actionN(t+n)]
model(t+n) goal(t) do(action(t))
Effectors
Environment
Sensors
PKB: PerceptInterpretation
VKB:
Past and Current
Environment Models
PKB: Environment
Model Update
PKB: Goals
Update
Inference
Engine
VKB: Goals
VKB:
Hypothetical Future
Environment Models
PKB: Prediction of
Future Environments
PKB: Acting
Strategy
Effectors
Environment
PKB: PerceptInterpretation
Inference
Engine 1
Sensors
VKB:
Past and Current
Environment Models
PKB: Environment
Model Update
Inference
Engine 2
PKB: Goals
Update
Inference
Engine 3
VKB: Goals
VKB:
Hypothetical Future
Environment Models
PKB: Prediction of
Future Environments
Inference
Engine 4
PKB: Acting
Strategy
Inference
Engine 5
Effectors
Environment
PKB: PerceptInterpretation
Abduction
Inference
Engine 1
Sensors
VKB:
Past and Current
Environment Models
PKB: Environment
Model Update
Belief
Update
Inference
Engine 2
PKB: Goals
Update
Inference
Engine 3
Deduction
VKB: Goals
VKB:
Hypothetical Future
Environment Models
PKB: Prediction of
Future Environments
Inference
Engine 4
Constraint
Solving
PKB: Acting
Strategy
Optimization
Inference
Engine 5
Effectors
Knowledge Elicitation
Knowledge Formalization
Knowledge Implementation
Knowledge Elicitation
Knowledge level:
Using the vocabulary of the domain experts
Natural language, domain-specific graphical notation
Knowledge Formalization
Formal level:
Unambiguous notation w/ mathematical formal semantics (Logic, probability theory)
Consistency verification
Semi-formal level:
Standard structured textual notation (XML)
Standard graphical notation (UML)
Validation with Expert
Knowledge Implementation
Implementation:
Inference engine or programming language
Prototype testing
Elicitação do conhecimento
Knowledge level:
Using the vocabulary of the domain experts
Natural language, domain-specific graphical notation
Formalização do conhecimento
Formal level:
Unambiguous notation w/ mathematical formal semantics (Logic, probability theory)
Consistency verification
Semi-formal level:
Standard structured textual notation (XML)
Standard graphical notation (UML)
Validation with Expert
Implementação do conhecimento
Implementation:
Inference engine or programming language
Prototype testing
Ask
InductiveInference Engine
Intentional Knowledge Base (IKB):
rules, classes or logical formulas
representing generic laws
about environment class
Tell
Hypothesis
Formation
Retract
Ask
Hypothesis
Verification
Data, Examples or Case Basefacts, objects, constraints or
logical formulas codifying
representative sample of
environment entities
Ask
Performance
Inference Engine:Any Reasoning Task
Except Analogy
and Induction
Tell
Retract
Ask
Inductively Learned
Persistent Knowledge Base (PKB):
rules, classes, logical formulas or probabilities
representing generic laws about environment class
Environment
Sensors
Ask
Inference Engine for Deduction, Abduction,
Inheritance, Belief Revision, Belief Update,
Planning, Constraint Solving or Optimization
Ask
Tell
Retract
Volatile Knowledge Base (VKB):
facts, objects, constraints, logical formulas or probabilities
representing environment instance in current agent execution
Effectors