Commit 3b26795f authored by Dario Pinto's avatar Dario Pinto
Browse files

Merge branch 'master' into 'master'

new article + update

See merge request OCamlPro/www!58
parents cf2352b9 ade02f43
title=Release of Alt-Ergo 1.30 with experimental support for models generation
authors=Mohamed Iguernlala
category=Formal Methods
We have recently released a new (public up-to-date) version of Alt-Ergo. We focus in this article on its main new feature: experimental support for models generation. This work has been done with *Frédéric Lang*, an intern at OCamlPro from February to July 2016.
### The idea behind models generation
The idea behind this feature is the following: when Alt-Ergo fails to prove the validity of a given formula `F`, it tries to compute and exhibit values for the terms of the problem that make the negation of `F` satisfiable. For instance, for the following example, written in Alt-Ergo's syntax,
logic f : int -> int
logic a, b : int
goal g:
(a <> b and f(a) <= f(b) + 2*a) ->
a possible (counter) model is `a = 1`, `b = 3`, `f(a) = 0`, and `f(b) = 0`. The solution is called a `candidate` model because universally quantified formulas are, in general, not taken into account. We talk about `counter example` or `counter model` because the solution falsifies (i.e. satisfies the negation of) `F`.
### Basic usage
Models generation in Alt-Ergo is non-intrusive. It is controlled via a new option called `-interpretation`. This option requires an integer argument. The default value `0` disables the feature, and:
- `-interpretation 1` triggers a model computation and display at the end of Alt-Ergo's execution (i.e. just before returning `I don't know`),
- `-interpretation 2` triggers a model computation before each axioms instantiation round,
- `-interpretation 3` is the most aggressive. It triggers a model computation before each Boolean decision in the SAT.
For the two latest strategies, the model will be displayed at the end of the execution if the given formula is not proved. Note that a negative argument (-1, -2, or -3) will enable model computation as explained above, but the result will not be displayed (useful for automatic testing). In addition, if Alt-Ergo timeouts, the latest computed model, if any, will be shown.
### Advanced usage
If you are not on Windows, you will also be able to use option `-interpretation-timelimit` to try to get a candidate model even when Alt-Ergo hits a given time limit (set with option `-timelimit`). The idea is simple: if Alt-Ergo fails to prove validity during the time allocated for "proof search", it will activate models generation and tries to get a counter example during the time allocated for that.
### Form of produced models
Currently, models are printed in a syntax similar to SMT2's. We made this choice because Why3 already parses models in this format. For instance, Alt-Ergo outputs the following model for the example above:
(a 1)
(b 3)
((f 3) 0)
((f 1) 0)
### Some known issues and limitations
- For the moment, arrays are interpreted in term of the accesses that appear in the input formula, or that have been added internally by the decision procedure. In particular, a non-constrained array `arr` will probably be uninterpreted in the model (which would mean that it can have any well-typed value at any well-typed index).
- Model generation may not terminate in presence of non-linear arithmetic. This is actually the case for the example
below (Alt-Ergo handles rationals, and there is no rational `x` such that `x * x = 2`). We plan to implement a `delta-completeness` like approach to stop splitting when intervals become really too small.
`goal g: forall x : real. x * x = 2. -> false`.
- Currently, we generate a model for the content of the decision procedures part. Since the SAT's model is (in general) partial in Alt-Ergo, some ground terms may be missing. Moreover, no filtering with labels mechanism is done for the moment.
### Alt-Ergo 1.30 vs 1.20 vs 1.01 releases
A quick comparison between this new version, the latest private release (1.20), and the latest public release (1.01) on our internal benchmarks is shown below. You notice that this version is faster and discharges more formulas.
<table style="width: 746px; height: 359px;">
<td style="width: 186px; text-align: center;"></td>
<td style="width: 175px; text-align: center;">Alt-Ergo 1.01</td>
<td style="width: 176.317px; text-align: center;">Alt-Ergo 1.20</td>
<td style="width: 170.683px; text-align: center;">Alt-Ergo 1.30</td>
<td style="width: 186px; text-align: center;">Why3 benchmarks
(9752 VCs)</td>
<td style="width: 175px; text-align: center;">88.36%
7310 seconds</td>
<td style="width: 176.317px; text-align: center;">89.23%
7155 seconds</td>
<td style="width: 170.683px; text-align: center;">89.57%
4553 seconds</td>
<td style="width: 186px; text-align: center;">SPARK benchmarks
(14442 VCs)</td>
<td style="width: 175px; text-align: center;">78.05%
3872 seconds</td>
<td style="width: 176.317px; text-align: center;">78.42%
3042 seconds</td>
<td style="width: 170.683px; text-align: center;">78.56%
2909 seconds</td>
<td style="width: 186px; text-align: center;"> BWare benchmarks
(12828 VCs)</td>
<td style="width: 175px; text-align: center;">97.38%
6373 seconds</td>
<td style="width: 176.317px; text-align: center;">98.02%
6907 seconds</td>
<td style="width: 170.683px; text-align: center;">98.31%
4231 seconds</td>
### Download, install and bugs report
You can learn more about Alt-Ergo and download the latest version on [the solver's website]( You can also install it [via the OPAM package manager]( For bugs report, we recommend [Alt-Ergo's issues tracker on Github](
Don't hesitate to give your feedback to help us improving Alt-Ergo. You can also contribute with benchmarks to diversify and enrich our internal test-suite.
......@@ -8,8 +8,6 @@ let old_to_new =
; ("/fr/recrutement-ocamlpro/", "/jobs")
; ( ""
, "/" )
; ( ""
, "/" )
; ("", "/")
; ( ""
, "/" )
......@@ -170,6 +168,9 @@ let old_to_new =
; ( "/2015/05/18/reduced-memory-allocations-with-ocp-memprof/"
, "/blog/2015_05_18_reduced_memory_allocations_with_ocp_memprof." )
; ("/2016/04/01/asm-ocaml/", "/blog/2016_04_01_asm_ocaml")
; ( "/2016/11/21/release-of-alt-ergo-1-30-with-experimental-support-for-models-generation/"
, "/blog/2016_11_21_release_of_alt_ergo_1_30_with_experimental_support_for_models_generation"
; ( "/2017/02/09/opam-2-0-beta-is-out/"
, "/blog/2017_02_09_opam_2.0_beta_is_out" )
; ( "/2017/03/16/new-opam-features-opam-build/"
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