logical agents - santa clara universitytschwarz/coen266/logicalagents.pdf · logical agents •...
TRANSCRIPT
![Page 1: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/1.jpg)
Logical AgentsSanta Clara University
![Page 2: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/2.jpg)
Logical Agents• Humans know things • Humans use knowledge to make plans • Humans do not act completely reflexive, but reason
• AI: • Simple problem-solving agents have knowledge encoded
in their search spaces • CSP: Use a more generic approach by building generic
models of the problem and solving them • Logical agents: Have knowledge base and use logic in
order to make plans
![Page 3: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/3.jpg)
Knowledge Based Agents• Knowledge base (KB)
• Set of sentences • Expressed in a knowledge representation
language• Need to add sentences and query
• TELL and ASK operations • Might involve inference
![Page 4: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/4.jpg)
Knowledge Based Agents• Knowledge based agent
• forever: • TELL(MAKE-PERCEPT-SENTENCE(percept)) • ASK(MAKE-ACTION-QUERY) • TELL(MAKE-ACTION-SEQUENCE)
![Page 5: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/5.jpg)
Wumpus World
PIT
1 2 3 4
1
2
3
4
START
Stench
Stench
Breeze
Gold
PIT
PIT
Breeze
Breeze
Breeze
Breeze
Breeze
Stench
![Page 6: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/6.jpg)
The Wumpus World• Wumpus world
• Caves (4x4 grid) consisting of rooms connected by passage ways • One wumpus (smells, eats players, can be
shot dead) • Bottomless pits (cause drafts, player falls into
pit) • Gold (glitters, can be picked up)
![Page 7: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/7.jpg)
The Wumpus World• Performance Measure
• +1000: getting out alive with gold • -1000: falling into a pit or being eaten by
wumpus • -1: each action taken • -10: shooting your only arrow
![Page 8: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/8.jpg)
The Wumpus World• Actuators:
• Move, turn left, turn right • Percepts:
• Stench • Breeze • Glitter • Bump • Scream
![Page 9: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/9.jpg)
Logic• Syntax • Semantics: defines truth depending on model • Model: possible world
![Page 10: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/10.jpg)
Logic• If a sentence α is satisfied in the model m
• m satisfies α • m is a model for α M(↵)
![Page 11: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/11.jpg)
Wumpus WorldABG
PS
W
= Agent = Breeze = Glitter, Gold
= Pit = Stench
= Wumpus
OK = Safe square
V = Visited
A
OK 1,1 2,1 3,1 4,1
1,2 2,2 3,2 4,2
1,3 2,3 3,3 4,3
1,4 2,4 3,4 4,4
OKOKB
P?
P?A
OK OK
OK 1,1 2,1 3,1 4,1
1,2 2,2 3,2 4,2
1,3 2,3 3,3 4,3
1,4 2,4 3,4 4,4
V
(a) (b)
![Page 12: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/12.jpg)
Wumpus World
1 2 3
1
2 PIT
1 2 3
1
2 PIT
1 2 3
1
2 PIT PIT
PIT
1 2 3
1
2 PIT
PIT
1 2 3
1
2
PIT
1 2 3
1
2 PIT
PIT
1 2 3
1
2 PIT PIT
1 2 3
1
2
KB α1
Breeze
Breeze
Breeze
Breeze
Breeze
Breeze
Breeze
Breeze
1 2 3
1
2 PIT
1 2 3
1
2 PIT
1 2 3
1
2 PIT PIT
PIT
1 2 3
1
2 PIT
PIT
1 2 3
1
2
PIT
1 2 3
1
2 PIT
PIT
1 2 3
1
2 PIT PIT
1 2 3
1
2
KB
Breeze
α2
Breeze
Breeze
Breeze
Breeze
Breeze
Breeze
Breeze
![Page 13: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/13.jpg)
Logic• Logical entailment
• α entails β
• The stronger assertion rules out more models
↵ ✏ � , M(↵) ⇢ M(�)
![Page 14: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/14.jpg)
Logic• Inference mechanism
• A method to derive a statement from other statements
• Inference algorithm: • Sound: it derives only entailed sentences • Complete: it derives any sentence that is entailed
• Grounding: How do we know that the knowledge base is true in the world
![Page 15: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/15.jpg)
Propositional Logic• Syntax
• Sentences are atomic or compound • To create compound statements, use logical
operations and, or, implies, equivalent (if and only if)
• Semantics • Give truth values to atomic sentences • Calculate truth values for compound statements
![Page 16: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/16.jpg)
Propositional Logic• Logical equivalence
• Two sentences are logically equivalent if they are true in the same set of models
↵ ⌘ �
↵ ⌘ � if and only if ↵ ✏ � and � ✏ ↵
![Page 17: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/17.jpg)
• Deduction Theorem
• Can prove the latter • by checking that it is true in every model • by proving that it is equivalent to true
Propositional Logic
↵ ✏ � if and only if (↵ ) �) is valid
![Page 18: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/18.jpg)
Propositional Logic Syntax
• Atomic sentences • Denoted by capital letters
• Literals • Atomic sentences or their negation
• Compound statements • Using operators
) _ ^ ()
![Page 19: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/19.jpg)
Propositional Logic Semantics
• Semantics of operations are defined by truth tables
![Page 20: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/20.jpg)
Wumpus world logic• P(i,j) — a pit in location i, j • W(i,j) — a wumpus in positions i, j (dead or alive) • B(i,j) — a breeze in i, j • S(i,j) — a stench in i, j
![Page 21: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/21.jpg)
Wumpus world logic
¬P1,1
Pi,j ) Bi�1,j ^Bi+1,j ^Bi,j+1 ^Bi,j�1
Wi,j ) Si�1,j ^ Si+1,j ^ Si,j+1 ^ Si,j�1
Bi,j ) Pi�1,j _ Pi+1,j _ Pi,j�1 _ Pi,j+1
Si,j ) Wi�1,j _Wi+1,j _Wi,j�1 _Wi,j+1
![Page 22: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/22.jpg)
Wumpus world logic• Logical agent needs to decide whether this
knowledge base entails propositions • Good algorithm is
• sound if it only labels true propositions as true • complete if
• it labels every true proposition as true • it eventually decides
![Page 23: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/23.jpg)
Propositional Theorem Proving
• Can do model checking • Generate the set of all allowable models • Check a proposition on whether it is valid in all
models • Can do mathematical proofs
• Use inference rules
![Page 24: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/24.jpg)
Propositional Logic• Modus ponens
• And elimination
A ) B,A
B
A ^B
A
![Page 25: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/25.jpg)
Wumpus World Logic• Can you inference rules in order to obtain
statements
P1,2 ) B1,1,¬B1,1
¬P1,2
P1,2 ) B1,1 ^B1,3 ^B2,2
P1,2 ) B1,1
![Page 26: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/26.jpg)
Wumpus Logic• Can use search algorithms in order to find true
propositions using the knowledge base • States are true propositions • Actions are applications of an inference rule
![Page 27: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/27.jpg)
Wumpus Logic• Can restrict to a single inference rule:
• Resolution
l1, l2, . . . ln literals, m literal that is the negative of literal li, then
l1 _ l2 _ . . . _ ln,ml1 _ l2 _ . . . li�1 _ li+1 _ . . . ln
![Page 28: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/28.jpg)
Wumpus Logic• Example:
P1,1 _ P3,1,¬P1,1 _ ¬P2,2
P3,1 _ P2,2
![Page 29: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/29.jpg)
Wumpus Logic• Transform knowledge base into CNF
• Use algebraic manipulations to move individual propositions to CNF
![Page 30: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/30.jpg)
Propositional Logic• To prove a statement A
• Add ˜A to the KB • See whether you can obtain the empty clause with
resolution
• Ground resolution theorem: If a set of clauses is unsatisfiable, then the resolution closure outhouse clauses contains the empty clause.
• Can use fact that entailed statements only grow with the addition of information
![Page 31: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/31.jpg)
Wumpus World Logic
¬P2,1 B1,1 ¬B1,1 P1,2 P2,1 ¬P1,2 B1,1 ¬B1,1 P1,2
¬P2,1 ¬P1,2P1,2 P2,1 ¬P2,1 ¬B1,1 P2,1 B1,1 P1,2 P2,1 ¬P1,2¬B1,1 P1,2 B1,1
^ ^ ^
^^ ^ ^ ^ ^ ^ ^
^
![Page 32: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/32.jpg)
Propositional Logic• Resolution works, but is involved • Often, KB can be written in a more restricted form • Horn Clause
• Single, positive literals (the facts) • Implications of the form body implies head
• In conjunctive normal form: disjunction of literals where at most one is positive
B1 ^B2 ^ . . . ^Bn ) H
![Page 33: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/33.jpg)
Propositional Logic• Deciding entailment with Horn clauses can be
done in time linear with the knowledge base
• Forward chaining: • Prove single literal • Start with all known literals • Try out Horn clauses to generate new known
literals
![Page 34: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/34.jpg)
Propositional Logic
Q
P
M
L
BA
P ) Q
L ^M ) P
B ^ L ) M
A ^ P ) L
A ^B ) L
A
B
![Page 35: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/35.jpg)
Propositional Logic• Backward chaining
• Sometimes uses much less inference • Start with goal • Look for all inferences with head goal • Include the body of these inferences in the goal
![Page 36: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/36.jpg)
SAT• To check whether KB entails a proposition
• Hence:
• Since the KB can be in CNF, this question is an instance of SAT (not 3-SAT yet)
KB ) A () ¬KB _A
KB ) A () KB ^ ¬A not satisfiable
![Page 37: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/37.jpg)
SAT• Every SAT can be changed to 3-SAT • Use a 3-SAT solver
• A cottage industry with annual competition • With huge theoretical importance • With many practical problems
![Page 38: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/38.jpg)
Davis Putnam Logemann Loveland Algorithm
• Input is a sentence in conjunctive normal form • Recursive, depth-first enumeration of possible models • With improvements
• Early termination of evaluation • If a literal is true in all clauses, the sentence is
true
• Independent of other assignmentsA; ((A _B) ^ (A _ ¬C))
![Page 39: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/39.jpg)
Davis Putnam Logemann Loveland Algorithm
• Improvements • Early termination
• One literal true in all clauses entails sentence is true
• One clause is false then sentence is falseA ^B ^ ¬C; ((¬A _ ¬B _ C) ^ . . .)
![Page 40: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/40.jpg)
Davis Putnam Logemann Loveland Algorithm
• Improvements • Pure symbols
• Literal appears always either positive or negative in all clauses
• Pure symbols lead to simple truth assignment • Unit clause
• A clause with just one literal • A clause where only one literal has not yet been
assigned • Unit clauses also force assignment
![Page 41: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/41.jpg)
DPLL algoritmo
![Page 42: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/42.jpg)
SAT• Not all SAT problems are equally hard
• Convert to 3-SAT • It turns out that there needs to be a ratio between
number of clauses and number of variables for SAT to be hard
![Page 43: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/43.jpg)
SAT
0
0.2
0.4
0.6
0.8
1
0 1 2 3 4 5 6 7 8
P(sa
tisfia
ble)
Clause/symbol ratio m/n
![Page 44: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/44.jpg)
SAT
0200400600800
100012001400160018002000
0 1 2 3 4 5 6 7 8
Runt
ime
Clause/symbol ratio m/n
DPLLWalkSAT
![Page 45: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/45.jpg)
Agents Based on Propositional Logic
• Collect many rules about breezes, stenches, wumpus
• Agent percepts: • Need to depend on the time • Connected to rules via location variables
Lt
x,y
) (Breezet , Bx,y
)
![Page 46: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/46.jpg)
Agents Based on Propositional Logic
• Percepts only say something about the current time • Example of fluents:
• Aspect of the world that changes • Symbols associated with permanent aspects of the
world are atemporal variables
![Page 47: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/47.jpg)
Agents Based on Propositional Logic
• Transition model • Propositions for the occurrences of actions
• Effect axioms
Forward
t
L10,0 ^ FacingEast
0 ^ Forward
0 ) (L12,1 ^ ¬L1
1,1)
![Page 48: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/48.jpg)
Agents Based on Propositional Logic
• Frame problem • Many states are unchanged by the action
• The “frame of reference” • Can add frame axioms
• But these proliferate • Representational frame problem
• How to represent the frame • Inferential frame problem
• Calculating the results of an action takes longer
![Page 49: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/49.jpg)
Agents Based on Propositional Logic
• Frame problem • Solution is to not write axioms about actions but
about fluents
HaveArrowt+1 ) (HaveArrowt ^ ¬Shoott)
![Page 50: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/50.jpg)
Agents Based on Propositional Logic
• Hybrid agent for the wumpus world • Maintain and update knowledge base • Construct plan
• If glitter, grab gold, walk out • If not:
• Explore the world, avoiding Wumpus and pits
• Use A* for route planning
![Page 51: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/51.jpg)
Agents Based on Propositional Logic
• Logical state estimation • Recalculating inferences becomes unsustainable
as the KB increases • Need to cache results • Past history of percepts can be accumulated in a
belief state • Process of updating belief state is called state
estimation • Example:
WumpusAlive3 ^ L32,1 ^B2,1 ^ (P3,1 _ P2,2)
![Page 52: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/52.jpg)
Agents Based on Propositional Logic
• Logical State Estimation • Exact belief state is large
• n fluents: • 2**n physical states
• 2**2**n belief states • Alternative: Use approximate belief state
• Only use 1-CNF (conservatively) • State estimation:
• See whether literals about fluents can be ascertained • Example: Wumpus world
• Belief state B2,1 ^ ¬P1,1 ^ S1,2 ^ ¬P1,2 ^ ¬B1,1
![Page 53: Logical Agents - Santa Clara Universitytschwarz/COEN266/LogicalAgents.pdf · Logical Agents • Humans know things • Humans use knowledge to make plans • Humans do not act completely](https://reader033.vdocument.in/reader033/viewer/2022051923/6010db265f535019bf25eb23/html5/thumbnails/53.jpg)
Agents Based on Propositional Logic
• Making plans by propositional inference • Construct a sentence that includes:
• Assertions about initial state • Successor-state axioms for all possible actions up to some
maximum time t • Goal assertion for time t
• Present the sentence to the SAT solver • If the solver finds a satisfying model, then the goal is
achievable • If not, then planning is impossible
• If there is a model, extract the action variables that are true as the plan