https://github.com/EugeneLoy/coq_jupyter
Jupyter kernel for Coq
https://github.com/EugeneLoy/coq_jupyter
coq dependent-types jupyter jupyter-extension jupyter-kernels jupyter-notebook kernel proof-assistant python-pa theorem-proving
Last synced: about 1 month ago
JSON representation
Jupyter kernel for Coq
- Host: GitHub
- URL: https://github.com/EugeneLoy/coq_jupyter
- Owner: EugeneLoy
- License: apache-2.0
- Created: 2018-12-26T14:40:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T21:23:12.000Z (8 months ago)
- Last Synced: 2025-03-20T09:44:34.661Z (about 1 month ago)
- Topics: coq, dependent-types, jupyter, jupyter-extension, jupyter-kernels, jupyter-notebook, kernel, proof-assistant, python-pa, theorem-proving
- Language: Python
- Homepage:
- Size: 414 KB
- Stars: 96
- Watchers: 5
- Forks: 8
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-coq - Jupyter kernel for Coq - Coq support for the Jupyter Notebook web environment. (Projects / User Interfaces)
README

[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) [](https://badge.fury.io/py/coq-jupyter) [](https://github.com/EugeneLoy/coq_jupyter/actions/workflows/ci-tests.yml) [](https://gitter.im/coq_jupyter/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://mybinder.org/v2/gh/EugeneLoy/coq_jupyter_demo/master?filepath=demo.ipynb)
A [Jupyter](https://jupyter.org/) kernel for [Coq](https://coq.inria.fr/).
You can try it [online in Binder](https://mybinder.org/v2/gh/EugeneLoy/coq_jupyter_demo/master?filepath=demo.ipynb).
## Installation
### Prerequisites
Make sure that CoqIDE (8.6 or newer) is installed and `coqidetop` or `coqidetop.opt` (`coqtop` for Coq versions before 8.9.0) is in your `PATH`. Also, make sure the `python` command is recognized on your machine. If not, you can set up an alias for it e.g. python-is-python3 on Ubuntu.
### Install using pip
Install with `pip`:
pip install coq-jupyter
python -m coq_jupyter.installUninstall with `pip`:
jupyter kernelspec uninstall coq
pip uninstall coq-jupyter### Install using MAKE
All commands are run from the top level folder of this repo (where `Makefile` is located).
Install from PyPi:
make
Install from locally checked out source code:
make install-local
Uninstall:
make uninstall
## Backtracking
There are number of convenience improvements over standard Jupyter notebook behaviour that are implemented to support Coq-specific use cases.
By default, running cell will rollback any code that was executed in that cell before. If needed, this can be disabled on a per-cell basis (using `Auto rollback` checkbox).
Manual cell rollback is also available using `Rollback cell` button (at the bottom of executed cell) or shortcut (`Ctrl+Backspace`).

## coqtop arguments
Use `--coqtop-args` to supply additional arguments to `coqidetop`/`coqidetop.opt`/`coqtop` when installing kernel. In this case you might also want to set custom kernel name/display name using `--kernel-name`/`--kernel-display-name`.
For example, to add kernel that instructs `coqidetop` to load `/workspace/init.v` on startup:
python -m coq_jupyter.install --kernel-name=coq_with_init --kernel-display-name="Coq (with init.v)" --coqtop-args="-l /workspace/init.v"
## Contributing
Give feedback with [issues](https://github.com/EugeneLoy/coq_jupyter/issues) or [gitter](https://gitter.im/coq_jupyter/community), send pull requests. Also check out [CONTRIBUTING.md](CONTRIBUTING.md) for instructions.