[m-dev.] TypeClassInfo var being reported in error message

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Apr 23 17:47:30 AEST 2008


On Wed, 23 Apr 2008, Mark Brown wrote:

> On 23-Apr-2008, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
>> I'm getting the following error with some code of Jakob's I'm adjusting:
>>
>> flatzinc_colgen_solver.m:1008: Error: the `promise_equivalent_solutions' goal
>> flatzinc_colgen_solver.m:1008:   binds a variable that is not listed:
>> flatzinc_colgen_solver.m:1008:   TypeClassInfo_for_flatzinc_solver.
>> flatzinc_colgen_solver.m:1015: In clause for `fcb_post_constraint(in, in, ia,
>> flatzinc_colgen_solver.m:1015:   ia, di, uo)':
>> flatzinc_colgen_solver.m:1015:   in argument 5 of call to predicate
>> flatzinc_colgen_solver.m:1015:   `flatzinc_solver.post_constraint'/6:
>> flatzinc_colgen_solver.m:1015:   mode error: variable `STATE_VARIABLE_PQ_0' has
>> flatzinc_colgen_solver.m:1015:   instantiatedness `mostly_unique',
>> flatzinc_colgen_solver.m:1015:   expected instantiatedness was `unique'.
>>
>> The mostly_unique complaint is the problem I'm trying to address.  The
>> fix (I think) is to add the following promise_equivalent_solutions
>> scope:
>>
>>             (
>>                 promise_equivalent_solutions [SPSolver, SPVarMap] (
>>                     search(SPSolvers, SPID,
>>                         sp_solver_instance(SPSolver, _, SPVarMap, _))
>>                 )
>>             ->
>>                 fcb_vars_to_sp_vars(SPSolver, SPVarMap, Vars, SPVars),
>>                 fcb_anns_to_sp_anns(SPSolver, SPVarMap, Anns, SPAnns),
>>                 flatzinc_solver.post_constraint(SPSolver, CName, SPVars,
>>                     SPAnns, !PQ)
>>             ;
>>                 throw("post_constraint: No subproblem solver for SPID")
>>             )
>>
>> As I understand it, I shouldn't be seeing any mention of
>> TypeClassInfo_for_flatzinc_solver in an error message.  What to do?
>
> I think you should report this as a Mercury bug.  The compiler should ignore
> the introduced variables for the purposes of this error check.

The problem is the code around det_report.m:1570.  The list of variables
being bound in the scope needs to be filtered so it doesn't include
any type-info related variables.  (The latter may be produced by calls
to procedures tha are existentially typed.)

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