|
⇤ ← Revision 1 as of 2010-12-01 18:28:38
Size: 73
Comment:
|
Size: 1400
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| Inserire una descrizione per RunModelSolve. | {{{ # !/usr/bin/env bash |
| Line 3: | Line 4: |
| {{{#! wiki | set -o pipefail # Disable output buffering |
| Line 5: | Line 6: |
| try | if [ $# -ne 2 ]; then echo "This script must be invoked with two parameters!" exit -1 fi |
| Line 7: | Line 11: |
| MAXINT=$1 MAX_NESTING_LEVEL=$2 # NOTE: MAX_NESTING_LEVEL is not used in this version of DLV SCRIPTDIR=`dirname $0` BIN=$SCRIPTDIR/dlv.i386-linux-elf-static.bin ENCODING=$SCRIPTDIR/myProblem1.dl OUTPUT_PREDICATES=path # Execution with preprocessing and postprocessing: $SCRIPTDIR/preprocess.pl | $BIN -N=$MAXINT -filter=$OUTPUT_PREDICATES -n=1 -silent $ENCODING -- | $SCRIPTDIR/postprocess.pl ECODE=$? if [ $ECODE -ne 0 ]; then echo UNKNOWN; fi exit $ECODE |
|
| Line 8: | Line 28: |
Note that, in the above script, {{{DLV}}} is invoked after a pre-processing perl script. The output of {{{DLV}}} is processed by a perl post-processing script. Your binary executable might not require a pre-processing script, in which case the following instruction can be used in the script: {{{ # Execution with postprocessing only: $BIN -N=$MAXINT -filter=$OUTPUT_PREDICATES -n=1 -silent $ENCODING -- | $SCRIPTDIR/postprocess.pl }}} Similarly, if your binary executable does not require a post-processing script, the following instruction can be used in the script: {{{ # Execution with preprocessing only: $SCRIPTDIR/preprocess.pl | $BIN -N=$MAXINT -filter=$OUTPUT_PREDICATES -n=1 -silent $ENCODING -- }}} |
# !/usr/bin/env bash
set -o pipefail # Disable output buffering
if [ $# -ne 2 ]; then
echo "This script must be invoked with two parameters!"
exit -1
fi
MAXINT=$1
MAX_NESTING_LEVEL=$2 # NOTE: MAX_NESTING_LEVEL is not used in this version of DLV
SCRIPTDIR=`dirname $0`
BIN=$SCRIPTDIR/dlv.i386-linux-elf-static.bin
ENCODING=$SCRIPTDIR/myProblem1.dl
OUTPUT_PREDICATES=path
# Execution with preprocessing and postprocessing:
$SCRIPTDIR/preprocess.pl | $BIN -N=$MAXINT -filter=$OUTPUT_PREDICATES -n=1 -silent $ENCODING -- | $SCRIPTDIR/postprocess.pl
ECODE=$?
if [ $ECODE -ne 0 ]; then
echo UNKNOWN;
fi
exit $ECODENote that, in the above script, DLV is invoked after a pre-processing perl script. The output of DLV is processed by a perl post-processing script. Your binary executable might not require a pre-processing script, in which case the following instruction can be used in the script:
# Execution with postprocessing only: $BIN -N=$MAXINT -filter=$OUTPUT_PREDICATES -n=1 -silent $ENCODING -- | $SCRIPTDIR/postprocess.pl
Similarly, if your binary executable does not require a post-processing script, the following instruction can be used in the script:
# Execution with preprocessing only: $SCRIPTDIR/preprocess.pl | $BIN -N=$MAXINT -filter=$OUTPUT_PREDICATES -n=1 -silent $ENCODING --
