Debian Codegraph @

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

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 "$@" $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 --jh-rlv-order
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|AUFDTLIA|AUFBV|AUFBVDTLIA|AUFBVFP|AUFNIA|UFFPDTLIRA|UFFPDTNIRA)
79 # initial runs 1 min
80 trywith 30 --simplification=none --full-saturate-quant
81 trywith 30 --no-e-matching --full-saturate-quant
82 trywith 30 --no-e-matching --full-saturate-quant --fs-sum
83 # trigger selections 3 min
84 trywith 30 --relevant-triggers --full-saturate-quant
85 trywith 30 --trigger-sel=max --full-saturate-quant
86 trywith 30 --multi-trigger-when-single --full-saturate-quant
87 trywith 30 --multi-trigger-when-single --multi-trigger-priority --full-saturate-quant
88 trywith 30 --multi-trigger-cache --full-saturate-quant
89 trywith 30 --no-multi-trigger-linear --full-saturate-quant
90 # other 4 min
91 trywith 30 --pre-skolem-quant --full-saturate-quant
92 trywith 30 --inst-when=full --full-saturate-quant
93 trywith 30 --no-e-matching --no-quant-cf --full-saturate-quant
94 trywith 30 --full-saturate-quant --quant-ind
95 trywith 30 --decision=internal --simplification=none --no-inst-no-entail --no-quant-cf --full-saturate-quant
96 trywith 30 --decision=internal --full-saturate-quant --fs-sum
97 trywith 30 --term-db-mode=relevant --full-saturate-quant
98 trywith 30 --fs-interleave --full-saturate-quant
99 # finite model find 3 min
100 trywith 30 --finite-model-find --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 --fmf-inst-engine
104 # long runs 4 min
105 trywith 240 --finite-model-find --decision=internal
106 finishwith --full-saturate-quant
107 ;;
108 UFBV)
109 # most problems in UFBV are essentially BV
110 trywith 300 --sygus-inst
111 trywith 300 --full-saturate-quant --cegqi-nested-qe --decision=internal
112 trywith 30 --full-saturate-quant --no-cegqi-innermost --global-negate
113 finishwith --finite-model-find
114 ;;
115 ABV|BV)
116 trywith 120 --full-saturate-quant
117 trywith 120 --sygus-inst
118 trywith 300 --full-saturate-quant --cegqi-nested-qe --decision=internal
119 trywith 30 --full-saturate-quant --no-cegqi-bv
120 trywith 30 --full-saturate-quant --cegqi-bv-ineq=eq-slack
121 # finish 10min
122 finishwith --full-saturate-quant --no-cegqi-innermost --global-negate
123 ;;
124 ABVFP|ABVFPLRA|BVFP|FP|NIA|NRA)
125 trywith 300 --full-saturate-quant --nl-ext-tplanes --fp-exp
126 finishwith --sygus-inst --fp-exp
127 ;;
128 LIA|LRA)
129 trywith 30 --full-saturate-quant
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
135 finishwith --decision=stoponly
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_BV|QF_UFBV)
143 finishwith --bitblast=eager --bv-assert-input
144 ;;
145 QF_AUFLIA)
146 finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=justification
147 ;;
148 QF_AX)
149 finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=internal
150 ;;
151 QF_AUFNIA)
152 finishwith --decision=justification --no-arrays-eager-index --arrays-eager-lemmas
153 ;;
154 QF_ALIA)
155 trywith 140 --decision=justification --arrays-weak-equiv
156 finishwith --decision=stoponly --no-arrays-eager-index --arrays-eager-lemmas
157 ;;
158 QF_S|QF_SLIA)
159 trywith 300 --strings-exp --strings-fmf --no-jh-rlv-order
160 finishwith --strings-exp --no-jh-rlv-order
161 ;;
162 QF_ABVFP|QF_ABVFPLRA)
163 finishwith --fp-exp
164 ;;
165 QF_BVFP|QF_BVFPLRA)
166 finishwith --fp-exp
167 ;;
168 QF_FP|QF_FPLRA)
169 finishwith --fp-exp
170 ;;
171 *)
172 # just run the default
173 finishwith
174 ;;
175
176 esac
177