Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

56
Tuteurs cognitifs: La théorie ACT-R et les systèmes de production Roger Nkambou

description

Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production. Roger Nkambou. What is a “Cognitive Model”?. A simulation of human thinking & resulting behavior Usually used to explain or predict data on human behavior Like error rates or solution time - PowerPoint PPT Presentation

Transcript of Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Page 1: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Tuteurs cognitifs: La théorie ACT-R et les systèmes de production

Roger Nkambou

Page 2: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

What is a “Cognitive Model”?

A simulation of human thinking & resulting behaviorUsually used to explain or predict data on human behavior Like error rates or solution time

Usually implemented as a computer program that can behave like humans Often using AI knowledge representations

like semantic nets, frames, schema, production rules

Page 3: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

What are Cognitive Models used for?

Output of basic research Explain results of psychology experiments

Guide design of software systems Have cognitive model “use” the system

Model predicts people’s time & errors(VanLehn) Redesign system to reduce time or errors

Can derive predictions without full implementation (e.g., Ethan)

As a component in an intelligent system Player in a game or training simulation Part of expert system or intelligent tutor

Page 4: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

What is an “Intelligent Tutoring System” (ITS)?

A kind of educational softwareUses artificial intelligence techniques to Provide human tutor-like behavior Be more flexible, diagnostic & adaptive Write more general code to get more

capabilities with less effort

Components of an ITS: Interface or problem solving environment,

domain knowledge, student model, pedagogical (tutoring) knowledge

Page 5: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

OverviewACT-R theory Features of production rules and their

predictions about learning

How Production Systems Work A Simple Example ACT-R Addition Example

Production System Notation Working memory “chunks” Production rule notation

Preview homework

Page 6: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

ACT-R Theory

Key Claim of Rules of the Mind: “Cognitive skills are realized by production rules”

What does this mean? What predictions does it make about learning?How does it help explain learning phenomena?

Page 7: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Main claims of ACT-R

1 There are two long-term memory stores, declarative memory and procedural memory.

2 The basic units in declarative memory are chunks.

3 The basic units in procedural memory are production rules.

Page 8: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Declarative-Procedural Distinction

Declarative knowledge Includes factual knowledge that people can report or

describe, but can be non-verbal Stores inputs of perception & includes visual memory Is processed & transformed by procedural knowledge Thus, it can be used flexibly, in multiple ways

Procedural knowledge Is only manifest in people’s behavior, not open to

inspection, cannot be directly verbalized Is processed & transformed by fixed processes of the

cognitive architecture It is more specialized & efficient

Page 9: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Intuition for difference between declarative & procedural rules

Although the rules for writing music (such as allowable chord structures and sequences) were often changed after a major composer had become a great influence, the actual rules by which composers shaped their compositions were often only known to later followers. When they first used them the composer was not consciously restricting himself/herself to the rules, but was rather using them subconsciously, leaving the collecting of the rules to later followers.

Page 10: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production Rules Describe How People Use Declarative Rules in their Thinking

Declarative rule:Side-side-side theoremIF the 3 corresponding

sides of two triangles are congruent ()

THENthe triangles are

Production rules describe thinking patterns:Special condition to aid searchIF two triangles share a side AND

the other 2 corresponding sides are THEN the triangles are congruent ()

Using rule backwardIF goal: prove triangles AND

2 sets of corresponding sides are THEN subgoal: prove 3rd set of sides

Using rule heuristicallyIF two triangles look THEN try to prove any of the corresponding

sides & angles

Page 11: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

4 Critical Features of Production Rules

Modular Performance knowledge is learned in

“pieces”

Goal & context sensitive Performance knowledge is tied to particular

goals & contexts by the “if-part”

Abstract Productions apply in multiple situations

Condition-Action Asymmetric Productions work in one direction

Page 12: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Features 1 & 2 of ACT-R Production Rules

1. Modularity production rules are the units by which a

complex skill is acquired empirical evidence: data from the Lisp tutor

2. Abstract character each production rule covers a range of

situations, not a single situation variables in the left-hand side of the rule

can match different working memory elements

Page 13: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Student Performance As They Practice with the LISP Tutor

100000

20

40

60

80

100

All Students

Mean Error Rate - 158 Goals in Lesson

Goal Number in Lesson (25 Exercises)

Mean

Err

or

Rate

Page 14: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production Rule Analysis

141210864200.0

0.1

0.2

