Skip to main content

Overview

st2smv is a tool for converting programmable logic controller (PLC) code to a formal model, and checking whether the model satisfies various properties (e.g., temporal logic specifications). As its name implies, st2smv can process PLC code written in a subset of the Structured Text (ST) programming language, and produces models in the SMV language.

Basic Use

Run the command

st2smv --help

to see a summary of how to use st2smv.

Consider the following ST program with 3 boolean variables:

x1 := x2;
x2 := NOT x1;
x3 := NOT (x1 = x2);

and the specification

SPEC AG(x3);

To convert the file code.st to a model, run the command

st2smv --convert --input code.st --output-directory outdir

where outdir is the directory where you want to save the output. You should now have the following files:

.
├── code.st
├── outdir
│   ├── ast.json
│   └── model.json
└── spec.smv

ast.json contains the abstract syntax tree (AST) of the code, and model.json is the model, stored in an intermediate representation.

To produce an SMV model (including the specification), run the command

st2smv --combine --input outdir/model.json spec.smv | tee outdir/model.smv

which will print the model and write it to the file outdir/model.smv.

Finally, run the command

NuSMV outdir/model.smv

to check the specification (which is true).

Structure of the Model

In progress…

Advanced Use

In progress…

Installation

To install st2smv from the Python Package Index (PyPI), run the command

pip install st2smv

If you have instead obtained this package from another source and wish to install that copy, run the command

pip install st2smv_directory

where st2smv_directory is the location of this directory (i.e., the directory that contains the file setup.py).

Dependencies

st2smv converts PLC code to a formal model, which then must be analyzed using a solver. The current version of st2smv produces models that can be analyzed using SynthSMV, which must be installed separately. NuSMV (which SynthSMV is based on) can be used to check some, but not all, of the models that st2smv produces.

License

GPLv3+: The GNU General Public License, version 3, or (at your option) any later version.

Metadata

Release files for st2smv 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for st2smv 0.1.2
File Size Uploaded
st2smv-0.1.2.tar.gz 36.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for st2smv 0.1.2
File Interpreter ABI Platform
st2smv-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 83.2 kB

Release files / st2smv-0.1.2.tar.gz

Download URL st2smv-0.1.2.tar.gz
Size 36.7 kB
Tags Source
SHA-256 checksum
How to use checksums
10ad79b4f1063fa3ebcf2fe0b916de8f4225fab91d57fc67b8346ea508106794
BLAKE2b-256 checksum
How to use checksums
b4bea1f6e2acb3c50336231d164baceced30d3edf6366b328713358c312128de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / st2smv-0.1.2-py2.py3-none-any.whl

Download URL st2smv-0.1.2-py2.py3-none-any.whl
Size 46.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bc591ae7fd03c33fd1114fb1be4ccd310b5fb9fd79407b00013d58ab04c7d340
BLAKE2b-256 checksum
How to use checksums
62f86e4f253add5e8c0deb221b0bd05b0d756e6952aeac2ea288598f279086e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page