Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to coq/coq#18038 (rewrite rules) #1060

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions template-coq/src/plugin_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ let quote_module ~(include_functor : bool) ~(include_submodule : bool) ~(include
match field with
| SFBconst _ -> [GlobRef.ConstRef (Constant.make2 mp label)]
| SFBmind _ -> [GlobRef.IndRef (MutInd.make2 mp label, 0)]
| SFBrules _ -> failwith "Rewrite rules are not supported by TemplateCoq"
| SFBmodule mb -> if include_submodule then aux mb.mod_type mb.mod_mp else []
| SFBmodtype mtb -> if include_submodtype then aux mtb.mod_type mtb.mod_mp else []
in
Expand Down
8 changes: 8 additions & 0 deletions template-coq/src/quoter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ let make_warning_if_not_exist w =
let warn_primitive_turned_into_axiom =
CWarnings.create_in (make_warning_if_not_exist "primitive-turned-into-axiom")
Pp.(fun prim -> str "Quoting primitive " ++ str prim ++ str " into an axiom.")

let warn_symbol_turned_into_axiom =
CWarnings.create_in (make_warning_if_not_exist "symbol-turned-into-axiom")
Pp.(fun prim -> str "Quoting symbol " ++ str prim ++ str " into an axiom.")
let warn_ignoring_private_polymorphic_universes =
CWarnings.create_in (make_warning_if_not_exist "private-polymorphic-universes-ignored")
Pp.(fun () -> str "Ignoring private polymorphic universes.")
Expand Down Expand Up @@ -522,6 +526,9 @@ struct
| Primitive t ->
warn_primitive_turned_into_axiom (CPrimitives.to_string t);
None
| Symbol _ ->
warn_symbol_turned_into_axiom (Constant.debug_to_string c);
None
| Def cs -> Some cs
| OpaqueDef lc ->
if bypass then
Expand Down Expand Up @@ -651,6 +658,7 @@ since [absrt_info] is a private type *)
then Some (quote_term env evm (fst (Global.force_proof Library.indirect_accessor cs)))
else None
| Primitive _ -> failwith "Primitive types not supported by TemplateCoq"
| Symbol _ -> failwith "Symbols are not supported by TemplateCoq"
in
(ty, body)

Expand Down
1 change: 1 addition & 0 deletions template-coq/src/run_extractable.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ let get_constant_body b =
(* FIXME delayed univs skipped *)
Some proof
| Primitive _ -> failwith "Primitives not supported by TemplateCoq"
| Symbol _ -> failwith "Symbols are not supported by TemplateCoq"

(* note(gmm): code taken from quoter.ml (quote_entry_aux) *)
let of_constant_body (env : Environ.env) (cd : Plugin_core.constant_body) : Ast0.Env.constant_body =
Expand Down
Loading