[m-rev.] Extended inst syntax documentation

Ralph Becket rafe at cs.mu.OZ.AU
Wed Feb 12 11:46:19 AEDT 2003


Estimated hours taken: 0.5
Branches: main

doc/reference_manual.texi:
	Mention the `_ ---> _ ; ...' alternative syntax
	for `_ == bound(_ ; ...)' in inst definitions.

Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.269
diff -u -r1.269 reference_manual.texi
--- doc/reference_manual.texi	9 Feb 2003 08:09:53 -0000	1.269
+++ doc/reference_manual.texi	12 Feb 2003 00:39:59 -0000
@@ -2150,6 +2150,19 @@
 The shape of these trees is determined by
 the type of the variable to which they apply.
 
+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
+
 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
--------------------------------------------------------------------------



More information about the reviews mailing list