[mercury-users] Another Mercury Modes Problem

Ralph Becket rafe at cs.mu.OZ.AU
Fri May 31 15:45:34 AEST 2002


Bob McKay, Friday, 31 May 2002:
> 
> Hi Ralph; I'd come to the conclusion I would have to switch to arrays
> for just this reason. Typically, individuals might occupy a few K
> (in my main application, they will be resolution clause sets). I
> expect to need to run populations of a few thousand. So we're likely
> up in the 10s of MB. Assuming that I will need to run for hundreds
> or thousands of generations, then destructive update of this main
> data structure is going to be crucial.

But surely only the current generation will be live data at any point?
In which case previous generations will be garbage collected.

> However I had decided to try to get the module structure right first,
> before I switched representations. The underlying issue, that I will
> need parametric modes, is still there I think. But perhaps I should
> go the other way, switch to arrays first, then try to fix up the
> module structure. Maybe some of the built-in array modes will solve
> the problem for me (I haven't really looked at the arrays library
> yet).

It's usually a mistake to concentrate on representation before
abstraction.  One can usually refine an abstraction to suit practical
considerations, but adapting a concrete representation to an as-yet
uncertain abstraction is unlikely to work.

> The underlying issue, though, seems to be an important one for
> Mercury: I can't really see the point of having parametric types
> and parametric insts if you can't have parametric modes, or at least
> not parametric ones that involve unique or ground. Or am I
> missing something here?

Mercury has parametric modes - e.g. in(I), out(I) etc.

I strongly advise you to work on your abstraction at the in/out level of
data flow before worrying about uniqueness and refined insts - for your
problem the latter are definitely implementation considerations and, as
you say, you haven't got the abstraction fully worked out yet.

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