0.3

0.4

0.5

Opportunity to Apply Rule (Required Exercises)

Err

or R

ate

Evidence for Production Rule as an appropriate unit of knowledge acquisition

Page 15: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production Rule Analysis “Cleans Up”

141210864200.0

0.1

0.2

0.3

0.4

0.5

Opportunity to Apply Rule (Required Exercises)

Err

or R

ate

100000

20

40

60

80

100

All Students

Mean Error Rate - 158 Goals in Lesson

Goal Number in Lesson (25 Exercises)

Mean

Err

or

Rate

Learning?

Yes! At the production rule level.

A surface level model does not explain/clarify learning process. Production rule model does.

Page 16: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Features 3 & 4 of ACT-R Production Rules

3. Goal structuring productions often include goals among their

conditions - a new production rule must be learned when the same action is done for a different purpose

abstract character means that productions capture a range of generalization, goal structuring means that the range is restricted to specific goals

4. Condition-action asymmetry For example, skill at writing Lisp code does not

transfer (fully) to skill at evaluating Lisp code.

Page 17: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production rules have limited generality -- depending on purpose & context of acquisition

Leads to order of operations error:“x * 3 + 4” is rewritten as “x * 7”

Works for “2x + 3x” but not for “x + 3x”

In “3x + 48 = 63”: 63- 48----- 15 / 3 = 5 (no use of equations!)

Overly generalIF “Num1 + Num2” appears in an expressionTHEN

replace it with the sum

Overly specificIF “ax + bx” appears in an expression and c

= a + bTHEN

replace it with “cx”

Not explicitly taughtIF you want to find Unknown and the final

result is Known-Result and the last step was to apply Last-Op to Last-Num,

THENWork backwards by inverting Last-Op and applying it to Known-Result and Last-Num

Page 18: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production Rule Asymmetry Example

Declarative rule:Side-side-side theoremIF the 3 corresponding

sides of two triangles are congruent ()

THENthe triangles are

Production rules describe thinking patterns:Special condition to aid searchIF two triangles share a side AND

the other 2 corresponding sides are THEN the triangles are congruent ()

Using rule backwardIF goal: prove triangles AND

2 sets of corresponding sides are THEN subgoal: prove 3rd set of sides

Using rule heuristicallyIF two triangles look THEN try to prove any of the corresponding

sides & angles

Forward use of declarative rule

Backward uses of declarative rule

Productions are learned independently, so a student might be only able to use a rule in the forward direction.

Page 19: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

The chunk in declarative memory

1 Limited size2 Configural structure

-> different parts of have different roles

3 Hierarchically organized -> chunks can have subchunks

Page 20: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Declarative Knowledge Terms

Declarative Knowledge Is the “Working Memory” of a

production system

A “chunk” is an element of declarative knowledge Also called “working memory element”

or “wme” (pronounced “wimee”) Chunks or wme’s are made up of pairs

of “slots” and “values”

Page 21: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Summary

Features of cognition explained by ACT-R production rules: Procedural knowledge:

modular, limited generality, goal structured, asymmetric

Declarative knowledge: flexible, verbal or visual, less efficient

Page 22: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Multiple Uses of Cognitive Model

Summarizes results of analysis of data on student thinking

Is the “intelligence” in the tutor

Most importantly, provides guidance for all aspects of tutor development Interface, tutorial assistance, problem

selection and curriculum sequencing

Page 23: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

OverviewACT-R theory Features of production rules and their

predictions about learning

How Production Systems Work A Simple Example ACT-R Addition Example

Production System Notation Working memory “chunks” Production rule notation

Page 24: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

How Production Systems Fit into Cognitive Tutors

The main step in developing a Cognitive Tutor is to develop a cognitive model. Decompose the skill to be taught into small

knowledge units. We use “production rules” to represent these

knowledge units.

A production system combines: A set of if-then production rules that transform

data in working memory as directed by a procedure called the interpreter.

Page 25: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Components of a Production Rule System

Working memory -- the databaseProduction rule memory InterpreterRepeats the following cycle: 1. Match

Match “if-parts” of productions with working memory Collect all applicable production rules

2. Conflict resolution Select one of these productions to “fire”

3. Act “Fire” production by making changes to working memory

as indicated in “then-part”

Page 26: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

An example production system

You want a program that can answer questions and make inferences about food itemsLike: What is purple and perishable? What is packed in small containers

