Skip to content

Commit

Permalink
Added createThread key to witness
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 21, 2023
1 parent 5a420c7 commit ace1757
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ fun traceToWitness(
for (i in 0 until trace.length()) {
val state = trace.states[i]
val nextState = trace.states[i + 1]
val newThreads = nextState.processes.keys - state.processes.keys
val node = WitnessNode(
id = "N${newStates.size}",
entry = false,
Expand All @@ -77,8 +78,11 @@ fun traceToWitness(
for (xcfaLabel in flattenedSequence) {
val node = WitnessNode(id = "N${newStates.size}", entry = false, sink = false,
violation = false)
val edge = labelToEdge(lastNode, node, xcfaLabel, action.pid,
var edge = labelToEdge(lastNode, node, xcfaLabel, action.pid,
nextState.sGlobal.getVal(), parseContext)
if (newThreads.isNotEmpty() && xcfaLabel is StartLabel) {
edge = edge.copy(createThread = newThreads.joinToString(","))
}
if (node != WitnessNode(id = "N${newStates.size}") || shouldInclude(edge, verbosity)) {
newStates.add(node)
newActions.add(edge)
Expand Down

0 comments on commit ace1757

Please sign in to comment.