Skip to content

Commit

Permalink
Added comments about time budget
Browse files Browse the repository at this point in the history
  • Loading branch information
Damtev committed Nov 1, 2023
1 parent 3250b40 commit 4043c90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions usvm-core/src/main/kotlin/org/usvm/solver/Solver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ open class USolverBase<Type>(
protected val typeSolver: UTypeSolver<Type>,
protected val translator: UExprTranslator<Type, *>,
protected val decoder: UModelDecoder<UModelBase<Type>>,
// TODO this timeout must not exceed time budget for the MUT
private val timeout: Duration
) : USolver<UPathConstraints<Type>, UModelBase<Type>>(), AutoCloseable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class USupportTypeStream<Type> private constructor(

private fun nextType(iterator: Iterator<Type>): Type =
runBlocking {
// This operation is potentially very long, so it's important to ensure it ends in reasonable time
withTimeoutOrNull(typeSystem.typeOperationsTimeout) { iterator.next() }
} ?: error("TODO return typed mock and info that the timeout was exceeded")

Expand Down
1 change: 1 addition & 0 deletions usvm-core/src/main/kotlin/org/usvm/types/TypeSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface UTypeSystem<Type> {
/**
* A timeout used for heavy operations with types.
*/
// TODO this timeout must not exceed time budget for the MUT
val typeOperationsTimeout: Duration

/**
Expand Down

0 comments on commit 4043c90

Please sign in to comment.