@@ -191,72 +191,6 @@ decl-const-in-struct Name S STy CS:- std.do![
191191 if-verbose (coq.say {header} "structure instance" Name "declared"),
192192].
193193
194-
195- pred declare-factory-sort-deps i:gref.
196- declare-factory-sort-deps GR :- std.do! [
197- if-verbose (coq.say {header} "required instances on factory sort for" GR),
198- Name is "SortInstances" ^ {std.any->string {new_int}},
199- log.coq.env.begin-module Name none,
200- log.coq.env.begin-section Name,
201- mk-factory-sort-deps GR CSL,
202- log.coq.env.end-section-name Name,
203- log.coq.env.end-module-name Name _,
204- std.forall CSL (x\ sigma CS\ x = pr _ CS, log.coq.CS.declare-instance CS)
205- ].
206-
207- pred declare-factory-sort-factory i:gref.
208- declare-factory-sort-factory GR :- std.do! [
209- if-verbose (coq.say {header} "required instances on factory sort for" GR),
210- Name is "SortInstances" ^ {std.any->string {new_int}},
211- log.coq.env.begin-module Name none,
212- log.coq.env.begin-section Name,
213- mk-factory-sort-factory GR CFL CSL,
214- log.coq.env.end-section-name Name,
215- log.coq.env.end-module-name Name _,
216- std.forall {std.append CFL CSL} (x\ sigma CS\ x = pr _ CS, log.coq.CS.declare-instance CS)
217- ].
218-
219- pred context.declare i:factories, o:mixins, o:list term, o:term, o:list prop, o:list constant.
220-
221- pred mk-factory-sort-deps i:gref, o:list (pair id constant).
222- mk-factory-sort-deps AliasGR CSL :- std.do! [
223- std.assert-ok! (factory-alias->gref AliasGR GR) "HB: mk-factory-sort-deps",
224- gref-deps GR MLwPRaw,
225- context.declare MLwPRaw MLwP SortParams SortKey SortMSL _,
226- SortMSL => synthesis.infer-all-gref-deps SortParams SortKey GR FSort,
227- log.coq.env.add-section-variable-noimplicits "f" FSort CF,
228- GCF = global (const CF),
229- factory-sort (coercion GRFSort _ GR _),
230- SortMSL => synthesis.infer-all-gref-deps SortParams SortKey GRFSort KSort,
231- coq.mk-app KSort [GCF] KFSortEta,
232- list-w-params_list MLwP ML,
233- std.length ML NMLArgs,
234- coq.mk-n-holes NMLArgs SortMLHoles,
235- std.append {std.append SortParams [SortKey|SortMLHoles]} [GCF] KFSortArgs,
236- coq.mk-app (global GRFSort) KFSortArgs KFSort,
237- std.assert-ok! (coq.unify-eq KFSortEta KFSort) "HB: KRSort not an app",
238- std.map SortMSL
239- (c\ o\ sigma m t\ c = mixin-src _ m t, o = mixin-src KFSort m t)
240- KFSortMSL,
241- KFSortMSL =>
242- synthesis.under-mixin-src-from-factory.do! KFSort GCF
243- [declare-all KFSort {findall-classes-for ML} CSL]
244- ].
245-
246- pred mk-factory-sort-factory i:gref, o:list (pair id constant), o:list (pair id constant).
247- mk-factory-sort-factory AliasGR CFL CSL :- std.do! [
248- std.assert-ok! (factory-alias->gref AliasGR GR) "HB",
249- gref-deps GR MLwPRaw,
250- context.declare MLwPRaw MLwP SortParams SortKey SortMSL _,
251- SortMSL => synthesis.infer-all-gref-deps SortParams SortKey GR FSort,
252- log.coq.env.add-section-variable-noimplicits "f" FSort CF,
253- std.length {list-w-params_list MLwP} NMLArgs,
254- coq.mk-n-holes NMLArgs SortMLHoles,
255- GCF = global (const CF),
256- coq.mk-app (global GR) {std.append SortParams [GCF|SortMLHoles]} FGCF,
257- declare-const "_" GCF (arity FGCF) CFL CSL
258- ].
259-
260194% create instances for all possible combinations of types and structure compatible
261195pred saturate-instances i:cs-pattern.
262196saturate-instances Filter :- std.do! [
0 commit comments