Skip to content

Commit ca1b82d

Browse files
committed
Also support cumulative definitions and add a test for them.
1 parent e5ece2b commit ca1b82d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/rocq_elpi_builtins.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,6 @@ Supported attributes:
21802180
err Pp.(str"coq.env.add-const: the type must be ground. Did you forge to call coq.typecheck-indt-decl?");
21812181
Some ty in
21822182
let state, poly, cumul, udecl, _ = poly_cumul_udecl_variance_of_options state options in
2183-
if cumul then err Pp.(str"coq.env.add-const: unsupported attribute @udecl-cumul! or @univpoly-cumul!");
21842183
let kind = Decls.(IsDefinition Definition) in
21852184
let scope = if Option.has_some local_bkind
21862185
then Locality.Discharge

tests/test_polymorphism.v

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,15 @@ Elpi Query lp:"
5353
".
5454
Print test.
5555
(* It's indeed polymorphic and we do get the minimized version *)
56-
End test_minimization.
56+
End test_minimization.
57+
58+
Module test_cumul_def.
59+
Elpi Command test_cumul_def.
60+
61+
Elpi Query lp:"
62+
coq.univ.new U,
63+
coq.univ.variable U V,
64+
@keep-alg-univs! => @udecl-cumul! [(auto V)] tt [] tt => coq.env.add-const ""polydef"" (sort (typ U)) _ _ _C.
65+
".
66+
Print polydef.
67+
Print test_cumul_def.

0 commit comments

Comments
 (0)