Skip to content

Commit

Permalink
Fixing iter lookup and missing state
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Feb 15, 2024
1 parent 017cad8 commit db73cbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class BoundedChecker<S : ExprState, A : StmtAction> @JvmOverloads constructor(
private val unfoldedPropExpr = { i: VarIndexing -> PathUtils.unfold(monolithicExpr.propExpr, i) }
private val indices = mutableListOf(VarIndexingFactory.indexing(0))
private val exprs = mutableListOf<Expr<BoolType>>()
private var lastIterLookup = Pair(0, 0)
private var kindLastIterLookup = 0

init {
check(bmcSolver != itpSolver || bmcSolver == null) { "Use distinct solvers for BMC and IMC!" }
Expand Down Expand Up @@ -108,12 +108,11 @@ class BoundedChecker<S : ExprState, A : StmtAction> @JvmOverloads constructor(
error("Bad configuration: induction check should always be preceded by a BMC/SAT check")
}
kind()?.let { return it }
lastIterLookup = lastIterLookup.copy(first = iteration)
kindLastIterLookup = iteration
}

if (imcEnabled(iteration)) {
itp()?.let { return it }
lastIterLookup = lastIterLookup.copy(second = iteration)
}
}
return SafetyResult.unknown()
Expand Down Expand Up @@ -157,8 +156,8 @@ class BoundedChecker<S : ExprState, A : StmtAction> @JvmOverloads constructor(

logger.write(Logger.Level.MAINSTEP, "\tStarting k-induction\n")

exprs.subList(lastIterLookup.first, exprs.size).forEach { indSolver.add(it) }
indices.subList(lastIterLookup.first, indices.size - 1).forEach { indSolver.add(unfoldedPropExpr(it)) }
exprs.subList(kindLastIterLookup, exprs.size).forEach { indSolver.add(it) }
indices.subList(kindLastIterLookup, indices.size - 1).forEach { indSolver.add(unfoldedPropExpr(it)) }

return WithPushPop(indSolver).use {
indSolver.add(Not(unfoldedPropExpr(indices.last())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private fun backend(xcfa: XCFA, mcm: MCM, parseContext: ParseContext, config: Xc
logger: Logger,
uniqueLogger: Logger): SafetyResult<*, *> =
if (config.backendConfig.backend == Backend.NONE) {
SafetyResult.unknown()
SafetyResult.unknown<State, Action>()
} else {
if (xcfa.procedures.all { it.errorLoc.isEmpty && config.inputConfig.property == ErrorDetection.ERROR_LOCATION }) {
SafetyResult.safe<State, Action>()
Expand Down

0 comments on commit db73cbb

Please sign in to comment.