# ISABELLE_BIN_PATH (if isabelle is not located in PATH)
if [ "${1%/*}" = "${1##*/}" ]; then
echo $(pwd -P)/$1
else
local P=`pwd`;
local R=$?;
return $R;
fi
}
if [ -z $1 ]; then
echo "Nothing to translate!"
exit 1
fi
echo "Cannot find $1"
exit 1
fi
echo "Cannot read file $TRANS.thy"
exit 1
fi
if [ ! -z $ISABELLE_BIN_PATH ]; then
ISABELLE="$ISABELLE_BIN_PATH/isabelle"
if [ ! -e $ISABELLE ]; then
echo "Cannot find isabelle executable. Maybe you didn't specify ISABELLE_BIN_PATH correctly?"
exit 1
fi
else
else
echo "Cannot find isabelle executable. Maybe you need to specify ISABELLE_BIN_PATH?"
exit 1
fi
fi
if [ ! -x $ISABELLE ]; then
echo "$ISABELLE is not executable"
exit 1
fi
else
fi
else
fi
echo "Starting Isabelle"
(
echo "theory IsaExport
imports Datatype FunDef
begin
ML {*
use \"$SCRIPTPATH/export_helper.ml\";
val s = File.read (Path.explode \"$TRANS.thy\");
val (th,err) = Parser.scan s |> Parser.test;
File.write (Path.explode \"./test.out\") (Parser.scan s |> PolyML.makestring);
*}
end"
echo "Loading Theory failed"
exit 1
fi