Published 2024
| Version v2
Software
Restricted
Mars
Creators
Description
Artifact for ASPLOS #1321
Table of Contents
- Background
- Install
- Usage
Background
Mars is an advanced testing tools specifically designed for the rigorous validation of SMT (Satisfiability Modulo Theories) solvers.
Its core functionality revolves around utilizing an extensive collection of rewrite rules to identify bugs in the solvers’ rewriters.
Install
Pre-requisites: Ensure your system has the following dependencies installed for Mars to operate smoothly:
1. C-reduce: Essential for minimizing test cases to better isolate bugs. Installation guidance can be found on its official GitHub page.
2. Python Packages: Certain functionalities of Mars require specific Python package. Install it via:
pip install antlr4-python3-runtime==4.9.2
3. Solvers: Direct interaction with the solvers is a cornerstone of Mars's testing process. Please build the solvers you wish to test, such as Z3 and cvc5, as per their installation manuals.
4. SMT-LIB official benchmarks: Mars performs mutations on seed files to unearth bugs. These seeds can be sourced from the SMT-LIB benchmarks available on their official site.
Usage
Testing
To initiate testing with Mars, follow these steps:
- Navigate to Mars's source directory:
cd mars/src
- To start testing with a solver like Z3, execute:
python3 mars.py --solver=z3 --solverbin=/home/z3/build/z3 --seeds=/home/benchmarks
Note: Adjustments to paths and parameters may be required based on your environment.
Minimization
To utilize Mars for bug minimization, initiate the following:
-
Navigate to the Mars source directory:
cd mars/src
- Use Mars with the specified SMT file. For example:
python mars.py --reduce --solver=z3 \
--solverbin=/home/z3/build/z3 \
--bugfile=/home/bug/bug.smt2 \
--priorfile=/home/bug/prior_file.smt2 \
--bugdir=/home/rewriter/reduce_test/completeness/0 \
--bugtype=completeness
For a hands-on demonstration, employ the command below to minimize a sample file:
python mars.py --reduce --solver=z3 \
--solverbin=/home/z3/build/z3 \
--bugfile=../example/mutant_6.smt2 \
--priorfile=../example/mutant_5.smt2 \
--bugdir=../example \
--bugtype=completeness