EXERCISE 16.9 [extra - not in book]
Here is a specification of an ATM in
an event-oriented production rule system. The terms
with initial Upper Case letters represent user events,
those in lower case represent internal system events,
those in <angle brackets> are external system
Enter-card -> card-in
Enter-Amnt pin-in -> money-ready card-ready
Enter-PIN card-in -> pin-in
Remove-Cash money-ready -> <user gets money>
Remove-Card card-ready -> <user gets card>
(a) Explain in natural language the possible
interactions allowed by this specification.
(b) Which of the following are valid traces for this
specification - explain your reasoning in terms of
the production rules.
answer available for tutors only
(a) The user has to enter the card, pin
number and amount requested in that order, but can
withdraw the money and card in either order.
After A.1. the system memory contains 'card-in'.
However, the second production rule needs 'pin-in'
to be in the system memory so cannot fire when the
user event 'Enter-Amnt' occurs.
What matters is the system memory, not the order of
Playing through the scenario (more detailed than necessary
in a student answer):
user action system memory