[m-dev.] Resources example

Ian MacLarty maclarty at cs.mu.OZ.AU
Tue Apr 26 18:10:55 AEST 2005

On 26 Apr 2005, at 14:27, Ian MacLarty wrote:

> It sounds like a good idea to me to have two versions of predicates 
> that put constraints on solver_type variables - one version that the 
> user sees which has solver_type arguments and one version that the 
> implementor of the constraint solver sees where the solver_type 
> arguments have their representation types.
> I propose extending this concept so that in addition to having 
> representation argument types, the implementor version also has two 
> extra arguments on the end -- representing the state of the solver 
> before and after the constraint is added.  This would present a pure 
> interface to both the implementor and the user without the need for 
> the seperate concept of resources.  When declaring the solve_type 
> you'd need to also declare the type of the constraint solver state, 
> but I think that's probably a good thing.  The compiler could then put 
> in all the impure code to convert the solver type arguments to their 
> representations and retrieve the solver state from a global variable.

This would also make debugging of code involving solver types easier.  
Since the compiler would be aware of the constraints store, it would be 
possible to have a "print constraints" command in mdb which would print 
the constraint store for a particular solver_type.  We could also 
display any changes to the constraint store in the declarative 


mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list