MBA-Solver is a tool to make MBA expressions easier for SMT solving.
MBA-Solver is written in Python 3.6. It relies on ast, numpy, sympy, astparse libraries, which can be easily installed
by pip3 install ast numpy astparse sympy
.
The following solvers are supported. MBA-Solver uses python interface to communicate with the solvers.
- Z3: GitHub Link
Python interface:pip3 install z3-solver
- Boolector: GitHub Link
Python interface: Link - STP: Github Link
Python interface: Link
- tools/svector_simplify.py: simplify linear MBA sub-expression
- tools/truthtable_search_simplify.py: simplify poly MBA sub-expression
- mba-simplifier/pldi_dataset_simplify_*.py: split MBA expression and apply the corresponding simplification (linear, poly, nonpoly) to them.
The folder "full-dataset" contains the compete dataset: 1000 linear MBA expression, 1000 poly MBA expression, and 1000 nonpoly MBA expression.
To facilitate the artifact evaluation, the folder "dataset" include a sub-dataset: 21 linear MBA expression, 21 poly MBA expression, and 20 nonpoly MBA expression.
If you would like to run on the full-dataset, please rename "full-dataset" to "dataset".
Run make quick-demo
will first use Z3 to solve the original MBA, then use MBA-Solver to simplify them, and then use Z3
to solve the simplified MBA.
Run MBA-Solver: make mba-solver-simplify-mba
.
Functions for analyzing and manipulating MBA expressions are in the "tools" folder. The simplification results are stored in the "dataset" folder.
Each script will print out the number of correctly simplified cases (True), incorrectly simplified cases (False), Timeout cases and total number.
The timeout can be configured at the beginning of the makefiles under boolector_solving, stp_solving, and z3_solving. The default timeout is set to 5 seconds for quick evaluation. The evaluation in our paper is set to one hour. Please note that, running with shorter timeout may reduce the ratio of solved cases in peer tools.
- Solve original MBA:
make z3-solving-original
. - Solve MBA after simplification by MBA-Solver:
make z3-solving-mba-solver-simplify
. - Solve MBA after simplification by SSPAM:
make z3-solving-sspam-simplify
. - Solve MBA after simplification by Syntia:
make z3-solving-syntia-simplify
.
Run make z3
will run these four experiments in a batch.
- Solve original MBA:
make boolector-solving-original
. - Solve MBA after simplification by MBA-Solver:
make boolector-solving-mba-solver-simplify
. - Solve MBA after simplification by SSPAM:
make boolector-solving-sspam-simplify
. - Solve MBA after simplification by Syntia:
make boolector-solving-syntia-simplify
.
Run make boolector
will run these four experiments in a batch.
- Solve original MBA:
make stp-solving-original
. - Solve MBA after simplification by MBA-Solver:
make stp-solving-mba-solver-simplify
. - Solve MBA after simplification by SSPAM:
make stp-solving-sspam-simplify
. - Solve MBA after simplification by Syntia:
make stp-solving-syntia-simplify
.
Run make stp
will run these four experiments in a batch.
- SSPAM: GitHub Link.
- Syntia: GitHub link.
Running peer tools may take around 18 hours on the subset. To save time, we have already include the simplified result from these tools. So you do not have to run the commands in this section.
Run SSPAM on MBA dataset: make sspam-simplify-mba
.
Run Syntia on MBA dataset: make syntia-simplify-mba
.