[m-rev.] for review: where safe_equality is ...

Simon Taylor stayl at cs.mu.OZ.AU
Tue May 13 00:25:43 AEST 2003


On 12-May-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> For review by Fergus or Simon. Any opinions on whether this capability should
> be documented and made available to users? I would vote yes.
> 
> Zoltan.
> 
> A step towards replacing hand-written unify and compare predicates for builtin
> types with foreign type definitions with "where equality is ..., comparison is
> ..." annotations. The foreign_proc's implementing those unify and compare
> predicates are as safe as compiler-generated predicates.
> 
> compiler/prog_data.m:
> 	Associate with user-defined equality predicates a boolean that says
> 	whether they are safe to treat the same as compiler-generated
> 	unification predicates.
> 
> compiler/det_analysis.m:
> 	Put unifications over types with user-defined equality into committed
> 	choice contexts only if the equality predicate wasn't declared safe.

I don't understand the rationale for this change.
If the hand-defined types are being replaced with foreign types,
it should be impossible to write a unification which examines
their representation, so no unifications of values of those
types should be required to be in committed choice contexts.

Could you give an example of a type for which `safe_equality'
would be necessary?

Simon.
--------------------------------------------------------------------------
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