Skip to content

Commit

Permalink
Merge pull request #573 from LPCIC/fix-detype
Browse files Browse the repository at this point in the history
fix detype
  • Loading branch information
gares authored Jan 26, 2024
2 parents 75b6197 + ee76019 commit 0451f1b
Show file tree
Hide file tree
Showing 12 changed files with 518 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .nix/coq-nix-toolbox.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"4e48948fa8252a2fc755182abdd4b199f4798724"
"dd771a5001cd955514f2462cad7cdd90377530e3"
2 changes: 1 addition & 1 deletion .nix/coq-overlays/coq-elpi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with builtins; with lib; let
{ case = "8.16"; out = { version = "1.17.0"; };}
{ case = "8.17"; out = { version = "1.17.0"; };}
{ case = "8.18"; out = { version = "v1.18.1"; };}
{ case = "8.19"; out = { version = "v1.18.1"; };}
{ case = "8.19"; out = { version = "v1.18.2"; };}
] {} );
in mkCoqDerivation {
pname = "elpi";
Expand Down
1 change: 1 addition & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
m=120
9 changes: 9 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [2.0.2] - 22/01/2024

Requires Elpi 1.18.1 and Coq 8.19.

### API
- Fix `coq.elaborate-*` does not erase the type annotation of `Let`s (regression
introduced in 2.0.1). This fix may introduce differences in generated names
- Fix `coq.elaborate-*` are not affected anymore by printing options

## [2.0.1] - 29/12/2023

Requires Elpi 1.18.1 and Coq 8.19.
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,6 @@ SPACE=$(XXX) $(YYY)
apps/%.vo: force
@$(MAKE) -C apps/$(word 1,$(subst /, ,$*)) \
$(subst $(SPACE),/,$(wordlist 2,99,$(subst /, ,$*))).vo

nix:
nix-shell --arg do-nothing true --run "updateNixToolBox & genNixActions"
4 changes: 2 additions & 2 deletions apps/derive/tests/test_projK.v
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ Check eq_refl 0 : projEnvelope1 nat 1 1 (Envelope nat 0 1) = 0.
Check projEnvelope2 : forall A, A -> A -> zeta A -> A.
Check eq_refl 0 : projEnvelope2 nat 1 1 (Envelope nat 1 0) = 0.
Check projRedex1 : forall A, A -> beta A -> A.
Check projWhy1 : forall n : peano, match n with
Check projWhy1 : forall n : peano, match n return Type with
| Zero => peano
| Succ _ => unit
end -> iota -> peano.
Check projWhy2 : forall n : peano, match n with
Check projWhy2 : forall n : peano, match n return Type with
| Zero => peano
| Succ _ => unit
end -> iota -> { i : peano & match i with Zero => peano | Succ _ => unit end }.
Expand Down
2 changes: 1 addition & 1 deletion coq-elpi.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ install: [ make "install" "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" ]
depends: [
"ocaml" {>= "4.09.0" }
"stdlib-shims"
"elpi" {>= "1.18.1" & < "1.19.0~"}
"elpi" {>= "1.18.2" & < "1.19.0~"}
"coq" {>= "8.19" & < "8.20~" }
"dot-merlin-reader" {with-dev}
"ocaml-lsp-server" {with-dev}
Expand Down
7 changes: 5 additions & 2 deletions src/coq_elpi_builtins_synterp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let scope = let open Conv in let open API.AlgebraicData in declare {

let grafting = let open Conv in let open API.AlgebraicData in declare {
ty = TyName "grafting";
doc = "Specify if the clause has to be grafted before or after a named clause";
doc = "Specify if the clause has to be grafted before, grafted after or replace a named clause";
pp = (fun fmt _ -> Format.fprintf fmt "<todo>");
constructors = [
K("before","",A(id,N),
Expand All @@ -62,10 +62,13 @@ let grafting = let open Conv in let open API.AlgebraicData in declare {
K("after","",A(id,N),
B (fun x -> (`After,x)),
M (fun ~ok ~ko -> function (`After,x) -> ok x | _ -> ko ()));
K("replace","",A(id,N),
B (fun x -> (`Replace,x)),
M (fun ~ok ~ko -> function (`Replace,x) -> ok x | _ -> ko ()));
]
} |> CConv.(!<)

type clause = string option * ([ `After | `Before ] * string) option * API.Data.term
type clause = string option * ([ `After | `Before | `Replace ] * string) option * API.Data.term

let clause = let open Conv in let open API.AlgebraicData in declare {
ty = TyName "clause";
Expand Down
4 changes: 2 additions & 2 deletions src/coq_elpi_builtins_synterp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ val set_accumulate_to_db_synterp :
val prop : Data.term Conversion.t
val id : string Conversion.t

type clause = string option * ([ `After | `Before ] * string) option * Data.term
type clause = string option * ([ `After | `Before | `Replace ] * string) option * Data.term

val clause : clause Conversion.t

type scope = ExecutionSite | CurrentModule | Library

val scope : scope Conversion.t
val grafting : ([ `After | `Before ] * string) Conversion.t
val grafting : ([ `After | `Before | `Replace ] * string) Conversion.t
val options : (Coq_elpi_HOAS.options, Data.constraints) ContextualConversion.ctx_readback
val locate_module : BuiltIn.declaration
val locate_module_type : BuiltIn.declaration
Expand Down
Loading

0 comments on commit 0451f1b

Please sign in to comment.