-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: exporting alt-ergo FPA built-in primitives #876
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should change the datatype constructor names depending on the input format, that is somewhat brittle (e.g. now reasoning depends on the input format, which it wasn't before and they should really be independent) and the benefits (strict backward compatibility) don't seem worth the cost.
We do need to use the SMT-LIB names for models, but I don't think we really need the "native" names for anything beyond parsing. Can we just change the names to the SMT-LIB ones ("RNE", etc.) for the ADT constructor names (so they are used for printing) and otherwise define the AE names (NearestTiesToEven
etc.) and the SMT constants (roundNearestTiesToEven
etc.) as aliases in the parser?
src/lib/frontend/d_cnf.ml
Outdated
with_cache ~cache:(Hashtbl.create 13) (fun n -> | ||
with_cache ~cache:(Hashtbl.create 13) (fun m rm -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why nested caches, and why is the rounding mode argument not cached? For multiple arguments it is better to cache a tuple:
with_cache ~cache:(Hashtbl.create 13) (fun (n, m, rm) -> ...)
src/lib/frontend/d_cnf.ml
Outdated
@@ -178,6 +178,7 @@ end | |||
(** Builtins *) | |||
type _ DStd.Builtin.t += | |||
| Float | |||
| SMTFloat of int * int * Fpa_rounding.rounding_mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is somewhat confusing that ae.round
becomes SMTFloat
, would probably deserve an explanatory comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe IndexedFloat
would be a better name here (SMTFloat
seems to imply that this is related to SMT-LIB somehow where it's not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can use AERound
to be sure
src/lib/frontend/d_cnf.ml
Outdated
in | ||
let open DT in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't blanket open DT
— it shouldn't be needed here, and Dolmen has many functions with the same names in different modules, using qualified names help (if only a bit) follow what we are doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just refactored some code and this let open
was copied from below (or above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you are right — but before it was scoped to the inside of a let fpa_builtins
statement, while now it "leaks" into the whole function :)
I would agree to break the backward compatibility if I was sure Why3 did not have drivers for these problems. I would rather not have aliases in the parser though, as we don't want conflicts between identifiers. I am not sure why you find this solution brittle though, the input format specifies straightforwardly the constructor names. If there are multiple input formats, it sounds consistent to have multiple manners to handle built-in values. |
Sorry, i said "parser" but meant "typer" (i.e. Can you clarify what you mean by "Why3 did not have drivers for these problems"? I am not suggesting we change the syntax of the native format in any way, if that was not clear, and adding extra builtins will not break Why3 because we now allow user-defined functions to shadow builtins.
We have support for problems that combine input files in different formats using preludes (and we use preludes for FPA). Now we need to think very hard about where we call All of this is only an issue because |
To be clear: as far as I know, the only backwards compatibility we would be breaking is that we would have different debug messages. |
src/lib/frontend/d_cnf.ml
Outdated
name = Indexed { | ||
basename = "ae.round" ; | ||
indexes = [ i; j; rm ] } } -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was focused on the cache earlier, but: ae.round
should only have two indexed identifiers; the rounding mode argument should be an actual term-level argument (in the same way that in the FloatingPoints SMT-LIB theory only the bit widths are indexed).
Okay, I did not understood your remark ; I thought you were asking to alias the Smtlib2 & the legacy identifiers. In any case, we have to test which identifier to use given the input language at some point to select which constructor is valid. Take
I tested the new feature with the |
I am saying that we should have a single hstring per identifier so that we do not have to do that dispatch. And yes, I am saying we should alias the SMT-LIB and legacy identifiers, in the sense that I am saying Alt-Ergo should behave in the native format as if we had:
Well, to be fair, we don't actually have to expose
Maybe I should have been more precise what I meant by "break", so let me clarify. Here is the same file in both formats, The SMT2 version:
The native version:
Running $ alt-ergo --enable-theories fpa float.ae
File "float.ae", line 4, characters 1-82: Valid (0.7564) (13 steps) (goal g) However here is what I observe on your branch: $ alt-ergo --enable-theories fpa float.ae
[Debug][Satml_frontend][unsat]
Failure("unsupported constant: NearestTiesToEven")
Fatal error: exception File "src/lib/reasoners/satml_frontend.ml", line 1207, characters 6-12: Assertion failed
$ alt-ergo --enable-theories fpa -i native float.ae
File "float.ae", line 4, characters 1-82: Valid (0.4636) (13 steps) (goal g)
$ alt-ergo --enable-theories fpa float.smt2
; File "float.smt2", line 5, characters 1-12: I don't know (0.4565) (4 steps) (goal g_1)
unknown I was actually surprised by the first one, I expected it to work, but it didn't, because when Anyways, this is the sort of things I had in mind when saying that the implementation is brittle. While we could fix these specific issues, we would always risk introducing new ones by mistake when changing the parsers and/or option handling, and it would be highly preferable to use a solution that is by design immune to this sort of shenanigans. (It also shows that we don't nearly have enough FPA tests in the test suite ;) ) |
I was thinking the other way round : we don't want the
I am not sure to understand your point here... Why not exposing them? Do you want to change how these constants are handled (i.e. not as constructors, but as constants) ? The input file issue is troubling though, you're right. |
We don't have to, and we have a lot of flexibility here: the definition of the ADT and the identifiers we expose to the user for each language are all completely distinct. In fact, we could define the ADT internally using arbitrary constructor names and the user would be none the wiser — except that the constructor names for the ADT end up in debug messages and in models, which is why I was saying that we had to use SMT2 names for it (because models are always using the SMT2 syntax).
As I state above: the constructors as objects and the environment binding them to names are completely separate. So we could have The reason to allow |
Okay, so what you propose is to change the fpa_rounding_type to not be an alt-ergo enum, but a special type defining 5 constants? If we build them at parsing, we forbid the user to overload this type (which can be a good thing actually) or we must be careful to match the cases in the right order ; if we do it at typechecking, we lose the file format we were working on. I'm sorry if I make you repeat, I have a hard time understanding your answers here. |
Here is what I propose:
Note that we can do this at typechecking because we use different builtin environments depending on the file format. Order of matches does not matter, because user-defined names and builtins live in two separate environments (in fact this is a reason to do this at typing time rather than at parsing time, because at parsing time we cannot know if the constructor has been shadowed or not). The actual names are not important, except that they will be used when printing values of type This way, there is a single "semantic" ADT (so that the reasoners don't know about the input format and that is very good), but we give different names to the constructors in the different input format, making it by construction compatible with preludes written in a different language.
Yes, sorry, the difference between "OCaml enum" vs "Alt-Ergo enum" plus the distinction between syntax and semantics make all this very confusing. Hopefully this is clearer now, otherwise we can discuss in person tomorrow as I will be in Paris, might be easier :) |
e4c0b86
to
455ece9
Compare
I think we forgot to talk about it when you were in Paris ! I chose it inject the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we forgot — but we did have a lot of other things to cover. I think we are mostly on the same page tho; translating everything into RoundingMode
is the right way forward I think.
There are still a few minor changes I'd like you to make (notably a couple unused stuff to remove) and we should be good to go :)
src/lib/frontend/d_cnf.ml
Outdated
| (B.RoundNearestTiesToEven | ||
| B.RoundNearestTiesToAway | ||
| B.RoundTowardPositive | ||
| B.RoundTowardNegative | ||
| B.RoundTowardZero as b), _ -> | ||
let fpa_rounding = match b with | ||
B.RoundNearestTiesToEven -> Fpa_rounding.NearestTiesToEven | ||
| B.RoundNearestTiesToAway -> NearestTiesToAway | ||
| B.RoundTowardPositive -> Up | ||
| B.RoundTowardNegative -> Down | ||
| B.RoundTowardZero -> ToZero | ||
| _ -> assert false | ||
in | ||
mk_rounding fpa_rounding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with mk_rounding
now the following is shorter and clearer:
| (B.RoundNearestTiesToEven | |
| B.RoundNearestTiesToAway | |
| B.RoundTowardPositive | |
| B.RoundTowardNegative | |
| B.RoundTowardZero as b), _ -> | |
let fpa_rounding = match b with | |
B.RoundNearestTiesToEven -> Fpa_rounding.NearestTiesToEven | |
| B.RoundNearestTiesToAway -> NearestTiesToAway | |
| B.RoundTowardPositive -> Up | |
| B.RoundTowardNegative -> Down | |
| B.RoundTowardZero -> ToZero | |
| _ -> assert false | |
in | |
mk_rounding fpa_rounding | |
| B.RoundNearestTiesToEven, _ -> mk_rounding NearestTiesToEven | |
| B.RoundNearestTiesToAway, _ -> mk_rounding NearestTiesToAway | |
| B.RoundTowardPositive, _ -> mk_rounding Up | |
| B.RoundTowardNegative, _ -> mk_rounding Down | |
| B.RoundTowardZero, _ -> mk_rounding ToZero |
let add_fpa_enum map = | ||
let ty = Fpa_rounding.fpa_rounding_mode in | ||
match ty with | ||
| Ty.Tsum (_, cstrs) -> | ||
List.fold_left | ||
(fun m c -> | ||
match Fpa_rounding.translate_smt_rounding_mode c with | ||
| None -> | ||
(* The constructors of the type are expected to be AE rounding | ||
modes. *) | ||
assert false | ||
| Some hs -> | ||
MString.add (Hstring.view hs) (`Term ( | ||
Symbols.Op (Constr c), | ||
{ args = []; result = ty }, | ||
Other | ||
)) | ||
m | ||
) | ||
map | ||
cstrs | ||
| _ -> (* Fpa_rounding.fpa_rounding_mode is a sum type. *) | ||
assert false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: while this is correct, I feel like having the generic add_builtin_enum
available is useful.
We could do add_builtin_enum ?(rename = Fun.id) map
with an optional rename
argument that is fun c -> Option.get (Fpa_rounding.translate_smt_rounding_mode c)
for the rounding mode. On the other hand we can also do this when (if) we ever have more builtin enums to add before removing the legacy typechecker entirely, so eh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC there was a more generic version of this function, which I specialized because it was used only once and I did not expect we would add new enums to the legacy syntax. I can revert it, but I already changed it to simplify the reading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generic version did not handle renaming so you were right to specialize it. This is a nit, feel free to ignore it :)
src/lib/frontend/typechecker.ml
Outdated
(* | _, _, _ when Ty.equal ty Fpa_rounding.fpa_rounding_mode -> | ||
* begin | ||
* match s with | ||
* | Symbols.Op (Symbols.Constr cstr ) -> | ||
* begin | ||
* match Fpa_rounding.translate_ae_rounding cstr with | ||
* | None -> TTapp (s, te_args) | ||
* | Some new_c -> | ||
* let new_s = Symbols.Op (Symbols.Constr new_c) in | ||
* TTapp (new_s, te_args) | ||
* end | ||
* | _ -> | ||
* (\* Values of type fpa_rounding_mode should only by constructors *\) | ||
* assert false | ||
* end *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
|
||
axiom ax : 1.0 <= x | ||
|
||
goal g : float(4, 4, NearestTiesToEven, 1.0) <= float(4, 4, NearestTiesToEven, x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add the smt2 version of this test to make sure the preludes work with smt2 input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point: I tested the 'simple' identifier parsing but not the 'indexed' one, which does not work.
EDIT: just an error in my test, ignore this comment
src/lib/structures/fpa_rounding.ml
Outdated
rounding_mode_of_smt_hs key | ||
| Some res -> res | ||
|
||
let translate_ae_rounding_mode hs = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this function is unused.
(** Transforms the Hstring corresponding to a RoundingMode element into | ||
the [rounding_mode] equivalent. Raises 'Failure' if the string does not | ||
correspond to a valid rounding mode. *) | ||
val rounding_mode_of_smt_hs : Hstring.t -> rounding_mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we use the SMT-LIB type as the "basis", this should be rounding_mode_of_hs
(also for symmetry with string_of_rounding_mode
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is to have symmetry and disambiguation with rounding_mode_of_ae_hs
, which also is exported.
src/lib/structures/fpa_rounding.ml
Outdated
(* Alt-Ergo's legacy language also accepts the SMT representation | ||
of rounding modes. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I that is the choice we make please update the documentation.
src/lib/structures/fpa_rounding.ml
Outdated
let rounding_mode_of_smt_hs_opt = | ||
let table = Hashtbl.create 5 in | ||
List.iter2 ( | ||
fun key bnd -> | ||
Hashtbl.add table key bnd | ||
) hstring_smt_reprs cstrs; | ||
fun key -> Hashtbl.find_opt table key | ||
|
||
let rounding_mode_of_smt_hs hs = | ||
match rounding_mode_of_smt_hs_opt hs with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing wrong with using 'a option
in general, but if we are going to raise an exception anyways, it would be better to call Hashtbl.find
and catch Not_found
to avoid the extra allocation.
src/lib/frontend/d_cnf.ml
Outdated
It transforms "fpa_rounding_mode", the Alt-Ergo builtin type into the SMT2 | ||
rounding type "RoundingMode". Also injects each constructor into their SMT2 | ||
equivalent *) | ||
let inject_identifier id = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment is useful but calling this something explicit like inject_ae_to_smt2
would be clearer than inject_identifier
which sounds generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I somehow missed that this one was ready — let's merge.
CHANGES: ### Command-line interface - Enable FPA theory by default (OCamlPro/alt-ergo#1177) - Remove deprecated output channels (OCamlPro/alt-ergo#782) - Deprecate the --use-underscore since it produces models that are not SMT-LIB compliant (OCamlPro/alt-ergo#805) - Add --dump-models-on to dump models on a specific output channel (OCamlPro/alt-ergo#838) - Use consistent return codes (OCamlPro/alt-ergo#842) - Add --continue-on-error flag to set the SMT-LIB error behavior (OCamlPro/alt-ergo#853) - Make dolmen the default value for the --frontend option (OCamlPro/alt-ergo#857) - Restore functionality to broken `--profiling` option (OCamlPro/alt-ergo#947) - Add bare-bones support for interactive input in SMT-LIB format (OCamlPro/alt-ergo#949) - Less confusing behavior on timeout (OCamlPro/alt-ergo#982, OCamlPro/alt-ergo#984) - Add `--strict` option for SMT-LIB compliant mode (OCamlPro/alt-ergo#916, OCamlPro/alt-ergo#1133) - Deprecate `sum`, `typing` and `warnings` debug flags (OCamlPro/alt-ergo#1204) ### SMT-LIB support - Add support for the many new SMT-LIB commands (OCamlPro/alt-ergo#837, OCamlPro/alt-ergo#848, OCamlPro/alt-ergo#852, OCamlPro/alt-ergo#863, OCamlPro/alt-ergo#911, OCamlPro/alt-ergo#942, OCamlPro/alt-ergo#945, OCamlPro/alt-ergo#961, OCamlPro/alt-ergo#975, OCamlPro/alt-ergo#1069) - Expose the FPA rounding builtin in the SMT-LIB format (OCamlPro/alt-ergo#876, OCamlPro/alt-ergo#1135) - Allow changing the SAT solver using (set-option) (OCamlPro/alt-ergo#880) - Add support for the `:named` attribute (OCamlPro/alt-ergo#957) - Add support for quoted identifiers (OCamlPro/alt-ergo#909, OCamlPro/alt-ergo#972) - Add support for naming lemmas in SMT-LIB syntax (OCamlPro/alt-ergo#1141, OCamlPro/alt-ergo#1143) ### Model generation - Use post-solve SAT environment in model generation, fixing issues where incorrect models were generated (OCamlPro/alt-ergo#789) - Restore support for records in models (OCamlPro/alt-ergo#793) - Use abstract values instead of dummy values in models where the actual value does not matter (OCamlPro/alt-ergo#804, OCamlPro/alt-ergo#835) - Use fresh names for all abstract values to prevent accidental captures (OCamlPro/alt-ergo#811) - Add support for model generation with the default CDCL solver (OCamlPro/alt-ergo#829) - Support model generation for the BV theory (OCamlPro/alt-ergo#841, OCamlPro/alt-ergo#968) - Add support for optimization (MaxSMT / OptiSMT) with lexicographic Int and Real objectives (OCamlPro/alt-ergo#861, OCamlPro/alt-ergo#921) - Add a SMT-LIB printer for expressions (OCamlPro/alt-ergo#952, OCamlPro/alt-ergo#981, OCamlPro/alt-ergo#1082, OCamlPro/alt-ergo#931, OCamlPro/alt-ergo#932) - Ensure models have a value for all constants in the problem (OCamlPro/alt-ergo#1019) - Fix a rare soundness issue with integer constraints when model generation is enabled (OCamlPro/alt-ergo#1025) - Support model generation for the ADT theory (OCamlPro/alt-ergo#1093, OCamlPro/alt-ergo#1153) ### Theory reasoning - Add word-level propagators for the BV theory (OCamlPro/alt-ergo#944, OCamlPro/alt-ergo#1004, OCamlPro/alt-ergo#1007, OCamlPro/alt-ergo#1010, OCamlPro/alt-ergo#1011, OCamlPro/alt-ergo#1012, OCamlPro/alt-ergo#1040, OCamlPro/alt-ergo#1044, OCamlPro/alt-ergo#1054, OCamlPro/alt-ergo#1055, OCamlPro/alt-ergo#1056, OCamlPro/alt-ergo#1057, OCamlPro/alt-ergo#1065, OCamlPro/alt-ergo#1073, OCamlPro/alt-ergo#1144, OCamlPro/alt-ergo#1152) - Add interval domains and arithmetic propagators for the BV theory (OCamlPro/alt-ergo#1058, OCamlPro/alt-ergo#1083, OCamlPro/alt-ergo#1084, OCamlPro/alt-ergo#1085) - Native support for bv2nat of bit-vector normal forms (OCamlPro/alt-ergo#1154) - Fix incompleteness issues in the BV solver (OCamlPro/alt-ergo#978, OCamlPro/alt-ergo#979) - Abstract more arguments of AC symbols to avoid infinite loops when they contain other AC symbols (OCamlPro/alt-ergo#990) - Do not make irrelevant decisions in CDCL solver, improving performance slightly (OCamlPro/alt-ergo#1041) - Rewrite the ADT theory to use domains and integrate the enum theory into the ADT theory (OCamlPro/alt-ergo#1078, OCamlPro/alt-ergo#1086, OCamlPro/alt-ergo#1087, OCamlPro/alt-ergo#1091, OCamlPro/alt-ergo#1094, OCamlPro/alt-ergo#1138) - Rewrite the Intervals module entirely (OCamlPro/alt-ergo#1108) - Add maximize/minimize terms for matching (OCamlPro/alt-ergo#1166) - Internalize `sign_extend` and `repeat` (OCamlPro/alt-ergo#1192) - Run cross-propagators to completion (OCamlPro/alt-ergo#1221) - Support binary distinct on arbitrary bit-widths (OCamlPro/alt-ergo#1222) - Only perform optimization when building a model (OCamlPro/alt-ergo#1224) - Make sure domains do not overflow the default domain (OCamlPro/alt-ergo#1225) - Do not build unnormalized values in `zero_extend` (OCamlPro/alt-ergo#1226) ### Internal/library changes - Rewrite the Vec module (OCamlPro/alt-ergo#607) - Move printer definitions closer to type definitions (OCamlPro/alt-ergo#808) - Mark proxy names as reserved (OCamlPro/alt-ergo#836) - Use a Zarith-based representation for numbers and bit-vectors (OCamlPro/alt-ergo#850, OCamlPro/alt-ergo#943) - Add native support for (bvnot) in the BV solver (OCamlPro/alt-ergo#856) - Add constant propagators for partially interpreted functions (OCamlPro/alt-ergo#869) - Remove `Util.failwith` in favor of `Fmt.failwith` (OCamlPro/alt-ergo#872) - Add more `Expr` smart constructors (OCamlPro/alt-ergo#877, OCamlPro/alt-ergo#878) - Do not use existential variables for integer division (OCamlPro/alt-ergo#881) - Preserve `Subst` literals to prevent accidental incompleteness (OCamlPro/alt-ergo#886) - Properly start timers (OCamlPro/alt-ergo#924) - Compute a concrete representation of a model instead of performing (OCamlPro/alt-ergo#925) - Allow direct access to the SAT API in the Alt-Ergo library computations during printing (OCamlPro/alt-ergo#927) - Better handling for step limit (OCamlPro/alt-ergo#936) - Add a generic option manager to deal with the dolmen state (OCamlPro/alt-ergo#951) - Expose an imperative SAT API in the Alt-Ergo library (OCamlPro/alt-ergo#962) - Keep track of the SMT-LIB mode (OCamlPro/alt-ergo#971) - Add ability to decide on semantic literals (OCamlPro/alt-ergo#1027, OCamlPro/alt-ergo#1118) - Preserve trigger order when parsing quantifiers with multiple trigger (OCamlPro/alt-ergo#1046). - Store domains inside the union-find module (OCamlPro/alt-ergo#1119) - Remove some polymorphic hashtables (OCamlPro/alt-ergo#1219) ### Build and integration - Drop support for OCaml <4.08.1 (OCamlPro/alt-ergo#803) - Use dune-site for the inequalities plugins. External pluginsm ust now be registered through the dune-site plugin mechanism in the `(alt-ergo plugins)` site to be picked up by Alt-Ergo (OCamlPro/alt-ergo#1049). - Add a release workflow (OCamlPro/alt-ergo#827) - Add a Windows workflow (OCamlPro/alt-ergo#1203) - Mark the dune.inc file as linguist-generated to avoid huge diffs (OCamlPro/alt-ergo#830) - Use GitHub Actions badges in the README (OCamlPro/alt-ergo#882) - Use `dune build @check` to build the project (OCamlPro/alt-ergo#887) - Enable warnings as errors on the CI (OCamlPro/alt-ergo#888) - Uniformization of internal identifiers generation (OCamlPro/alt-ergo#905, OCamlPro/alt-ergo#918) - Use an efficient `String.starts_with` implementation (OCamlPro/alt-ergo#912) - Fix the Makefile (OCamlPro/alt-ergo#914) - Add `Logs` dependency (OCamlPro/alt-ergo#1206) - Use `dynamic_include` to include the generated file `dune.inc` (OCamlPro/alt-ergo#1199) - Support Windows (OCamlPro/alt-ergo#1184,OCamlPro/alt-ergo#1189,OCamlPro/alt-ergo#1195,OCamlPro/alt-ergo#1199,OCamlPro/alt-ergo#1200) - Wrap the library `Alt_ergo_prelude` (OCamlPro/alt-ergo#1223) ### Testing - Use --enable-assertions in tests (OCamlPro/alt-ergo#809) - Add a test for push/pop (OCamlPro/alt-ergo#843) - Use the CDCL solver when testing model generation (OCamlPro/alt-ergo#938) - Do not test .smt2 files with the legacy frontend (OCamlPro/alt-ergo#939) - Restore automatic creation of .expected files (OCamlPro/alt-ergo#941) ### Documentation - Add a new example for model generation (OCamlPro/alt-ergo#826) - Add a Pygments lexer for the Alt-Ergo native language (OCamlPro/alt-ergo#862) - Update the current authors (OCamlPro/alt-ergo#865) - Documentation of the `Enum` theory (OCamlPro/alt-ergo#871) - Document `Th_util.lit_origin` (OCamlPro/alt-ergo#915) - Document the CDCL-Tableaux solver (OCamlPro/alt-ergo#995) - Document Windows support (OCamlPro/alt-ergo#1216) - Remove instructions to install Alt-Ergo on Debian (OCamlPro/alt-ergo#1217) - Document optimization feature (OCamlPro/alt-ergo#1231)
CHANGES: ### Command-line interface - Enable FPA theory by default (OCamlPro/alt-ergo#1177) - Remove deprecated output channels (OCamlPro/alt-ergo#782) - Deprecate the --use-underscore since it produces models that are not SMT-LIB compliant (OCamlPro/alt-ergo#805) - Add --dump-models-on to dump models on a specific output channel (OCamlPro/alt-ergo#838) - Use consistent return codes (OCamlPro/alt-ergo#842) - Add --continue-on-error flag to set the SMT-LIB error behavior (OCamlPro/alt-ergo#853) - Make dolmen the default value for the --frontend option (OCamlPro/alt-ergo#857) - Restore functionality to broken `--profiling` option (OCamlPro/alt-ergo#947) - Add bare-bones support for interactive input in SMT-LIB format (OCamlPro/alt-ergo#949) - Less confusing behavior on timeout (OCamlPro/alt-ergo#982, OCamlPro/alt-ergo#984) - Add `--strict` option for SMT-LIB compliant mode (OCamlPro/alt-ergo#916, OCamlPro/alt-ergo#1133) - Deprecate `sum`, `typing` and `warnings` debug flags (OCamlPro/alt-ergo#1204) ### SMT-LIB support - Add support for the many new SMT-LIB commands (OCamlPro/alt-ergo#837, OCamlPro/alt-ergo#848, OCamlPro/alt-ergo#852, OCamlPro/alt-ergo#863, OCamlPro/alt-ergo#911, OCamlPro/alt-ergo#942, OCamlPro/alt-ergo#945, OCamlPro/alt-ergo#961, OCamlPro/alt-ergo#975, OCamlPro/alt-ergo#1069) - Expose the FPA rounding builtin in the SMT-LIB format (OCamlPro/alt-ergo#876, OCamlPro/alt-ergo#1135) - Allow changing the SAT solver using (set-option) (OCamlPro/alt-ergo#880) - Add support for the `:named` attribute (OCamlPro/alt-ergo#957) - Add support for quoted identifiers (OCamlPro/alt-ergo#909, OCamlPro/alt-ergo#972) - Add support for naming lemmas in SMT-LIB syntax (OCamlPro/alt-ergo#1141, OCamlPro/alt-ergo#1143) ### Model generation - Use post-solve SAT environment in model generation, fixing issues where incorrect models were generated (OCamlPro/alt-ergo#789) - Restore support for records in models (OCamlPro/alt-ergo#793) - Use abstract values instead of dummy values in models where the actual value does not matter (OCamlPro/alt-ergo#804, OCamlPro/alt-ergo#835) - Use fresh names for all abstract values to prevent accidental captures (OCamlPro/alt-ergo#811) - Add support for model generation with the default CDCL solver (OCamlPro/alt-ergo#829) - Support model generation for the BV theory (OCamlPro/alt-ergo#841, OCamlPro/alt-ergo#968) - Add support for optimization (MaxSMT / OptiSMT) with lexicographic Int and Real objectives (OCamlPro/alt-ergo#861, OCamlPro/alt-ergo#921) - Add a SMT-LIB printer for expressions (OCamlPro/alt-ergo#952, OCamlPro/alt-ergo#981, OCamlPro/alt-ergo#1082, OCamlPro/alt-ergo#931, OCamlPro/alt-ergo#932) - Ensure models have a value for all constants in the problem (OCamlPro/alt-ergo#1019) - Fix a rare soundness issue with integer constraints when model generation is enabled (OCamlPro/alt-ergo#1025) - Support model generation for the ADT theory (OCamlPro/alt-ergo#1093, OCamlPro/alt-ergo#1153) ### Theory reasoning - Add word-level propagators for the BV theory (OCamlPro/alt-ergo#944, OCamlPro/alt-ergo#1004, OCamlPro/alt-ergo#1007, OCamlPro/alt-ergo#1010, OCamlPro/alt-ergo#1011, OCamlPro/alt-ergo#1012, OCamlPro/alt-ergo#1040, OCamlPro/alt-ergo#1044, OCamlPro/alt-ergo#1054, OCamlPro/alt-ergo#1055, OCamlPro/alt-ergo#1056, OCamlPro/alt-ergo#1057, OCamlPro/alt-ergo#1065, OCamlPro/alt-ergo#1073, OCamlPro/alt-ergo#1144, OCamlPro/alt-ergo#1152) - Add interval domains and arithmetic propagators for the BV theory (OCamlPro/alt-ergo#1058, OCamlPro/alt-ergo#1083, OCamlPro/alt-ergo#1084, OCamlPro/alt-ergo#1085) - Native support for bv2nat of bit-vector normal forms (OCamlPro/alt-ergo#1154) - Fix incompleteness issues in the BV solver (OCamlPro/alt-ergo#978, OCamlPro/alt-ergo#979) - Abstract more arguments of AC symbols to avoid infinite loops when they contain other AC symbols (OCamlPro/alt-ergo#990) - Do not make irrelevant decisions in CDCL solver, improving performance slightly (OCamlPro/alt-ergo#1041) - Rewrite the ADT theory to use domains and integrate the enum theory into the ADT theory (OCamlPro/alt-ergo#1078, OCamlPro/alt-ergo#1086, OCamlPro/alt-ergo#1087, OCamlPro/alt-ergo#1091, OCamlPro/alt-ergo#1094, OCamlPro/alt-ergo#1138) - Rewrite the Intervals module entirely (OCamlPro/alt-ergo#1108) - Add maximize/minimize terms for matching (OCamlPro/alt-ergo#1166) - Internalize `sign_extend` and `repeat` (OCamlPro/alt-ergo#1192) - Run cross-propagators to completion (OCamlPro/alt-ergo#1221) - Support binary distinct on arbitrary bit-widths (OCamlPro/alt-ergo#1222) - Only perform optimization when building a model (OCamlPro/alt-ergo#1224) - Make sure domains do not overflow the default domain (OCamlPro/alt-ergo#1225) - Do not build unnormalized values in `zero_extend` (OCamlPro/alt-ergo#1226) ### Internal/library changes - Rewrite the Vec module (OCamlPro/alt-ergo#607) - Move printer definitions closer to type definitions (OCamlPro/alt-ergo#808) - Mark proxy names as reserved (OCamlPro/alt-ergo#836) - Use a Zarith-based representation for numbers and bit-vectors (OCamlPro/alt-ergo#850, OCamlPro/alt-ergo#943) - Add native support for (bvnot) in the BV solver (OCamlPro/alt-ergo#856) - Add constant propagators for partially interpreted functions (OCamlPro/alt-ergo#869) - Remove `Util.failwith` in favor of `Fmt.failwith` (OCamlPro/alt-ergo#872) - Add more `Expr` smart constructors (OCamlPro/alt-ergo#877, OCamlPro/alt-ergo#878) - Do not use existential variables for integer division (OCamlPro/alt-ergo#881) - Preserve `Subst` literals to prevent accidental incompleteness (OCamlPro/alt-ergo#886) - Properly start timers (OCamlPro/alt-ergo#924) - Compute a concrete representation of a model instead of performing (OCamlPro/alt-ergo#925) - Allow direct access to the SAT API in the Alt-Ergo library computations during printing (OCamlPro/alt-ergo#927) - Better handling for step limit (OCamlPro/alt-ergo#936) - Add a generic option manager to deal with the dolmen state (OCamlPro/alt-ergo#951) - Expose an imperative SAT API in the Alt-Ergo library (OCamlPro/alt-ergo#962) - Keep track of the SMT-LIB mode (OCamlPro/alt-ergo#971) - Add ability to decide on semantic literals (OCamlPro/alt-ergo#1027, OCamlPro/alt-ergo#1118) - Preserve trigger order when parsing quantifiers with multiple trigger (OCamlPro/alt-ergo#1046). - Store domains inside the union-find module (OCamlPro/alt-ergo#1119) - Remove some polymorphic hashtables (OCamlPro/alt-ergo#1219) ### Build and integration - Drop support for OCaml <4.08.1 (OCamlPro/alt-ergo#803) - Use dune-site for the inequalities plugins. External pluginsm ust now be registered through the dune-site plugin mechanism in the `(alt-ergo plugins)` site to be picked up by Alt-Ergo (OCamlPro/alt-ergo#1049). - Add a release workflow (OCamlPro/alt-ergo#827) - Add a Windows workflow (OCamlPro/alt-ergo#1203) - Mark the dune.inc file as linguist-generated to avoid huge diffs (OCamlPro/alt-ergo#830) - Use GitHub Actions badges in the README (OCamlPro/alt-ergo#882) - Use `dune build @check` to build the project (OCamlPro/alt-ergo#887) - Enable warnings as errors on the CI (OCamlPro/alt-ergo#888) - Uniformization of internal identifiers generation (OCamlPro/alt-ergo#905, OCamlPro/alt-ergo#918) - Use an efficient `String.starts_with` implementation (OCamlPro/alt-ergo#912) - Fix the Makefile (OCamlPro/alt-ergo#914) - Add `Logs` dependency (OCamlPro/alt-ergo#1206) - Use `dynamic_include` to include the generated file `dune.inc` (OCamlPro/alt-ergo#1199) - Support Windows (OCamlPro/alt-ergo#1184,OCamlPro/alt-ergo#1189,OCamlPro/alt-ergo#1195,OCamlPro/alt-ergo#1199,OCamlPro/alt-ergo#1200) - Wrap the library `Alt_ergo_prelude` (OCamlPro/alt-ergo#1223) ### Testing - Use --enable-assertions in tests (OCamlPro/alt-ergo#809) - Add a test for push/pop (OCamlPro/alt-ergo#843) - Use the CDCL solver when testing model generation (OCamlPro/alt-ergo#938) - Do not test .smt2 files with the legacy frontend (OCamlPro/alt-ergo#939) - Restore automatic creation of .expected files (OCamlPro/alt-ergo#941) ### Documentation - Add a new example for model generation (OCamlPro/alt-ergo#826) - Add a Pygments lexer for the Alt-Ergo native language (OCamlPro/alt-ergo#862) - Update the current authors (OCamlPro/alt-ergo#865) - Documentation of the `Enum` theory (OCamlPro/alt-ergo#871) - Document `Th_util.lit_origin` (OCamlPro/alt-ergo#915) - Document the CDCL-Tableaux solver (OCamlPro/alt-ergo#995) - Document Windows support (OCamlPro/alt-ergo#1216) - Remove instructions to install Alt-Ergo on Debian (OCamlPro/alt-ergo#1217) - Document optimization feature (OCamlPro/alt-ergo#1231)
Issue #873