-
Notifications
You must be signed in to change notification settings - Fork 63
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
Further typechecker and interpreter cleanup #2165
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ca96455
CHANGES: Reword the entry for #2077.
sauclovian-g 28c6e34
Interpreter: remove special-case handling of syntactically top-level …
sauclovian-g 06b3516
Fix examples and tests that don't typecheck any more.
sauclovian-g ed47528
Fix uses of mir_find_adt in the manual, and two uses of rename in exa…
sauclovian-g 07fc5b6
interpreter: tidy processStmtBind
sauclovian-g 3e25fab
interpreter: tidy processStmtBind more
sauclovian-g f6f6d49
interpreter: reorganize the repl-facing print logic for binds.
sauclovian-g fa84fb5
interpreter: Simplify previous now it's in one place.
sauclovian-g 19ba85a
interpreter: Move the typechecker call out of processStmtBind.
sauclovian-g 8156442
Interpreter: check let-bindings with checkStmt instead of checkDeclGr…
sauclovian-g 4dba50c
interpreter: simplify typechecker calls
sauclovian-g ebb4bf0
interpreter: Now we can typecheck once at the top of interpretStmt.
sauclovian-g 0dcb4e9
Give the (SAWScript) typechecker the ability to produce warnings.
sauclovian-g 2be7724
typechecker: add workaround for fallout from #2162.
sauclovian-g df3b8c2
Update the test jig for #2162's tests, as one of those now only warns.
sauclovian-g e53ce7c
Two tweaks to previous change.
sauclovian-g 0142dd3
Remove commented-out leftovers.
sauclovian-g cb4c031
Adjustments from first batch of review comments.
sauclovian-g ddb7641
Typechecker: avoid printing type errors in reverse order.
sauclovian-g 5310f75
Typechecker: tinker with the allowWrongMonad message in inferStmt.
sauclovian-g 10126b9
CHANGES: markdown 1, dholland 0 (fix formatting)
sauclovian-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,53 @@ | |
|
||
## Bug fixes | ||
|
||
* Unexpected special-case type behavior of monad binds in the | ||
syntactic top level has been removed. | ||
(This was _not_ specifically associated with the TopLevel monad, so | ||
top-level binds and binds in functions in TopLevel, or in nested | ||
do-blocks, would behave differently.) | ||
See issue #2162. | ||
|
||
There are three primary visible consequences. | ||
The first is that the REPL no longer accepts | ||
non-monadic expressions. | ||
These can still be evaluated and printed; just prefix them with | ||
```return```. | ||
(Affordances specifically for the REPL so this is not required there | ||
may be restored in the future.) | ||
|
||
The second is that statements of the form ```x <- e;``` where ```e``` | ||
is a pure (non-monadic) term used to be (improperly) accepted at the | ||
top level of scripts. | ||
These statements now generate a warning. | ||
This will become an error in a future release and such statements | ||
should be rewritten as ```let x = e;```. | ||
For example, ```t <- unfold_term ["reverse"] {{ reverse 0b01 }};``` | ||
should be changed to ```let t = unfold_term ["reverse"] {{ reverse 0b01 }};```. | ||
|
||
The third is that statements of the form ```x <- s;``` or just ```s;``` | ||
where ```s``` is a term in the _wrong_ monad also used to be | ||
improperly accepted at the top level of scripts. | ||
These statements silently did nothing. | ||
They will now generate a warning. | ||
This will become an error in a future release. | ||
Such statements should be removed or rewritten. | ||
For example, it used to be possible to write ```llvm_assert {{ False }};``` | ||
at the top level (outside any specification) and it would be ignored. | ||
```llvm_assert``` is only meaningful within an LLVM specification. | ||
|
||
* A number of SAWScript type checking problems have been fixed, | ||
including issue #2077. | ||
Some of these problems were partially mutually compensating; for | ||
example, in some cases nonexistent typedefs had been mishandled in | ||
ways that made them mostly work. | ||
Some previously accepted scripts and specs may be rejected and need | ||
(generally minor) adjustment. | ||
Prior to these changes the typechecker allowed unbound type variables | ||
in a number of places (such as on the right-hand side of typedefs, and | ||
in function signatures), so for example type names contaning typos | ||
would not necessarily have been caught and will now fail. | ||
```typedef t = nonexistent``` was previously accepted and now is not. | ||
These problems could trigger panics, but there does not appear to have | ||
been any way to produce unsoundness in the sense of false | ||
verifications. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A similar comment about indentation here. |
||
|
||
* Counterexamples including SMT arrays are now printed with the array | ||
contents instead of placeholder text. | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(\n -> n) 1; | ||
return ((\n -> n) 1); |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Would you be willing to indent each line here (that doesn't begin with a
*
) by two spaces? That is:Otherwise, GitHub-Flavored Markdown will render it strangely (click "View file" in the PR to see what I mean).
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 didn't realize you could check it that way... was basically hoping it would come out ok (the success rate for which is not high)
Will fix.