|
[NEXT] [PREV]
HANDBOOK
/ GENTLE PRIMER
/ Describing Computations
/Failure |
|
Gentle
Applications Concepts Examples Handbook Support Download
|
The invocation
of a predicate can fail for two reasons:
the predicate is not applicable for the given input values, or
the returned output values do not match the corresponding values
in the invocation.
Consider IsJimsColor(yellow)This invocation will fail because IsJimsColor is only applicable for red. An invocation fails if there is no applicable rule. Consider also JimsColor(-> yellow)This invocation will fail since JimsColor returns red which does not match yellow. Failure does not mean error. As we shall see, it can be used to control predicate evaluation. |