and gives you a buzz? What is green and weighs 15 lbs?

Page 27: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

A simple production rule system making inferences about food

WORKING MEMORY (WM)Initially WM = (green, weighs-15-lbs)

RULE MEMORYP1. IF green THEN produceP2. IF packed-in-small-container THEN delicacyP3. IF refrigerated OR produce THEN perishableP4. IF weighs-15-lbs AND inexpensive AND NOT perishable THEN

stapleP5. IF perishable AND weighs-15-lbs THEN turkeyP6. IF weighs-15-lbs AND produce THEN watermelon

INTERPRETER1. Find all productions whose condition parts are true2. Deactivate productions that would add a duplicate symbol3. Execute the lowest numbered production (or quit)4. Repeat until there is no rule to execute

Adapted from the Handbook of AI, Vol I, pp. 191

Page 28: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

First cycle of execution

RULE MEMORYP1. IF green THEN produceP2. IF packed-in-small-container

THEN delicacyP3. IF refrigerated OR produce

THEN perishableP4. IF weighs-15-lbs AND inexpensive

AND NOT perishable THEN staple

P5. IF perishable AND weighs-15-lbs THEN turkey

P6. IF weighs-15-lbs AND produce THEN watermelon

Adapted from the Handbook of AI, Vol I, pp. 191

WORKING MEMORYWM = (green, weighs-15-lbs)

CYCLE 11. Productions whose condition parts are true: P12. No production would add duplicate symbol3. Execute P1.

This gives: WM = (produce, green, weighs-15-lbs)

INTERPRETER1. Find all productions whose

condition parts are true2. Deactivate productions that

would add a duplicate symbol3. Execute the lowest numbered

production (or quit)4. Repeat

Page 29: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Do This Yourself Before Going On!Hand simulate the execution of the production rule model.For each cycle, write down the following information:

Activate rules:Deactivate rules:Execute rule:WM = ( …. )

What is in working memory when the production rule model finishes? Are there any mistakes in the production rules?

Page 30: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Cycle 2

RULE MEMORYP1. IF green THEN produceP2. IF packed-in-small-container

THEN delicacyP3. IF refrigerated OR produce

THEN perishableP4. IF weighs-15-lbs AND inexpensive

AND NOT perishable THEN staple

P5. IF perishable AND weighs-15-lbs THEN turkey

P6. IF weighs-15-lbs AND produce THEN watermelon

Adapted from the Handbook of AI, Vol I, pp. 191

WORKING MEMORYWM = (produce, green, weighs-15-lbs)

CYCLE 21. Productions whose condition parts are true: P1, P3, P62. Production P1 would add duplicate symbol, so deactivate P13. Execute P3 because it is the lowest numbered production.

This gives: WM = (perishable, produce, green, weighs-15-lbs)

INTERPRETER1. Find all productions whose

condition parts are true2. Deactivate productions that

would add a duplicate symbol3. Execute the lowest numbered

production (or quit)4. Repeat

Page 31: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Cycle 3

RULE MEMORYP1. IF green THEN produceP2. IF packed-in-small-container

THEN delicacyP3. IF refrigerated OR produce

THEN perishableP4. IF weighs-15-lbs AND inexpensive

AND NOT perishable THEN staple

P5. IF perishable AND weighs-15-lbs THEN turkey

P6. IF weighs-15-lbs AND produce THEN watermelon

Adapted from the Handbook of AI, Vol I, pp. 191

WORKING MEMORYWM = (perishable, produce, green, weighs-15-lbs)

CYCLE 31. Productions whose condition parts are true: P1, P3, P5, P62. Productions P1 and P3 would add duplicate symbol, so deactivate P1 and P33. Execute P5.

This gives: WM = (turkey, perishable, produce, green, weighs-15-lbs)

INTERPRETER1. Find all productions whose

condition parts are true2. Deactivate productions that

would add a duplicate symbol3. Execute the lowest numbered

production (or quit)4. Repeat

Incorrect rule!?

Page 32: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Cycle 4

RULE MEMORYP1. IF green THEN produceP2. IF packed-in-small-container

THEN delicacyP3. IF refrigerated OR produce

THEN perishableP4. IF weighs-15-lbs AND inexpensive

AND NOT perishable THEN staple

P5. IF perishable AND weighs-15-lbs THEN turkey

P6. IF weighs-15-lbs AND produce THEN watermelon

