Skip to content

Commit a2b302e

Browse files
authored
Merge branch 'master' into fix-HOAS-primproj
2 parents 45c4699 + 84cd737 commit a2b302e

File tree

93 files changed

+4307
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4307
-481
lines changed

.github/workflows/nix-action-coq-8.19.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ jobs:
314314
- coq
315315
- mathcomp-classical
316316
- mathcomp-field
317+
- mathcomp-bigenough
317318
- hierarchy-builder
318319
runs-on: ubuntu-latest
319320
steps:
@@ -368,6 +369,10 @@ jobs:
368369
name: 'Building/fetching previous CI target: mathcomp-field'
369370
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
370371
--argstr job "mathcomp-field"
372+
- if: steps.stepCheck.outputs.status == 'built'
373+
name: 'Building/fetching previous CI target: mathcomp-bigenough'
374+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
375+
--argstr job "mathcomp-bigenough"
371376
- if: steps.stepCheck.outputs.status == 'built'
372377
name: 'Building/fetching previous CI target: hierarchy-builder'
373378
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
@@ -376,6 +381,63 @@ jobs:
376381
name: Building/fetching current CI target
377382
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
378383
--argstr job "mathcomp-analysis"
384+
mathcomp-bigenough:
385+
needs:
386+
- coq
387+
- mathcomp-ssreflect
388+
runs-on: ubuntu-latest
389+
steps:
390+
- name: Determine which commit to initially checkout
391+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
392+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
393+
\ }}\" >> $GITHUB_ENV\nfi\n"
394+
- name: Git checkout
395+
uses: actions/checkout@v3
396+
with:
397+
fetch-depth: 0
398+
ref: ${{ env.target_commit }}
399+
- name: Determine which commit to test
400+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
401+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
402+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
403+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
404+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
405+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
406+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
407+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
408+
- name: Git checkout
409+
uses: actions/checkout@v3
410+
with:
411+
fetch-depth: 0
412+
ref: ${{ env.tested_commit }}
413+
- name: Cachix install
414+
uses: cachix/install-nix-action@v20
415+
with:
416+
nix_path: nixpkgs=channel:nixpkgs-unstable
417+
- name: Cachix setup coq-elpi
418+
uses: cachix/cachix-action@v12
419+
with:
420+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
421+
extraPullNames: coq, coq-community, math-comp
422+
name: coq-elpi
423+
- id: stepCheck
424+
name: Checking presence of CI target mathcomp-bigenough
425+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
426+
\ bundle \"coq-8.19\" --argstr job \"mathcomp-bigenough\" \\\n --dry-run\
427+
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
428+
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
429+
- if: steps.stepCheck.outputs.status == 'built'
430+
name: 'Building/fetching previous CI target: coq'
431+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
432+
--argstr job "coq"
433+
- if: steps.stepCheck.outputs.status == 'built'
434+
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
435+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
436+
--argstr job "mathcomp-ssreflect"
437+
- if: steps.stepCheck.outputs.status == 'built'
438+
name: Building/fetching current CI target
439+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
440+
--argstr job "mathcomp-bigenough"
379441
mathcomp-character:
380442
needs:
381443
- coq

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ META
4848
apps/coercion/src/coq_elpi_coercion_hook.ml
4949
.filestoinstall
5050
apps/tc/src/coq_elpi_tc_hook.ml
51+
apps/cs/src/coq_elpi_cs_hook.ml

.nix/config.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
odd-order.override.version = "master";
1717
odd-order.job = true;
1818

19-
mathcomp-analysis.override.version = "hierarchy-builder";
19+
mathcomp-analysis.override.version = "master";
2020
mathcomp-analysis.job = true;
2121

2222
mathcomp-finmap.override.version = "master";
2323
mathcomp-finmap.job = true;
2424

25-
mathcomp-classical.override.version = "hierarchy-builder";
25+
mathcomp-classical.override.version = "master";
2626
mathcomp-classical.job = true;
2727

2828
mathcomp-single-planB-src.job = false;

.nix/coq-nix-toolbox.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"4e48948fa8252a2fc755182abdd4b199f4798724"
1+
"dd771a5001cd955514f2462cad7cdd90377530e3"

