Comments (2)
Abstraction doesn't happen during the Alive2.
Here are the detailed steps to TV the example. Hope it could help:
[Get final-state of src]
-
foo (int x)
:
Alive2 assumes that function arguments can be arbitrary values, so they can be undef, poison, or well-defined value.
It can be encoded into:
(= %x ((ite isundef(%x) undef %x), ispoison(%x)))
FYI, x is an SMT bitvector -
y=(x+0)
:
By the defined semantics of add, following holds:
a) x = poison -> y = poison
b) x = {n} -> y = {n + 0} = {n}
c) x = undef -> y = {n + 0 | -2^31 <= n <= 2^31}
It can be encoded into:
(= %y ((ite isundef(%x) undef %x) + 0, ispoison(%x)))
Note that, in alive2, the value could be a poison, set of integer/floating-point numbers or pointers. And the set of values is not a singleton if the value is undef.
-
return y
:
End the execution and emit the final-state<y, empty, false>
. Note that the definition of the final-state is ValueNoRet x Memory x bool, in which each of them represents return value, memory, and whether the undefined behavior has occurred or not.
[Get final-state of tgt]
Same above, the final-state of the target is <y, empty, false>
[Check the refinement]
Since no operation manipulates the memory or triggers the UB, this example can be validated by only checking the refinement between the return values.
Let's rename the return value to avoid confusion.
- y_src: return value of src
- y_tgt: return value of tgt
Then we can say that, for all valid input, if y_tgt is a refinement of the y_src, then the target function is a refinement of the source.
Therefore if the following condition is true, the target function is a refinement of the source function(=, <= are symbols of set):
ispoison(y_tgt)
\/ (isdefined(y_src) /\ isdefined(y_tgt) /\ y_src = y_tgt)
\/ (isundef(y_src) /\ (y_tgt <= y_src))
And it could be checked by the off-the-shelf SMT solver like Z3.
from is661-advanced-software-security.
Thanks for the detailed response!
from is661-advanced-software-security.
Related Issues (20)
- [Announcement] Homework 2 is out (Updated: 3/12) HOT 1
- [Announcement] Scheduling paper presentation (Due: 3. 6. Wed.)
- [Announcement] Homework 1 is graded
- [Announcement] Paper presentation schedule (Updated: 3/14) HOT 1
- [Announcement] Research Talk & Project Proposal Talk schedule HOT 1
- [Announcement] Hw2
- [Announcement] Homework 2 Desk Reject
- [Announcement] Homework 3 is out
- [Announcement] Homework 2 is graded
- [Announcement] Homework 4 & Final project (Due date: 6/5)
- [Announcement] Homework 3 is graded
- [Announcement] Research Talk is graded
- [Announcement] Homework 5 is out
- [Announcement] Final project presentation schedule HOT 1
- [Announcement] Final project due date has been changed: 6/11 -> 6/1
- [Announcement] Paper presentation guidelines
- [Announcement] Format
- [Announcement] Submit the slides of the proposal talk and the paper reviews HOT 1
- [Announcement] No class on May 21 & Presentation schedules have been postponed
- [Announcement] 강의 평가 참여 안내 Course evaluation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from is661-advanced-software-security.