https://github.com/epfl-systemf/ppx_rocq
PPX syntax extensions for quoting Rocq terms in OCaml
https://github.com/epfl-systemf/ppx_rocq
ocaml ppx ppx-rewriter rocq rocq-prover
Last synced: 6 days ago
JSON representation
PPX syntax extensions for quoting Rocq terms in OCaml
- Host: GitHub
- URL: https://github.com/epfl-systemf/ppx_rocq
- Owner: epfl-systemf
- License: lgpl-2.1
- Created: 2026-05-16T14:32:18.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-08T11:34:05.000Z (13 days ago)
- Last Synced: 2026-06-08T13:23:26.874Z (13 days ago)
- Topics: ocaml, ppx, ppx-rewriter, rocq, rocq-prover
- Language: OCaml
- Homepage:
- Size: 114 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `ppx_rocq`: PPX syntax extensions for quoting Rocq terms in OCaml
`ppx_rocq` is a PPX rewriter that enables plugin writers to write Rocq terms using a simple quotation system, like so:
```ocaml
let nat_plus_assoc = [%constr "forall x y z : nat, (x + y) + z = x + (y + z)"] ;;
- : EConstr.t Proofview.tactic
```
`ppx_rocq` supports all quotations from Ltac2 (`%constr`, `%preterm`), an extra quotation for concrete syntax terms (`%expr`), as well as additional quotations for identifiers (`%ident`), qualifiers (`%qualid`), etc. Moreover, `ppx_rocq` also supports anti-quotations using the `%{…}` notation:
```ocaml
let lhs = [%expr "(x + y) + z"] in
let rhs = [%expr "x + (y + z)"] in
let nat_plus_assoc = [%constr "forall x y z : nat, %expr:{lhs} = %expr:{rhs}"] ;;
- : EConstr.t Proofview.tactic
```
## Setup
To use `ppx_rocq`, run `dune install` on this repository:
```bash
git clone https://github.com/epfl-systemf/ppx_rocq.git
cd ppx_rocq
dune build
dune install
```
Then add `ppx_rocq` to the `preprocessing` field of your `library` or `executable` stanza:
```dune
(library
(name my_library)
; …
(preprocessing (pps ppx_rocq)))
```