Skip to content

Commit

Permalink
fixed coverage vs equality issue in bad end remover
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamZsofi committed Jan 26, 2025
1 parent ce57c6d commit d7db9d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ class DoubleEndNodeRemover<S : State, A : Action> {
val parent = node.parent.get()
if (parent.parent.isEmpty) return false
val grandParent = node.parent.get().parent.get()
return if (
node.isCovered && parent.parent.get() == node.coveringNode.get()
) { // node is covered and parent is checked above
return if (node.state == grandParent.state) { // node is covered and parent is checked above
// bad node
true
} else {
Expand All @@ -49,7 +47,7 @@ class DoubleEndNodeRemover<S : State, A : Action> {
var transitionFired = false
if (node.parent.isPresent && node.parent.get().parent.isPresent) {
val grandParent = node.parent.get().parent.get()
if (!(node.isCovered && node.coveringNode.get() == grandParent)) return false
if (node.state != grandParent.state) return false

val state = node.parent.get().state.toString()
val bufReader = BufferedReader(StringReader(state))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import hu.bme.mit.theta.analysis.algorithm.tracegeneration.summary.AbstractTrace
import hu.bme.mit.theta.analysis.algorithm.tracegeneration.summary.TraceGenerationResult
import hu.bme.mit.theta.common.logging.Logger
import java.util.function.Consumer
import kotlin.collections.ArrayList

class TraceGenerationChecker<S : State, A : Action, P : Prec>(
private val logger: Logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class XstsCliTracegen :

for (node in summaryStateMap.keys) {
for (outEdge in node.outEdges) {
sb.add("${node.id} -> ${outEdge.target.id}")
sb.add("_${node.id} -> _${outEdge.target.id}")
}
}

Expand Down Expand Up @@ -200,6 +200,7 @@ class XstsCliTracegen :
traceDirPath.mkdir()
}

// TODO FIX: if prop at end of xsts, it uses that, not this one
val propStream = ByteArrayInputStream(("prop {\n" + "\ttrue\n" + "}\n").toByteArray())
val xsts =
XstsDslManager.createXsts(SequenceInputStream(FileInputStream(modelFile), propStream))
Expand Down

0 comments on commit d7db9d4

Please sign in to comment.