GithubHelp home page GithubHelp logo

cequencer / sspam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quarkslab/sspam

0.0 3.0 0.0 124 KB

Symbolic Simplification with PAttern Matching

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.15% Python 99.85%

sspam's Introduction

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:

  • The SMT solver z3 version 4.4.2
  • The Python library for symbolic mathematics sympy
  • The Python module for ast unparsing astunparse

To contribute to sspam, you need:

Installation

  • You can install most requirements with pip install -r requirements.txt (or pip install -r requirements-dev.txt to contribute)

  • To install z3, you can either:

  • Compile it from source

  • Or download a release and add the bin/ directory to your $PYTHONPATH

  • To install SSPAM:

$ 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.

sspam's People

Contributors

serge-sans-paille-qb avatar

Watchers

James Cloos avatar Jim Huang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.