85-411/711 Cognitive Processes and Problem Solving Homework #3-Solutions This assignment had several goals: 1) to be able to read and understand basic productions; 2) to provide a basic understanding of the OPS5 interface (for the next assignment); 3) to provide some understanding of the move-pattern strategy, and how it might be implemented. Programming hints. If one uses command-period while the production system is running (to stop an infinite loop or some other problem), there is a good chance that (remove-all) will not work properly. i.e., some of the WME's will not be removed. If this bothers you, always type (run 50) rather than run, and just let it run for 50 steps rather than halting it. Getting more information from the simulation. To track the changes to working memory, use (watch 2). As each rule is fired, it will print which WME's are added and deleted. Deleted WME's are shown by a <=, and added WME's by a =>. When WME's are changed, the old version of the WME is removed, and a new version is added. D. Questions about the move-pattern simulation 1. OPS5 working memory elements really consist of items that we would consider to be in working memory as well as items that would be in external memory. For example, the "peg" statements represent the state of the world and can be thought of as external memory. Run the simulation on a 3-disk puzzle and allow 9 rules to fire [use (run 9)]. Then enter (ppwm) to print the WME's. Which WME's represent items in psychological working memory? Which others are parts of external memory? Psychological Working Memory: smallest-move-order, smallest-moves-to, move-parity External Memory: peg (A, B, and C) The smallest-move-order WME represents the knowledge of the order in which to move the smallest disks. While this element remains unchanged during a simulation, it represents strategic knowledge rather than some fact about the environment. The smallest-moves-to WME represents which move in that list of moves is next. The move-parity WME represents the knowledge of whether the next move is an odd move or an even move. The peg WME's are merely representations of the current status of the external world. One might also argue that the peg elements are internal representations of the external world, and hence part of psychological working memory. For example, in the memory for word lists experiments, there were both visual words out in the environment, and internal representations (usually phonological recodings) of the visual words. However, most production system models assume that these internal representations of the external world are veridical (and hence the distinction between the two is lost). Of the other kinds of WME's, goal is a psychological WME, and place-disk, set-smallest-order, and start are elements which are neither psychological WME's nor external WME's; rather they are internal variables to OPS5 that are necessary to initialize the system environment. 2. If a subject was interrupted at this point (after 9 rule firings), what would happen? Suppose the subject forgot whether he was on an even or an odd move. What happens? Restart the simulation and try this again, modifying different elements or interrupting after different numbers of rule firings. Discuss the kinds of errors produced. The move-pattern strategy is very brittle to mistakes and interruptions. If it confuses the parity, it is very likely that it will just move disks 1 and 2 back and forth without moving disk 3. Changing the smallest-moves-to position, or moving one of the disks externally can cause the same problem, or a situation in which no productions can fire. There are two sources of these problems: 1) the move-pattern strategy does not examine the environment sufficiently to be able to react to the environment; 2) the move-pattern is inflexible, in that it cannot adapt in the face of problems. While it may be true that many human subjects would not be as brittle as this simulation, the reason is not that the simulation does not capture how humans use the move-pattern strategy. Rather, humans are able to switch to a different strategy, which this simulation cannot do. 3. Enter the following rule: (p startup (start) --> (make peg ^name A ^disk-list 3) (make peg ^name B ^disk-list 2) (make peg ^name C ^disk-list 1) (make smallest-moves-to ^position 0) (make move-parity ^value odd) (make set-smallest-order ^disk-parity 1)) This changes the rule STARTUP so that the problem uses three disks and starts with disk 3 on peg A, disk 2 on peg B and disk 1 on peg C. You can see this by typing (run 1) and then (ppwm). Can the system solve the task? Why not? Change the STARTUP rule so that the program works. Note. Some students may have had trouble answering this question because they did not do (remove-all) and (make start) after changing the startup rule. OPS productions can only match to WME's that were created after the production. This rule changes the initial state from a tower configuration to a flat configuration. This new initial state is the same as the third state from the old initial state. Consider what WME's would be in working memory on the third state in the old problem (smallest-moves-order ^disk-list C B A) ;there are an odd number of disks (smallest-moves-to ^position 1) ;disk 1 has moved once since the start (move-parity ^value odd) ;the third move is odd again. So, the new startup rule sets smallest-move-order and the move-parity correctly. However, smallest-moves-to is incorrectly set to 0 (which points C) rather than 1 (which points to B). Therefore, the simulation will incorrectly move the smallest disk to C., rather than to B. Just as in question 2, the simulation is unable to recover from this error because it does not derive sufficient information from the environment. The simulation can be fixed by changing the smallest-moves-to position to 1, or by changing the smallest-moves-order disk-list to B A C.