Skip to content

Fix roots in solution2evd #614

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

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
@@ -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

Unchanged files with check annotations Beta

}}.
#[this, more(stuff="33")] Elpi attr.

Check warning on line 609 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (8.19, 4.14-flambda)

This command does not support these attributes: more, this.

Check warning on line 609 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (8.20, 4.14-flambda)

This command does not support these attributes: more, this.

Check warning on line 609 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (dev, 4.14-flambda)

This command does not support these attributes: more, this.
(*|
}}.
#[this, more(stuff="33")] Elpi parse_attr.

Check warning on line 642 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (8.19, 4.14-flambda)

This command does not support these attributes: more, this.

Check warning on line 642 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (8.20, 4.14-flambda)

This command does not support these attributes: more, this.

Check warning on line 642 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (dev, 4.14-flambda)

This command does not support these attributes: more, this.
Fail #[unknown] Elpi parse_attr. (* .fails *)

Check warning on line 643 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (8.19, 4.14-flambda)

This command does not support this attribute: unknown.

Check warning on line 643 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (8.20, 4.14-flambda)

This command does not support this attribute: unknown.

Check warning on line 643 in examples/tutorial_coq_elpi_command.v

GitHub Actions / build (dev, 4.14-flambda)

This command does not support this attribute: unknown.
(*|
elpi set "x" (P).
unfold x.
Fail elpi set "x" (Q /\ _). (* .fails .in .messages *)
elpi set "x" (P /\ _).

Check warning on line 631 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.19, 4.14-flambda)

x is already taken, Elpi will make a name up

Check warning on line 631 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.20, 4.14-flambda)

x is already taken, Elpi will make a name up

Check warning on line 631 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (dev, 4.14-flambda)

x is already taken, Elpi will make a name up
Abort.
(*|
Elpi Tactic split_ll_bis.
Elpi Accumulate lp:{{
solve (goal Ctx Trigger {{ lp:A /\ lp:B }} Proof []) GL :- !,

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.19, 4.14-flambda)

B is linear: name it _B (discard) or B_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.19, 4.14-flambda)

A is linear: name it _A (discard) or A_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.19, 4.14-flambda)

Ctx is linear: name it _Ctx (discard) or Ctx_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.20, 4.14-flambda)

B is linear: name it _B (discard) or B_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.20, 4.14-flambda)

A is linear: name it _A (discard) or A_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.20, 4.14-flambda)

Ctx is linear: name it _Ctx (discard) or Ctx_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (dev, 4.14-flambda)

B is linear: name it _B (discard) or B_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (dev, 4.14-flambda)

A is linear: name it _A (discard) or A_ (fresh variable)

Check warning on line 741 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (dev, 4.14-flambda)

Ctx is linear: name it _Ctx (discard) or Ctx_ (fresh variable)
% this triggers the elaboration
Trigger = {{ conj _ _ }},
% we only take main goals
same-goal (nabla G1) (nabla G2) :-
% TODO: proof variables could be permuted
pi x\ same-goal (G1 x) (G2 x).
same-goal (seal (goal Ctx1 _ Ty1 P1 _) as G1)

Check warning on line 842 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.19, 4.14-flambda)

G2 is linear: name it _G2 (discard) or G2_ (fresh variable)

Check warning on line 842 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.19, 4.14-flambda)

G1 is linear: name it _G1 (discard) or G1_ (fresh variable)

Check warning on line 842 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.20, 4.14-flambda)

G2 is linear: name it _G2 (discard) or G2_ (fresh variable)

Check warning on line 842 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (8.20, 4.14-flambda)

G1 is linear: name it _G1 (discard) or G1_ (fresh variable)

Check warning on line 842 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (dev, 4.14-flambda)

G2 is linear: name it _G2 (discard) or G2_ (fresh variable)

Check warning on line 842 in examples/tutorial_coq_elpi_tactic.v

GitHub Actions / build (dev, 4.14-flambda)

G1 is linear: name it _G1 (discard) or G1_ (fresh variable)
(seal (goal Ctx2 _ Ty2 P2 _) as G2) :-
same-ctx Ctx1 Ctx2,
% this is an elpi builtin, aka same_term, which does not