[m-dev.] proposal: drop automatic initialisation of solver types

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Oct 29 18:54:49 AEDT 2007


On Fri, 26 Oct 2007, Julien Fischer wrote:

> There has been an on-and-off discussion about removing support for automatic
> initialisation for solver types.
>
> Automatic initialisation is problematic because:
>
> * it prevents solver types from being properly polymorphic, e.g.
>  you cannot have the type foo(bar) where:
>
> 	:- solver type foo(T).
> 	:- solver type bar.
>
> * the introduction of calls to the initialisation predicates complicates
>  mode analysis.  Also, the compiler doesn't do a very good job of
>  introducing them anyway: the introduction of the calls can change det
>  code into semidet code etc.
>
> * we don't use automatic intialisation in practice anyway.  The solver
>  types in G12 all require (or we recommend) using explicit
>  initialisation predicates.
>
> * mode error messages are often poor or misleading because of
>  interactions between automatic initialisation and impure code.
>
> In light of this, I propose that we drop support for automatic
> initialisation.

Having discussed this with various people, here is the course of
action I intend to take on this:

Remove support for automatic initialisation from the language completely,
i.e. solver type definitions will not support a `where intialisation is'
bit.  (As a transitional measure, `where initialisation is' will be
ignored rather than result in a syntax error.)

The machinery in the compiler for supporting automatic initialisation
predicates will *not* be removed, it will instead be made dependent
upon a developer-only command line option.

If we need to support automatic initialisation in the future, we
can support two versions of solver types: one that has automatic
initialisation and another that doesn't.

I will go ahead and make this change sometime in the next few days.

Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list