Commit 6e3a01ae authored by David Hauzar's avatar David Hauzar

Merge commit '46e48687' into counter-examples

parents 74d2b385 46e48687
...@@ -256,7 +256,8 @@ pvsbin/ ...@@ -256,7 +256,8 @@ pvsbin/
/examples/in_progress/bigInt/*__*.ml /examples/in_progress/bigInt/*__*.ml
/examples/in_progress/mp/jsmain.js /examples/in_progress/mp/jsmain.js
/examples/in_progress/mp/*__*.ml /examples/in_progress/mp/*__*.ml
/examples/in_progress/prover/build/*__*.ml
/examples/in_progress/prover/.depend
# modules # modules
/modules/string/ /modules/string/
......
* marks an incompatible change * marks an incompatible change
library
* improved bitvectors theories
Encodings
* When a task has no polymorphic object (except for the special
cases of equality and maps) then the translation to SMT-LIB
format is direct
provers provers
o support for Isabelle 2015 (released May 25, 2015) o support for Isabelle 2015 (released May 25, 2015)
o support for Coq 8.4pl6 (released April 9, 2015)
Version 0.86.1, May 22, 2015 Version 0.86.1, May 22, 2015
============================ ============================
......
...@@ -120,11 +120,6 @@ CLEANDIRS = ...@@ -120,11 +120,6 @@ CLEANDIRS =
CLEANLIBS = CLEANLIBS =
GENERATED = GENERATED =
install_local::
ln -s -n -f ../drivers share/drivers
ln -s -n -f ../modules share/modules
ln -s -n -f ../theories share/theories
############## ##############
# Why3 library # Why3 library
############## ##############
...@@ -158,6 +153,7 @@ LIB_PARSER = ptree glob parser typing lexer ...@@ -158,6 +153,7 @@ LIB_PARSER = ptree glob parser typing lexer
LIB_TRANSFORM = simplify_formula inlining split_goal induction \ LIB_TRANSFORM = simplify_formula inlining split_goal induction \
detect_polymorphism \ detect_polymorphism \
reduction_engine compute \
eliminate_definition eliminate_algebraic \ eliminate_definition eliminate_algebraic \
eliminate_inductive eliminate_let eliminate_if \ eliminate_inductive eliminate_let eliminate_if \
libencoding discriminate encoding encoding_select \ libencoding discriminate encoding encoding_select \
...@@ -168,7 +164,7 @@ LIB_TRANSFORM = simplify_formula inlining split_goal induction \ ...@@ -168,7 +164,7 @@ LIB_TRANSFORM = simplify_formula inlining split_goal induction \
eliminate_epsilon intro_projections_counterexmp \ eliminate_epsilon intro_projections_counterexmp \
prepare_for_counterexmp \ prepare_for_counterexmp \
eval_match instantiate_predicate smoke_detector \ eval_match instantiate_predicate smoke_detector \
reduction_engine compute induction_pr prop_curry induction_pr prop_curry
LIB_PRINTER = alt_ergo why3printer smtv1 smtv2 coq pvs isabelle \ LIB_PRINTER = alt_ergo why3printer smtv1 smtv2 coq pvs isabelle \
simplify gappa cvc3 yices mathematica simplify gappa cvc3 yices mathematica
...@@ -555,6 +551,17 @@ install_local:: bin/why3 $(addprefix bin/,$(TOOLS_BIN)) ...@@ -555,6 +551,17 @@ install_local:: bin/why3 $(addprefix bin/,$(TOOLS_BIN))
bin/%: bin/%.@OCAMLBEST@ bin/%: bin/%.@OCAMLBEST@
ln -sf $(notdir $<) $@ ln -sf $(notdir $<) $@
install_local:: share/drivers share/modules share/theories
share/drivers:
ln -snf ../drivers share/drivers
share/modules:
ln -snf ../modules share/modules
share/theories:
ln -snf ../theories share/theories
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean" ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
include $(TOOLSDEP) include $(TOOLSDEP)
endif endif
...@@ -946,7 +953,7 @@ ifeq (@enable_coq_fp_libs@,yes) ...@@ -946,7 +953,7 @@ ifeq (@enable_coq_fp_libs@,yes)
cp $(addsuffix .vo, $(COQLIBS_FP)) $(LIBDIR)/why3/coq/floating_point/ cp $(addsuffix .vo, $(COQLIBS_FP)) $(LIBDIR)/why3/coq/floating_point/
endif endif
update-coq: remove-coq-headers update-coq-int update-coq-bool update-coq-real update-coq-number update-coq-set update-coq-map update-coq-list update-coq-option update-coq-fp update-coq-seq headers-coq update-coq: remove-coq-headers update-coq-int update-coq-bool update-coq-real update-coq-number update-coq-set update-coq-map update-coq-list update-coq-option update-coq-fp update-coq-seq update-coq-bv headers-coq
update-coq-int: bin/why3realize.@OCAMLBEST@ drivers/coq-realizations.aux theories/int.why update-coq-int: bin/why3realize.@OCAMLBEST@ drivers/coq-realizations.aux theories/int.why
for f in $(COQLIBS_INT_ALL_FILES); do WHY3CONFIG="" bin/why3realize.@OCAMLBEST@ -L theories -D drivers/coq-realize.drv -T int.$$f -o lib/coq/int/; done for f in $(COQLIBS_INT_ALL_FILES); do WHY3CONFIG="" bin/why3realize.@OCAMLBEST@ -L theories -D drivers/coq-realize.drv -T int.$$f -o lib/coq/int/; done
...@@ -1601,12 +1608,10 @@ MODULESTODOC = \ ...@@ -1601,12 +1608,10 @@ MODULESTODOC = \
util/weakhtbl util/stdlib util/rc util/debug \ util/weakhtbl util/stdlib util/rc util/debug \
core/ident core/ty core/term core/decl core/theory \ core/ident core/ty core/term core/decl core/theory \
core/env core/task \ core/env core/task \
driver/whyconf driver/driver \ driver/whyconf driver/call_provers driver/driver \
session/session session/session_tools session/session_scheduler \ session/session session/session_tools session/session_scheduler \
whyml/mlw_ty whyml/mlw_expr whyml/mlw_decl whyml/mlw_module \ whyml/mlw_ty whyml/mlw_expr whyml/mlw_decl whyml/mlw_module \
whyml/mlw_main whyml/mlw_wp
# transform/introduction \
# ide/db
FILESTODOC = $(addsuffix .mli, $(addprefix src/, $(MODULESTODOC))) FILESTODOC = $(addsuffix .mli, $(addprefix src/, $(MODULESTODOC)))
......
theory BuiltIn theory BuiltIn
meta "select_inst" "goal" meta "select_inst_default" "goal"
meta "select_lskept" "goal" meta "select_lskept_default" "goal"
meta "select_lsinst" "goal" meta "select_lsinst_default" "goal"
meta "select_kept" "all" meta "select_kept_default" "all"
end end
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
printer "ocaml" printer "ocaml"
theory BuiltIn theory BuiltIn
syntax type int "Why3__BigInt.t" syntax type int "Why3extract.Why3__BigInt.t"
syntax predicate (=) "(%1 = %2)" syntax predicate (=) "(%1 = %2)"
end end
...@@ -14,6 +14,7 @@ import "ocaml-no-arith.drv" ...@@ -14,6 +14,7 @@ import "ocaml-no-arith.drv"
(* int *) (* int *)
theory int.Int theory int.Int
prelude "open Why3extract"
syntax constant zero "Why3__BigInt.zero" syntax constant zero "Why3__BigInt.zero"
syntax constant one "Why3__BigInt.one" syntax constant one "Why3__BigInt.one"
...@@ -29,38 +30,46 @@ theory int.Int ...@@ -29,38 +30,46 @@ theory int.Int
end end
theory int.Abs theory int.Abs
prelude "open Why3extract"
syntax function abs "(Why3__BigInt.abs %1)" syntax function abs "(Why3__BigInt.abs %1)"
end end
theory int.MinMax theory int.MinMax
prelude "open Why3extract"
syntax function min "(Why3__BigInt.min %1 %2)" syntax function min "(Why3__BigInt.min %1 %2)"
syntax function max "(Why3__BigInt.max %1 %2)" syntax function max "(Why3__BigInt.max %1 %2)"
end end
theory int.Lex2 theory int.Lex2
prelude "open Why3extract"
syntax predicate lt_nat "(Why3__BigInt.lt_nat %1 %2)" syntax predicate lt_nat "(Why3__BigInt.lt_nat %1 %2)"
syntax predicate lex "(Why3__BigInt.lex %1 %2)" syntax predicate lex "(Why3__BigInt.lex %1 %2)"
end end
theory int.EuclideanDivision theory int.EuclideanDivision
prelude "open Why3extract"
syntax function div "(Why3__BigInt.euclidean_div %1 %2)" syntax function div "(Why3__BigInt.euclidean_div %1 %2)"
syntax function mod "(Why3__BigInt.euclidean_mod %1 %2)" syntax function mod "(Why3__BigInt.euclidean_mod %1 %2)"
end end
theory int.ComputerDivision theory int.ComputerDivision
prelude "open Why3extract"
syntax function div "(Why3__BigInt.computer_div %1 %2)" syntax function div "(Why3__BigInt.computer_div %1 %2)"
syntax function mod "(Why3__BigInt.computer_mod %1 %2)" syntax function mod "(Why3__BigInt.computer_mod %1 %2)"
end end
theory int.Power theory int.Power
prelude "open Why3extract"
syntax function power "(Why3__BigInt.power %1 %2)" syntax function power "(Why3__BigInt.power %1 %2)"
end end
theory int.Fact theory int.Fact
prelude "open Why3extract"
syntax function fact "(Why3__IntAux.fact %1)" syntax function fact "(Why3__IntAux.fact %1)"
end end
theory int.Fibonacci theory int.Fibonacci
prelude "open Why3extract"
syntax function fib "(Why3__IntAux.fib %1)" syntax function fib "(Why3__IntAux.fib %1)"
end end
...@@ -69,6 +78,7 @@ end ...@@ -69,6 +78,7 @@ end
(* WhyML *) (* WhyML *)
module stack.Stack module stack.Stack
prelude "open Why3extract"
syntax type t "(%1 Stack.t)" syntax type t "(%1 Stack.t)"
syntax val create "Stack.create" syntax val create "Stack.create"
syntax val push "Stack.push" syntax val push "Stack.push"
...@@ -84,6 +94,7 @@ module stack.Stack ...@@ -84,6 +94,7 @@ module stack.Stack
end end
module queue.Queue module queue.Queue
prelude "open Why3extract"
syntax type t "(%1 Queue.t)" syntax type t "(%1 Queue.t)"
syntax val create "Queue.create" syntax val create "Queue.create"
syntax val push "Queue.push" syntax val push "Queue.push"
...@@ -100,6 +111,7 @@ module queue.Queue ...@@ -100,6 +111,7 @@ module queue.Queue
end end
module array.Array module array.Array
prelude "open Why3extract"
syntax type array "(%1 Why3__Array.t)" syntax type array "(%1 Why3__Array.t)"
syntax function ([]) "(Why3__Array.get %1 %2)" syntax function ([]) "(Why3__Array.get %1 %2)"
...@@ -120,6 +132,7 @@ module array.Array ...@@ -120,6 +132,7 @@ module array.Array
end end
module matrix.Matrix module matrix.Matrix
prelude "open Why3extract"
syntax type matrix "(%1 Why3__Matrix.t)" syntax type matrix "(%1 Why3__Matrix.t)"
syntax function get "(Why3__Matrix.get %1 %2)" syntax function get "(Why3__Matrix.get %1 %2)"
...@@ -137,16 +150,17 @@ module matrix.Matrix ...@@ -137,16 +150,17 @@ module matrix.Matrix
end end
module mach.int.Int module mach.int.Int
prelude "open Why3extract"
syntax val ( / ) "Why3__BigInt.computer_div" syntax val ( / ) "Why3__BigInt.computer_div"
syntax val ( % ) "Why3__BigInt.computer_mod" syntax val ( % ) "Why3__BigInt.computer_mod"
end end
module mach.int.Int31 module mach.int.Int31
(* even on a 64-bit machine, it is safe to use type int for 31-bit integers *) (* even on a 64-bit machine, it is safe to use type int for 31-bit integers *)
syntax val of_int "Why3__BigInt.to_int" syntax val of_int "Why3extract.Why3__BigInt.to_int"
syntax converter of_int "%1" syntax converter of_int "%1"
syntax function to_int "(Why3__BigInt.of_int %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int %1)"
syntax type int31 "int" syntax type int31 "int"
syntax val ( + ) "( + )" syntax val ( + ) "( + )"
...@@ -165,6 +179,7 @@ end ...@@ -165,6 +179,7 @@ end
module mach.int.UInt64 module mach.int.UInt64
(* no OCaml library for unsigned 64-bit integers => we use BigInt *) (* no OCaml library for unsigned 64-bit integers => we use BigInt *)
prelude "open Why3extract"
syntax val of_int "(fun x -> x)" syntax val of_int "(fun x -> x)"
syntax converter of_int "(Why3__BigInt.of_string \"%1\")" syntax converter of_int "(Why3__BigInt.of_string \"%1\")"
...@@ -202,6 +217,7 @@ end ...@@ -202,6 +217,7 @@ end
module string.Char module string.Char
prelude "open Why3extract"
syntax type char "Pervasives.char" syntax type char "Pervasives.char"
syntax val chr "Why3__BigInt.chr" syntax val chr "Why3__BigInt.chr"
syntax val code "Why3__BigInt.code" syntax val code "Why3__BigInt.code"
...@@ -211,13 +227,13 @@ end ...@@ -211,13 +227,13 @@ end
module io.StdIO module io.StdIO
prelude "open Why3extract"
syntax val print_char "Pervasives.print_char" syntax val print_char "Pervasives.print_char"
syntax val print_int "Why3__BigInt.print" syntax val print_int "Why3__BigInt.print"
syntax val print_newline "Pervasives.print_newline" syntax val print_newline "Pervasives.print_newline"
end end
module random.Random module random.Random
prelude "open Why3extract"
syntax val random_int "Why3__BigInt.random_int" syntax val random_int "Why3__BigInt.random_int"
end end
...@@ -47,32 +47,26 @@ theory int.MinMax ...@@ -47,32 +47,26 @@ theory int.MinMax
syntax function max "(Pervasives.max %1 %2)" syntax function max "(Pervasives.max %1 %2)"
end end
(* FIXME (* TODO
theory int.Lex2 - int.EuclideanDivision
syntax predicate lt_nat "(Why3__BigInt.lt_nat %1 %2)" - number.Gcd
syntax predicate lex "(Why3__BigInt.lex %1 %2)" *)
end
theory int.EuclideanDivision
syntax function div "(Why3__BigInt.euclidean_div %1 %2)"
syntax function mod "(Why3__BigInt.euclidean_mod %1 %2)"
end
theory int.Power theory int.Power
syntax function power "(Why3__BigInt.power %1 %2)" prelude "let rec power x n = if n = 0 then 1 else x * power x (n-1)"
syntax function power "(power %1 %2)"
end end
theory int.Fact theory int.Fact
syntax function fact "(Why3__IntAux.fact %1)" prelude "let rec fact n = if n <= 1 then 1 else n * fact (n-1)"
syntax function fact "(fact %1)"
end end
theory int.Fibonacci theory int.Fibonacci
syntax function fib "(Why3__IntAux.fib %1)" prelude "let rec fib n = if n <= 1 then n else fib (n-2) + fib (n-1)"
syntax function fib "(fib %1)"
end end
TODO number.Gcd
*)
(* WhyML *) (* WhyML *)
module stack.Stack module stack.Stack
...@@ -243,24 +237,3 @@ module mach.matrix.Matrix63 ...@@ -243,24 +237,3 @@ module mach.matrix.Matrix63
syntax val copy "(Array.map Array.copy)" syntax val copy "(Array.map Array.copy)"
end end
(* TODO
module string.Char
syntax type char "Pervasives.char"
syntax val chr "Why3__BigInt.chr"
syntax val code "Why3__BigInt.code"
syntax function uppercase "Char.uppercase"
syntax function lowercase "Char.lowercase"
end
module io.StdIO
syntax val print_char "Pervasives.print_char"
syntax val print_int "Why3__BigInt.print"
syntax val print_newline "Pervasives.print_newline"
end
module random.Random
syntax val random_int "Why3__BigInt.random_int"
end
*)
...@@ -15,10 +15,10 @@ import "ocaml-gen.drv" ...@@ -15,10 +15,10 @@ import "ocaml-gen.drv"
end*) end*)
module mach.int.Int32 module mach.int.Int32
syntax val of_int "Why3__BigInt.to_int32" syntax val of_int "Why3extract.Why3__BigInt.to_int32"
syntax converter of_int "%1l" syntax converter of_int "%1l"
syntax function to_int "(Why3__BigInt.of_int32 %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int32 %1)"
syntax type int32 "Int32.t" syntax type int32 "Int32.t"
syntax val (+) "Int32.add" syntax val (+) "Int32.add"
...@@ -39,10 +39,10 @@ module mach.int.Int32 ...@@ -39,10 +39,10 @@ module mach.int.Int32
end end
module mach.int.UInt32 module mach.int.UInt32
syntax val of_int "Why3__BigInt.to_int64" syntax val of_int "Why3extract.Why3__BigInt.to_int64"
syntax converter of_int "%1L" syntax converter of_int "%1L"
syntax function to_int "(Why3__BigInt.of_int64 %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int64 %1)"
syntax constant zero_unsigned "0L" syntax constant zero_unsigned "0L"
syntax type uint32 "Int64.t" syntax type uint32 "Int64.t"
...@@ -78,10 +78,10 @@ module mach.int.UInt32 ...@@ -78,10 +78,10 @@ module mach.int.UInt32
end end
module mach.int.Int63 module mach.int.Int63
syntax val of_int "Why3__BigInt.to_int64" syntax val of_int "Why3extract.Why3__BigInt.to_int64"
syntax converter of_int "%1L" syntax converter of_int "%1L"
syntax function to_int "(Why3__BigInt.of_int64 %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int64 %1)"
syntax type int63 "Int64.t" syntax type int63 "Int64.t"
syntax val (+) "Int64.add" syntax val (+) "Int64.add"
...@@ -99,10 +99,10 @@ module mach.int.Int63 ...@@ -99,10 +99,10 @@ module mach.int.Int63
end end
module mach.int.Int64 module mach.int.Int64
syntax val of_int "Why3__BigInt.to_int64" syntax val of_int "Why3extract.Why3__BigInt.to_int64"
syntax converter of_int "%1L" syntax converter of_int "%1L"
syntax function to_int "(Why3__BigInt.of_int64 %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int64 %1)"
syntax type int64 "Int64.t" syntax type int64 "Int64.t"
syntax val (+) "Int64.add" syntax val (+) "Int64.add"
......
...@@ -6,10 +6,10 @@ import "ocaml-gen.drv" ...@@ -6,10 +6,10 @@ import "ocaml-gen.drv"
(** Machine arithmetic *) (** Machine arithmetic *)
module mach.int.Int32 module mach.int.Int32
syntax val of_int "Why3__BigInt.to_int" syntax val of_int "Why3extract.Why3__BigInt.to_int"
syntax converter of_int "%1" syntax converter of_int "%1"
syntax function to_int "(Why3__BigInt.of_int %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int %1)"
syntax type int32 "int" syntax type int32 "int"
syntax val ( + ) "( + )" syntax val ( + ) "( + )"
...@@ -27,10 +27,10 @@ module mach.int.Int32 ...@@ -27,10 +27,10 @@ module mach.int.Int32
end end
module mach.int.UInt32 module mach.int.UInt32
syntax val of_int "Why3__BigInt.to_int" syntax val of_int "Why3extract.Why3__BigInt.to_int"
syntax converter of_int "%1" syntax converter of_int "%1"
syntax function to_int "(Why3__BigInt.of_int %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int %1)"
syntax constant zero_unsigned "0" syntax constant zero_unsigned "0"
syntax type uint32 "int" syntax type uint32 "int"
...@@ -63,10 +63,10 @@ module mach.int.UInt32 ...@@ -63,10 +63,10 @@ module mach.int.UInt32
end end
module mach.int.Int63 module mach.int.Int63
syntax val of_int "Why3__BigInt.to_int" syntax val of_int "Why3extract.Why3__BigInt.to_int"
syntax converter of_int "%1" syntax converter of_int "%1"
syntax function to_int "(Why3__BigInt.of_int %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int %1)"
syntax type int63 "int" syntax type int63 "int"
syntax val ( + ) "( + )" syntax val ( + ) "( + )"
...@@ -98,10 +98,10 @@ module mach.int.MinMax63 ...@@ -98,10 +98,10 @@ module mach.int.MinMax63
end end
module mach.int.Int64 module mach.int.Int64
syntax val of_int "Why3__BigInt.to_int64" syntax val of_int "Why3extract.Why3__BigInt.to_int64"
syntax converter of_int "%1L" syntax converter of_int "%1L"
syntax function to_int "(Why3__BigInt.of_int64 %1)" syntax function to_int "(Why3extract.Why3__BigInt.of_int64 %1)"
syntax type int64 "Int64.t" syntax type int64 "Int64.t"
syntax val (+) "Int64.add" syntax val (+) "Int64.add"
...@@ -120,7 +120,7 @@ end ...@@ -120,7 +120,7 @@ end
module mach.peano.Peano module mach.peano.Peano
syntax type t "int" syntax type t "int"
syntax val to_int "Why3__BigInt.of_int" syntax val to_int "Why3extract.Why3__BigInt.of_int"
syntax val zero "(fun _ -> 0)" syntax val zero "(fun _ -> 0)"
syntax val succ "succ" syntax val succ "succ"
syntax val pred "pred" syntax val pred "pred"
...@@ -135,7 +135,7 @@ module mach.peano.Peano ...@@ -135,7 +135,7 @@ module mach.peano.Peano
syntax val add "(fun x y _ _ -> x+y)" syntax val add "(fun x y _ _ -> x+y)"
syntax val sub "(fun x y _ _ -> x-y)" syntax val sub "(fun x y _ _ -> x-y)"
syntax val mul "(fun x y _ _ -> x*y)" syntax val mul "(fun x y _ _ -> x*y)"
syntax val of_int "(fun n _ _ -> Why3__BigInt.to_int n)" syntax val of_int "(fun n _ _ -> Why3extract.Why3__BigInt.to_int n)"
syntax val div "(/)" syntax val div "(/)"
syntax val mod "(mod)" syntax val mod "(mod)"
syntax val max "max" syntax val max "max"
...@@ -144,7 +144,7 @@ end ...@@ -144,7 +144,7 @@ end
module mach.onetime.OneTime module mach.onetime.OneTime
syntax type t "int" syntax type t "int"
syntax val to_int "Why3__BigInt.of_int" syntax val to_int "Why3extract.Why3__BigInt.of_int"
syntax val zero "(fun _ -> 0)" syntax val zero "(fun _ -> 0)"