[m-rev.] for review: promise scopes (part 1)

Ralph Becket rafe at cs.mu.OZ.AU
Mon Mar 21 17:30:23 AEDT 2005


Zoltan Somogyi, Monday, 21 March 2005:
> For review by Ralph. I would like feedback on the reference manual
> in particular.
> 
> Zoltan.
> 
> Replace the some() HLDS goal with a more general scope() goal, which can be
> used not just for existential quantification but also for other purposes.
> 
> The main such purposes are new goal types that allow the programmer
> to annotate arbitrary goals, and not just whole procedure bodies, with the
> equivalents of promise_pure/promise_semipure and promise_only_solution:
> 
> 	promise_pure ( <impure/semipure goal> )
> 	promise_semipure ( <impure goal> )
> 
> 	promise_equivalent_solution [OutVar1, OutVar2] (
> 		<cc_multi/cc_nondet goal that computed OutVar1 & OutVar2>
> 	)
> 
> Both are intended to be helpful in writing constraint solvers, as well as in
> other situations.

The solver implementors have long been asking for a way to avoid putting
impure and semipure annotations all over the code that currently needs
them.

Julien and I are of the opinion that inside a promise_[semi]pure scope,
the annotations should be optional and that adding extra scopes with
names like promise_pure_with_implicit_annotations would be overkill.

If there are no strong opinions to the contrary, I plan to make the
corresponding changes to purity.m in the near future.

-- Ralph
--------------------------------------------------------------------------
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