Debian Codegraph @

contrib/competitions/smt-comp/run-script-smtcomp2020

raw
1 #!/bin/bash
2
3 cvc4=./cvc4
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"; $cvc4 -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 cvc4. Only "sat" or "unsat" are output. Other outputs are written to
38 # $out_file.
39 function finishwith {
40 result="$({ $cvc4 -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 480 --nl-ext-tplanes --decision=internal
60 trywith 60 --nl-ext-tplanes --decision=justification
61 trywith 60 --no-nl-ext-tplanes --decision=internal
62 trywith 60 --no-arith-brab --nl-ext-tplanes --decision=internal
63 # this totals up to more than 20 minutes, although notice that smaller bit-widths may quickly fail
64 trywith 300 --solve-int-as-bv=2 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
65 trywith 300 --solve-int-as-bv=4 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
66 trywith 300 --solve-int-as-bv=8 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
67 trywith 300 --solve-int-as-bv=16 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
68 trywith 600 --solve-int-as-bv=32 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
69 finishwith --nl-ext-tplanes --decision=internal
70 ;;
71 QF_NRA)
72 trywith 300 --nl-ext-tplanes --decision=internal
73 trywith 300 --nl-ext-tplanes --decision=justification --no-nl-ext-factor
74 trywith 30 --nl-ext-tplanes --decision=internal --solve-real-as-int
75 finishwith --nl-ext-tplanes --decision=justification
76 ;;
77 # all logics with UF + quantifiers should either fall under this or special cases below
78 ALIA|AUFLIA|AUFLIRA|AUFNIRA|UF|UFIDL|UFLIA|UFLRA|UFNIA|UFDT|UFDTLIA|AUFDTLIA|AUFBVDTLIA|AUFNIA)
79 # initial runs 1 min
80 trywith 30 --simplification=none --full-saturate-quant
81 trywith 30 --no-e-matching --full-saturate-quant
82 # trigger selections 3 min
83 trywith 30 --relevant-triggers --full-saturate-quant
84 trywith 30 --trigger-sel=max --full-saturate-quant
85 trywith 30 --multi-trigger-when-single --full-saturate-quant
86 trywith 30 --multi-trigger-when-single --multi-trigger-priority --full-saturate-quant
87 trywith 30 --multi-trigger-cache --full-saturate-quant
88 trywith 30 --no-multi-trigger-linear --full-saturate-quant
89 # other 4 min
90 trywith 30 --pre-skolem-quant --full-saturate-quant
91 trywith 30 --inst-when=full --full-saturate-quant
92 trywith 30 --no-e-matching --no-quant-cf --full-saturate-quant
93 trywith 30 --full-saturate-quant --quant-ind
94 trywith 30 --decision=internal --simplification=none --no-inst-no-entail --no-quant-cf --full-saturate-quant
95 trywith 30 --decision=internal --full-saturate-quant
96 trywith 30 --term-db-mode=relevant --full-saturate-quant
97 trywith 30 --fs-interleave --full-saturate-quant
98 # finite model find 3 min
99 trywith 30 --finite-model-find --mbqi=none
100 trywith 30 --finite-model-find --decision=internal
101 trywith 30 --finite-model-find --macros-quant --macros-quant-mode=all
102 trywith 30 --finite-model-find --uf-ss=no-minimal
103 trywith 60 --finite-model-find --fmf-inst-engine
104 # long runs 4 min
105 trywith 240 --finite-model-find --decision=internal
106 finishwith --full-saturate-quant
107 ;;
108 ABVFP|BVFP|FP|UFFPDTLIRA|UFFPDTNIRA)
109 finishwith --full-saturate-quant --fp-exp
110 ;;
111 UFBV)
112 # most problems in UFBV are essentially BV
113 trywith 300 --full-saturate-quant --decision=internal
114 trywith 300 --full-saturate-quant --cegqi-nested-qe --decision=internal
115 trywith 30 --full-saturate-quant --no-cegqi-innermost --global-negate
116 finishwith --finite-model-find
117 ;;
118 BV)
119 trywith 120 --full-saturate-quant
120 trywith 120 --full-saturate-quant --no-cegqi-innermost
121 trywith 300 --full-saturate-quant --cegqi-nested-qe --decision=internal
122 trywith 30 --full-saturate-quant --no-cegqi-bv
123 trywith 30 --full-saturate-quant --cegqi-bv-ineq=eq-slack
124 # finish 10min
125 finishwith --full-saturate-quant --no-cegqi-innermost --global-negate
126 ;;
127 LIA|LRA|NIA|NRA)
128 trywith 30 --full-saturate-quant --nl-ext-tplanes
129 trywith 300 --full-saturate-quant --no-cegqi-innermost
130 trywith 300 --full-saturate-quant --cegqi-nested-qe
131 finishwith --full-saturate-quant --cegqi-nested-qe --decision=internal
132 ;;
133 QF_AUFBV)
134 trywith 600 --ite-simp
135 finishwith --decision=justification-stoponly --ite-simp
136 ;;
137 QF_ABV)
138 trywith 50 --ite-simp --simp-with-care --repeat-simp --arrays-weak-equiv
139 trywith 500 --arrays-weak-equiv
140 finishwith --ite-simp --simp-with-care --repeat-simp --arrays-weak-equiv
141 ;;
142 QF_UFBV)
143 # Benchmarks with uninterpreted sorts cannot be solved with eager
144 # bit-blasting currently
145 trywith 1200 --bitblast=eager --bv-sat-solver=cadical
146 finishwith
147 ;;
148 QF_BV)
149 finishwith --bv-div-zero-const --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
150 ;;
151 QF_AUFLIA)
152 finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=justification
153 ;;
154 QF_AX)
155 finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=internal
156 ;;
157 QF_AUFNIA)
158 finishwith --decision=justification --no-arrays-eager-index --arrays-eager-lemmas
159 ;;
160 QF_ALIA)
161 trywith 140 --decision=justification --arrays-weak-equiv
162 finishwith --decision=justification-stoponly --no-arrays-eager-index --arrays-eager-lemmas
163 ;;
164 QF_S|QF_SLIA)
165 trywith 300 --strings-exp --rewrite-divk --strings-fmf
166 finishwith --strings-exp --rewrite-divk
167 ;;
168 QF_ABVFP|QF_ABVFPLRA)
169 finishwith --fp-exp
170 ;;
171 QF_BVFP|QF_BVFPLRA)
172 finishwith --fp-exp
173 ;;
174 QF_FP|QF_FPLRA)
175 finishwith --fp-exp
176 ;;
177 *)
178 # just run the default
179 finishwith
180 ;;
181
182 esac
183