[mercury-users] Request for comments on this code

Ian MacLarty maclarty at csse.unimelb.edu.au
Wed Jul 12 14:41:21 AEST 2006


On Wed, Jul 12, 2006 at 10:55:40AM +1000, Ralph Becket wrote:
> Ian MacLarty, Tuesday, 11 July 2006:
> > On Tue, Jul 11, 2006 at 03:46:35PM +1000, Ralph Becket wrote:
> > > Here's my two worms' worth:
> > > 
> > > I've always assumed that the IO state corresponded to a representation
> > > of part of the world, including parts of the state of the computer
> > > running the computation.
> > > 
> > > When an IO operation is invoked, the universe gets to manipulate the IO
> > > state just before and just after the IO operation is carried out.
> > > 
> > > That is, when I write
> > > 
> > > 	io.print(..., !IO),
> > > 
> > > what really happens is
> > > 
> > > 	universe_gets_a_turn(!IO),
> > > 	io.print(..., !IO),
> > > 	universe_gets_a_turn(!IO),
> > > 
> > > What the universe does, however, is cc_multi (i.e., for any IO state
> > > there are many possible successor IO states, but we only get one of
> > > them and we can't backtrack.)
> > > 
> > 
> > Does the one that gets chosen happen to be the IO state that's fed as
> > input to the next IO primitive?
> 
> Yes.
> 
> > If so then I think your understanding
> > is quite similar to mine, except you view it as cc_multi and I view it as
> > deterministic.
> 
> I don't view it as morally deterministic because, under this reading,
> IO operations cannot implement functional relationships between IO
> states.
> 
> > > Is there a problem with this view (i.e., IO is really cc_multi, but we
> > > actually lose something if we don't pretend it's det)?
> > 
> > I don't think so, since a particular IO state exists only once, so you
> > can always only get one resulting IO state from calling an IO primitive,
> > effectively making the operation det.
> 
> I don't follow you here.

Sorry I misread what you said above.  I thought you were saying we
don't loose anything by pretending it's det.  I was merely saying I
don't think it makes any difference in practice whether you think of it
as cc_multi or det.

Ian.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at csse.unimelb.edu.au
administrative address: owner-mercury-users at csse.unimelb.edu.au
unsubscribe: Address: mercury-users-request at csse.unimelb.edu.au Message: unsubscribe
subscribe:   Address: mercury-users-request at csse.unimelb.edu.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list