#!/bin/sh
java.lang.NullPointerException # proveit.in # Release: ProofLite-6.0.9 (3/14/14)
java.lang.NullPointerException # Contact: Cesar Munoz (cesar.a.munoz@nasa.gov) # NASA Langley Research Center # http://shemesh.larc.nasa.gov/people/cam/ProofLite
java.lang.NullPointerException # Copyright (c) 2011-2012 United States Government as represented by # the National Aeronautics and Space Administration. No copyright # is claimed in the United States under Title 17, U.S.Code. All Other # Rights Reserved.
java.lang.NullPointerException # Script for batch proving in PVS #
all_opt() { if [ -z "$FILENOTFOUND" ]; then
QUIET=yes if [ -z "$CLEAN" ]; then
CLEAN=yes
fi if [ "$CLEAN" = "only" ]; then
QUIET=
fi
LISPIMPORT=t
LISPSCRIPTS=nil
fi
}
# $ARG has the general form # <dir> | <file>[.pvs] | [<dir>@]<thf1>,..,<thfn>, where # <thfi> has the form <th>[.<f1>:..:<fm>]
compile_infile_name() { # If <dir>, set context to <dir> and pvsfile to top.pvs if [ -d $ARG ]; then
PVSCONTEXT=$ARG if [ -z "$OUTFILE" ]; then
OUTFILE=$ARG$EXT
fi
PVSFILE=`basename $TOP .pvs` if [ -f $PVSCONTEXT/$PVSFILE.pvs ]; then
all_opt else
FILENOTFOUND="$PVSCONTEXT/$PVSFILE.pvs"
fi
LISPDEPENDENCIES=t # If <file>, set context to its dirname and pvsfile to its base name else
PVSCONTEXT=`dirname $ARG`
PVSFILE=`basename $ARG .pvs` if [ ! -f $PVSCONTEXT/$PVSFILE.pvs ]; then case $ARG in
*@*) predir=`echo $ARG | sed -e "s/\([^@]*\)@.*/\1/"`
THFS=`echo $ARG | sed -e "s/[^@]*@//"` if [ -z "$predir" ]; then
PVSCONTEXT="." else if [ -d "$predir" ]; then
PVSCONTEXT=$predir else
echo "Error: $predir is not a directory" exit1
fi
fi if [ "$THFS" ]; then
PVSFILE=$THFS
THEORIES=`echo $THFS | sed -e "s/\..*,/,/g" -e "s/\..*//"` else
echo "Error: At least one theory has to be specified in $ARG" exit1
fi;;
*) FILENOTFOUND="$PVSCONTEXT/$PVSFILE.pvs" if [ -z "$NOFILE" ]; then
echo "Error: File $FILENOTFOUND not found" exit;
fi;;
esac
fi
fi
}
strip_ext() {
echo "$1" | sed -e "s/\(.*\)\..*/\1/g"
}
# If necessary, set the name of the output file
java.lang.NullPointerException
compile_outfile_names() {
dir=$OUTDIR if [ -z "$OUTFILE" ]; then if [ -z "$dir" ]; then
dir=$PVSCONTEXT
fi
OUTFILE=$PVSFILE$EXT else if [ -z "$dir" ]; then
dir=`dirname $OUTFILE`
fi
fi
base=`basename $OUTFILE`
BASEOUT=`strip_ext $base` if [ "$BASEOUT" = $base ]; then
base=$BASEOUT$EXT
fi
OUTFILE=$dir/$base
LOGFILE=$dir/$BASEOUT.log if [ "$LISPTYPECHECK" = "t" ]; then
OUTFILE=$OUTFILE-tc
LOGFILE=$LOGFILE
fi
}
# Translate a list l1,...,ln into (l1 .. ln)
list_to_lisp() { if [ -z "$1" ]
then
echo nil else
echo "(\"$1\")" | sed -e "s/,/\" \"/g"
fi
}
# append e l = e,le. Check for the special case when l is empty
append() { if [ -z "$2" ]; then
echo "$1" else
echo "$2,$1"
fi
}
# Take care of the optional cleaning
java.lang.NullPointerException
cleanup() { if [ "$CLEAN" ]
then if [ -z "$QUIET" ]
then
echo "Removing $PVSCONTEXT/.pvscontext $PVSCONTEXT/$PVSBIN/ $OUTFILE $LOGFILE"
fi
rm -r -f $PVSCONTEXT/.pvscontext $PVSCONTEXT/$PVSBIN/*.* $OUTFILE $LOGFILE fi }
p
}' else
sed -n -e '/Proof summary/h'\
-e '/Proof summary/ !{
/unfinished/H
/unchecked/H
/untried/H
}'\
-e '/Theory totals/ {
H;g
/\.\.\.\./p
}'\
-e '/^Grand Totals:/p'
fi
}
process_opts() { while [ $# -gt 0 ] do case $1 in
-a|all|--all)
all_opt;;
-c|-clean|--clean)
CLEAN=yes;;
-C|-Clean|--Clean|-clean-only|--clean-only)
QUIET=
CLEAN=only;;
~c|-no-clean|--no-clean)
CLEAN=;;
-dep|--dep|-dependencies|--dependencies)
LISPDEPENDENCIES=t;;
-f|-force|--force)
LISPFORCE=t;;
~f|-no-force|--no-force)
LISPFORCE=nil;;
-i|-importchain|--importchain)
LISPSCRIPTS=nil
LISPIMPORT=t;;
~i|-no-importchain|--no-importchain)
LISPIMPORT=nil;;
-s|-scripts|--scripts)
LISPSCRIPTS=t;;
~s|-no-scripts|--no-scripts)
LISPSCRIPTS=nil;;
-T|-Typecheck|--Typecheck|-typecheck-only|--typecheck-only)
LISPTYPECHECK=t;;
-traces|--traces)
LOG=yes
LISPTRACES=t;;
-no-traces|--no-traces)
LISPTRACES=nil;;
-txt|--txt)
LISPTXTPROOFS=t;;
-no-txt|--no-txt)
LISPTXTPROOFS=nil;;
-tex|--tex)
LISPTEXPROOFS=t;;
-no-tex|--no-tex)
LISPTEXPROOFS=nil;;
-l|-log|--log)
LOG=yes;;
~l|-no-log|--no-log)
LOG=;;
~p|-no-prelude-ext|--no-prelude-ext)
PRELUDEXT=;;
-q|-quiet|--quiet)
QUIET=yes;;
-v|-verbose|--verbose)
QUIET=;;
--*)
usage
echo "Error: $1 is not a valid option" exit1;;
-*)
opts=`echo "$1" | sed -e s/-//g -e "s/\(.\)/\1 /g"` for opt in $opts; do case $opt in
a)
all_opt;;
c)
CLEAN=yes;;
C)
QUIET=
CLEAN=only;;
f)
LISPFORCE=t;;
s)
LISPSCRIPTS=t;;
v)
QUIET=;;
i)
LISPSCRIPTS=nil
LISPIMPORT=t;;
l)
LOG=yes;;
q)
QUIET=yes;;
T)
LISPTYPECHECK=t;;
*)
usage
echo "Error: -$opt is not a valid option" exit1;;
esac
done;;
~*)
opts=`echo "$1" | sed -e s/~//g -e "s/\(.\)/\1 /g"` for opt in $opts; do case $opt in
c)
CLEAN=;;
f)
LISPFORCE=nil;;
i)
LISPIMPORT=nil;;
s)
LISPSCRIPTS=nil;;
l)
LOG=;;
p)
PRELUDEXT=;;
*)
usage
echo "Error: ~$opt is not a valid option" exit1;;
esac
done
esac
shift
done
}
# Main Function
proveit() {
compile_infile_name if [ "$CLEAN" = "only" ]; then
cleanup else
process_opts $OPTS if [ "$DEBUG" ]; then
QUIET=
LOG=y
fi
compile_outfile_names
cleanup
if [ "$FILENOTFOUND" ]; then if [ -z "$CLEAN" ]; then
echo "Error: File $FILENOTFOUND not found"
fi exit1
fi
echo Processing $PVSCONTEXT/$PVSFILE.pvs. Writing output to file $OUTFILE if [ "$LOG" ]; then
echo "Logging PVS information in $LOGFILE"
fi if [ -z "$QUIET" ]; then if [ "$PRELUDEXT" ]; then
echo "Loading prelude extensions: $PRELUDEXT"
fi if [ "$DISABLE" ]; then if [ "$DISABLE" = "_" ]; then
echo "Disabling any external oracle" else
echo "Disabling oracles: $DISABLE"
fi
fi if [ "$ENABLE" ]; then
echo "Enabling oracles: $ENABLE"
fi if [ "$LISPIMPORT" = "t" ]; then
echo "Proving chain of imported theories"
fi if [ "$LISPDEPENDENCIES" ]; then
echo "Saving theory dependencies in directory pvsbin"
fi if [ "$LISPSCRIPTS" != "t" ]; then
echo "ProofLite scripts won't be installed"
fi if [ "$LISPFORCE" != "t" ]; then
echo "Proofs won't be forced"
fi if [ "$LISPTRACES" = "t" ]; then
echo "Including proof traces in output file"
fi if [ "$LISPTXTPROOFS" = "t" ]; then
echo "Generating text proof files in directory pvstxt"
fi if [ "$LISPTEXPROOFS" = "t" ]; then
echo "Generating LaTeX proof files in directory pvstex"
fi
fi
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.