forked from OCamlPro/alt-ergo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shostak): Transparent abstracted constants
This patch introduces a new type of leaf in the Shostak module, called *abstract leaves*. Abstract leaves behave like constant terms, and are intended to replace the `X.term_embed (E.fresh_name ty)` pattern where possible. An abstract leaf is created by calling `X.abstract` on an existing semantic value `r`. The abstract leaf `X.abstract r` is automatically defined to be equal to `r` when processed by the `Uf` and `Ccx` modules. The benefits of abstract leaves over fresh term constants are twofold: - With fresh constants, when the same semantic value is abstracted multiple times, a new constant is created for each abstraction. Semantically, this is correct; however, this causes the introduction of unnecessary constants in the union-find that will just end up in the same equivalence class. With abstract leaves, abstracting the same semantic value multiple times always returns the same constant. - With fresh constants, an additional equation between the new constant and the original term to abstract must be kept and processed separately. Since abstract leaves embed their definition, the additional equations can be introduced automatically by the `Uf` and `Ccx` modules and do not need to be carried separately. Abstract leaves are currently only used by the AC theory. In the future, it is intended to be used as a basis for implementing application of interpreted-but-not-solvable functions to semantic values (so that for instance we can denote `bv2nat(r)` where `r` is a semantic value). While it would be straightforward to adapt abstract leaves to be able to create terminal leaves for `bv2nat(r)` (without definitional equations), we want congruence closure and computation (so that `bv2nat(x @ y)` automatically becomes `bv2nat(x) * 2^n + bv2nat(y)`) to work for such leaves. This require additional adaptations to CC(X), and is expected to need abstract leaves to enforce an AC(X)-compatible ordering.
- Loading branch information
1 parent
6424e77
commit 6c3ae05
Showing
12 changed files
with
180 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.