Skip to main content

Temporal logic models for Python

Project description

Timewinder Logo

Status license tox-test version PyPI - Python Version

Timewinder is a Python 3 library to build and run temporal logic models. The goal of the library is to bring formal methods, specifically Lamport's Temporal Logic of Actions, to a broader audience. While very much inspired by TLA+, Timewinder tries to be simpler, more readable, and more industry-focused. That said, TLA+ is an impressive tool and Timewinder is not trying to cover the full spectrum of what TLA+ can do.

The project intends to work toward the following goals:

  • Introduce more developers into modeling and formal methods
  • Increase the number of people working with temporal logic
  • Improve design docs, with testable example models that non-experts can also read
  • Make running models easy and automatable, even from the command line.

Project Status

This project is still alpha, so the API may change. Please join in on the Github Discussions to talk about models, examples, and direction. Help is definitely wanted and appreciated!

Examples

High-level Usage

Timewinder starts with the @timewinder.object and @timewinder.process decorators. object wraps classes and registers them as a Timewinder data structures. process wraps functions that we intend to check. Inside process functions, Python's yield keyword represents an atomicity boundary -- that is, at every yield point, the evaluator saves the state and is free to run any other available process in any order. A function with no yield keyword always runs to completion in one step.

Finally, there are predicates, which are properties about the objects to be checked at every stage.

These are all combined in the Evaluator, where Timewinder will exhaustively generate (up to a limit number of steps) all the potential program states resulting from running the processes in any order.

Installation

You can simply pip install timewinder.

Developing

Pre-requisites

You only need tox for testing and documentation building:

python3 -m pip install tox

Or clone the repository:

git clone https://github.com/timewinder-dev/timewinder

Running the test suite

You can run the full test suite with:

tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timewinder-0.1.dev1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timewinder-0.1.dev1-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file timewinder-0.1.dev1.tar.gz.

File metadata

  • Download URL: timewinder-0.1.dev1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for timewinder-0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 f8772398312f46a0fd50e3b871cf7e93e80286f581c98ac6ab9b0ee99bcd8534
MD5 3c142d3d25884fe5324a7bb7af0dc2f6
BLAKE2b-256 191e8a801419b503eee7dde7291c4cab3fa809090138dc20f4dc67a0cada280b

See more details on using hashes here.

File details

Details for the file timewinder-0.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: timewinder-0.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for timewinder-0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 be3c33ad6adab973ba872cb8ec8c02a0c4d2d9b3862a8b2097848ff5e95bb831
MD5 0b5df9626292a6d18d8ba6d8afc81707
BLAKE2b-256 b54380891b86640911733c5ab70a590cfbd6406bc0eebb0cd5d89ac0924a5440

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page