Fix 1243#1282
Draft
Halbaroth wants to merge 2 commits into
Draft
Conversation
This PR changes the way we construct identifiers for names (in Symbols) and
variables (in Var).
We plan to completely replace the AE identifiers with identifiers from Dolmen.
This PR serves as an intermediate step from string-based identifiers to Dolmen
identifiers.
- All the identifiers are now managed in the Id module.
- Constant terms are used for declared or defined identifiers in the input file.
- Internal identifiers are still pre-mangled strings. Replacing them with
Dolmen identifiers requires careful investigation, particularly in the AC(X)
implementation.
- I haven't removed Id.typed yet. After this PR, the user identifiers will be
typed, so we do not need to store them separately. If we use the internal
type of the identifier, we will need to implement a conversion function from
Dolmen type to Alt-Ergo type, which is not trivial. I prefer keeping this
type and remove it after transitioning from Alt-Ergo types to Dolmen types.
- The new API of Id prevents us from creating duplicate fresh/fresh_ac/abstract
identifiers.
- I still check that user identifiers do not start with . or @. In Before this
PR, we mangled the identifier if it happened. In this PR, we crash. I don't
have a strong opinion on this behavior, it was just simpler to implement
this way.
- I use identifiers for term variables too. I preserved the internal
representation because:
1. The notion of local variables is AE-specific, whereas the local name in
Dolmen identifiers is a distinct concept.
2. After this PR, variables are typed but what is the type of Underscore?
May be forall a. a?
This PR have been tested on ae-format (+2-2).
The fix consists in using `declared_ids` to guarantee that we never define symbols that have not been declared at the current assertion level in models. A proper fix requires a lot of work as we need to rework the push/pop mechanism of CDCL. This PR is rebased OCamlPro#1280 to ensure we won't mix identifiers from different assertion levels as it could happen with string-based identifiers.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fix consists in using
declared_idsto guarantee that we neverdefine symbols that have not been declared at the current assertion
level in models. A proper fix requires a lot of work as we need to
rework the push/pop mechanism of CDCL.
This PR is rebased #1280 to ensure we won't mix identifiers from
different assertion levels as it could happen with string-based
identifiers.