final sources (?) for competition
authorMorgan Deters <mdeters@gmail.com>
Mon, 18 Jun 2012 21:33:00 +0000 (21:33 +0000)
committerMorgan Deters <mdeters@gmail.com>
Mon, 18 Jun 2012 21:33:00 +0000 (21:33 +0000)
Makefile
contrib/Makefile.am
contrib/run-script-smtcomp2012 [new file with mode: 0755]

index d0e7b2ebc58887e87f74844a5acd66235913f564..5b1acecbd83a12e256a6a1f22f34eb73c7990ee3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ examples: all
 
 YEAR := $(shell date +%Y)
 submission submission-main:
-       @if [ -n "`ls src/parser/*/generated`" ]; then \
+       @if [ -n "`ls src/parser/*/generated 2>/dev/null`" ]; then \
          echo 'ERROR:' >&2; \
          echo 'ERROR: Please make maintainer-clean first.' >&2; \
          echo 'ERROR:' >&2; \
@@ -58,13 +58,12 @@ submission submission-main:
        # main track
        mkdir -p cvc4-smtcomp-$(YEAR)
        cp -p builds/bin/cvc4 cvc4-smtcomp-$(YEAR)/cvc4
-       ( echo '#!/bin/sh'; \
-         echo 'exec ./cvc4 -L smt2 --no-checking --no-interactive' ) > cvc4-smtcomp-$(YEAR)/run
+       cp contrib/run-script-smtcomp2012 cvc4-smtcomp-$(YEAR)/run
        chmod 755 cvc4-smtcomp-$(YEAR)/run
        tar cf cvc4-smtcomp-$(YEAR).tar cvc4-smtcomp-$(YEAR)
 submission-application:
        # application track is a separate build because it has different preprocessor #defines
-       @if [ -n "`ls src/parser/*/generated`" ]; then \
+       @if [ -n "`ls src/parser/*/generated 2>/dev/null`" ]; then \
          echo 'ERROR:' >&2; \
          echo 'ERROR: Please make maintainer-clean first.' >&2; \
          echo 'ERROR:' >&2; \
@@ -85,7 +84,7 @@ submission-application:
        tar cf cvc4-application-smtcomp-$(YEAR).tar cvc4-application-smtcomp-$(YEAR)
 submission-parallel:
        # parallel track can't be built with -cln, so it's a separate build
-       @if [ -n "`ls src/parser/*/generated`" ]; then \
+       @if [ -n "`ls src/parser/*/generated 2>/dev/null`" ]; then \
          echo 'ERROR:' >&2; \
          echo 'ERROR: Please make maintainer-clean first.' >&2; \
          echo 'ERROR:' >&2; \
index 815c3377d913cc8855b647f73a88795f39a72be6..facf5a21c29c14fe7464e8ae110b8fb999d0530c 100644 (file)
@@ -11,6 +11,7 @@ EXTRA_DIST = \
        configure-in-place \
        depgraph \
        get-antlr-3.4 \
+       run-script-smtcomp2012 \
        theoryskel/kinds \
        theoryskel/Makefile \
        theoryskel/Makefile.am \
diff --git a/contrib/run-script-smtcomp2012 b/contrib/run-script-smtcomp2012
new file mode 100755 (executable)
index 0000000..bad8482
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+cat >bench-$$.smt2
+trap 'rm bench-$$.smt2' EXIT
+
+logic=$(expr "$(head -n 1 bench-$$.smt2)" : '^ *(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.
+function trywith {
+  result="$(./cvc4 -L smt2 --no-checking --no-interactive "$@" bench-$$.smt2)"
+  case "$result" in
+    sat|unsat) echo "$result"; exit 0;;
+  esac
+}
+
+# use: finishwith [params..]
+# to run cvc4 and let it output whatever it will to stdout.
+function finishwith {
+  ./cvc4 -L smt2 --no-checking --no-interactive "$@" bench-$$.smt2
+}
+
+case "$logic" in
+
+QF_LRA)
+  # 10 minutes with default decision heuristic
+  trywith --tlimit-per=600000
+  # switch to internal decision heuristic
+  finishwith --decision=internal
+  ;;
+AUFLIA)
+  # 60 seconds with default decision heuristic
+  trywith --tlimit-per=60000
+  # try simplification for 60 seconds, default decision heuristic
+  trywith --simplification=batch --tlimit-per=60000
+  # switch to internal decision heuristic
+  finishwith --decision=internal
+  ;;
+QF_AUFBV)
+  trywith --tlimit-per=600000
+  finishwith --decision=justification-stoponly
+  ;;
+*)
+  # just run the default
+  finishwith
+  ;;
+
+esac
+