Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lclem/agda-kernel
An experimental Agda kernel for Jupyter
https://github.com/lclem/agda-kernel
agda jupyter jupyter-notebook
Last synced: 3 months ago
JSON representation
An experimental Agda kernel for Jupyter
- Host: GitHub
- URL: https://github.com/lclem/agda-kernel
- Owner: lclem
- License: cc-by-4.0
- Created: 2019-04-07T19:53:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-09T13:30:59.000Z (almost 3 years ago)
- Last Synced: 2024-11-09T15:50:43.393Z (3 months ago)
- Topics: agda, jupyter, jupyter-notebook
- Language: Jupyter Notebook
- Homepage:
- Size: 19.9 MB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://mybinder.org/v2/gh/lclem/agda-kernel/master?filepath=example)
[](https://travis-ci.org/lclem/agda-kernel)
[](https://codecov.io/github/lclem/agda-kernel)
[](https://github.com/jupyter/notebook/releases/tag/5.7.8)
[](https://github.com/agda/agda/releases/tag/v2.6.0)
[](https://github.com/agda/agda-stdlib/releases/tag/v1.0.1)# agda-kernel
An experimental Agda kernel for Jupyter.
Used at [Nextjournal](https://nextjournal.com/plfa/ToC) [[nextjournal kernel]](https://github.com/nextjournal/agda-kernel).
Examples
--------You can launch the following examples directly via the mybinder interface:
- [example/LabImp.ipynb](https://github.com/lclem/agda-kernel/blob/master/example/LabImp.ipynb) [[binder]](https://mybinder.org/v2/gh/lclem/agda-kernel/master?filepath=example/LabImp.ipynb).
Alternatively, if you have [binder](https://github.com/jupyterhub/binderhub),
then you can use [repo2docker](https://github.com/jupyter/repo2docker) locally:repo2docker https://github.com/lclem/agda-kernel
Installation
------------pip install agda_kernel
python -m agda_kernel.install### Syntax highlighting
Syntax highlighting is done separately by [Codemirror](https://codemirror.net/),
but unfortunately there is no Agda mode packaged with it.
A rudimentary Agda mode for Codemirror can be found in ``codemirror-agda/agda.js``.
In order to install it, typemake codemirror-install
### Agda extension
In order to improve the Jupyter interface,
it is strongly recommended to also install [`agda-extension`](https://github.com/lclem/jupyter_contrib_nbextensions).Functionality
-------------Each code cell must contain a line of the form ``module A.B.C where``.
For instance:```agda
module A.B.C whereid : {A : Set} → A → A
id x = x
```Upon execution, the file `A/B/C.agda` is created containing the cell's contents,
and it is fed to the Agda interpreter (via `agda --interaction`).
The results of typechecking the cell are then displayed.After a cell has been evaluated, one can
- Run Agsy (auto) by putting the cursor next to a goal `?` and hitting TAB.
The hole `?` is replaced by the result returned by Agsy, if any,
or by `{! !}` if no result was found.
If there is more than one result, the first ten of them are presented for the user to choose from.- Refine the current goal by putting the cursor next to a goal `{! !}` and hitting TAB.
An optional variable can be provided for case-splitting `{! m !}`.- Show information about the current context, goal, etc.: putting the cursor near a goal/literal and hit SHIFT-TAB.
Editing
-------Inputting common UNICODE characters is facilitated by the code-completion feature of Jupyter.
- When the cursor is immediately to the right of one of the `base form` symbols
hitting TAB will replace it by the corresponding `alternate form`.
Hitting TAB again will go back to the base form.| base form | alternate form |
|:---------:|:----------------:|
| -> | → |
| \ | λ |
| < | ⟨ |
| B | 𝔹 |
| > | ⟩ |
| = | ≡ |
| top | ⊤ |
| /= | ≢ |
| bot | ⊥ |
| alpha | α |
| /\ | ∧ |
| e | ε |
| \/ | ∨ |
| emptyset | ∅ |
| neg | ¬ |
| qed | ∎ |
| forall | ∀ |
| Sigma | Σ |
| exists | ∃ |
| Pi | Π |
| \[= | ⊑ |