-
Notifications
You must be signed in to change notification settings - Fork 79
Add builtin to the tc app #1042
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
5e0c4ce
60b1839
b3dfd61
a1cbff7
dc9956f
2933a3a
2e52cf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| (executable | ||
| (name gen_doc) | ||
| (libraries elpi_tc_plugin)) | ||
|
|
||
| (rule | ||
| (targets | ||
| tc-builtin.elpi) | ||
| (deps gen_doc.exe) | ||
| (mode promote) | ||
| (action (run ./gen_doc.exe))) | ||
|
|
||
| (install | ||
| (files | ||
| tc-builtin.elpi) | ||
| (section doc) | ||
| (package rocq-elpi-typeclasses)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| let _ = Elpi.API.BuiltIn.document_file ~header:"% Generated" | ||
| Elpi_tc_plugin.Rocq_elpi_class_tactics_takeover.tc_builtins |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -180,6 +180,17 @@ let set_solver_mode kind qname (l: Libnames.qualid list) = | |||||
| | ANone-> Lib.add_leaf (cache_solver_mode (qname, Set (Only OSet.empty), false)) | ||||||
| | ASet -> Lib.add_leaf (cache_solver_mode (qname, Set (Only l), false)) | ||||||
|
|
||||||
| let tc_builtins = [ | ||||||
| Elpi.API.BuiltIn.MLCode(Pred("coq.TC.override-solver", | ||||||
| In(Elpi.API.BuiltInData.string, "GR", | ||||||
| In(Elpi.API.BuiltInData.list Elpi.API.BuiltInData.string, "GR", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or even |
||||||
| Easy("Declares that goals on GR should be solved using elpi's typeclass solver."))), | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept the word |
||||||
| (fun s gr ~depth -> | ||||||
| set_solver_mode AAdd [s] (List.map Libnames.qualid_of_string gr))), | ||||||
| DocAbove)] | ||||||
|
|
||||||
| let tc_builtins = API.BuiltIn.declare ~file_name:"tc-builtin.elpi" tc_builtins | ||||||
|
|
||||||
| let solver_register l = | ||||||
| Lib.add_leaf (Solver.cache_solver (l, Create)); | ||||||
| Lib.add_leaf (Modes.cache_solver_mode (l, Add OSet.empty, true)) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| (coq.theory | ||
| (name elpi.apps.tc) | ||
| (package rocq-elpi) | ||
| (theories elpi elpi.apps.tc.elpi) | ||
| (package rocq-elpi-typeclasses) | ||
| (theories elpi_elpi elpi elpi.apps.tc.elpi) | ||
| (flags -w -all -w -elpi) | ||
| (plugins rocq-elpi.tc)) | ||
| (plugins rocq-elpi.elpi rocq-elpi-typeclasses.elpi_tc_plugin)) | ||
|
|
||
| (include_subdirs qualified) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,6 +35,12 @@ | |||||
| ppx_optcomp | ||||||
| (ocaml-lsp-server :with-dev-setup))) | ||||||
|
|
||||||
| (package | ||||||
| (name rocq-elpi-typeclasses) | ||||||
| (synopsis "TC bindings for rocq-elpi") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| (description "This package provides a typeclass solver written in Elpi for Rocq") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Also in the .opam file |
||||||
| (depends rocq-elpi)) | ||||||
|
|
||||||
| (package | ||||||
| (name rocq-elpi-json) | ||||||
| (synopsis "Yojson bindings for rocq-elpi") | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # This file is generated by dune, edit dune-project instead | ||
| opam-version: "2.0" | ||
| synopsis: "TC bindings for rocq-elpi" | ||
| description: "This package provides a typeclass solver written in Elpi for Rocq" | ||
| maintainer: ["Enrico Tassi <enrico.tassi@inria.fr>"] | ||
| authors: ["Enrico Tassi <enrico.tassi@inria.fr>"] | ||
| license: "LGPL-2.1-or-later" | ||
| homepage: "https://github.com/LPCIC/coq-elpi/apps/tc/" | ||
| bug-reports: "https://github.com/LPCIC/coq-elpi/issues" | ||
| depends: [ | ||
| "dune" {>= "3.13"} | ||
| "rocq-elpi" | ||
| ] | ||
| build: [ | ||
| ["dune" "subst"] {dev} | ||
| [ | ||
| "etc/with-rocq-wrap.sh" {!coq-core:installed} | ||
| "dune" | ||
| "build" | ||
| "-p" | ||
| name | ||
| "-j" | ||
| jobs | ||
| "@install" | ||
| "@runtest" {with-test} | ||
| "@doc" {with-doc} | ||
| ] | ||
| ] | ||
| dev-repo: "git+https://github.com/LPCIC/coq-elpi.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.