Skip to content

Commit 6a48660

Browse files
proux01gares
authored andcommitted
Do not spill predicated defined later
1 parent 3b54647 commit 6a48660

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

HB/common/database.elpi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ assert-building-bottom-up CurrentClass C3n C1n C2n :-
233233
CurrentClass = class CC _ _,
234234
if (not (sub-class? CurrentClass (class C3n X Y)))
235235
(gref->modname CC 1 "." Before, gref->modname_short C3n "." After,
236+
gref->modname_short C1n "." C1nS, gref->modname_short C2n "." C2nS,
236237
Msg1 is "- declare structure " ^ Before ^ " before structure " ^ After ^ " if " ^ After ^ " inherits from it;",
237238
Msg2 is "- declare an additional structure that inherits from both "
238-
^ {gref->modname_short C1n "."} ^ " and " ^ {gref->modname_short C2n "."}
239+
^ C1nS ^ " and " ^ C2nS
239240
^ " and from which " ^ Before ^ " and/or " ^ After ^ " inherit.",
240241
coq.error "You must declare the hierarchy bottom-up or addd a missing join."
241242
"There are two ways out:"

HB/factory.elpi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ cdecl->w-mixins.mixins (context-item ID _ TySkel none Rest) Out :- !,
166166
% The identity builder
167167
pred declare-id-builder i:factoryname, o:prop.
168168
declare-id-builder GR (from GR GR (const C)) :- std.do! [
169-
synthesis.mixins-w-params.fun {gref-deps GR} (declare-id-builder.aux GR) IDBodySkel,
169+
gref-deps GR GRD,
170+
synthesis.mixins-w-params.fun GRD (declare-id-builder.aux GR) IDBodySkel,
170171
std.assert-ok! (coq.elaborate-skeleton IDBodySkel IDType IDBody) "identity builder illtyped",
171172
log.coq.env.add-const-noimplicits "identity_builder" IDBody IDType @transparent! C,
172173
].
@@ -281,7 +282,9 @@ declare-mixin-or-factory MixinSrcClauses SectionCanonicalInstance
281282
]] NewClauses,
282283
acc-clauses current NewClauses,
283284

284-
std.map {list-w-params_list MLwP} (_\ r\ r = maximal) Implicits,
285+
list-w-params_list MLwP MLwoP,
286+
std.map MLwoP (_\ r\ r = maximal) Implicits,
287+
/* std.map {list-w-params_list MLwP} (_\ r\ r = maximal) Implicits, */
285288
@global! => log.coq.arguments.set-implicit GRK [[maximal|Implicits]],
286289
% @global! => log.coq.coercion.declare FactorySortCoe,
287290

HB/howto.elpi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ pred list_factories o:list factory_deps_prov.
100100
list_factories FL :-
101101
std.map-filter {std.findall (factory-constructor _ _)} list_factories.aux FL.
102102
list_factories.aux (factory-constructor F _) (fdp F DML PML) :-
103-
list-w-params_list {gref-deps F} DML,
103+
gref-deps F FD,
104+
list-w-params_list FD DML,
104105
list-w-params_list {factory-provides F} PML.
105106

106107
% [paths-from-for-step MLSrc ML K R] returns in [R] a list of sequences

HB/structure.elpi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ export-1-operation M Struct Psort Pclass MwP (some Poperation) EXI EXO :- !, std
275275

276276
w-params.nparams MwP NP,
277277
NImplicits is NP + 1,
278-
std.map {std.iota NImplicits} (_\r\ r = maximal) Implicits,
278+
std.iota NImplicits INI,
279+
std.map INI (_\r\ r = maximal) Implicits,
279280
@global! => log.coq.arguments.set-implicit (const C) [Implicits],
280281

281282
EXO = [exported-op M Poperation C|EXI]
@@ -315,8 +316,9 @@ mk-coe-class-body FC TC TMLwP Params T _ CoeBody :- std.do! [
315316
std.map TML (from FC) Builders,
316317
std.map Builders (x\r\mk-app (global x) Params r) BuildersP,
317318

319+
factory-nparams TC TCNP,
318320
mk-app (global {get-constructor TC})
319-
{coq.mk-n-holes {factory-nparams TC}} KCHoles,
321+
{coq.mk-n-holes TCNP} KCHoles,
320322

321323
(pi c\ sigma Mixes\
322324
std.map BuildersP (builder\r\ r = app[builder, T, c]) Mixes,
@@ -343,8 +345,9 @@ mk-coe-structure-body StructureF StructureT TC Coercion SortProjection ClassProj
343345
mk-app ClassProjection Params ClassP,
344346
mk-app Coercion Params CoercionP,
345347

348+
factory-nparams TC TCNP,
346349
mk-app (global {get-constructor StructureT})
347-
{coq.mk-n-holes {factory-nparams TC}} PackPH,
350+
{coq.mk-n-holes TCNP} PackPH,
348351

349352
SCoeBody = {{ fun s : lp:StructureP =>
350353
(* let T := lp:SortP s in*)
@@ -582,7 +585,8 @@ mc-compat-structure ModuleName _Module NewMixins CNParams ClassProjection GRPack
582585

583586
if (NewMixins = [NewMixin]) (std.do! [
584587
if-verbose (coq.say "mc-compat-structure: declaring notations 'axioms', 'mixin_of' and 'Mixin'"),
585-
MArgs is {factory-nparams NewMixin} + 1,
588+
factory-nparams NewMixin NewMixinNP,
589+
MArgs is NewMixinNP + 1,
586590
mk-eta MArgs {coq.env.typeof NewMixin} (global NewMixin) EtaNewMixin,
587591
@global! => log.coq.notation.add-abbreviation "axioms" MArgs EtaNewMixin ff _,
588592
@deprecated! "mathcomp 2.0.0" "use the factory instead" =>

0 commit comments

Comments
 (0)