Skip to main content

Python interface to Imandra (cloud-native automated reasoning engine for analysis of algorithms)

Project description

imandra is a Python client for Imandra - a cloud-native automated reasoning engine built on the latest advances in formal verification and symbolic reasoning.

Usage

The client idiomatically exposes the Imandra Iterative Decomposition Framework (IDF) functionality to decompose state-transition algorithms. The client accepts a string containing the Python code to decompose - see the documentation to learn how to write accepted model code:

code = """
class State:
     def __init__(self):
          self.x : int = 0
     def receive_Update(self, v : int):
          self.x : int = v

scenario = [ 'Update' , 'Update' ]
"""

You can launch an IDF decomposition job in the cloud with imandra.idf.decompose, passing it the code string:

from imandra import idf
decomposition = idf.decompose(code)

Using the decomposition object as a handle, you can check the status of the job which can be in queued, processing, done or error status:

print(decomposition.status())

When the decomposition job is finished, you can obtain the generated Python code for the regions:

# Create a separate Python function per region predicate 
print(decomposition.dumps(kind='flat'))
# Create a single optimized function that returns a region number
print(decomposition.dumps(kind='tree'))

Links

Project details


Download files

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

Files for imandra, version 0.1.12
Filename, size File type Python version Upload date Hashes
Filename, size imandra-0.1.12-py3-none-any.whl (10.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size imandra-0.1.12.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page