sspam: Symbolic Simplification with PAttern Matching

sspam is a software for simplifying mixed expressions (expressions using both arithmetic and boolean operators) with pattern matching. It uses sympy for arithmetic simplification, and z3 for flexible matching (matching equivalent expressions with different representations).

Requirements

To use sspam, you need:

To contribute to sspam, you need:

Installation

$ sudo python setup.py install

Using sspam

You can use sspam either with the command line:

$ sspam "(x & y) + (x | y)"

(x + y)

Or in a python script:

from sspam import simplifier

print simplifier.simplify("(x & y) + (x | y)")

You'll see a few examples of utilisation of sspam in the examples/ directory.

Note that a cse module is provided in order to do common subexpression elimination (avoid dealing with the same subexpressions several times).

Tests

To run tests of sspam please use make test

Contribute

To contribute to sspam, create a branch with your contribution (feature, fix...). Please use the command make check for some basic checkings of your codestyle. As not all errors of pylint might be relevant, you can use #pylint: disable= comments in your code to disable irrelevant errors.

To check that your contribution does not affect normal behaviour of sspam, please use make test.