Commit f546ae8a authored by Stefan Berghofer's avatar Stefan Berghofer

Adapted to Isabelle2016

Isabelle2015 is still supported, but support for Isabelle2014 has been
discontinued.
parent 295c2913
......@@ -157,8 +157,7 @@ pvsbin/
/lib/isabelle/map/
/lib/isabelle/real/
/lib/isabelle/set/
/lib/isabelle/Tools/why3
/lib/isabelle/Why3_Number.thy
/lib/isabelle/Why3_BV.thy
/lib/isabelle/why3.ML
/lib/isabelle/last_build
/lib/isabelle/bv
......
......@@ -1144,7 +1144,7 @@ clean::
ifeq (@enable_isabelle_libs@,yes)
ISABELLEVERSIONSPECIFIC=why3.ML Tools/why3 Why3_Number.thy
ISABELLEVERSIONSPECIFIC=why3.ML Why3_BV.thy
ISABELLEVERSIONSPECIFICTARGETS=$(addprefix lib/isabelle/, $(ISABELLEVERSIONSPECIFIC))
ISABELLEVERSIONSPECIFICSOURCES=$(addsuffix .@ISABELLEVERSION@, $(ISABELLEVERSIONSPECIFICTARGETS))
......
......@@ -618,21 +618,21 @@ else
ISABELLEDETECTEDVERSION=`$ISABELLE version | sed -n -e 's|Isabelle\([[^:]]*\).*$|\1|p' `
case $ISABELLEDETECTEDVERSION in
2014*)
2015*)
enable_isabelle_support=yes
ISABELLEVERSION=2014
ISABELLEVERSION=2015
AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
;;
2015*)
2016*)
enable_isabelle_support=yes
ISABELLEVERSION=2015
ISABELLEVERSION=2016
AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
;;
*)
AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
enable_isabelle_support=no
AC_MSG_WARN(You need Isabelle 2014 or 2015; Isabelle discarded)
reason_isabelle_support=" (need version >= 2014)"
AC_MSG_WARN(You need Isabelle 2015 or later; Isabelle discarded)
reason_isabelle_support=" (need version >= 2015)"
;;
esac
fi
......
......@@ -11,9 +11,9 @@ using ``Edit'' action in \texttt{why3ide}.
\subsection{Installation}
You need version Isabelle2014 or Isabelle2015. Former versions are not
supported. We assume below that your version is 2015, please replace
2015 by 2014 otherwise.
You need version Isabelle2015 or Isabelle2016. Former versions are not
supported. We assume below that your version is 2016, please replace
2016 by 2015 otherwise.
Isabelle must be installed before compiling \why. After compilation
and installation of \why, you must manually add the path
......@@ -22,7 +22,7 @@ and installation of \why, you must manually add the path
\end{verbatim}
into either the user file
\begin{verbatim}
.isabelle/Isabelle2015/etc/components
.isabelle/Isabelle2016/etc/components
\end{verbatim}
or the system-wide file
\begin{verbatim}
......
theory number.Parity
syntax predicate even "<app><const name=\"Parity.even_odd_class.even\"/>%1</app>"
syntax predicate odd "<app><const name=\"Parity.even_odd_class.odd\"/>%1</app>"
end
theory number.Parity
syntax predicate even "<app><const name=\"Parity.semiring_parity_class.even\"/>%1</app>"
syntax predicate odd "<app><const name=\"Parity.semiring_parity_class.odd\"/>%1</app>"
theory algebra.Field
syntax function inv "<app><const name=\"Fields.inverse_class.inverse\"/>%1</app>"
syntax function (/) "<app><const name=\"Fields.inverse_class.divide\"/>%1%2</app>"
end
theory algebra.Field
syntax function inv "<app><const name=\"Fields.inverse_class.inverse\"/>%1</app>"
syntax function (/) "<app><const name=\"Rings.divide_class.divide\"/>%1%2</app>"
end
......@@ -150,6 +150,11 @@ theory set.Fset
syntax function cardinal "<app><const name=\"Nat.semiring_1_class.of_nat\"><fun><type name=\"Nat.nat\"/><type name=\"Int.int\"/></fun></const><app><const name=\"FSet.fcard\"/>%1</app></app>"
end
theory number.Parity
syntax predicate even "<app><const name=\"Parity.semiring_parity_class.even\"/>%1</app>"
syntax predicate odd "<app><const name=\"Parity.semiring_parity_class.odd\"/>%1</app>"
end
theory number.Divisibility
syntax predicate divides "<app><const name=\"Rings.dvd_class.dvd\"/>%1%2</app>"
end
......@@ -166,11 +171,6 @@ theory number.Coprime
syntax predicate coprime "<app><const name=\"GCD.gcd_class.coprime\"/>%1%2</app>"
end
theory algebra.Field
syntax function inv "<app><const name=\"Fields.inverse_class.inverse\"/>%1</app>"
syntax function (/) "<app><const name=\"Fields.inverse_class.divide\"/>%1%2</app>"
end
theory real.Real
syntax function zero "<number val=\"0\"><type name=\"Real.real\"/></number>"
syntax function one "<number val=\"1\"><type name=\"Real.real\"/></number>"
......
......@@ -7,4 +7,4 @@ filename "%t.xml"
transformation "inline_trivial"
import "isabelle-common.gen"
import "isabelle-2014.gen"
import "isabelle-2016.gen"
......@@ -8,7 +8,7 @@ transformation "inline_trivial"
transformation "eliminate_builtin"
import "isabelle-common.gen"
import "isabelle-2014.gen"
import "isabelle-2016.gen"
transformation "simplify_trivial_quantification_in_goal"
#!/usr/bin/env bash
#
# DESCRIPTION: process files generated by Why3
## diagnostics
PRG="$(basename "$0")"
function usage()
{
echo
echo "Usage: isabelle $PRG [OPTIONS] WHY3_FILE"
echo
echo " Options are:"
echo " -b batch mode"
echo " -i NAME interactive mode using interface NAME"
echo
echo "Process files generated by Why3."
exit 1
}
function fail()
{
echo "$1" >&2
exit 2
}
## utilities
function make_theory()
{
BNAME=`basename "$1"`
if [ ! -e "$1.thy" ]; then
echo -e "theory $BNAME\nimports Why3\nbegin\n\nwhy3_open \"$BNAME.xml\"\n" > "$1.thy"
sed \
-e 's/<lemma name="\([^"]*\)"[^>]*>/why3_vc \1\n\n/g' \
-e 's/<[^l][^>]*>//g' \
"$1.xml" >> "$1.thy"
echo -e "why3_end\n\nend" >> "$1.thy"
fi
}
## process command line
while getopts "bi:" OPT
do
case "$OPT" in
b)
BATCH=true
;;
i)
INTERACTIVE=true
INTERFACE="$OPTARG"
;;
\?)
usage
;;
esac
done
## main
shift $(($OPTIND - 1))
[ "$#" != 1 ] && usage
NAME=`dirname "$1"`/`basename "$1" .xml`
if [ "$BATCH" = true ]; then
"$ISABELLE_PROCESS" -e "use_thy \"$NAME\";" -rq Why3
elif [ "$INTERACTIVE" = true ]; then
make_theory "$NAME"
case "$INTERFACE" in
emacs)
"$ISABELLE_TOOL" emacs -L Why3 "${NAME}.thy"
;;
jedit)
if [ -f "$JEDIT_SETTINGS/$WHY3_JEDIT_SERVER" ]; then
"$ISABELLE_TOOL" java -jar "$(jvmpath "$JEDIT_HOME/dist/jedit.jar")" \
"-settings=$(jvmpath "$JEDIT_SETTINGS")" "-server=$WHY3_JEDIT_SERVER" \
-reuseview -wait "$(jvmpath "${NAME}.thy")"
else
"$ISABELLE_TOOL" jedit -l Why3 "${NAME}.thy"
fi
;;
*)
fail "Unknown Isabelle interface: \"$INTERFACE\""
;;
esac
else
usage
fi
This diff is collapsed.
......@@ -232,7 +232,7 @@ proof (induct n rule: less_induct)
next
case False
with `1 < n` obtain k where "k dvd n" "k \<noteq> 1" "k \<noteq> n"
by (auto simp add: prime_nat_def)
by (auto simp add: Primes.prime_def)
with `1 < n` have "k \<le> n" by (simp add: dvd_imp_le)
with `k \<noteq> n` have "k < n" by simp
moreover from `k dvd n` `1 < n` have "k \<noteq> 0" by (rule_tac notI) simp
......@@ -263,7 +263,7 @@ proof
with `2 \<le> p` obtain d
where d: "prime d" "d * d \<le> p" "d dvd p"
by (auto simp add: int_dvd_iff le_nat_iff int_mult)
from `prime d` have "2 \<le> d" by auto
from `prime d` have "2 \<le> d" by (simp add: prime_ge_2_nat)
then have "2 \<le> int d" by simp
with `2 \<le> int d` have "2 * 2 \<le> int d * int d"
by (rule mult_mono) simp_all
......@@ -275,14 +275,14 @@ qed
why3_vc even_prime
proof -
from `prime (nat p)` have "0 \<le> p" by (simp add: prime_def)
from `prime (nat p)` have "2 \<le> nat p" by auto
from `prime (nat p)` have "2 \<le> nat p" by (simp add: prime_ge_2_nat)
with `prime (nat p)` `even p` `0 \<le> p` show ?thesis
by (auto simp add: order_le_less prime_odd_nat even_nat_iff [symmetric])
qed
why3_vc odd_prime
proof -
from `prime (nat p)` have "2 \<le> nat p" by auto
from `prime (nat p)` have "2 \<le> nat p" by (simp add: prime_ge_2_nat)
with `prime (nat p)` `3 \<le> p` show ?thesis
by (auto simp add: order_le_less prime_odd_nat even_nat_iff [symmetric])
qed
......
This diff is collapsed.
......@@ -181,9 +181,9 @@ subsection {* Rounding towards zero *}
why3_vc Real_of_truncate
using floor_correct [of x] ceiling_correct [of x]
by (simp_all add: truncate_def)
by (simp_all add: truncate_def del: of_int_floor_le le_of_int_ceiling)
why3_vc Truncate_int by (simp add:truncate_def)
why3_vc Truncate_int by (simp add: truncate_def)
why3_vc Truncate_up_neg
using assms ceiling_correct [of x]
......@@ -299,6 +299,9 @@ section {* Power of a real to a real exponent *}
section {* Trigonometric Functions *}
abbreviation (input)
"why3_divide \<equiv> divide"
why3_open "real/Trigonometry.xml"
constants
cos = cos
......
......@@ -527,26 +527,26 @@ name = "Isabelle"
exec = "isabelle"
version_switch = "version"
version_regexp = "Isabelle\\([0-9]+\\(-[0-9]+\\)?\\)"
version_ok = "2015"
version_bad = "2014"
version_ok = "2016"
version_bad = "2015"
# not why3-cpulimit 0 %m because isabelle needs more memory at start-up
command = "%l/why3-cpulimit 0 0 -s %e why3 -b %f"
driver = "drivers/isabelle2015.drv"
driver = "drivers/isabelle2016.drv"
in_place = true
editor = "isabelle2015-jedit"
editor = "isabelle-jedit"
[ITP isabelle]
name = "Isabelle"
exec = "isabelle"
version_switch = "version"
version_regexp = "Isabelle\\([0-9]+\\(-[0-9]+\\)?\\)"
version_ok = "2014"
version_bad = "2015"
version_ok = "2015"
version_bad = "2016"
# not why3-cpulimit 0 %m because isabelle needs more memory at start-up
command = "%l/why3-cpulimit 0 0 -s %e why3 -b %f"
driver = "drivers/isabelle2014.drv"
driver = "drivers/isabelle2015.drv"
in_place = true
editor = "isabelle2014-jedit"
editor = "isabelle-jedit"
[editor pvs]
name = "PVS"
......@@ -561,18 +561,10 @@ name = "Emacs/ProofGeneral/Coq"
command = "emacs --eval \"(setq coq-load-path '((\\\"%l/coq-tactic\\\" \\\"Why3\\\") \
(\\\"%l/coq\\\" \\\"Why3\\\")))\" %f"
[editor isabelle2015-jedit]
name = "Isabelle2015/jEdit"
[editor isabelle-jedit]
name = "Isabelle/jEdit"
command = "isabelle why3 -i %f"
[editor isabelle2014-jedit]
name = "Isabelle2014/jEdit"
command = "isabelle why3 -i jedit %f"
[editor isabelle2014-proofgeneral]
name = "Isabelle2014/Emacs/ProofGeneral"
command = "isabelle why3 -i emacs %f"
[editor altgr-ergo]
name = "AltGr-Ergo"
command = "altgr-ergo %f"
......
......@@ -205,7 +205,7 @@ let rec print_term info defs fmt t = match t.t_node with
<num val=\"%s\"/>\
</app>",
"<app>\
<const name=\"Fields.inverse_class.divide\"/>\
<const name=\"Why3_Real.why3_divide\"/>\
<num val=\"%s\"><type name=\"Real.real\"/></num>\
<num val=\"%s\"/>\
</app>"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment