Skip to content

informalsystems/apalache-chai

Repository files navigation

🍵 Chai: Client for Human-Apalache Interaction

Chai is a Python RPC client to interact with the Server for Human-Apalache Interaction (or Shai). It enables transparent interactions with the Apalache model checker via python function calls.

Chai is developed by the Apalache team at Informal Systems.

Installation

You can install the apalache-chai library from this git repo with:

pip install git+https://github.com/informalsystems/apalache-chai.git

If you are using poetry to manage your project, you can add a dependency on apalache-chai with:

poetry add git+https://github.com/informalsystems/apalache-chai.git

Documentation

Development

Clone the repository

git clone --recurse-submodules git@github.com:informalsystems/apalache-chai.git

The --recurse-submodules flag is needed because we use a git submodule to bring in the .proto files from Apalache.

Dev Dependencies

Required

Recommended

Activate the development shell

poetry shell

Updating the protobuf messages

To update he proto files, first update to the desired commit of the apalache submodule, then regenerate the gRPC code, e.g.,

pushd apalache && git pull && popod
make update-grpc

Documentation

We use pdoc for generating our API docs.

You can run the doc server on the code base with

poetry run pdoc ./chai

Testing

Unit tests

Unit tests are defined in ./tests.

Run the unit tests (this also runs static analysis via pyright):

make test

Integration tests

Dependencies

The reason for depending on nix for our integration test is as follows: To run the integration tests, we need the version of Apalache included as a git submodule. We ensure the version is kept in sync by building the Apalache executable from the exact same git submodule used to obtain the proto files. Since we are building Apalache, we need to ensure that we have all build dependencies. We therefore reuse Apalache's flake.nix, which is already maintained and ensures pre-requisties are supplied.

Running
make integration

About

Chai: Client for Human-Apalache Interaction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published