Skip to content

Commit

Permalink
Merge PR coq#19144: Include module type with definition
Browse files Browse the repository at this point in the history
Reviewed-by: proux01
Co-authored-by: proux01 <[email protected]>
  • Loading branch information
coqbot-app[bot] and proux01 authored Jun 9, 2024
2 parents 526a447 + ac79ea4 commit 054e150
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- **Changed:**
The :cmd:`Include` command can now include module types with a `with` clause (:n:`@with_declaration`)
to instantiate some parameters
(`#19144 <https://github.com/coq/coq/pull/19144>`_,
by Pierre Rousselin).
2 changes: 1 addition & 1 deletion doc/sphinx/language/core/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ are now available through the dot notation.
#. Assumptions such as :cmd:`Axiom` that include the :n:`Inline` clause will be automatically
expanded when the functor is applied, except when the function application is prefixed by ``!``.

.. cmd:: Include @module_type_inl {* <+ @module_expr_inl }
.. cmd:: Include @module_type_inl {* <+ @module_type_inl }

Includes the content of module(s) in the current
interactive module. Here :n:`@module_type_inl` can be a module expression or a module
Expand Down
2 changes: 1 addition & 1 deletion doc/tools/docgram/fullGrammar
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ gallina_ext: [
| "From" global "Require" export_token LIST1 filtered_import
| "Import" OPT import_categories LIST1 filtered_import
| "Export" OPT import_categories LIST1 filtered_import
| "Include" module_type_inl LIST0 ext_module_expr
| "Include" module_type_inl LIST0 ext_module_type
| "Include" "Type" module_type_inl LIST0 ext_module_type
| "Transparent" OPT "!" LIST1 smart_global
| "Opaque" OPT "!" LIST1 smart_global
Expand Down
2 changes: 1 addition & 1 deletion doc/tools/docgram/orderedGrammar
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ command: [
| OPT [ "From" dirpath ] "Require" OPT ( [ "Import" | "Export" ] OPT import_categories ) LIST1 filtered_import
| "Import" OPT import_categories LIST1 filtered_import
| "Export" OPT import_categories LIST1 filtered_import
| "Include" module_type_inl LIST0 ( "<+" module_expr_inl )
| "Include" module_type_inl LIST0 ( "<+" module_type_inl )
| "Include" "Type" LIST1 module_type_inl SEP "<+"
| "Transparent" OPT "!" LIST1 reference
| "Opaque" OPT "!" LIST1 reference
Expand Down
14 changes: 14 additions & 0 deletions test-suite/modules/include_module_type.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Module Type type1.
Parameter A : Prop.
End type1.

Module Type type2.
Parameter B : Prop.
End type2.

Module Type type3 := type1 <+ type2 with Definition B := True.
Print type3.

Module Type type3''.
Include type1 <+ type2 with Definition B := True.
End type3''.
2 changes: 1 addition & 1 deletion vernac/g_vernac.mlg
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ GRAMMAR EXTEND Gram
{ VernacSynterp (VernacImport ((Import,cats),qidl)) }
| IDENT "Export"; cats = OPT import_categories; qidl = LIST1 filtered_import ->
{ VernacSynterp (VernacImport ((Export,cats),qidl)) }
| IDENT "Include"; e = module_type_inl; l = LIST0 ext_module_expr ->
| IDENT "Include"; e = module_type_inl; l = LIST0 ext_module_type ->
{ VernacSynterp (VernacInclude(e::l)) }
| IDENT "Include"; "Type"; e = module_type_inl; l = LIST0 ext_module_type ->
{ warn_deprecated_include_type ~loc ();
Expand Down

0 comments on commit 054e150

Please sign in to comment.