@@ -87,16 +87,18 @@ declare-const Name BodySkel TyWPSkel CSL :- std.do! [
87
87
% regular instance %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88
88
if (get-option "wrapper" ff ; not(is-subject-lifter TheType _ _))
89
89
% 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)
91
91
% wrapper %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92
- (private.declare-wrapper-inst TheType ML TheMixins TyWP SectionName CSL)
92
+ (private.declare-wrapper-inst TheType ML TheMixins TyWP SectionName ClausesHas CSL)
93
93
,
94
94
95
95
% shared to all branches
96
96
if (get-option "export" tt)
97
97
(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,
100
102
]),
101
103
102
104
% we accumulate clauses now that the section is over
@@ -416,13 +418,13 @@ declare-mixins-from-factory Factory T F ML TheMixins :- std.do! [
416
418
417
419
% [declare-structure-instance-from-mixins T ML MLI] given mixins ML and
418
420
% 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! [
421
423
% The order of the following two "under...do!" is crucial,
422
424
% priority must be given to canonical mixins
423
425
% as they are the ones which guarantee forgetful inheritance
424
426
% 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 [
426
428
synthesis.under-local-canonical-mixins-of.do! T [
427
429
instance.declare-all T {findall-classes-for ML} CL,
428
430
]
@@ -436,9 +438,9 @@ close-section-if-has-params _ SectionName :-
436
438
log.coq.env.end-section-name SectionName.
437
439
438
440
pred 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,
442
444
443
445
% TODO: share between the two cases and put just after declare-mixins-from-factory
444
446
% since it talks about the unwrapped mixins
@@ -450,13 +452,13 @@ declare-regular-inst TheType ML TheMixins TyWP SectionName CSL :- std.do![
450
452
].
451
453
452
454
pred 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![
455
457
coq.safe-dest-app TheType TheTypeKey _,
456
458
std.assert! (TheTypeKey = global TheTypeKeyGR) "The subject to be wrapped has no key",
457
459
private.close-section-if-has-params TyWP SectionName,
458
460
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,
460
462
].
461
463
462
464
pred derive-wrapper-instances i:term, i:mixinname, o:term, o:constant.
0 commit comments