-
Notifications
You must be signed in to change notification settings - Fork 16
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
Basic USVM TS type system with type coercion #215
base: main
Are you sure you want to change the base?
Conversation
…rgeyl/ts_typecoercion
# Conflicts: # usvm-core/src/main/kotlin/org/usvm/StateForker.kt # usvm-ts/src/main/kotlin/org/usvm/TSInterpreter.kt
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.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This PR indirectly introduces a bug |
|
||
class TSTestResolver { | ||
class TSTestResolver( | ||
private val state: TSState |
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.
Why? Resolver should be able to resolve many states independently
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.
TSTestResolver
was instantiated for each returned state, and I needed access to state.typeStorage
.
So I decided to add state as private constructor param.
private fun approximateParam(expr: UConcreteHeapRef, idx: Int, model: UModelBase<EtsType>): TSObject = | ||
with(expr.ctx as TSContext) { | ||
val suggestedType = state.getSuggestedType(idx) | ||
return suggestedType?.let { newType -> |
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.
Something odd is happening here. You can always access all required information using symbolic values and symbolic values only, otherwise you will encounter path divergence. This map cannot be built from concrete values to type info, only from symbolic ones
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 believe different types of ref entities (reg readings, etc.) have unique ways to generate a key. For example, reg readings can use its' idx
field as a key, and this key leads to correct list of types from any model.
No description provided.