.nix/coq-overlays/coq-elpi/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ with builtins; with lib; let
1010
{ case = "8.16"; out = { version = "1.17.0"; };}
1111
{ case = "8.17"; out = { version = "1.17.0"; };}
1212
{ case = "8.18"; out = { version = "v1.18.1"; };}
13-
{ case = "8.19"; out = { version = "v1.18.1"; };}
13+
{ case = "8.19"; out = { version = "v1.18.2"; };}
1414
] {} );
1515
in mkCoqDerivation {
1616
pname = "elpi";

.ocamlformat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
m=120

Changelog.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,47 @@
22

33
## UNRELEASED
44

5-
### API:
5+
### Commands
6+
- New `Elpi Accumulate dbname File filename` allows to accumulate a file int a db
7+
- Change `Elpi Db` now only creates (and initialises) a database for the specified phase
8+
9+
### API
10+
- New `coq.parse-attributes` support for the `attlabel` specification,
11+
see `coq-lib-common.elpi` for its documentation.
12+
- New `coq.goal->pp`
13+
- Replace `coq.replay-all-missing-synterp-actions` by (nestable) groups of actions
14+
- New `coq.begin-synterp-group` and `coq.end-synterp-group` primitives
15+
- New `coq.replay-synterp-action-group` primitive (replaces `coq.replay-all-missing-synterp-actions` in conjunction with a group)
16+
- New `coq.replay-next-synterp-actions` to replay all synterp actions until the next beginning/end of a synterp group
617
- New `coq.primitive.projection-unfolded` to fold/unfold a primitive projection.
718
Note that unfolded primitive projections are still compact terms, but they
819
are displayed as `match` expressions and some Ltac code can see that.
920

21+
## [2.0.2] - 01/02/2024
22+
23+
Requires Elpi 1.18.2 and Coq 8.19.
24+
25+
### API
26+
- Fix `coq.elaborate-*` does not erase the type annotation of `Let`s (regression
27+
introduced in 2.0.1). This fix may introduce differences in generated names
28+
- Fix `coq.elaborate-*` are not affected anymore by printing options
29+
30+
### Commands
31+
- Fix install the right initial parsing state (the one before any synterp action
32+
is re-played)
33+
34+
### HOAS
35+
- Fix evar instantiation loss when crossing the elpi/ltac border
36+
- Fix encoding of "definitional classes" (`Class` with no record)
37+
- Fix order of implicit arguments of `Record`
38+
39+
### Misc
40+
- Change requiring `elpi` does not load primitive integers nor primitive floats
41+
42+
### Apps
43+
- TC: avoid declaring options twice (could make vscoq2 fail)
44+
- CS: `cs` now takes a context, a term that is the projection of some structure applied to the parameters of the structure, a term to put a structure on and the solution to return
45+
1046
## [2.0.1] - 29/12/2023
1147

1248
Requires Elpi 1.18.1 and Coq 8.19.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export ELPIDIR
2121

2222
DEPS=$(ELPIDIR)/elpi.cmxa $(ELPIDIR)/elpi.cma
2323

24-
APPS=$(addprefix apps/, derive eltac NES locker coercion tc)
24+
APPS=$(addprefix apps/, derive eltac NES locker coercion cs tc)
2525

2626
ifeq "$(COQ_ELPI_ALREADY_INSTALLED)" ""
2727
DOCDEP=build
@@ -151,3 +151,6 @@ SPACE=$(XXX) $(YYY)
151151
apps/%.vo: force
152152
@$(MAKE) -C apps/$(word 1,$(subst /, ,$*)) \
153153
$(subst $(SPACE),/,$(wordlist 2,99,$(subst /, ,$*))).vo
154+
155+
nix:
156+
nix-shell --arg do-nothing true --run "updateNixToolBox & genNixActions"

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
[![Actions Status](https://github.com/LPCIC/coq-elpi/workflows/CI/badge.svg)](https://github.com/LPCIC/coq-elpi/actions)
1+
[![Docker CI](https://github.com/LPCIC/coq-elpi/actions/workflows/main.yml/badge.svg)](https://github.com/LPCIC/coq-elpi/actions/workflows/main.yml)
2+
[![Nix CI](https://github.com/LPCIC/coq-elpi/actions/workflows/nix-action-coq-8.19.yml/badge.svg)](https://github.com/LPCIC/coq-elpi/actions/workflows/nix-action-coq-8.19.yml)
3+
[![DOC](https://github.com/LPCIC/coq-elpi/actions/workflows/doc.yml/badge.svg)](https://github.com/LPCIC/coq-elpi/actions/workflows/doc.yml)
24
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://coq.zulipchat.com/#narrow/stream/253928-Elpi-users.20.26.20devs)
35
<img align="right" src="https://github.com/LPCIC/coq-elpi/raw/master/etc/logo.png" alt="Coq-Elpi logo" width="25%" />
46

@@ -179,14 +181,13 @@ In order to load Coq-Elpi use `From elpi Require Import elpi`.
179181
It understands the `#[phase]` attribute, see [synterp-vs-interp](README.md#separation-of-parsing-from-execution-of-vernacular-commands).
180182
- `Elpi Program <qname> <code>` lower level primitive letting one crate a
181183
command/tactic with a custom preamble `<code>`.
182-
183-
- `Elpi Accumulate [<qname>] [<code>|File <filename> From <loadpath>|Db <dbname>]`
184-
adds code to the current program (or `<qname>` if specified).
184+
- `From some.load.path Extra Dependency <filename> as <fname>`.
185+
- `Elpi Accumulate [<dbname>|<qname>] [<code>|File <fname>|Db <dbname>]`
186+
adds code to the current program (or `<dbname>` or `<qname>` if specified).
185187
The code can be verbatim, from a file or a Db.
188+
File names `<fname>` must have been previously declared with the above command.
186189
It understands the `#[skip="rex"]` and `#[only="rex"]` which make the command
187190
a no op if the Coq version is matched (or not) by the given regular expression.
188-
File names are relative to the directory mapped to `<loadpath>`; if more than
189-
one such directory exists, the `<filename>` must exists only once.
190191
It understands the `#[phase]` attribute, see [synterp-vs-interp](README.md#separation-of-parsing-from-execution-of-vernacular-commands)
191192
- `Elpi Typecheck [<qname>]` typechecks the current program (or `<qname>` if
192193
specified).
@@ -289,11 +290,23 @@ The synterp-command can output data of that type, but also any other data it
289290
wishes.
290291

291292
The second way to communicate data is implicit, but limited to synterp actions.
292-
During the interp phase commands can use the `coq.next-synterp-action` API to
293-
peek into the list of actions yet to be performed.
294-
Once an action is performed, the API reveals the next one. See also the
295-
related utilities `coq.replay-synterp-action` and
296-
`coq.replay-all-missing-synterp-actions`.
293+
Such synterp actions can be recorded into (nested) groups whose structure is
294+
declared using well-bracketed calls to predicates `coq.begin-synterp-group`
295+
and `coq.end-synterp-group` in the synterp phase. In the interp phase, one can
296+
then use predicate `coq.replay-synterp-action-group` to replay all the synterp
297+
actions of the group with the given name at once.
298+
299+
In the case where one wishes to interleave code between the actions of a given
300+
group, it is also possible to match the synterp group structure at interp, via
301+
`coq.begin-synterp-group` and `coq.end-synterp-group`. Individual actions that
302+
are contained in the group then need to be replayed individually.
303+
304+
One can use `coq.replay-next-synterp-actions` to replay all synterp actions
305+
until the next beginning/end of a synterp group. However, this is discouraged
306+
in favour of using groups explicitly, as this is more modular. Code that used
307+
to rely on the now-removed `coq.replay-all-missing-synterp-actions` predicate
308+
can rely on `coq.replay-next-synterp-actions` instead, but this is discouraged
309+
in favour of using groups explicitly)
297310

298311
##### Syntax of the `#[phase]` attribute
299312

_CoqProject

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
-R apps/coercion/tests elpi.apps.tc.coercion
3030
-I apps/coercion/src
3131

32+
# CS
33+
-R apps/cs/theories elpi.apps.cs
34+
-R apps/cs/tests elpi.apps.tc.cs
35+
-I apps/cs/src
36+
3237
# Type classes
3338
-R apps/tc/theories elpi.apps.tc
3439
-R apps/tc/tests elpi.apps.tc.tests

0 commit comments

Comments
 (0)