Causal Consistency Checker in Python.
C3PY is a Python library for checking the causal consistency of an execution history of a concurrent system. It is based on the paper "On verifying causal consistency" by Bouajjani, et al.
C3PY checks whether a given execution history is causally consistent provided the sequential specification of the system.
The library is still under active development and the API is subject to change. Please see the tests for usage examples.
This repository uses Rye for development. Install Rye and run the following command to start the development environment.
git clone https://github.com/shumbo/c3py.git
cd c3py
rye sync
Use ruff
(which is bundled with Rye) to lint and format the code.
rye format
rye check
rye check --fix # to auto-fix some of the issues
This repository uses pytest for testing. Run the following command to run the tests.
rye run pytest
# some tests are marked as slow, so you may want to run the following command to run all tests
rye run pytest --slow
To write a new test, create a new file suffixed with _test.py
in the src
directory and write a test function prefixed with test_
. Please see the pytest documentation for more information.