<commit_before>sspam: Symbolic Simplification with PAttern Matching
====================================================

For some sort of roadmap with developpement ideas:
[SSPAM libreboard (internal QB)](http://libreboard.dmz.qb/b/w5JbCyxXdciWN8rGQ/sspam)


Requirements
------------
To use sspam, you need:

* The SMT solver [z3](https://github.com/Z3Prover/z3)
* The Python library for symbolic mathematics [sympy](http://www.sympy.org/fr/index.html)
* The Python module for ast unparsing [astunparse](https://github.com/simonpercivall/astunparse)


Installation
------------

* You can install sympy and astunparse with `pip install -r requirements.txt`
  Be careful to use pip for Python 2.7!

* To install z3, you can either:
 * Compile it from [source](https://github.com/Z3Prover/z3)
 * Or download a [release](https://github.com/Z3Prover/z3/releases) and
  add the `bin/` directory to your `$PYTHONPATH`

* To install SSPAM:

```
$ cd sspam_directory
$ 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.

Know that expressions passed to the simplifier should be in
cse form (a list of assignment), as provided by the cse module.


Tests
-----

To run tests of sspam:

```
$ cd tests/
$ python run_all_tests.py
```
<commit_msg>Update README with contribution part<commit_after>sspam: Symbolic Simplification with PAttern Matching
====================================================

For some sort of roadmap with developpement ideas:
[SSPAM libreboard (internal QB)](http://libreboard.dmz.qb/b/w5JbCyxXdciWN8rGQ/sspam)


Requirements
------------
To use sspam, you need:

* The SMT solver [z3](https://github.com/Z3Prover/z3)
* The Python library for symbolic mathematics [sympy](http://www.sympy.org/fr/index.html)
* The Python module for ast unparsing [astunparse](https://github.com/simonpercivall/astunparse)


Installation
------------

* You can install sympy and astunparse with `pip install -r requirements.txt`
  Be careful to use pip for Python 2.7!

* To install z3, you can either:
 * Compile it from [source](https://github.com/Z3Prover/z3)
 * Or download a [release](https://github.com/Z3Prover/z3/releases) and
  add the `bin/` directory to your `$PYTHONPATH`

* To install SSPAM:

```
$ cd sspam_directory
$ 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.

Know that expressions passed to the simplifier should be in
cse form (a list of assignment), as provided by the cse module.


Tests
-----

To run tests of sspam:

```
$ cd tests/
$ python run_all_tests.py
```


Contribute
----------

To contribute to sspam, create a branch with your contribution
(feature, fix...). Please use the script `check_codestyle.sh` provided
for some basic checkings of your code. As not all errors of pylint
might be relevant, you can use `#pylint: disable=` comments in your
code to disable irrelevant errors.
{'fraction_non_alphanumeric': 0.15869756526840717, 'fraction_numerical': 0.007040187738339689, 'mean_word_length': 3.782608695652174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3153260', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1124, 'n_words': 392}