Skip to main content

Binder Build Status codecov.io Jupyter Notebook Agda agda-stdlib

agda-kernel

An experimental Agda kernel for Jupyter. Used at Nextjournal [nextjournal kernel].

Examples

You can launch the following examples directly via the mybinder interface:

Alternatively, if you have binder, then you can use 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, 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, type

make codemirror-install

Agda extension

In order to improve the Jupyter interface, it is strongly recommended to also install agda-extension.

Functionality

Each code cell must contain a line of the form module A.B.C where. For instance:

module A.B.C where

id : {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 Π
[= ⊑

Metadata

Release files for agda-kernel 0.64

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agda-kernel 0.64
File Size Uploaded
agda_kernel-0.64.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agda-kernel 0.64
File Interpreter ABI Platform
agda_kernel-0.64-py3-none-any.whl Python 3 none any Details

Total release size: 37.7 kB

Release files / agda_kernel-0.64.tar.gz

Download URL agda_kernel-0.64.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a515ff4e188b55d2841d92e3305e0c2a1c6c612d88ef53a56297edc9dde6965c
BLAKE2b-256 checksum
How to use checksums
4ab1f00ace52cf4a8e13d944db0635ddaaf42ebcf46e050e29485772632856c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.7.1

Release files / agda_kernel-0.64-py3-none-any.whl

Download URL agda_kernel-0.64-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4087057c311292a3c8ce446acd4db64032c7c1cf0d733e4db0d8b28c497faf8b
BLAKE2b-256 checksum
How to use checksums
c40e6c193ad49ff9c3797de2dc1cf31b17495e1b91125e2781bfb942858170a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.64 This release

2 release files

0.63

1 release file

0.62

2 release files

0.61

1 release file

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

1 release file

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page