Title: Production System
1Production System
- Production rule
- AI Planning, expert systems, action selection
- Condition/Action
- LHS/RHS
- Match/Choose/Act
- Inference engine
- OPS5
2Production System
- Matching
- Expressive power
- RETE (Forgy 1983, OPS5)
- Variables
- Substitution of constants
- Conflict Set
- Conflict Resolution
- All productions that match
- Utility, first, priority
3Production System Cycle
- Match conditions of all rules to buffers
- Those that match enter the conflict set
- Conflict resolution selects a rule to fire
- Action side of rule initiates changes to one or
more buffers - If no production can match and no action is in
progress then quit else repeat
4ACT-R
- Architecture Knowledge gt Behavior
- Procedural versus Declarative Knowledge
- Declarative
- Aware of
- Can describe to others
- Facts
- Structures called Chunks
- Procedural
- Display in behavior
- Not conscious of
- e.g. language
- rules
5Declarative Knowledge
- Chunk - basic unit of declarative knowledge
- Type slots
- Type - category (bird)
- Slots - attributes (color, size)
6Chunks
- Types
- Categories
- Names
- Reference
- Not part of chunk
7Creating Chunks
Chunk type ((chunk-type type-name slot-name1
(slot-namek init-val)..slot-namen)
(chunk-type count-order first second) (chunk-type
add arg1 arg2 sum count)
Chunk Instantiation (add-dm (chunk-name isa
type-name slot-name slot-value) )
(add-dm (a ISA count-order first 0 second 1)
(b ISA count-order first 1 second 2)
(second-goal ISA add arg1 5 arg2 2) ) sum and
count are nil
8Procedural Knowledge
- Production Rule - basic unit of procedural
knowledge - Control
- IF the goal is to classify a person
- and he is unmarried
- THEN classify him as a bachelor
9Production
- Condition-action pair
- If conditions are true then perform action
- Conditions
- Specification of chunks in buffers
- Actions
- Modification of buffers or module commands
10ACT-R 6.0
ENVIRONMENT
11ACT-R Production
12Variables
- prefixed by sign, e.g. num
- Bind values to variables
- Two purposes
- Conditionals
- Compare values
- Test for non nil
- Copy values between slots
- Lhs -gt right hand side
13Buffers
- Interface between procedural memory and other
modules - Implicit clearing
- Chunk creation
- Copies of chunks in Declarative Memory
14Modules
- Procedural Module
- Choose next action
- Declarative Module
- Memory creation and retrieval
- Goal Module
- Task Control
- Imaginal Module
- Problem repesentation
15Models
- Text file(s)
- Parameters
- Chunk-types
- Declarative Memory
- Productions
- Goal
- Must load
16Environment
- (run-environment)
- (start-environment)
- Must load tcl\tk (Start Environment.exe or Start
Environment OSX) - (stop-environment)
17Count Model
18Pattern Matching Exercise
19Addition Fact Example
ADDITION-FACT
3
7
VALUE
isa
VALUE
ADDEND1
SUM
FACT34
THREE
SEVEN
ADDEND2
4
isa
isa
FOUR
VALUE
isa
INTEGER
20Addition Example
(CLEAR-ALL) (CHUNK-TYPE addition-fact addend1
addend2 sum) (CHUNK-TYPE integer value) (ADD-DM
(fact34 isa addition-fact addend1 three
addend2 four sum seven) (three isa
integer value 3) (four isa integer
value 4) (seven isa integer value 7)
21Production Syntax
(P initialize-addition goalgt ISA
add arg1 num1 arg2
num2 sum nil gt goalgt
sum num1 count 0
retrievalgt isa count-order
first num1 )
(P increment-sum goalgt ISA add
sum sum count count
retrievalgt ISA count-order
first sum second newsum gt
goalgt sum newsum retrievalgt
isa count-order first
count )
22(p got-number goalgt isa make-a-call
who person retrievalgt isa phone-number
who person where office
ph-num num gt !output! (The phone number
for person is num) goalgt
isa dial-number who person
ph-num num current-digit 1 )
(p dial-a-digit goalgt
isa dial-number ph-num num
current-digit digit state nil gt
!bind! d (get-digit digit num)
visual-locationgt isa visual-location
value d goalgt state dialing )
23(P increment goalgt ISA
count-from start num1 - end
num1 step counting
retrievalgt ISA count-order
first num1 second num2 gt
goalgt start num2 retrievalgt
ISA count-order first
num2 !output! (num1) )
(p read-choose goalgt isa read-letters
state verify-choose visualgt isa text
value "choose" gt goalgt state
find-letter )
24Models
- Count model
- Addition model
- Semantic model
25Semantic Model
26(P rotate-counter-clockwise goalgt ISA
translaterotate step
counter-clockwise reference-y y axis
axis form form
retrievalgt ISA point-i gt
screen-y (!eval! ( y 15)) gt !eval!
(rotate-counter-clockwise form axis) )
(P get-direction goalgt ISA
make-report step find-point
retrievalgt ISA point-i
screen-x x screen-y y gt
goalgt step find-direction
retrievalgt ISA direction lt
screen-x (!eval! ( x 15)) gt screen-x
(!eval! (- x 15)) lt screen-y (!eval! (
y 15)) gt screen-y (!eval! (- y 15)) )