stp-mt

loading
details
attribute current value
name stp-mt
description multithreaded CryptoMinisat that uses all cores
owning solver stp-mt
contents
#!/bin/bash
#
# Use STP to create CNF from SMT input, and use Cryptominisat to solve it
# Note: Cryptominisat will run in multicore mode, and will start a thread
#       for each core it's allowed to use.

SOLVERDIR="$(dirname "${BASH_SOURCE[0]}" )"

# clean last call
rm -f output_0.cnf
"$SOLVERDIR"/stp --SMTLIB2 --output-CNF --exit-after-CNF "$1"

# In case a file was created, call the SAT solver
if [ -f output_0.cnf ]
then
	result=`$SOLVERDIR/cryptominisat5 --verb 0 --threads $(nproc) --printsol 0 output_0.cnf 2>&1`

	if [[ "$result" == *"s SATISFIABLE"* ]]; then
		echo "sat"
	elif [[ "$result" == *"s UNSATISFIABLE"* ]]; then
		echo "unsat"
	fi
fi

back to stp-mt