Skip to content

Commit e540b11

Browse files
committed
collect-goals for primitive projections
1 parent 1555517 commit e540b11

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Requires Elpi 3.0.0 and Coq 8.20 or Rocq 9.0 or Rocq 9.1.
1212
### APPS:
1313
- New experimental app `rbuild`: build any record with « ... »
1414

15+
### API
16+
- `coq.ltac.collect-goals` now takes the parameters of primitive projections into account
17+
1518
# [2.6.0] 8/7/2025
1619

1720
Requires Elpi 2.0.7 and Coq 8.20 or Rocq 9.0 or Rocq 9.1.

src/rocq_elpi_builtins.ml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3864,16 +3864,21 @@ The order of Goals is given by the traversal order of EConstr.fold (a
38643864
fold_left over the terms, letin body comes before the type).
38653865
|})))),
38663866
(fun proof _ shelved ~depth proof_context constraints state ->
3867+
let env = proof_context.env in
38673868
let sigma = get_sigma state in
38683869
let evars_of_term evd c =
38693870
let rec evrec (acc_set,acc_rev_l as acc) c =
38703871
let c = EConstr.whd_evar evd c in
38713872
match EConstr.kind sigma c with
38723873
| Constr.Evar (n, l) ->
3873-
if Evar.Set.mem n acc_set then SList.Skip.fold evrec acc l
3874-
else
3875-
let acc = Evar.Set.add n acc_set, n :: acc_rev_l in
3876-
SList.Skip.fold evrec acc l
3874+
if Evar.Set.mem n acc_set then acc
3875+
else
3876+
let acc = Evar.Set.add n acc_set, n :: acc_rev_l in
3877+
SList.Skip.fold evrec acc l
3878+
| Constr.Proj (_, _, c) ->
3879+
let t = Retyping.get_type_of env sigma c in
3880+
let acc = evrec acc t in
3881+
evrec acc c
38773882
| _ -> EConstr.fold sigma evrec acc c
38783883
in
38793884
let _, rev_l = evrec (Evar.Set.empty, []) c in

0 commit comments

Comments
 (0)