Skip to main content

Build status Build Status Binder

tlaplus_jupyter

Jupyter kernel for TLA⁺ and Pluscal specification languages.

  • Syntax highlight based on official lexer.
  • REPL functionality for expressions.
  • Can be executed online with Binder. Try it now!
  • No need to install TLA Toolbox: Java and Python will be enough.

XXX screen or gif

Installation

tlaplus_jupyter is a python package installable with pip. Python 2 and 3 are supported. To install run:

pip install tlaplus_jupyter
python -m tlaplus_jupyter.install

The last step will register tlaplus_jupyter as a Jupyter kernel in your system and will download tla2tools.jar. After that Jupyter can be started as usual:

jupyter notebook

To create a new TLA⁺ notebook click on the New button and select TLA⁺ in a dropdown menu. It is also handy to enable line numbering inside cells (View > Toggle Line Numbers) since syntax checker refers to problems by their line numbers.

Usage

tlaplus_jupyter supports several types of cells with different behavior on execution:

  1. Cells with full module definition. Upon execution kernel will perform syntax check (with tla2sany.SANY) and report errors if any. If the module contains Pluscal program kernel will also translate it to TLA.

  2. Cell starting with %tlc:ModuleName where ModuleName is the name of one of the modules previously executed. In this case, the cell is treated as a config file for the TLC model checker. For example to check spec Spec and invariant TypeOk of model DieHardTLA execute following:

    %tlc:DieHardTLA
    SPECIFICATION Spec
    INVARIANT TypeOK
    

    Init and next state formula can be set after keywords INIT and NEXT correspondingly. Constant definitions should follow CONSTANTS keyword separated by newline or commas. Description of possible config statements and syntax is given in chapter 14 of Specifying systems book.

    Custom TLC flags may be specified after the module name:

    %tlc:DieHardTLA -deadlock
    SPECIFICATION Spec
    

    TLC evaluation happens in the context of all defined modules. So if model refers to another model that other model should be at some cell too.

  3. Cells containing neither %-magic nor module definition are treated as a constant expression and will print its results on execution. As with !tlc evaluation happens in the context of all defined modules, so the expression can refer to anything defined in evaluated modules.

  4. Command %log / %log on / %log off correspondingly shows kernel log / enables logging / disables logging for currently open notebook.

Sharing executable models with Binder

TLA⁺ models shared on Github can be easily made runnable by coping Dockerfile to the repository root. After that, URL to such repo can be used at Binder to start a dynamic TLA⁺ environment.

vscode-tlaplus Cool plugin for VSCode editor with syntax highlight and custom widgets for displaying traces.

License

BSD

Metadata

Release files for tlaplus-jupyter 0.1

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

Source distribution (sdist)

Source distribution for tlaplus-jupyter 0.1
File Size Uploaded
tlaplus_jupyter-0.1.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tlaplus-jupyter 0.1
File Interpreter ABI Platform
tlaplus_jupyter-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / tlaplus_jupyter-0.1.tar.gz

Download URL tlaplus_jupyter-0.1.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dcac67c162edd6f2c775b2483266cbc5d6350e747e38643270075222c566be6d
BLAKE2b-256 checksum
How to use checksums
cad8327a2415e3096601a0f218ba99c66626bbca94d9d2557221d2c2ff73b86e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

Release files / tlaplus_jupyter-0.1-py3-none-any.whl

Download URL tlaplus_jupyter-0.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78d5e51d11007ed43e59ef154f494b428fe4d88192a1a3c37d4de293b5ee0425
BLAKE2b-256 checksum
How to use checksums
ac48cd098ee3aac84cf940e6627631019b1f4489370c4e68fe683c2a029fa05c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1 This release

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