Adapted from the Handbook of AI, Vol I, pp. 191

WORKING MEMORYWM = (turkey, perishable, produce, green, weighs-15-lbs)

CYCLE 41. Productions whose condition parts are true: P1, P3, P5, P62. Productions P1, P3, P5 would add duplicate symbol, so deactivate them3. Execute P6. This gives: WM = (watermelon, turkey, perishable, produce,

green, weighs-15-lbs)

INTERPRETER1. Find all productions whose

condition parts are true2. Deactivate productions that

would add a duplicate symbol3. Execute the lowest numbered

production (or quit)4. Repeat

Page 33: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Cycle 5

RULE MEMORYP1. IF green THEN produceP2. IF packed-in-small-container

THEN delicacyP3. IF refrigerated OR produce

THEN perishableP4. IF weighs-15-lbs AND inexpensive

AND NOT perishable THEN staple

P5. IF perishable AND weighs-15-lbs THEN turkey

P6. IF weighs-15-lbs AND produce THEN watermelon

Adapted from the Handbook of AI, Vol I, pp. 191

WORKING MEMORYWM = (watermelon, turkey, perishable, produce, green, weighs-15-lbs)

CYCLE 51. Productions whose condition parts are true: P1, P3, P5, P62. Productions P1, P3, P5, P6 would add duplicate symbol, so deactivate

them3. Quit.

INTERPRETER1. Find all productions whose

condition parts are true2. Deactivate productions that

would add a duplicate symbol3. Execute the lowest numbered

production (or quit)4. Repeat

Page 34: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Cycles 2-5

CYCLE 51. Activate: P1, P3, P5, P62. Deactivate: P1, P3, P5, P6.3. Quit.

CYCLE 41. Activate: P1, P3, P5, P62. Deactivate: P1, P3, P53. Execute P6. WM = (watermelon, turkey,

perishable, produce, green, weighs-15-lbs)

CYCLE 31. Activate: P1, P3, P5, P62. Deactivate: P1 and P33. Execute P5. WM= (turkey, perishable, produce,

green, weighs-15-lbs)

Is this a bug?

WM = (produce, green, weighs-15-lbs)CYCLE 21. Activate: P1, P3, P62. Deactivate P13. Execute P3. WM= (perishable, produce,

green, weighs-15-lbs)

RULE MEMORYP1. IF green THEN

produceP2. IF packed-in-

small-containerTHEN delicacy

P3. IF refrigerated OR produceTHEN perishable

P4. IF weighs-15-lbs AND inexpensive AND NOT perishableTHEN staple

P5. IF perishable AND weighs-15-lbsTHEN turkey

P6. IF weighs-15-lbs AND produceTHEN watermelon

Page 35: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

How ACT-R production system is more complex

Watermelon is simple example: Working memory elements: a single word Production rules: no variables in if-part Interpreter: conflict resolution selects lowest

numbered unused production

In contrast, in ACT-R: Working memory elements: database-like record

structures with attributes and values Production rules: includes variables & patterns Interpreter: match must deal with variables and

patterns, conflict resolution does not use rule order

Page 36: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

A Second Production Rule Model Example

Think about how you would write production rules to do multi-column addition?

What if-then rules would you write to perform this task in a step-by-step fashion?

264 + 716

Page 37: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production Rules Set New Goals & Perform Actions

Goal: Solve the addition problem

ADD-CARRY

264 + 716

Adapted from Anderson, J. R. 1993. Rules of the Mind. Hillsdale, NJ: LEA.

FOCUS-ON-FIRST-COLUMN,FOCUS-ON-NEXT-COLUMN

Goal: Process column C

Goal: Write carry in next column

MUST-CARRY

WRITE-SUM

Action: Write the sum

Action: Write the carry

WRITE-CARRY

Goal: Write sum in column C

ADD-ADDENDS

Page 38: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production rule model for additionFOCUS-ON-FIRST-COLUMNIF The goal is to do an addition problem And there is no pending subgoal And there is no result yet in the rightmost column of

the problemTHEN Set a subgoal to process the rightmost column

FOCUS-ON-NEXT-COLUMNIF The goal is to do an addition problem And here is no pending subgoal And C is the rightmost column with numbers to add and no

resultTHEN Set a subgoal to process column C

ADD-ADDENDSIF There is a goal to process column CTHEN Set Sum to the sum of the addends in column C And set a subgoal to write Sum as the result in column C And remove the goal to process column C

