Title: Python ACTR: A New Implementation and A New Syntax
1Python ACT-RA New Implementation and A New
Syntax
- Terrence C. Stewart and Robert L. West
- Carleton Cognitive Modelling Lab
- Institute of Cognitive Science, Carleton
University, Canada - ACT-R Workshop 2005
2Vision of the Future of ACT-R
- A standard tool for modelling cognition
- As widespread and widely used as basic statistics
- Easy for any researcher to put together a model
to test their theory about a particular aspect of
cognition - Easy to develop new ACT-R modules
- Easy to collect data from ACT-R models, do
multiple runs, interact with various user
interfaces, other ACT-R models, and other
cognitive models.
3How can we achieve this?
- ACT-R 6
- Alternate implementations
- jACT-R
- Very few cognitive scientists are learning Lisp
- Not knowing Lisp makes it difficult to create the
experimental framework around an ACT-R model - Having ACT-R available in other languages means
more people will be tempted to make use of it - Alternate syntax
- Current syntax is based in Common Lisp
- More familiar syntax may entice more users
4System Design
- Python
- Cleanly supports all of Lisp's essential
features except macros lthttp//www.norvig.com/pyt
hon-lisp.htmlgt - It's Lisp with one fixed syntax that has been
optimized for fast development, clarity, and ease
of learning (executable pseudo-code) - One implementation, extensive standard libraries
- Virtual Machine language, similar speed as Java
5def incrementSum( goal'add ?count ?sum',
retrieval'count-order ?sum ?newsum')
goal(sumnewsum) retrieval('count-order ?count
?')
(P increment-sum goalgt
isa add count
count sum sum
retrievalgt isa count-order first
sum second newsum gt goalgt
sum newsum retrievalgt isa
count-order first count )
6import actr class Count goalactr.Buffer
specify the modules
retrieveactr.BasicMemory productionactr.BasicP
roduction memory"""count 0 1, count 1 2,
initialize count 2 3, count 3
4, declarative memory
count 4 5, count 5 6, count 6 7,
count 7 8, count 8 9, count 9 10"""
def start(goal'count-from ?start ?end
starting') define the retrieve('count
?start ?next') productions
goal('count-from ?start ?end counting')
def increment(goal'count-from ?x !?x counting',
retrieve'count ?x ?next')
print x retrieve('count ?next ?nextNext')
goal(xnext) def stop(goal'count-from ?x ?x
counting') print x goal('count-from ?x
?x stop') modelactr.ACTR(Count)
create the model model.goal('count-from 2
4 starting') set the goal
chunk model.run()
run the model
7Chunks
- Lisp ACT-R chunks
- (chunk-type count-order first second)(a isa
count-order first 2 second 3) - Python ACT-R chunks
- count 2 3
- No slot names (use order instead)
- No special 'isa' slot (usually first slot)
- No chunk-types
- Why the big change?
- To reduce the idea of the semantic value of slots
- To reduce the value value confusion between
slot names and variables
8Existing Modules
- Declarative Memory
- BasicMemory no learning (ESC F)
- FastMemory optimized (OL T)
- FullMemory non-optimized (OL F)
- Productions
- BasicProduction (PL F)
- PGCProduction (PL T)
- CompilingProduction with compilation (EPL T)
- Others
- Buffer a simple buffer with a do-nothing module
- Used for the Goal Buffer
- Total size 20.9kB, 750 lines
(No partial matching or spreading activation yet)
9Future Work Open Design Questions
- Production compilation
- We currently just do the RHS of the two base
productions, so memory requests still happen,
even though their response is not used - Can we simplify the constraints on when
productions can be combined? Do we need the
limits imposed by Lisp ACT-R? - The Goal Buffer
- The goal buffer is not special in Python ACT-R
- Can have productions which don't match on the
goal buffer - Is this a way of doing reactive models?
10Future Work Open Design Questions
- Slots with no names
- Any aspects of ACT-R which require named slots?
- Does it cause development confusion?
- Does it get rid of people making chunks with many
slots? - Does not requiring an 'isa' match change things?
- Temporary slot names
- Currently, if a variable is bound to a particular
slot, that variable also becomes a temporary name
for that slot within that production - Meant to simplify a RHS rule that just changes a
few slot values
11Future Work More Modules
- Partial Matching
- With an easier way of specifying matching values
- Spreading Activation
- How do we work with slots referring to other
chunks? - This is possible now, but needs a clear syntax
- Production learning via other Reinforcement
Learning systems - Instead of PG-C, use Q-Learning or other modern
reinforcement learning systems (Gray et al, 2005) - ACT-R/PM
- Integrated with the Tcl/Tk and wxPython gui
libraries - SOS for Python ACT-R
- A simple interface to manipulate objects
12Discussion Questions
- Is this useful to any of you?
lthttp//ccmlab.ca/actrgt - What would it need in order to be more useful?
- What divergences from Lisp ACT-R seem the most
dangerous? The most interesting? - Does it fit with ACT-R 6?
- Is having two different syntaxes for ACT-R more
confusing or less confusing? - Will this help people researching ACT-R?
- Will this help people who just want to use ACT-R
to create models?