[m-rev.] Extended inst syntax documentation
David Overton
dmo at cs.mu.OZ.AU
Wed Feb 12 11:51:29 AEDT 2003
On Wed, Feb 12, 2003 at 11:46:19AM +1100, Ralph Becket wrote:
> +A more concise, alternative syntax exists for @samp{bound} instantiatedness
> +trees:
> +
> + at example
> +:- inst listskel ---> [] ; [free | listskel].
> + at end example
> +
> +which is equivalent to writing
> +
> + at example
> +:- inst listskel == bound([] ; [free | listskel]).
> + at end example
> +
Lists might not be the clearest example to use here, given the special
syntax for list construction. It might be better to use something like
:- inst maybe ---> no ; yes(ground).
> As execution proceeds, variables may become more instantiated.
> A @dfn{mode mapping} is a mapping
> from an initial instantiatedness tree to a final instantiatedness tree,
> @@ -2199,10 +2212,9 @@
> :- type operation
> ---> lookup(key, data)
> ; set(key, data).
> -:- inst request ==
> - bound( lookup(ground, free)
> - ; set(ground, ground)
> - ).
> +:- inst request
> + ---> lookup(ground, free)
> + ; set(ground, ground).
> :- mode create_request == free >> request.
> :- mode satisfy_request == request >> ground.
> @end example
> @@ -2211,7 +2223,7 @@
> For example, the following declaration
>
> @example
> -:- inst listskel(Inst) == bound( [] ; [Inst | listskel(Inst)] ).
> +:- inst listskel(Inst) ---> [] ; [Inst | listskel(Inst)].
> @end example
>
> @noindent
> @@ -2660,6 +2672,9 @@
> needed on backtracking. This means that unique modes are generally
> only useful for code whose determinism is @samp{det} or @samp{cc_multi}
> (@pxref{Determinism}).
> +
> +Unlike @samp{bound} instantiatedness trees, there is no alternative
> +syntax for @samp{unique} instantiatedness trees.
>
> @node Backtrackable destructive update
> @section Backtrackable destructive update
> --------------------------------------------------------------------------
> mercury-reviews mailing list
> post: mercury-reviews at cs.mu.oz.au
> administrative address: owner-mercury-reviews at cs.mu.oz.au
> unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
> subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
> --------------------------------------------------------------------------
--
David Overton Uni of Melbourne +61 3 8344 1354
dmo at cs.mu.oz.au Monash Uni (Clayton) +61 3 9905 5779
http://www.cs.mu.oz.au/~dmo Mobile Phone +61 4 0337 4393
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list