-
Notifications
You must be signed in to change notification settings - Fork 6
Concolic driver #85
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
Merged
Merged
Concolic driver #85
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
cca476b
connect concolic evaluator to z3
butterunderflow fd4a673
not all constrains have a solution
butterunderflow 5148cc9
guarantee termination && symbolic should consume symstack
butterunderflow 5681c67
i32.or is bitwise or in wasm
butterunderflow 1cf0237
exploration tree
butterunderflow 1431e9a
some fixes
butterunderflow be08e32
simplify
butterunderflow 84dc283
when true branch, condition should not be zero
butterunderflow 5ec17ea
mark endpoint as Finished
butterunderflow 4febdc7
refactor
butterunderflow f1e7f22
print exploration tree
butterunderflow 0604e58
complete interpreter
butterunderflow d27f0ac
fix: put retCont to trail
butterunderflow 7b48c44
try bug finding
butterunderflow d4a7d35
see if ci works
ahuoguo 29436e6
default is actually good enough
butterunderflow 8eae070
bring back the original test case
butterunderflow c0cb648
ubuntu-24.04 is removed on 2025-04-15
butterunderflow f3b4893
Fix ci (#86)
butterunderflow d74744e
do not generate node in exploration tree if symbolic condition is con…
ahuoguo 5192e45
still explore all paths in assert_false
ahuoguo 59d32d5
we could endwith a fail node
butterunderflow 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 hidden or 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 hidden or 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,46 @@ | ||
| (module | ||
| (type (;0;) (func (param i32 i32) (result i32))) | ||
| (type (;1;) (func (param i32))) | ||
| (func (;0;) (type 0) (param i32 i32) (result i32) | ||
| local.get 0 | ||
| i32.const 0 | ||
| i32.le_s | ||
| if (result i32) ;; label = @1 | ||
| i32.const 1 | ||
| else | ||
| local.get 1 | ||
| i32.const 0 | ||
| i32.le_s | ||
| end | ||
| if (result i32) ;; label = @1 | ||
| i32.const -1 | ||
| else | ||
| local.get 0 | ||
| local.get 0 | ||
| i32.mul | ||
| local.get 1 | ||
| local.get 1 | ||
| i32.mul | ||
| i32.add | ||
| i32.const 25 | ||
| i32.eq | ||
| if (result i32) ;; label = @2 | ||
| i32.const 1 | ||
| else | ||
| i32.const 0 | ||
| call 2 | ||
| end | ||
| end | ||
| ) | ||
| (export "f" (func 0)) | ||
| (func $real_main | ||
| ;; TODO: is there a better way to put symbolic values on the stack? | ||
| i32.const 0 | ||
| i32.symbolic | ||
| i32.const 1 | ||
| i32.symbolic | ||
| call 0 | ||
| ) | ||
| (import "console" "assert" (func (type 1))) | ||
| (export "real_main" (func 1)) | ||
| ) | ||
This file contains hidden or 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 hidden or 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,41 @@ | ||
| (module | ||
| (type (;0;) (func (param i32 i32) (result i32))) | ||
| (func (;0;) (type 0) (param i32 i32) (result i32) | ||
| local.get 0 | ||
| i32.const 0 | ||
| i32.le_s | ||
| local.get 1 | ||
| i32.const 0 | ||
| i32.le_s | ||
| i32.or | ||
| if (result i32) ;; label = @1 | ||
| i32.const -1 | ||
| else | ||
| local.get 0 | ||
| local.get 0 | ||
| i32.mul | ||
| local.get 1 | ||
| local.get 1 | ||
| i32.mul | ||
| i32.add | ||
| i32.const 25 | ||
| i32.eq | ||
| if (result i32) ;; label = @2 | ||
| i32.const 1 | ||
| else | ||
| i32.const 0 | ||
| end | ||
| end | ||
| ) | ||
| (export "f" (func 0)) | ||
| (func $real_main | ||
| ;; TODO: is there a better way to put symbolic values on the stack? | ||
| i32.const 0 | ||
| i32.symbolic | ||
| i32.const 1 | ||
| i32.symbolic | ||
| call 0 | ||
| ) | ||
|
|
||
| (export "real_main" (func 1)) | ||
| ) |
This file contains hidden or 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 hidden or 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,29 @@ | ||
| (module | ||
| (func $f (param $x i32) (param $y i32) (result i32) | ||
| ;; if (x <= 0 || y <= 0) | ||
| (if (result i32) | ||
| (i32.or | ||
| (i32.le_s (local.get $x) (i32.const 0)) | ||
| (i32.le_s (local.get $y) (i32.const 0)) | ||
| ) | ||
| (then (i32.const -1)) ;; return -1 | ||
| (else | ||
| ;; if (x * x + y * y == 25) | ||
| (if (result i32) | ||
| (i32.eq | ||
| (i32.add | ||
| (i32.mul (local.get $x) (local.get $x)) | ||
| (i32.mul (local.get $y) (local.get $y)) | ||
| ) | ||
| (i32.const 25) | ||
| ) | ||
| (then (i32.const 1)) ;; return 1 | ||
| (else (i32.const 0)) ;; return 0 | ||
| ) | ||
| ) | ||
| ) | ||
| ) | ||
|
|
||
| ;; Optionally export the function | ||
| (export "f" (func $f)) | ||
| ) |
This file contains hidden or 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.
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.
might be worth trying to
call 2in thex^2 + y^2 = 25branch since it's easier to check the results. (also concolic execution allegedly tries to deal with this kinda of non-linear constraint (eg: https://faculty.sist.shanghaitech.edu.cn/faculty/songfu/cav/CT-slides.pdf)PS: they seem to take the example from CACM https://dl.acm.org/doi/fullHtml/10.1145/2408776.2408795