-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
saw-core-coq: fix and document the local translation state (#1328)
5a37203 introduced a subtle bug in the translation of Cryptol modules to Coq. In this commit, it was decided that all 'TranslationState' should be restored when calling `withLocalLocalEnvironment'. Historically, 'withLocalLocalEnvironment' was only supposed to restore the value of the 'localEnvironment' field of the translation state, hence its name. The translation state has grown since, and includes many fields that ought to be restored after a local (sub-)term translation. Unfortunately, the translation state also contains fields that are meant to monotonically accumulate global data through the translation. Those fields are thus being erased incorrectly due to the changes made. This commit revert those changes, making it painfully explicit which fields of the state are to be restored or preserved so that future refactorings will have to make a decision. In the process, I also renamed the confusing 'localDeclarations' into 'topLevelDeclarations', since it captures declarations that appear in the processed file (so more local than the "global", "ambient" standard library declarations), but the name made it sound like these were more local.
- Loading branch information
Showing
8 changed files
with
177 additions
and
124 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
Large diffs are not rendered by default.
Oops, something went wrong.
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.