-
Notifications
You must be signed in to change notification settings - Fork 8
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
Test cases for @assert
notation
#153
Open
langfield
wants to merge
12
commits into
master
Choose a base branch
from
aemartinez/assert-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
langfield
force-pushed
the
aemartinez/assert-tests
branch
from
February 2, 2023 21:08
bbb3405
to
976df12
Compare
langfield
force-pushed
the
aemartinez/assert-tests
branch
2 times, most recently
from
February 14, 2023 18:27
44a653d
to
f8bec79
Compare
In this commit, we add a function `userAnnotatedSources` which replaces `isStandardSource`. It generates a list of all the user annotated ScopedFunctions. This list is used to filter modules for solving. This requires a slight refactor within `FunctionAnalysis.hs`. * Add `extern_remove_dirty` test. The basic idea is this: 1. Find all wrapper functions. 2. Compute their respective set of reachable functions. 3. Mark them all as 'don't check' unless they are referenced from a different source as well.
langfield
force-pushed
the
aemartinez/assert-tests
branch
from
March 24, 2023 18:03
f8bec79
to
27f365b
Compare
Don't verify `@external`-generated wrapper functions
* Use `ssh-agent` to clone with specific private key * Set `0o400` permissions on private key file * Add `mathsat` to list of solvers used in tests
Add mathsat installation to Github actions workflow
Cairo semantics comments
…ted-specs Add FAQ about commenting-out annotations
…eadme-additions Add `README.md` section on details of `CairoSemanticsL`
langfield
force-pushed
the
aemartinez/assert-tests
branch
3 times, most recently
from
March 29, 2023 12:43
10c8259
to
638c31a
Compare
At a high-level, we add a bunch of tests and golds, break module name formatting into two parts, and sort the `scopedNames` when constructing module names. This commit replaces the `normalizedName` function with several new functions, removing use of partial helper functions like `init` and `head`, and instead making use of `Data.List.NonEmpty`. The new functions are: * preprocessScopes * formatScopes * summarizeLabels Additionally, we rename: * summarizeLabels -> summarizeLabels' * sansCommonAncestor -> detachCommonPrefix This fixes a bug where a dot is not added between function name and label for anonymous asserts. We no longer generate the `prefix` and `labelsSummary` within the same function, because that was kind of arbitrary. Other things: * Adjust gold files to remove assert label, inlined markers * Add test `assert_let_minimal.cairo` * Fix order of results in `assert_let.gold` Notes from squashed intermediate commits ======================================== * Add precondition checking tags to golds * Fix branch identifiers in golds * Add `mathsat` back to `oneoff.sh` test running script. * Fix `assert_let.gold`. It now correctly shows something other than `Verified` for the functions with faulty asserts. In particular, it shows `Contradictory premises`.
langfield
force-pushed
the
aemartinez/assert-tests
branch
from
March 29, 2023 14:13
10c8259
to
b96c5e8
Compare
langfield
force-pushed
the
master
branch
2 times, most recently
from
March 31, 2023 15:01
9f9928b
to
3397b7c
Compare
Ferinko
requested changes
Apr 3, 2023
userAnnotatedSources :: Set ScopedFunction -> [LabeledInst] -> GlobalL (Set ScopedFunction) | ||
userAnnotatedSources inlinableFs rows = | ||
getProgram >>= \prog -> | ||
let functionsWithBodies = functionsOf rows prog |
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.
There is a bug here that triggers fromJust under some circumstances unknown to me. This needs investigation. Preferably, this whole bit of code wouldn't be here in the first place because we're replicating this kind of logic in FunctionAnalysis.hs and frankly even in Module.hs.
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.
Add test cases for
@assert
notationAt a high-level, we add a bunch of tests and golds, break module name formatting into two parts, and sort the
scopedNames
when constructing module names.This commit replaces the
normalizedName
function with several new functions, removing use of partial helper functions likeinit
andhead
, and instead making use ofData.List.NonEmpty
. The new functions are:Additionally, we rename:
This fixes a bug where a dot is not added between function name and label for anonymous asserts.
We no longer generate the
prefix
andlabelsSummary
within the same function, because that was kind of arbitrary.Other things:
assert_let_minimal.cairo
assert_let.gold
Notes from squashed intermediate commits
mathsat
back tooneoff.sh
test running script.assert_let.gold
. It now correctly shows something other thanVerified
for the functions with faulty asserts. In particular, itshows
Contradictory premises
.Comments from old PR reviews
Note that tests/resources/golden/assert_func_peano_prod.gold currently times out.Not anymore!