-
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
Support mutable globals during x86 verification #712
Conversation
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.
Let's split this in two commits: one that introduces X86Sim
, and does not make any other changes, and one that builds on top of that to add support for mutable globals.
fb3c58c
to
74e26cb
Compare
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.
Looks good now! Would it be complicated to add a test?
Mem {- ^ The state of memory before simulation -} -> | ||
Regs {- ^ The state of the registers before simulation -} -> | ||
X86Sim () | ||
assertPost env premem preregs = do |
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.
this function is very easy to review, github highlights the liftIO
👍
Just LeqProof -> do | ||
off' <- W4.bvZext sym (knownNat @64) off | ||
X86Sim () | ||
setArgs env tyenv nameEnv args |
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.
this function is not easy to review, because of the format changes, which is why I don't like where
To facilitate this, I've refactored a bunch of functions to use a
MonadState
rather than passing many arguments / returning large tuples. This makes the diff unpleasantly large, but the only "real" changes are ininitialState
,setupGlobals
, andexecutePointsTo
.