311 Commits

Author SHA1 Message Date
Solène Moreau
74914e7651 (V719-014) Merging Inria/master into SPARK/master
Change-Id: I2144736b2dbb76966fbe4eae6238a8751799a3d2
Depends-On: I5a522521b64c6e676113695f30625b9618461867
Depends-On: I51bf388c10a7d73401ebb48c7c3c07828da4af12
2022-07-19 14:57:03 +02:00
Jacques-Henri Jourdan
5633c0e12c MLCFG: allow attributes to the body of a function. 2022-07-06 13:18:28 +02:00
MARCHE Claude
a23f364805 Resolve "wish: use a multi-line format for source locations" 2022-06-22 18:17:43 +00:00
Solène Moreau
4441127004 V516-003 Merging Inria master into SPARK master
Change-Id: I8cf967252c89e4cb3a31a0257060eee413f61f28
Depends-On: Ida46d9019fdc15a00df2697c45e5519b48bbe7aa
Depends-On: I710c21a3c22933eec6a2369ed6a293bb30b73bbf
2022-06-15 14:15:27 +02:00
Claude Marche
a9b61c8a43 Display source files in the IDE
When a source location points to a file that is not part of the session,
the IDE now displays it in an extra tab. If the source locations are
properly positioned, then the source positioning and coloring should
work in these extra files. This feature should be useful for front-ends
generating mlw files with being recorded as a language plug-in
2022-05-17 15:57:03 +02:00
Guillaume Melquiond
53926bbbf5 Update headers. 2022-04-26 16:33:42 +02:00
Solène Moreau
a29b8b930c V325-031 Merging Why3/Inria master into Why3/SPARK master
Change-Id: Ib12de95cfa922bd1b8c1f5ad1ba269de9c90894c
Depends-On: I3c3e37849899e4436210701c67ddf0049aa08204
Depends-On: I28a9ef2ea1b11448bea50d1f4c4c799e8255fda8
2022-04-26 09:17:30 +02:00
Claude Marche
27b9fd8a97 CFG/stackify: keep the name of invariants in generated WhyML 2022-04-19 13:00:38 +02:00
Johannes Kanig
b214ef9ff4 V330-007 add code to remove duplicate includes
IN an effort to clean up the generated mlw, we remove duplicate
includes. We do this by transforming the includes in an intermediate
representation which can be easily be compared, then use a set to
avoid duplicates. We do this in a way as to preserve ordering of the
includes, as why3 is apparently sensitive to that.

* gnat_ast_to_ptree.ml
(Include_Decl): new module to be able to build sets of includes
(mk_theory_declaration): build a set of includes before translation,
  to avoid duplicates

Change-Id: Ibd06f7b7edfe3c55ed5e467837c7f021d17e052e
2022-03-31 08:17:49 +09:00
Johannes Kanig
27a3a2798e V330-007 follow changes in gnat_ast
* gnat_ast.ml: autogenerated
* gnat_ast_to_ptree.ml: remove code for case that's not possible any
  more

Change-Id: I0cdc2d90f3fe24dec16ca3a53a83e0a604ecfd9b
2022-03-30 17:56:56 +09:00
Claude Marche
10c3ba9a84 fix generation of infinite loops, adding an absurd afterwards
Additional various fixes, including removing annoying warnings from
recent versions of OCaml
2022-03-29 19:03:27 +02:00
Solène Moreau
524b938a9d V325-031 Merge with upstream Why3
Change-Id: I2e98bd5ec8c138751713811f4dad164be6a4463a
2022-03-29 10:47:33 +02:00
Guillaume Melquiond
b61b4e73eb Print real numbers directly from their internal representation.
This has the following benefits:
- fractional real numbers no longer have spurious zeros;
- hexadecimal real numbers now decay to decimal ones;
- integer real numbers no longer use a multiplication.
2022-03-16 10:37:36 +01:00
Johannes Kanig
851fd46e55 V215-001 contract accesses to constructed record in terms
Change-Id: I395a37001174570a4047e05ff50e840e4a0a621b
2022-02-18 18:19:36 +09:00
Xavier Denis
1985144eab Stackify 2022-01-14 10:35:59 +01:00
Jean-Christophe Filliatre
f31498beda fixed Python lexer
empty comment lines were not accepted by the lexer
2021-12-09 08:48:51 +01:00
Yannick Moy
5040c670ae UB05-006 Add theories and drivers for extended floats
This adds the support for 80-bits so-called extended floating-point types
to the IEEE theory of floats in Why3.

