This project implements an interpolation algorithm
for the theory of arrays extended with the diff
operator equipped with an index theory
In the root directory, execute the command:
./make_common.sh
make -j<N>
where <N> is the number of cores the build script is allowed to use.
If the above is successful, then the binary file _axd_interpolator_
will be located inside the bin directory.
If the user wants to use the MathSAT SMT solver, the
implementation requires a soft link inside the bin
directory. For the latter, use the following command:
ln -s <mathsat-path> ./bin/mathsat
We use the type Int to encode elements of the Index type.
The SMT terms select, store are used to encode the terms rd, wr (read and write)
respectively.
Input is processed as SMTLIB2 files. If the input includes function applications of our extended language, i.e. diff, length, empty_array, undefined, then the latter elements should be appended a string denoting the type of the range of the associated array element. The latter ensures compatibility with the internal language used in the implementation. The following are examples of declarations following the above convention:
(declare-fun diffInt ((Array Int Int) (Array Int Int)) Int)
(declare-fun lengthArrayIntInt ((Array Int (Array Int Int))) Int)
(declare-fun empty_arrayArrayIntInt () (Array Int (Array Int Int))
The rest of the SMTLIB2 file should specify two assertions. The first one encodes the A-part and the second one the B-part.
The axd_interpolator binaries receives 4 arguments:
- The first argument specifies the theory to be used. Currently, the implementation supports the quantifier free fragment of the following theories: total order, integer difference logic, unit-two variable per inequality (
$UTVPI$ ), and linear arithmetic logic. The user should specify$QF_{TO}$ to use the total order logic,$QF_{IDL}$ for integer difference logic,$QF_{UTVPI}$ for$UTVPI$ , and$QF_{LIA}$ for the linear arithmetic logic option. - The second argument specifies the path of the smt2 file to work with.
- The third argument specifies the engine/method to be used. For the latter there are three options: 0, 1, and 2.
- Option 0 uses
iZ3 - Option 1 uses
MathSAT - Option 2 uses
SMTInterpol
- Option 0 uses
The following is an example of an execution of the axd_interpolator binary using iZ3 as interpolating engine:
./bin/axd_interpolator QF_TO ./tests/smt2-files/maxdiff_paper_example.smt2 0 100
macOS users need to add DYLD_LIBRARY_PATH=./lib to execute the binary, i.e.:
DYLD_LIBRARY_PATH=./lib ./bin/axd_interpolator QF_TO ./tests/smt2-files/maxdiff_paper_example.smt2 1 100
The binary axd_interpolator outputs to the standard output any of the following:
- If the formula is unsatisfiable, then it outputs Unsatisfiable: followed by the interpolant obtained.
- If the formula is satisfiable, then the implementation outputs either Satisfiable: or Unknown:. The last option happens when the internal variable
num_attemptsreaches 0.
We include a script to produce the tables reported in our submission. For the latter, the following items are neccessary:
- Python3
- Softlink to a mathsat binary file as indicated above.
- Git with LFS support, git-lfs, or download the
files-full.zipraw file from https://github.com/typesAreSpaces/AXDInterpolator/blob/master/tests/smt2-files/benchmark/files-full.zip. If the user downloadsfiles-full.zipdirectly, the zip file should be moved to thetests/smt2-files/benchmarkdirectory.
The steps to execute the benchmarking script are the following:
- Unzip the verification files in
tests/smt2-files/benchmarkwithunzip files-full.zip cdintotests/benchmark/scriptsand execute the script./submission-results.sh- The previous step will write two files
benchmark_memsafety_results.txtandbenchmark_reachsafety_results.txtin thetests/benchmarkdirectory. - To produce a LaTeX-compatible table with the obtained results,
cdintotests/benchmark/scriptsand execute the script./get_table.sh.