Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix roots in solution2evd #614

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/coq_elpi_HOAS.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2570,10 +2570,13 @@ let reachable sigma roots acc =
prlist_with_sep spc Evar.print (Evar.Set.elements res));
res

let compute_roots sigma0 roots =
Evd.fold (fun k _ acc -> Evar.Set.add k acc) sigma0 roots

let solution2evd ~eta_contract_solution sigma0 { API.Data.constraints; assignments; state; pp_ctx } roots =
let state, solved_goals, _, _gls = elpi_solution_to_coq_solution ~eta_contract_solution ~calldepth:0 constraints state in
let sigma = get_sigma state in
let roots = Evd.fold_undefined (fun k _ acc -> Evar.Set.add k acc) sigma0 roots in
let roots = compute_roots sigma0 roots in
let reachable_undefined_evars = reachable sigma roots Evar.Set.empty in
let declared_goals, shelved_goals =
get_declared_goals (Evar.Set.diff reachable_undefined_evars solved_goals) constraints state assignments pp_ctx in
Expand Down
Loading