Debian Codegraph @

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

raw
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 --fp-exp "$@" $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 --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
65 trywith 300 --solve-int-as-bv=4 --bitblast=eager
66 trywith 300 --solve-int-as-bv=8 --bitblast=eager
67 trywith 300 --solve-int-as-bv=16 --bitblast=eager
68 trywith 600 --solve-int-as-bv=32 --bitblast=eager
69 finishwith --nl-ext-tplanes --decision=internal
70 ;;
71 QF_NRA)
72 trywith 600 --decision=justification
73 trywith 300 --decision=internal --no-nl-cov --nl-ext=full --nl-ext-tplanes
74 finishwith --decision=internal --nl-ext=none
75 ;;
76 # all logics with UF + quantifiers should either fall under this or special cases below
77 ALIA|AUFLIA|AUFLIRA|AUFNIRA|UF|UFBVLIA|UFBVFP|UFIDL|UFLIA|UFLRA|UFNIA|UFDT|UFDTLIA|UFDTLIRA|AUFDTLIA|AUFDTLIRA|AUFBV|AUFBVDTLIA|AUFBVFP|AUFNIA|UFFPDTLIRA|UFFPDTNIRA)
78 # initial runs 1 min
79 trywith 30 --simplification=none --enum-inst
80 trywith 30 --no-e-matching --enum-inst
81 trywith 30 --no-e-matching --enum-inst --enum-inst-sum
82 # trigger selections 3 min
83 trywith 30 --relevant-triggers --enum-inst
84 trywith 30 --trigger-sel=max --enum-inst
85 trywith 30 --multi-trigger-when-single --enum-inst
86 trywith 30 --multi-trigger-when-single --multi-trigger-priority --enum-inst
87 trywith 30 --multi-trigger-cache --enum-inst
88 trywith 30 --no-multi-trigger-linear --enum-inst
89 # other 4 min 30 sec
90 trywith 30 --pre-skolem-quant=on --enum-inst
91 trywith 30 --inst-when=full --enum-inst
92 trywith 30 --no-e-matching --no-cbqi --enum-inst
93 trywith 30 --enum-inst --quant-ind
94 trywith 30 --decision=internal --simplification=none --no-inst-no-entail --no-cbqi --enum-inst
95 trywith 30 --decision=internal --enum-inst --enum-inst-sum
96 trywith 30 --term-db-mode=relevant --enum-inst
97 trywith 30 --enum-inst-interleave --enum-inst
98 trywith 30 --preregister-mode=lazy --enum-inst
99 # finite model find and mbqi 3 min 30 sec
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 trywith 60 --mbqi
105 # long runs 3 min
106 trywith 180 --finite-model-find --decision=internal
107 finishwith --enum-inst
108 ;;
109 UFBV)
110 # most problems in UFBV are essentially BV
111 trywith 150 --sygus-inst
112 trywith 150 --mbqi --no-cegqi --no-sygus-inst
113 trywith 300 --enum-inst --cegqi-nested-qe --decision=internal
114 trywith 300 --mbqi-fast-sygus --no-cegqi --no-sygus-inst
115 trywith 30 --enum-inst --no-cegqi-innermost --global-negate
116 finishwith --finite-model-find
117 ;;
118 ABV|BV)
119 trywith 80 --enum-inst
120 trywith 80 --sygus-inst
121 trywith 80 --mbqi --no-cegqi --no-sygus-inst
122 trywith 300 --mbqi-fast-sygus --no-cegqi --no-sygus-inst
123 trywith 300 --enum-inst --cegqi-nested-qe --decision=internal
124 trywith 30 --enum-inst --no-cegqi-bv
125 trywith 30 --enum-inst --cegqi-bv-ineq=eq-slack
126 # finish 10min
127 finishwith --enum-inst --no-cegqi-innermost --global-negate
128 ;;
129 ABVFP|ABVFPLRA|BVFP|FP|NIA|NRA|BVFPLRA)
130 trywith 300 --mbqi-fast-sygus --no-cegqi --no-sygus-inst
131 trywith 300 --enum-inst --nl-ext-tplanes
132 trywith 60 --mbqi --no-cegqi --no-sygus-inst
133 finishwith --sygus-inst
134 ;;
135 LIA|LRA)
136 trywith 30 --enum-inst
137 trywith 300 --enum-inst --cegqi-nested-qe
138 trywith 30 --mbqi --no-cegqi --no-sygus-inst
139 trywith 30 --mbqi-fast-sygus --no-cegqi --no-sygus-inst
140 finishwith --enum-inst --cegqi-nested-qe --decision=internal
141 ;;
142 QF_AUFBV)
143 trywith 600
144 finishwith --decision=stoponly
145 ;;
146 QF_ABV)
147 trywith 50 --ite-simp --simp-with-care --repeat-simp
148 trywith 500
149 finishwith --ite-simp --simp-with-care --repeat-simp
150 ;;
151 QF_BV|QF_UFBV)
152 finishwith --bitblast=eager --bv-assert-input
153 ;;
154 QF_AUFLIA)
155 finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=justification
156 ;;
157 QF_AX)
158 finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=internal
159 ;;
160 QF_AUFNIA)
161 finishwith --decision=justification --no-arrays-eager-index --arrays-eager-lemmas
162 ;;
163 QF_ALIA)
164 trywith 140 --decision=justification
165 finishwith --decision=stoponly --no-arrays-eager-index --arrays-eager-lemmas
166 ;;
167 QF_S|QF_SLIA)
168 trywith 300 --strings-exp --strings-fmf --no-jh-rlv-order
169 finishwith --strings-exp --no-jh-rlv-order
170 ;;
171 *)
172 # just run the default
173 finishwith
174 ;;
175
176 esac
177