ADD-CARRYIF There is a goal to write Sum as the result in column C And there is a carry into column C And the carry has not been added to SumTHEN Change the goal to write Sum+1 as the result And mark the carry as added

MUST-CARRYIF There is a goal to write Sum as the result in column C And the carry into column C (if any) has been added to Sum And Sum > 9 And Next is the column to the left of CTHEN Change the goal to write Sum-10 as the result in C Set a subgoal to write 1 as a carry in column Next

WRITE-SUMIF There is a goal to write Sum as the result in column

C And Sum < 10 And the carry into column C (if any) has been addedTHEN Write Sum as the result in column C And remove the goal

WRITE-CARRYIF There is a goal to write a carry in column CTHEN Write the carry in column C And remove the goal

DONEIF The goal is to do an addition problem And there is no incomplete subgoal to work on And there is no column left with numbers to add (or a carry)

and no resultTHEN Mark the problem as done

Page 39: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Step 11. FOCUS-ON-FIRST-COLUMN

C = column1 Goal: Process column1

2. ADD-ADDENDSC = column1Sum = 10 Goal: Process column1 Goal: Write 10 as result in

column13. MUST-CARRY

C = column1Sum = 10Next = column2 Goal: Write carry in column2 Goal: Write 0 as result in column1

4. WRITE-SUMC = column1Sum = 0Action: Write 0 as result in column1 Goal: Write 0 as result in column1

Q: Could the carry have been written first?A: Yes, the condition of WRITE-CARRY

holds after step 3. The model is flexible w.r.t. the order of writing the carry and writing the result.

Step 25. WRITE-CARRY

C = column2Action: Write carry in column2 Goal: Write carry in column2

Q: Could we have moved on without writing the carry?

A: No, FOCUS-ON-NEXT-COLUMN can fire only if there is no pending goal. The model does NOT allow implicit carrying.

A Trace of Production Rule Firings 264

+ 716 264 + 716 0

Pending goal: Write carry in column2

colu

mn

3colu

mn

2colu

mn

1

Page 40: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Step 36. FOCUS-ON-NEXT-COLUMN

C = column2 Goal: Process column2

7. ADD-ADDENDSC = column2Sum = 7 Goal: Process column2 Goal: Write 7 as result in column2

8. ADD-CARRYC = column2Sum = 7 Goal: Write 8 as result in column2

Q: Good thing that WRITE-SUM did not fire instead after step 7. Why didn’t it?

A: WRITE-SUM has condition that carry into the column must have been added.

9. WRITE-SUMC = column2Sum = 8Action: Write 8 as result in column1 Goal: Write 8 as result in column1

1 264 + 716 0

No pending goal

A Trace of Production Rule Firings (ctnd.)

1 264 + 716 80

1 264 + 716 980

No pending goal

DONE

Step 410. FOCUS-ON-NEXT-COLUMN

C = column3 Goal: Process column3

11. ADD-ADDENDSC = column3Sum = 9 Goal: Process column3 Goal: Write 9 as result in column3

12. WRITE-SUMC = column3Sum = 9Action: Write 9 as result in column3 Goal: Write 9 as result in column3

Step 513. DONE

Page 41: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

How could you model students that don’t carry?

Instead of doing the addition correctly:

Can you model a student that writes:

How can you change the production rule model?

1 264+ 716 980

264+ 716 970

Page 42: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

OverviewACT-R theory Features of production rules and their

predictions about learning

How Production Systems Work A Simple Example ACT-R Addition Example

Production System Notation Working memory “chunks” Production rule notation

Page 43: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Production Rules in the Tutor Development Kit (TDK)

How do you go about writing a production rule?

The TDK Production System Working Memory:

Make up of “Working Memory Elements” (WMEs) Production Rules Interpreter (Match, Conflict Resolution, Fire)

Page 44: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Implementing a Production Rule Model in TDK

Simple example: a model for single-column addition without carrying!

How would you define: Working Memory representation for the

problem states Production rules that transform working

memory

4+ 3 7

4+ 3

4+ 3 7 Done

Page 45: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

A Notation for Working Memory Elements (“WMEs”) in TDK

PROBLEM4+3> ISA SINGLE-COLUMN-ADDITION-

PROBLEM FIRST-ADDEND 4 SECOND-ADDEND 3 RESULT nil DONE nil

4+ 3 WME Name

