#!/usr/bin/env bash
if [ $# -ne 3 ]; then
    echo "This script must be invoked with three parameters!"
    exit
fi

MAXINT=$1
MAX_NESTING_LEVEL=$2    # NOTE: MAX_NESTING_LEVEL is not used in this version of DLV
SCRIPTDIR=`dirname $0`
BIN=$SCRIPTDIR/bin/clasp
MODELS=$SCRIPTDIR/models/
OUTP=$(echo $3 | tr "," " ")
SHIFTER="shifter -q -ss -nS"
GRINGO="gringo --shift"

{
$SHIFTER
echo "#hide."
for s in $OUTP ; do for i in {0..8} ; do echo "#show ${s}/${i}."; done done
}  | $GRINGO | $BIN --outf=1 --auto --configurations=${MODELS}portfolio.txt --modelpath=${MODELS}

exit $?

