Skip to content

Commit d88dd20

Browse files
committed
wip
1 parent d94c19f commit d88dd20

File tree

8 files changed

+78
-1041
lines changed

8 files changed

+78
-1041
lines changed

HB/structure.elpi

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@ declare Module BSkel Sort :- std.do! [
180180
log.coq.env.end-module-name ElpiOperationModName ElpiOperations,
181181
export.module ElpiOperationModName ElpiOperations,
182182

183-
% we need to filter the wrappers out of ML
184-
std.filter ML (x\ wrapper-mixin x _ _) WrapperML,
185183
% we need to assert locally the clauses in EX
186-
EX => std.forall WrapperML private.reexport-wrapper-as-instance,
184+
EX => std.forall ML private.reexport-wrapper-as-instance,
185+
186+
%hack
187+
hack,
187188

188189
if-verbose (coq.say {header} "abbreviation factory-by-classname"),
189190

@@ -196,6 +197,11 @@ declare Module BSkel Sort :- std.do! [
196197
% NewClauses => instance.saturate-instances,
197198
].
198199

200+
pred hack.
201+
hack :- coq.next-synterp-action (begin-section X), coq.env.begin-section X, hack.
202+
hack :- coq.next-synterp-action end-section, coq.env.end-section, hack.
203+
hack.
204+
199205
/* ------------------------------------------------------------------------- */
200206
/* ----------------------------- private code ------------------------------ */
201207
/* ------------------------------------------------------------------------- */
@@ -703,7 +709,7 @@ lift-to-the-subject.aux [factory-on-subject-lifter Expr _ _|_] _ _ :-
703709
% instance.declare-const (notably used in the API, i.e. in structures.v,
704710
% HB.instance)
705711
pred reexport-wrapper-as-instance i:mixinname.
706-
reexport-wrapper-as-instance M :- std.do! [
712+
reexport-wrapper-as-instance M :- wrapper-mixin M _ _, !, std.do! [
707713

708714
% need the body of the wrapper projection type
709715
exported-op M _ C,
@@ -718,5 +724,11 @@ reexport-wrapper-as-instance M :- std.do! [
718724

719725
get-option "wrapper" ff => instance.declare-const Str B Arity _
720726
].
727+
reexport-wrapper-as-instance _ :-
728+
std.assert! (coq.next-synterp-action (begin-section SectionName)) "synterp code did not open section",
729+
coq.env.begin-section SectionName,
730+
std.assert! (coq.next-synterp-action (end-section)) "synterp code did not close section",
731+
coq.env.end-section.
732+
721733

722734
}}

Makefile.coq.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Coq does not know about Elpi Accumulate File, so we declare the dependency here
2-
structures.vo : $(wildcard HB/*.elpi HB/common/*.elpi)
2+
theories/structures.vo : $(wildcard HB/*.elpi HB/common/*.elpi)
33

44
clean::
55
$(SHOW)'CLEAN *.hb *.hb.old'

Makefile.test-suite.coq.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ output_for=`\
77
fi`
88

99
DIFF=\
10-
@if [ -z "$$COQ_ELPI_ATTRIBUTES" ]; then \
10+
if [ -z "$$COQ_ELPI_ATTRIBUTES" ]; then \
1111
echo OUTPUT DIFF $(1);\
1212
$(COQTOP) $(COQFLAGS) $(COQLIBS) -topfile $(1) \
1313
< $(1) 2>/dev/null \

_CoqProject

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
structures.v
1+
theories/structures.v
22
theories/cat.v
33
theories/encatD.v
44
theories/encatI.v
55
-arg -w -arg -elpi.accumulate-syntax
66
-arg -w -arg +elpi.typecheck
7-
-Q . HB
87

98
-R tests HB.tests
109
-R examples HB.examples

_CoqProject.test-suite

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ tests/tag_wrap.v
100100
-R tests HB.tests
101101
-R examples HB.examples
102102

103-
-Q . HB
103+
-R theories HB

tests/hnf.v.out

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ HB_unnamed_mixin_8 =
77
Datatypes_bool__canonical__hnf_S =
88
{| S.sort := bool; S.class := {| S.hnf_M_mixin := hnf_f__to__hnf_M__11 |} |}
99
: S.type
10-
HB_unnamed_mixin_12 =
11-
Builders_1.HB_unnamed_factory_3 bool HB_unnamed_factory_9
12-
: M.axioms_ bool

0 commit comments

Comments
 (0)