Slot Values

Slots

WME TypeSeparator

Page 46: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Working Memory Transitions

PROBLEM4+3> ISA SINGLE-COLUMN-

ADDITION-PROBLEM FIRST-ADDEND 4 SECOND-ADDEND 3 RESULT nil DONE nil

4+ 3 7

4+ 3

4+ 3 7 Done

PROBLEM4+3> ISA SINGLE-COLUMN-

ADDITION-PROBLEM FIRST-ADDEND 4 SECOND-ADDEND 3 RESULT 7 DONE nil

PROBLEM4+3> ISA SINGLE-COLUMN-

ADDITION-PROBLEM FIRST-ADDEND 4 SECOND-ADDEND 3 RESULT 7 DONE T

Production: ADD Production: DONE

Page 47: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

TDK Production Rule Notation

(defproduction add single-column-addition (=problem) =problem> isa single-column-addition-problem result NIL first-addend =num1 second-addend =num2

==>

!eval! =sum (+ =num1 =num2)

=problem> result =sum)

ADD (English version)IFThe goal is to do =problem, a

single-column addition problem

And no result has been found yet

And the first addend is =num1And the second added is

=num2THENSet =sum to the sum of

=num1 and =num2

Write =sum as the result

Page 48: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

TDK Production Rule Notation

(defproduction add single-column-addition (=problem)

=problem> isa single-column-addition-problem result NIL first-addend =num1 second-addend =num2

==>

!eval! =sum (+ =num1 =num2)

=problem> result =sum)

If-part

Then-part

Page 49: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

TDK Production Rule Notation

(defproduction add single-column-addition (=problem)

=problem> isa single-column-addition-problem result NIL first-addend =num1 second-addend =num2

==>

!eval! =sum (+ =num1 =num2)

=problem> result =sum)

If-part

Then-part

WME pattern

WME pattern

Computation in Lisp

Page 50: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

TDK Production Rule Notation

(defproduction add single-column-addition (=problem)

=problem> isa single-column-addition-problem result NIL first-addend =num1 second-addend =num2

==>

!eval! =sum (+ =num1 =num2)

=problem> result =sum)

WME pattern

Variables(“bound” to values through matching) (JESS uses ? Instead of =)

Separator

Page 51: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

JESS Production Rule Notation(defrule add single-column-addition (=problem)REMOVE

(addition

(problem ?problem))

?problem <- (single-column-addition-problem //note-no name (result NIL) (first-addend ?num1) (second-addend ?num2)

=> //only one =

(bind ?sum (+ ?num1 ?num2)) //call out to Jess

(modify ?problem( result ?sum)

)

No Arguments in JESS

Page 52: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Matching a Production Rule to Working Memory—Find Values for Each Variable

Working Memoryproblem4+3> isa single-column-

addition-problem first-addend 4 second-addend 3 result NIL done NIL

Find value for each variable

Variable=problem=num1=num2=sum

ValueProblem4+3437

Match!

Modify WME

problem4+3>

isa single-column-addition-problem

first-addend 4

second-addend 3

result 7

done NIL

Production Rule

add =problem> isa single-column-

addition-problem result NIL first-addend =num1 second-addend =num2==>!eval! =sum (+ =num1 =num2)=problem> result =sum)This WME pattern in the

THEN-part means change slot value of existing WME

What changes are made to Working Memory?

Page 53: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Summary—Components of a TDK Production Rule Model

Working Memory is a collection of WMEswme-name>

isa wme-typeslot1 value1slot2 value2

Production rules specify working memory transitions WME patterns in the IF-part are matched against

Working Memory=wme-variable>

isa wme-typeslot1 value-pattern1slot2 value-pattern2

WME patterns in the THEN-part specify changes to Working Memory

Page 54: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

Overall SummaryComponents of Production Systems:

Working memory, production memory, interpreter Steps in the interpreter: Match, conflict resolution,

fire

Features of cognition explained by ACT-R production rules: Procedural knowledge:

modular, limited generality, goal structured, asymmetric

Declarative knowledge: flexible, verbal or visual, less efficient

Page 55: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

OverviewACT-R theory Features of production rules and their

predictions about learning

How Production Systems Work A Simple Example ACT-R Addition Example

Production System Notation Working memory “chunks” Production rule notation

Preview homework

Page 56: Tuteurs cognitifs: La th éorie ACT-R et les systèmes de production

END