[m-rev.] for review: drop support for automatic solver type initialisation

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Oct 31 14:49:03 AEDT 2007


On Wed, 31 Oct 2007, Ralph Becket wrote:

> This all looks good.  I have only two comments:
>
> Julien Fischer, Wednesday, 31 October 2007:
>>
>> For review by Ralph.
>>
>> Estimated hours taken: 10
>> Branches: main
>>
>> Remove support for automatic initialisation of solver types from the
>> language.
>> This is being done because:
>>
>> * the current implementation of automatic initialisation means we cannot
>>   support polymorphic solver types, e.g. you cannot have the type foo(bar)
>>   where:
>>   		:- solver type foo(T).
>> 		:- solver type bar.
>
> It occurs to me that we also need a solver_type type class:
>
> 	:- typeclass solver_type(T) where [
> 		pred new_solver_var(T::oa) is det
> 	].
>
> Then I can write something like
>
> 	:- instance solver_type(foo(T)) <= solver_type(T) where [
> 		( new_solver_var(foo(X)) :-
> 			new_solver_var(X)
> 		)
> 	].

Maybe, but certainly not as part of this change :-)

>> Index: compiler/type_util.m
>> ===================================================================
>> RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_util.m,v
>> retrieving revision 1.184
>> diff -u -r1.184 type_util.m
>> --- compiler/type_util.m	2 Oct 2007 04:32:49 -0000	1.184
>> +++ compiler/type_util.m	30 Oct 2007 14:48:58 -0000
>> @@ -97,6 +97,12 @@
>>  :- pred type_body_has_solver_type_details(module_info::in,
>>      hlds_type_body::in, solver_type_details::out) is semidet.
>>
>> +    % Succeeds if this type is a solver type that has an initialisation
>> +    % predicate specified by the user.
>> +    %
>
> You might want to change that to "specified by the user in the solver
> type definition".

Done.

Updates the to NEWS file, remaining solver type test cases etc, will be made as
the second part of this change, in about a week.

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



More information about the reviews mailing list