Answers To Some Questions
- 24 Oct 2002
I got the following questions:
- What should the items be removed from in step 4?
From the state. The state contains a set of items. A predicate selects a subset of those items that together satisfy the predicate. Another way of looking at it is that the
prediucate selects a subset of the items in the state.
- Can you give an example of what should be the result of each step?
no, since not all steps produce a result.
After asking the user for his identity the system shows all tasks for which sufficient ingredient are available. Note that an item contains two kinds of information:
- fixed information that is of the same type for all items. This information is used to filter a subset of items out of the state, that subsequently is used to try to satisfy predicates
- a flexible part (the dictionary) that may contain different information for different items, and thus is modelled by a dictionary. Note that either element may not be used in a specific system (collection of predicates). It is quite likely that the user identifier is used either in the selection process, or to initialise the environment with or possibly both. The result of a select is a set of item sets, each representing the ingredients for a task.
- What is a predicate and what is a state?
- A state is a set of items (think of it as a collection of available ingredients)
- A predicate can be evaluated against a state (or a subset of a state), and selects a set of items out of its arguments.
- If you have an item
(1, Item "make bread" [("ingredient", "flour"),("ingredient", "sugar")] is in that case
make bread the task and are
flour=and =sugar the ingredients?
Yes and No. I would model things differently. In the state I would expect items like:
Item "baker" [("task", "make bread"), ("flour","")]
Item "baker" [("task", "make bread"), ("sugar","")]
Item "lecturer" [("task", "lecture"), ("course","IST"), ...]
and then one might define the predicate
makebread = PrItem (ItAnd (IsField "task" "make bread") (Hasfield "flour))
PrItem (ItAnd (IsField "task" "make bread") (Hasfield "flour))
If the user now logs in with user name
only the first two items apply, but fortunately they are sufiicient to make the predicate