@@ -87,16 +87,18 @@ declare-const Name BodySkel TyWPSkel CSL :- std.do! [
8787 % regular instance %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8888 if (get-option "wrapper" ff ; not(is-subject-lifter TheType _ _))
8989 % regular subject %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90- (private.declare-regular-inst TheType ML TheMixins TyWP SectionName CSL)
90+ (private.declare-regular-inst TheType ML TheMixins TyWP SectionName ClausesHas CSL)
9191 % wrapper %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92- (private.declare-wrapper-inst TheType ML TheMixins TyWP SectionName CSL)
92+ (private.declare-wrapper-inst TheType ML TheMixins TyWP SectionName ClausesHas CSL)
9393 ,
9494
9595 % shared to all branches
9696 if (get-option "export" tt)
9797 (coq.env.current-library File,
98- std.map CSL (x\r\ sigma i c\ x = pr i c, r = instance-to-export File i c) Clauses)
99- (Clauses = []),
98+ std.map CSL (x\r\ sigma i c\ x = pr i c, r = instance-to-export File i c) ClausesExp)
99+ (ClausesExp = []),
100+
101+ std.append ClausesHas ClausesExp Clauses,
100102 ]),
101103
102104 % we accumulate clauses now that the section is over
@@ -416,13 +418,13 @@ declare-mixins-from-factory Factory T F ML TheMixins :- std.do! [
416418
417419% [declare-structure-instance-from-mixins T ML MLI] given mixins ML and
418420% their implementation MLI declares all structure instances for T
419- pred declare-structure-instance-from-mixins i:term, i:list mixinname, i:list constant, o:list (pair id constant).
420- declare-structure-instance-from-mixins T ML TheMixins CL :- std.do! [
421+ pred declare-structure-instance-from-mixins i:term, i:list mixinname, i:list constant, o:list prop, o:list (pair id constant).
422+ declare-structure-instance-from-mixins T ML TheMixins ClausesHas CL :- std.do! [
421423 % The order of the following two "under...do!" is crucial,
422424 % priority must be given to canonical mixins
423425 % as they are the ones which guarantee forgetful inheritance
424426 % hence we add these clauses last.
425- synthesis.under-these-mixin-src.do! T ML TheMixins [
427+ synthesis.under-these-mixin-src.do! T ML TheMixins ClausesHas [
426428 synthesis.under-local-canonical-mixins-of.do! T [
427429 instance.declare-all T {findall-classes-for ML} CL,
428430 ]
@@ -436,9 +438,9 @@ close-section-if-has-params _ SectionName :-
436438 log.coq.env.end-section-name SectionName.
437439
438440pred declare-regular-inst i:term, i:list mixinname, i:list constant, i:arity, i:id,
439- o:list (pair id constant).
440- declare-regular-inst TheType ML TheMixins TyWP SectionName CSL :- std.do![
441- private.declare-structure-instance-from-mixins TheType ML TheMixins CCSL,
441+ o:list prop, o:list (pair id constant).
442+ declare-regular-inst TheType ML TheMixins TyWP SectionName ClausesHas CSL :- std.do![
443+ private.declare-structure-instance-from-mixins TheType ML TheMixins ClausesHas CCSL,
442444
443445 % TODO: share between the two cases and put just after declare-mixins-from-factory
444446 % since it talks about the unwrapped mixins
@@ -450,13 +452,13 @@ declare-regular-inst TheType ML TheMixins TyWP SectionName CSL :- std.do![
450452].
451453
452454pred declare-wrapper-inst i:term, i:list mixinname, i:list constant, i:arity, i:id,
453- o:list (pair id constant).
454- declare-wrapper-inst TheType ML TheMixins TyWP SectionName CSL :- std.do![
455+ o:list prop, o:list (pair id constant).
456+ declare-wrapper-inst TheType ML TheMixins TyWP SectionName ClausesHas CSL :- std.do![
455457 coq.safe-dest-app TheType TheTypeKey _,
456458 std.assert! (TheTypeKey = global TheTypeKeyGR) "The subject to be wrapped has no key",
457459 private.close-section-if-has-params TyWP SectionName,
458460 private.wrap-mixins TheTypeKeyGR ML TheMixins TheNewType WML TheWrappedMixins,
459- private.declare-structure-instance-from-mixins TheNewType WML TheWrappedMixins CSL,
461+ private.declare-structure-instance-from-mixins TheNewType WML TheWrappedMixins ClausesHas CSL,
460462].
461463
462464pred derive-wrapper-instances i:term, i:mixinname, o:term, o:constant.
0 commit comments