[mercury-users] Uniqueness modes etc

Dr Mark H Phillips mark at austrics.com.au
Thu Jan 8 15:59:18 AEDT 2004


On Thu, 2004-01-08 at 14:19, Zoltan Somogyi wrote:
> > By the way, should those T's actually be T0, T1, T2 and T3?
> 
> Not in my example. T represents the type of the state. The predicate
> `generic' doesn't know what type that is, but it must be one type,
> otherwise the output of the pred you pass in won't be acceptable as its input.

Yes sorry, I mistakenly thought T was the parameter itself.

> I do not know what you mean, since I don't know what criterion you use
> to distinguish appropriate from inappropriate.

My recent reply to Fergus hopefully illustrates better what I am
getting at.

> Note that absolute information hiding is not feasible, since the generic
> predicate may call C code that has access to the entire address space
> of the process.

Useful to know, thanks.  Does calling C code render the predicate
"impure"?

> > How can the use of mutvar hide the fact that state is changing?  I
> > thought you still needed to pass the store in and out?
> 
> You can use the I/O state as a store, so the generic code wouldn't
> know whether you are changing any state other than the I/O state.
> 
> > Why do you strongly advise against this approach?  What are the
> > negatives?
> 
> I advise against it precisely because it hides whether you are doing
> I/O or some other kind of state change.

I'm not sure I understand what you're saying here.  I would have 
thought that the generic code you outlined previously doesn't know
whether it's doing I/O or state transition in any case.  Perhaps 
you are saying there is a way of specifying that the parameter 
type T in the generic pred is not allowed to be a store?

Cheers,

Mark.


--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list