[changelog]
* drivers/smt-libv2-floats.gen:
(ieee_float.Float80): Use native support and remove propositions.
(ieee_float.FloatConverter): Remove propositions on this generic theory.
(ieee_float.Float32_64_Converter): Adapt from previous binding.
(ieee_float.Float80_BV_Converter): Similar to other BV converters.
* plugins/gnat_json/gnat_ast_to_ptree.ml: Adapt to new Float80 theory.
* stdlib/ieee_float.mlw:
(Float80): New module.
(FloatConverter): Make module abstract in small/large fp types.
(Float32_64_Converter): New name for previous FloatConverter.
(Float32_80_Converter): New conversion module.
(Float64_80_Converter): New conversion module.
(Float_BV_Converter): Delay axiom of_ubv64_to_real at instantiation.
(Float32_BV_Converter): Provide axiom for of_ubv64_to_real.
(Float64_BV_Converter): Provide axiom for of_ubv64_to_real.
(Float80_BV_Converter): New conversion module.

Change-Id: I8feba3c3440878c4a6a20c511b86b8cd69eef328
2021-11-08 15:28:43 +01:00
Johannes Kanig
94e7888150 UB04-014 save temp for new value of variant
When generating the assertion comparing the old value of the variant
with the new one, we were directly using the expression provided in
the Variant node of the GNAT AST. This is not correct, as it may be
a program expression, so not suitable for an assertion. We introduce
let-bindings to introduce temps for these expressions.

* gnat_ast_pretty.ml
  new pretty printing functions to (almost) complete pretty-printing
  of nodes
* gnat_ast_to_ptree.ml
  (mk_of_expr): introduce temps for new values of variants

Change-Id: Ifeb30d508ec834ddf0253c19859f5305fe18d8a5
2021-11-05 17:13:16 +09:00
Guillaume Melquiond
7c186a1233 Fix copyright headers. 2021-10-06 17:51:40 +02:00
Benedikt Becker
9b0ae82b66 TC02-027 Emit attributes RAC:call_id in conversion to Ptree
Normally, result values of function calls are requested during
giant-step RAC by their location. However, lexical, unique locations
can be overwritten using location annotations, which are frequent in
SPARK-generated WhyML programs, resulting in ambiguous locations, and
retrieval of the wrong result values.

As a workaround, this change generates call ids for calls and abstract
expressions, to identify result values in the counterexample uniquely.

In the future, result values should instead be identified by their
structural position in the WhyML AST, to avoid the need for generating
the call ids.

Change-Id: Id4734dc26e0cbdc19289ddeb72f8ec3a42c735f6
2021-10-01 23:57:10 +02:00
Jean-Christophe Filliatre
1c08c1987f micro Python: added def for function/predicate and type variables 2021-09-30 14:32:03 +02:00
Guillaume Melquiond
55fc17a4ea Change interface-only .ml files into .mli files. 2021-09-28 18:05:52 +02:00
Guillaume Melquiond
f75492a0db Remove dead code. 2021-09-28 17:32:00 +02:00
Guillaume Melquiond
ebfa10f2b9 Silence warning 70 "missing-mli".
OCaml warns when there is a .ml file but no .mli file. This commit adds
almost all the missing .mli files. The remaining ones are the *_ast.ml
files, as the .mli files would be verbatim copies.
2021-09-28 17:32:00 +02:00
Jean-Christophe Filliatre
d6010c82eb micro Python: types in quantifiers 2021-09-28 14:36:47 +02:00