| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
cvc5=$(dirname "$(readlink -f "$0")")/cvc5 |
| 4 |
bench="$1" |
| 5 |
|
| 6 |
# Output other than "sat"/"unsat" is either written to stderr or to "err.log" |
| 7 |
# in the directory specified by $2 if it has been set (e.g. when running on |
| 8 |
# StarExec). |
| 9 |
out_file=/dev/stderr |
| 10 |
|
| 11 |
if [ -n "$STAREXEC_WALLCLOCK_LIMIT" ]; then |
| 12 |
# If we are running on StarExec, don't print to `/dev/stderr/` even when $2 |
| 13 |
# is not provided. |
| 14 |
out_file="/dev/null" |
| 15 |
fi |
| 16 |
|
| 17 |
if [ -n "$2" ]; then |
| 18 |
out_file="$2/err.log" |
| 19 |
fi |
| 20 |
|
| 21 |
logic=$(expr "$(grep -m1 '^[^;]*set-logic' "$bench")" : ' *(set-logic *\([A-Z_]*\) *) *$') |
| 22 |
|
| 23 |
# use: trywith [params..] |
| 24 |
# to attempt a run. Only thing printed on stdout is "sat" or "unsat", in which |
| 25 |
# case this run script terminates immediately. Otherwise, this function |
| 26 |
# returns normally and prints the output of the solver to $out_file. |
| 27 |
function trywith { |
| 28 |
limit=$1; shift; |
| 29 |
result="$({ ulimit -S -t "$limit"; $cvc5 -L smt2.6 --no-incremental --no-type-checking --no-interactive "$@" $bench; } 2>&1)" |
| 30 |
case "$result" in |
| 31 |
sat|unsat) echo "$result"; exit 0;; |
| 32 |
*) echo "$result" &> "$out_file";; |
| 33 |
esac |
| 34 |
} |
| 35 |
|
| 36 |
# use: finishwith [params..] |
| 37 |
# to run cvc5. Only "sat" or "unsat" are output. Other outputs are written to |
| 38 |
# $out_file. |
| 39 |
function finishwith { |
| 40 |
result="$({ $cvc5 -L smt2.6 --no-incremental --no-type-checking --no-interactive "$@" $bench; } 2>&1)" |
| 41 |
case "$result" in |
| 42 |
sat|unsat) echo "$result"; exit 0;; |
| 43 |
*) echo "$result" &> "$out_file";; |
| 44 |
esac |
| 45 |
} |
| 46 |
|
| 47 |
# the following is designed for a run time of 20 min. |
| 48 |
case "$logic" in |
| 49 |
|
| 50 |
QF_LRA) |
| 51 |
trywith 200 --miplib-trick --miplib-trick-subs=4 --use-approx --lemmas-on-replay-failure --replay-early-close-depth=4 --replay-lemma-reject-cut=128 --replay-reject-cut=512 --unconstrained-simp --use-soi |
| 52 |
finishwith --no-restrict-pivots --use-soi --new-prop --unconstrained-simp |
| 53 |
;; |
| 54 |
QF_LIA) |
| 55 |
# same as QF_LRA but add --pb-rewrites |
| 56 |
finishwith --miplib-trick --miplib-trick-subs=4 --use-approx --lemmas-on-replay-failure --replay-early-close-depth=4 --replay-lemma-reject-cut=128 --replay-reject-cut=512 --unconstrained-simp --use-soi --pb-rewrites --ite-simp --simp-ite-compress |
| 57 |
;; |
| 58 |
QF_NIA) |
| 59 |
trywith 420 --nl-ext-tplanes --decision=justification |
| 60 |
trywith 60 --nl-ext-tplanes --decision=internal |
| 61 |
trywith 60 --nl-ext-tplanes --decision=justification-old |
| 62 |
trywith 60 --no-nl-ext-tplanes --decision=internal |
| 63 |
trywith 60 --no-arith-brab --nl-ext-tplanes --decision=internal |
| 64 |
# this totals up to more than 20 minutes, although notice that smaller bit-widths may quickly fail |
| 65 |
trywith 300 --solve-int-as-bv=2 --bitblast=eager |
| 66 |
trywith 300 --solve-int-as-bv=4 --bitblast=eager |
| 67 |
trywith 300 --solve-int-as-bv=8 --bitblast=eager |
| 68 |
trywith 300 --solve-int-as-bv=16 --bitblast=eager |
| 69 |
trywith 600 --solve-int-as-bv=32 --bitblast=eager |
| 70 |
finishwith --nl-ext-tplanes --decision=internal |
| 71 |
;; |
| 72 |
QF_NRA) |
| 73 |
trywith 600 --decision=justification |
| 74 |
trywith 300 --decision=internal --no-nl-cad --nl-ext=full --nl-ext-tplanes |
| 75 |
finishwith --decision=internal --nl-ext=none |
| 76 |
;; |
| 77 |
# all logics with UF + quantifiers should either fall under this or special cases below |
| 78 |
ALIA|AUFLIA|AUFLIRA|AUFNIRA|UF|UFBVLIA|UFIDL|UFLIA|UFLRA|UFNIA|UFDT|UFDTLIA|UFDTLIRA|AUFDTLIA|AUFDTLIRA|AUFBV|AUFBVDTLIA|AUFBVFP|AUFNIA|UFFPDTLIRA|UFFPDTNIRA) |
| 79 |
# initial runs 1 min |
| 80 |
trywith 30 --simplification=none --enum-inst |
| 81 |
trywith 30 --no-e-matching --enum-inst |
| 82 |
trywith 30 --no-e-matching --enum-inst --enum-inst-sum |
| 83 |
# trigger selections 3 min |
| 84 |
trywith 30 --relevant-triggers --enum-inst |
| 85 |
trywith 30 --trigger-sel=max --enum-inst |
| 86 |
trywith 30 --multi-trigger-when-single --enum-inst |
| 87 |
trywith 30 --multi-trigger-when-single --multi-trigger-priority --enum-inst |
| 88 |
trywith 30 --multi-trigger-cache --enum-inst |
| 89 |
trywith 30 --no-multi-trigger-linear --enum-inst |
| 90 |
# other 4 min |
| 91 |
trywith 30 --pre-skolem-quant=on --enum-inst |
| 92 |
trywith 30 --inst-when=full --enum-inst |
| 93 |
trywith 30 --no-e-matching --no-cbqi --enum-inst |
| 94 |
trywith 30 --enum-inst --quant-ind |
| 95 |
trywith 30 --decision=internal --simplification=none --no-inst-no-entail --no-cbqi --enum-inst |
| 96 |
trywith 30 --decision=internal --enum-inst --enum-inst-sum |
| 97 |
trywith 30 --term-db-mode=relevant --enum-inst |
| 98 |
trywith 30 --enum-inst-interleave --enum-inst |
| 99 |
# finite model find 3 min |
| 100 |
trywith 30 --finite-model-find --fmf-mbqi=none |
| 101 |
trywith 30 --finite-model-find --decision=internal |
| 102 |
trywith 30 --finite-model-find --macros-quant --macros-quant-mode=all |
| 103 |
trywith 60 --finite-model-find --e-matching |
| 104 |
# long runs 4 min |
| 105 |
trywith 240 --finite-model-find --decision=internal |
| 106 |
finishwith --enum-inst |
| 107 |
;; |
| 108 |
UFBV) |
| 109 |
# most problems in UFBV are essentially BV |
| 110 |
trywith 150 --sygus-inst |
| 111 |
trywith 150 --mbqi --no-cegqi --no-sygus-inst |
| 112 |
trywith 300 --enum-inst --cegqi-nested-qe --decision=internal |
| 113 |
trywith 30 --enum-inst --no-cegqi-innermost --global-negate |
| 114 |
finishwith --finite-model-find |
| 115 |
;; |
| 116 |
ABV|BV) |
| 117 |
trywith 80 --enum-inst |
| 118 |
trywith 80 --sygus-inst |
| 119 |
trywith 80 --mbqi --no-cegqi --no-sygus-inst |
| 120 |
trywith 300 --enum-inst --cegqi-nested-qe --decision=internal |
| 121 |
trywith 30 --enum-inst --no-cegqi-bv |
| 122 |
trywith 30 --enum-inst --cegqi-bv-ineq=eq-slack |
| 123 |
# finish 10min |
| 124 |
finishwith --enum-inst --no-cegqi-innermost --global-negate |
| 125 |
;; |
| 126 |
ABVFP|ABVFPLRA|BVFP|FP|NIA|NRA) |
| 127 |
trywith 300 --enum-inst --nl-ext-tplanes --fp-exp |
| 128 |
trywith 60 --mbqi --no-cegqi --no-sygus-inst |
| 129 |
finishwith --sygus-inst --fp-exp |
| 130 |
;; |
| 131 |
LIA|LRA) |
| 132 |
trywith 30 --enum-inst |
| 133 |
trywith 300 --enum-inst --cegqi-nested-qe |
| 134 |
trywith 60 --mbqi --no-cegqi --no-sygus-inst |
| 135 |
finishwith --enum-inst --cegqi-nested-qe --decision=internal |
| 136 |
;; |
| 137 |
QF_AUFBV) |
| 138 |
trywith 600 |
| 139 |
finishwith --decision=stoponly |
| 140 |
;; |
| 141 |
QF_ABV) |
| 142 |
trywith 50 --ite-simp --simp-with-care --repeat-simp --arrays-weak-equiv |
| 143 |
trywith 500 --arrays-weak-equiv |
| 144 |
finishwith --ite-simp --simp-with-care --repeat-simp --arrays-weak-equiv |
| 145 |
;; |
| 146 |
QF_BV|QF_UFBV) |
| 147 |
finishwith --bitblast=eager --bv-assert-input |
| 148 |
;; |
| 149 |
QF_AUFLIA) |
| 150 |
finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=justification |
| 151 |
;; |
| 152 |
QF_AX) |
| 153 |
finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=internal |
| 154 |
;; |
| 155 |
QF_AUFNIA) |
| 156 |
finishwith --decision=justification --no-arrays-eager-index --arrays-eager-lemmas |
| 157 |
;; |
| 158 |
QF_ALIA) |
| 159 |
trywith 140 --decision=justification --arrays-weak-equiv |
| 160 |
finishwith --decision=stoponly --no-arrays-eager-index --arrays-eager-lemmas |
| 161 |
;; |
| 162 |
QF_S|QF_SLIA) |
| 163 |
trywith 300 --strings-exp --strings-fmf --no-jh-rlv-order |
| 164 |
finishwith --strings-exp --no-jh-rlv-order |
| 165 |
;; |
| 166 |
QF_ABVFP|QF_ABVFPLRA) |
| 167 |
finishwith --fp-exp |
| 168 |
;; |
| 169 |
QF_BVFP|QF_BVFPLRA) |
| 170 |
finishwith --fp-exp |
| 171 |
;; |
| 172 |
QF_FP|QF_FPLRA) |
| 173 |
finishwith --fp-exp |
| 174 |
;; |
| 175 |
*) |
| 176 |
# just run the default |
| 177 |
finishwith |
| 178 |
;; |
| 179 |
|
| 180 |
esac |
| 181 |
|