Skip to content

Commit f8fd3fa

Browse files
committed
Clear logs
1 parent 201e5f4 commit f8fd3fa

File tree

3 files changed

+12
-52
lines changed

3 files changed

+12
-52
lines changed

usvm-ts/src/main/kotlin/org/usvm/machine/TsMachine.kt

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import org.usvm.CoverageZone
88
import org.usvm.StateCollectionStrategy
99
import org.usvm.UMachine
1010
import org.usvm.UMachineOptions
11-
import org.usvm.UPathSelector
1211
import org.usvm.api.targets.TsTarget
1312
import org.usvm.machine.interpreter.TsInterpreter
1413
import org.usvm.machine.state.TsMethodResult
@@ -74,39 +73,15 @@ class TsMachine(
7473

7574
val timeStatistics = TimeStatistics<EtsMethod, TsState>()
7675

77-
val pathSelector = object : UPathSelector<TsState> {
78-
val internalSelector = createPathSelector(
79-
initialStates = initialStates,
80-
options = options,
81-
applicationGraph = graph,
82-
timeStatistics = timeStatistics,
83-
coverageStatisticsFactory = { coverageStatistics },
84-
cfgStatisticsFactory = { cfgStatistics },
85-
callGraphStatisticsFactory = { callGraphStatistics }
86-
)
87-
88-
override fun isEmpty(): Boolean {
89-
return internalSelector.isEmpty()
90-
}
91-
92-
override fun peek(): TsState {
93-
return internalSelector.peek()
94-
}
95-
96-
override fun remove(state: TsState) {
97-
logger.warn { "Selector size -1" }
98-
return internalSelector.remove(state)
99-
}
100-
101-
override fun add(states: Collection<TsState>) {
102-
logger.warn { "Selector size +1" }
103-
return internalSelector.add(states)
104-
}
105-
106-
override fun update(state: TsState) {
107-
return internalSelector.update(state)
108-
}
109-
}
76+
val pathSelector = createPathSelector(
77+
initialStates = initialStates,
78+
options = options,
79+
applicationGraph = graph,
80+
timeStatistics = timeStatistics,
81+
coverageStatisticsFactory = { coverageStatistics },
82+
cfgStatisticsFactory = { cfgStatistics },
83+
callGraphStatisticsFactory = { callGraphStatistics }
84+
)
11085

11186
val statesCollector =
11287
when (options.stateCollectionStrategy) {
@@ -169,16 +144,6 @@ class TsMachine(
169144
)
170145
}
171146

172-
val endReasonObserver = object : UMachineObserver<TsState> {
173-
override fun onStateTerminated(state: TsState, stateReachable: Boolean) {
174-
logger.warn {
175-
"State is terminated on ${state.currentStatement} in the method ${state.currentStatement.method}"
176-
}
177-
}
178-
}
179-
180-
observers += endReasonObserver
181-
182147
run(
183148
interpreter,
184149
pathSelector,

usvm-ts/src/main/kotlin/org/usvm/machine/expr/TsExprResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ class TsSimpleValueResolver(
10751075
return mkFieldLValue(ctx.addressSort, globalObject, local.name)
10761076
}
10771077

1078-
logger.warn { "Cannot resolve local $local" }
1078+
logger.warn { "Cannot resolve local $local, creating a fake field of the global object" }
10791079

10801080
globalObject.createFakeField(localName, scope)
10811081
scope.doWithState {

usvm-ts/src/main/kotlin/org/usvm/machine/interpreter/TsInterpreter.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class TsInterpreter(
243243
val entryPoint = graph.entryPoints(stmt.callee).singleOrNull()
244244

245245
if (entryPoint == null) {
246-
logger.warn { "No entry point for method: ${stmt.callee}" }
246+
logger.warn { "No entry point for method: ${stmt.callee}, mocking the call" }
247247
// If the method doesn't have entry points,
248248
// we go through it, we just mock the call
249249
mockMethodCall(scope, stmt.callee.signature)
@@ -355,8 +355,6 @@ class TsInterpreter(
355355

356356
val (posStmt, negStmt) = graph.successors(stmt).take(2).toList()
357357

358-
logger.warn { "Forking on if stmt $stmt" }
359-
360358
scope.forkWithBlackList(
361359
boolExpr,
362360
posStmt,
@@ -637,10 +635,7 @@ class TsInterpreter(
637635
local.name to localIdx
638636
}.toMap()
639637
}
640-
map[local.name] ?: run {
641-
logger.error("Local not declared: $local")
642-
return null
643-
}
638+
map[local.name]
644639
}
645640

646641
// Note: 'this' has index 'n'

0 commit comments

Comments
 (0)