/* when solving a goal in tc, we want to trigger the declared evar only after the proof search. This means that, while the search is performed, we do not risk to assign too early incorrect types (for example with wrong universes). The evar typechecking is triggered after the search, just before refining the proof with the original goal. We use the guard declare-evars-now that to trigger the constraints to reproduce this behavior. */ % pred declare-evar-later i:list prop, i:term, i:term, i:term. % pred declare-evars-now. % constraint declare-evar-later declare-evars-now { % rule declare-evars-now \ (declare-evar-later Ctx RawEv Ty Ev) <=> (declare-evars-now, Ctx => evar RawEv Ty Ev). % rule \ declare-evars-now. % } % declare-evars-now :- % declare_constraint declare-evars-now [_]. % We want to deactivate the evar declaration if coming from the % original goal (the original type class problem to be solved) % :before "default-declare-evar" % :name "tc-solver-declare-evar" % declare-evar Ctx X Ty E :- !, % declare_constraint (declare-evar-later Ctx X Ty E) [_].