logic=$(expr "$(grep -m1 '^[^;]*set-logic' "$bench")" : ' *(set-logic *\([A-Z_]*\) *) *$')
# use: trywith [params..]
-# to attempt a run. Only thing printed on stdout is "sat" or "unsat", in
-# which case this run script terminates immediately. Otherwise, this
-# function returns normally.
+# to attempt a run. Only thing printed on stdout is "sat" or "unsat", in which
+# case this run script terminates immediately. Otherwise, this function
+# returns normally and prints the output of the solver to stderr.
function trywith {
limit=$1; shift;
result="$(ulimit -S -t "$limit";$cvc4 -L smt2.6 --no-incremental --no-checking --no-interactive "$@" $bench)"
case "$result" in
sat|unsat) echo "$result"; exit 0;;
+ *) echo "$result" >&2;;
esac
}