|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +# This runs ebmc in BMC mode on the HWMCC08 benchmarks. |
| 4 | + |
| 5 | +if [ ! -e aiger/. ] ; then |
| 6 | + echo Downloading and building the AIGER tools |
| 7 | + git clone https://github.com/arminbiere/aiger |
| 8 | + (cd aiger ; ./configure.sh ; make aigtosmv ) |
| 9 | +fi |
| 10 | + |
| 11 | +if [ ! -e hwmcc08/. ] ; then |
| 12 | + echo Downloading HWMCC08 benchmark archive |
| 13 | + wget -q http://fmv.jku.at/hwmcc/hwmcc08public.tar.bz2 |
| 14 | + bunzip2 hwmcc08public.tar.bz2 |
| 15 | + tar xf hwmcc08public.tar |
| 16 | + rm hwmcc08public.tar |
| 17 | +fi |
| 18 | + |
| 19 | +if [ ! -e hwmcc08public-smv/. ] ; then |
| 20 | + echo Converting AIGER to SMV |
| 21 | + mkdir hwmcc08public-smv |
| 22 | + (cd hwmcc08; for FILE in *.aig ; do |
| 23 | + SMV=`echo "$FILE" | sed s/.aig/.smv/` |
| 24 | + ../aiger/aigtosmv -b "$FILE" "../hwmcc08public-smv/$SMV" |
| 25 | + done) |
| 26 | +fi |
| 27 | + |
| 28 | +# expected answers |
| 29 | +# from the abc result column in https://fmv.jku.at/hwmcc08/hwmcc08results.csv |
| 30 | + |
| 31 | +if [ ! -e hwmcc08results.csv ] ; then |
| 32 | + echo Downloading HWMCC08 result table |
| 33 | + wget -q https://fmv.jku.at/hwmcc08/hwmcc08results.csv |
| 34 | +fi |
| 35 | + |
| 36 | +echo Running ebmc on the HWMCC08 benchmarks |
| 37 | + |
| 38 | +(# ignore first three lines of hwmcc08results.csv |
| 39 | +read -r line |
| 40 | +read -r line |
| 41 | +read -r line |
| 42 | +# now process the lines |
| 43 | +while read -r line; do |
| 44 | + BENCHMARK=` echo "$line" | cut -d ',' -f 1 | tr -d '"'` |
| 45 | + if [ ! -e "hwmcc08public-smv/${BENCHMARK}.smv" ] ; then |
| 46 | + echo benchmark $BENCHMARK not found |
| 47 | + else |
| 48 | + RESULT=` echo "$line" | cut -d ',' -f 3 | tr -d '"'` |
| 49 | + if [ "$RESULT" = "uns" ] ; then |
| 50 | + ebmc --bound 2 "hwmcc08public-smv/${BENCHMARK}.smv" > ebmc.out |
| 51 | + if [ $? = 10 ] ; then |
| 52 | + echo $BENCHMARK: got unexpected counterexample |
| 53 | + exit 1 |
| 54 | + else |
| 55 | + echo $BENCHMARK: ok "(UNSAT)" |
| 56 | + fi |
| 57 | + fi |
| 58 | + if [ "$RESULT" = "sat" ] ; then |
| 59 | + LENGTH=` echo "$line" | cut -d ',' -f 2` |
| 60 | + if [ "$LENGTH" = "\"*\"" ] ; then |
| 61 | + echo $BENCHMARK: no counterexample length |
| 62 | + else |
| 63 | + ebmc --bound $LENGTH "hwmcc08public-smv/${BENCHMARK}.smv" > ebmc.out |
| 64 | + if [ $? = 10 ] ; then |
| 65 | + echo $BENCHMARK: ok "(SAT $LENGTH)" |
| 66 | + else |
| 67 | + echo $BENCHMARK: failed to find counterexample at bound $LENGTH |
| 68 | + exit 1 |
| 69 | + fi |
| 70 | + fi |
| 71 | + fi |
| 72 | + fi |
| 73 | +done ) < hwmcc08results.csv |
0 commit comments