-
Notifications
You must be signed in to change notification settings - Fork 400
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
Propagate unsafety to definitions that depend on unsafe definitions #379
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e6c8123
Add first version of safety propagation
edusporto bc870fc
Clean up and better comments
edusporto 3fd3412
Merge branch 'main' into fix-safety-checking
edusporto 55b6b4c
Remove unnecessary lookup table return from `Book::build`
edusporto 77f8b73
Tidy up before pull request
edusporto 2bfbd99
Bump version
edusporto 607426d
Add `@test-rust-only` option
edusporto 0f44d07
Add test for safety checking
edusporto 0f675a8
Resolve suggestions
edusporto 92773fb
Slightly better visited definition
edusporto e016d7c
Function name change
edusporto 23ad6dc
Fix function name change
edusporto 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@List/Cons = (a (b ((@List/Cons/tag (a (b c))) c))) | ||
|
||
@List/Cons/tag = 1 | ||
|
||
@List/Nil = ((@List/Nil/tag a) a) | ||
|
||
@List/Nil/tag = 0 | ||
|
||
@id = (a a) | ||
|
||
@list = c | ||
& @List/Cons ~ (1 (b c)) | ||
& @List/Cons ~ (2 (@List/Nil b)) | ||
|
||
@main = b | ||
& @map ~ (@main__C0 (a b)) | ||
& @List/Cons ~ (@id (@List/Nil a)) | ||
|
||
@main__C0 = (a b) | ||
& @map ~ (a (@list b)) | ||
|
||
@map = (a ((@map__C1 (a b)) b)) | ||
|
||
@map__C0 = (* (a (d ({(a b) c} f)))) | ||
& @List/Cons ~ (b (e f)) | ||
& @map ~ (c (d e)) | ||
|
||
@map__C1 = (?(((* @List/Nil) @map__C0) a) a) | ||
|
||
// Test flags | ||
@test-rust-only = 1 |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
source: tests/run.rs | ||
expression: rust_output | ||
input_file: tests/programs/safety-check.hvm | ||
--- | ||
ERROR: attempt to clone a non-affine global reference. |
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.
I added the possibility to only run tests in the Rust implementation, since the C one doesn't throw an error in this same case. This is something to discuss - should the C and CUDA implementations also "panic" printing this error and stopping the program?
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 this is fine as is, and is in line with the other
test-io
pattern.