% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0 % % rotd-2007-11-27 emits the following error message for this program: % % equiv_solns_ia.m:043: Error: the `promise_equivalent_solutions' goal lists % equiv_solns_ia.m:043: some extra variables: SolveSpec, SolverAnns % equiv_solns_ia.m:043: and AllVars. :- module equiv_solns_ia. :- interface. :- import_module list. :- typeclass flatzinc_solver(Solver, Var) <= (Solver -> Var) where [ pred solve_for_vars(Solver::in, solve_spec(Var)::ia, solver_annotations(Var)::ia, list(Var)::ia) is nondet ]. :- type solve_spec(Var) ---> satisfy ; minimize(Var) ; maximize(Var). :- type solver_annotations(Var) == list(solver_annotation(Var)). :- type solver_annotation(Var) ---> solver_annotation(list(Var)). :- type env(Var) == list({int, Var}). :- implementation. :- import_module exception. :- pred interpret(Solver::in) is det <= flatzinc_solver(Solver, Var). interpret(Solver) :- SolveSpec = satisfy, SolverAnns = [], AllVars = [], promise_pure ( if promise_equivalent_solutions [SolveSpec, SolverAnns, AllVars] ( solve_for_vars(Solver, SolveSpec, SolverAnns, AllVars) ) then true else throw("") ).