#!/bin/sh cleanup () { rm -f $sol } die () { echo "**** runaigmcncheck: $*" 1>&2 cleanup exit 1 } aig="" cmd="" while [ $# -gt 0 ] do case $1 in *.aig|*.aag|*.aig.gz|*.aag.gz) [ x"$aig" = x ] || die "multiple models $aig and $1" aig=$1 [ x"$cmd" = x ] || cmd="$cmd " cmd="${cmd}$1" ;; *) [ x"$cmd" = x ] || cmd="$cmd " cmd="${cmd}$1" ;; esac shift done [ x"$aig" = x ] && die "no aiger model specified" [ x"$cmd" = x ] && die "no model checking command specified" sol=/tmp/runaigmcncheck-$$.sol trap "cleanup" 2 11 15 rm -f $sol $cmd > $sol aigsim -m -w -c -2 $aig $sol res=$? cleanup exit $res