Skip to main content

A Python Interface for TChecker

Project description

tcheckerpy

tcheckerpy is a Python interface to the TChecker model checker, allowing you to analyze and compare timed automata models directly from Python.
It provides access to the following TChecker tools:

  • tck-compare
  • tck-liveness
  • tck-reach
  • tck-simulate
  • tck-syntax

For detailed documentation, refer to the TChecker Wiki.

Installation

You can install tcheckerpy via PyPI:

pip install tcheckerpy

Usage

To use any of the supported tools, import the corresponding router and call the associated function. Each function expects the system declaration of your timed automata network(s) as a string input. You may also provide additional arguments by creating a parameter object specific to the selected tool. Return values are in the form of either a string, a dict of strings, or a Response object.
Most tools (except tck-syntax) require the use of Python's asyncio to run the functions asynchronously.

Example

# import required routers
from tcheckerpy.routers import tck_reach, tck_syntax
import asyncio

# read declaration of timed automata network from .txt or .tck file into string
with open(system_declaration_path) as file:
        system = file.read()

# check syntax
syntax_check = tck_syntax.check(system)["status"] == "success" # convert to bool

# define reachability analysis parameters
reach_body = tck_reach.TckReachBody(
    sysdecl=system, 
    labels="", 
    algorithm=0,
    search_order="bfs",
    certificate=0
)

# perform reachability analysis if syntax is valid
if(syntax_check):
    reachability_result = asyncio.run(tck_reach.reach(reach_body))
    print(reachability_result["stats"])
    print(reachability_result["certificate"])

Example output (based on ad94.txt):

MEMORY_MAX_RSS 41116
REACHABLE false
RUNNING_TIME_SECONDS 6.1474e-05
VISITED_STATES 7
VISITED_TRANSITIONS 8

digraph ad94_fig10 {
  0 [initial="true", intval="", labels="", vloc="<l0>", zone="(0<=x && 0<=y)"]
  1 [intval="", labels="", vloc="<l1>", zone="(1<x && 0<=y && 1<x-y)"]
  2 [intval="", labels="", vloc="<l1>", zone="(0<=x && 0<=y && 0<=x-y)"]
  3 [intval="", labels="", vloc="<l2>", zone="(1<x && 1<=y)"]
  4 [intval="", labels="", vloc="<l2>", zone="(1<=x && 1<=y)"]
  5 [intval="", labels="green", vloc="<l3>", zone="(1<x && 0<y && x-y<1)"]
  6 [intval="", labels="green", vloc="<l3>", zone="(0<=x && 0<=y && x-y<1)"]
  0 -> 2 [vedge="<P@a>"]
  1 -> 3 [vedge="<P@b>"]
  2 -> 4 [vedge="<P@b>"]
  2 -> 6 [vedge="<P@c>"]
  5 -> 1 [vedge="<P@a>"]
  5 -> 5 [vedge="<P@d>"]
  6 -> 2 [vedge="<P@a>"]
  6 -> 5 [vedge="<P@d>"]
}

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

tcheckerpy-0.0.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

tcheckerpy-0.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file tcheckerpy-0.0.1.tar.gz.

File metadata

  • Download URL: tcheckerpy-0.0.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tcheckerpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e6b62b44c88c23ca68b75f894ce51a31c9f5045f70829e8c5412d5227fe2c7ce
MD5 12575d8e73938ddd12a8ad14e64c83db
BLAKE2b-256 1a120caa9ce8c8d65df8e9041bd7765614b167973aa83fdb843f2bcb9bcbec08

See more details on using hashes here.

Provenance

The following attestation bundles were made for tcheckerpy-0.0.1.tar.gz:

Publisher: publish_to_pypi.yaml on Echtzeitsysteme/tcheckerpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tcheckerpy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tcheckerpy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tcheckerpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf155e9241437b477ee2bdbc6ea53cfad46106a5549ca2dc65c4323c804540d5
MD5 f8afa0340cc9b7a37577ac692f3a0b1a
BLAKE2b-256 8ef37cca59299d2ae8efd5d3c26d8cdad12264d639b13d525fdbc1929d6c8bb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tcheckerpy-0.0.1-py3-none-any.whl:

Publisher: publish_to_pypi.yaml on Echtzeitsysteme/tcheckerpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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