Skip to content

Commit 68fe617

Browse files
authored
Merge pull request #876 from Tragicus/collect_goals
Fold with binders in collect-goals
2 parents f9c21c6 + c4443cf commit 68fe617

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

elpi/elpi-ltac.elpi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ open T (nabla G) O :- (pi x\ open T (G x) (NG x)), private.distribute-nabla NG O
8787
open _ (seal (goal _ _ _ Solution _)) [] :- not (var Solution), !. % solved by side effect
8888
open T (seal (goal Ctx _ _ _ _ as G)) O :-
8989
std.filter Ctx private.not-already-assumed Ctx1,
90-
(Ctx1 => T G O),
91-
if (var O)
92-
(G = goal _ _ _ P _, coq.ltac.collect-goals P O1 O2, std.append O1 O2 O)
93-
true.
90+
Ctx1 => (T G O,
91+
if (var O)
92+
(G = goal _ _ _ P _, coq.ltac.collect-goals P O1 O2, std.append O1 O2 O)
93+
true).
9494

9595
% helper code ---------------------------------------------------------------
9696

@@ -127,4 +127,4 @@ func not-already-assumed prop.
127127
not-already-assumed (decl X _ _Ty) :- not(decl X _ _ ; def X _ _ _).
128128
not-already-assumed (def X _ _Ty _Bo) :- not(decl X _ _ ; def X _ _ _).
129129

130-
}}
130+
}}

src/rocq_elpi_builtins.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3896,24 +3896,24 @@ fold_left over the terms, letin body comes before the type).
38963896
(fun proof _ shelved ~depth proof_context constraints state ->
38973897
let env = proof_context.env in
38983898
let sigma = get_sigma state in
3899-
let evars_of_term evd c =
3900-
let rec evrec (acc_set,acc_rev_l as acc) c =
3901-
let c = EConstr.whd_evar evd c in
3899+
let evars_of_term c =
3900+
let rec evrec env (acc_set,acc_rev_l as acc) c =
39023901
match EConstr.kind sigma c with
39033902
| Constr.Evar (n, l) ->
3904-
if Evar.Set.mem n acc_set then acc
3903+
if Evar.Set.mem n acc_set then
3904+
acc
39053905
else
39063906
let acc = Evar.Set.add n acc_set, n :: acc_rev_l in
3907-
SList.Skip.fold evrec acc l
3907+
SList.Skip.fold (evrec env) acc l
39083908
| Constr.Proj (_, _, c) ->
39093909
let t = Retyping.get_type_of env sigma c in
3910-
let acc = evrec acc t in
3911-
evrec acc c
3912-
| _ -> EConstr.fold sigma evrec acc c
3910+
let acc = evrec env acc t in
3911+
evrec env acc c
3912+
| _ -> Termops.fold_constr_with_full_binders env sigma EConstr.push_rel evrec env acc c
39133913
in
3914-
let _, rev_l = evrec (Evar.Set.empty, []) c in
3914+
let _, rev_l = evrec env (Evar.Set.empty, []) c in
39153915
List.rev rev_l in
3916-
let subgoals = evars_of_term sigma proof in
3916+
let subgoals = evars_of_term proof in
39173917
let free_evars =
39183918
let cache = Evarutil.create_undefined_evars_cache () in
39193919
let map ev =

0 commit comments

Comments
 (0)