[m-dev.] Re: assertions (was: Assocative predicates)
zs at cs.mu.OZ.AU
Thu Apr 23 16:09:32 AEST 1998
David Jeffery wrote:
> Rather than having a constraint on every mode declaration, you could simply
> have two kinds of assertions: one kind are concerned with which terms end
> up succeeding, and the other are concerned with which terms you are
> ``allowed'' to use. Basically this corresponds to:
> - *Descriptive* assertions, which tell you properties of the predicate
> that you are able to take advantage of. (eg. if the first list is
> sorted, then so is the second).
> - *Prescriptive* assertions, which say that it is illegal to call the
> predicate unless the condition is known to be satisfied.
It may not be quite so simple. One reason why you may want prescriptive
assertions is to make sure that the predicate never gets called with arguments
that would cause a runtime abort, and the conditions required to ensure this
may be different in different modes.
More information about the developers