Skip to content

Commit b0c2bc6

Browse files
authored
Merge pull request #650 from FissoreD/tc-all-in-namespace
[TC] all tc predicates are inside a tc namespace
2 parents ba48e03 + 9d392f3 commit b0c2bc6

38 files changed

+1006
-930
lines changed

.github/workflows/doc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
opam repo add coq-dev https://coq.inria.fr/opam/core-dev
3535
opam repo add extra-dev https://coq.inria.fr/opam/extra-dev
3636
opam update
37-
opam install coq-serapi . coq-core.8.19.1
37+
opam install coq-serapi ./coq-elpi.opam coq-core.8.19.1
3838
sudo apt-get update
3939
sudo apt-get install python3-pip -y
4040
pip3 install git+https://github.com/cpitclaudel/alectryon.git@c8ab1ec

.github/workflows/main.yml

+12-25
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,27 @@ env:
2525
OPAM_SUITE: ${{ inputs.suite }}
2626

2727
jobs:
28+
2829
build:
2930
runs-on: ubuntu-latest
3031
strategy:
31-
fail-fast: false
32+
#fail-fast: false
3233
matrix:
33-
coq_version: [ '8.19' , '8.20' , 'dev' ]
34+
coq_version: [ '8.19.2' , '8.20+rc1' , 'dev' ]
3435
ocaml_version:
35-
- '4.14-flambda'
36-
steps:
37-
- uses: actions/checkout@v2
38-
- uses: coq-community/docker-coq-action@v1
39-
with:
40-
opam_file: './coq-elpi.opam'
41-
coq_version: ${{ matrix.coq_version }}
42-
ocaml_version: ${{ matrix.ocaml_version }}
43-
export: 'OPAMWITHTEST'
44-
install: |
45-
startGroup "Install dependencies"
46-
opam pin add -n -y -k path $PACKAGE $WORKDIR
47-
opam update -y
48-
opam install -y -j 2 $PACKAGE --deps-only
49-
endGroup
50-
env:
51-
OPAMWITHTEST: 'true'
52-
53-
play:
54-
runs-on: ubuntu-latest
36+
- '4.14.x'
37+
- '5.2.x'
5538
steps:
5639
- uses: actions/checkout@v2
5740
- uses: avsm/setup-ocaml@v2
5841
with:
59-
ocaml-compiler: 5.1.x
60-
- run: |
61-
opam install ./coq-elpi.opam
42+
ocaml-compiler: ${{ matrix.ocaml_version }}
43+
- run: opam repo add coq-dev https://coq.inria.fr/opam/core-dev
44+
- run: opam install coq-core.${{ matrix.coq_version }}
45+
- run: opam install coq-stdlib.${{ matrix.coq_version }}
46+
- run: opam install ./coq-elpi.opam --deps-only --with-test -y
47+
- run: opam exec make build
48+
- run: opam exec make test
6249

6350
release:
6451
runs-on: ubuntu-latest

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,7 @@ apps/cs/src/coq_elpi_cs_hook.ml
5252

5353
*.timing
5454
_build
55-
tmp.out
55+
tmp.out
56+
coq-elpi-tests.opam
57+
coq-elpi-tests.install
58+
coq-elpi.install

apps/NES/tests/dune

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(coq.theory
22
(name elpi.apps.NES.tests)
3+
(package coq-elpi-tests)
34
(theories elpi elpi.apps.NES))
45

56
(include_subdirs qualified)

apps/derive/tests/dune

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(coq.theory
22
(name elpi.apps.derive.tests)
3+
(package coq-elpi-tests)
34
(flags -w -default-output-directory)
45
(theories elpi elpi.apps.derive))
56

apps/eltac/tests/dune

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(coq.theory
22
(name elpi.apps.eltac.tests)
3+
(package coq-elpi-tests)
34
(theories elpi elpi.apps.eltac))
45

56
(include_subdirs qualified)

apps/locker/tests/dune

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(coq.theory
22
(name elpi.apps.locker.tests)
3+
(package coq-elpi-tests)
34
(theories elpi elpi.apps.locker))
45

56
(include_subdirs qualified)

apps/tc/elpi/WIP/force_llam.elpi

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ namespace force-llam {
2323
% of other premises.
2424
compile-conclusion ff Goal Proof HOPremisesIn HOPremisesOut Premises Clause :-
2525
coq.safe-dest-app Goal Class Args,
26-
get-mode {get-TC-of-inst-type Class} Modes,
26+
tc.get-mode {tc.get-TC-of-inst-type Class} Modes,
2727
force-llam.modes Modes Args ForceLlam,
28-
make-tc Goal Proof Premises ff Clause1,
28+
tc.make-tc Goal Proof Premises ff Clause1,
2929
Prems = [HOPremisesIn, ForceLlam, [Clause1], HOPremisesOut],
3030
std.flatten Prems AllPremises,
3131
Clause = do AllPremises.

apps/tc/elpi/WIP/modes.elpi

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pred add-modes i:gref.
3434
:if "add-modes"
3535
add-modes GR :-
3636
% the hint mode is added only if not exists
37-
if (not (class GR _ _)) (
37+
if (not (tc.class GR _ _)) (
3838
coq.env.typeof GR Ty,
3939
coq.hints.modes GR "typeclass_instances" ModesProv,
4040
if (ModesProv = []) (Modes = [{make-last-hint-mode-input Ty}]) (Modes = ModesProv),

apps/tc/elpi/alias.elpi

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
/* license: GNU Lesser General Public License Version 2.1 or later */
22
/* ------------------------------------------------------------------------- */
33

4-
pred alias i:term, o:term.
4+
namespace tc {
5+
pred alias i:term, o:term.
56

6-
pred replace-with-alias.aux i:list term, o:list term, o:bool.
7-
replace-with-alias.aux [] [] ff.
8-
replace-with-alias.aux [X | Xs] [Y | Ys] B :-
9-
replace-with-alias X Y B',
10-
replace-with-alias.aux Xs Ys B'',
11-
or B' B'' B.
12-
13-
% [replace-with-alias T T1 Changed] T1 is T where aliases are replaced
14-
pred replace-with-alias i:term, o:term, o:bool.
15-
replace-with-alias A Sol tt :- alias A Sol',
16-
replace-with-alias Sol' Sol _.
17-
replace-with-alias (app ToReplace) (app Sol) A :-
18-
replace-with-alias.aux ToReplace Sol A.
19-
replace-with-alias A A ff.
7+
pred replace-with-alias.aux i:list term, o:list term, o:bool.
8+
replace-with-alias.aux [] [] ff.
9+
replace-with-alias.aux [X | Xs] [Y | Ys] B :-
10+
replace-with-alias X Y B',
11+
replace-with-alias.aux Xs Ys B'',
12+
or B' B'' B.
13+
14+
% [replace-with-alias T T1 Changed] T1 is T where aliases are replaced
15+
pred replace-with-alias i:term, o:term, o:bool.
16+
replace-with-alias A Sol tt :- alias A Sol',
17+
replace-with-alias Sol' Sol _.
18+
replace-with-alias (app ToReplace) (app Sol) A :-
19+
replace-with-alias.aux ToReplace Sol A.
20+
replace-with-alias A A ff.
21+
}

0 commit comments

Comments
 (0)