-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ThreadModel and remove useless data structures
Signed-off-by: Tianrui Zheng <tianrui.zheng@huawei.com>
- Loading branch information
Tianrui Zheng
committed
Nov 26, 2024
1 parent
89107bd
commit 8e8a4ae
Showing
7 changed files
with
91 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
dartagnan/src/main/java/com/dat3m/dartagnan/verification/model/ThreadModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.dat3m.dartagnan.verification.model; | ||
|
||
import com.dat3m.dartagnan.program.event.Tag; | ||
import com.dat3m.dartagnan.program.Thread; | ||
import com.dat3m.dartagnan.verification.model.event.EventModel; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
|
||
public class ThreadModel { | ||
private final Thread thread; | ||
private final List<EventModel> eventList; | ||
|
||
public ThreadModel(Thread thread, List<EventModel> eventList) { | ||
this.thread = thread; | ||
this.eventList = eventList; | ||
} | ||
|
||
public int getId() { | ||
return thread.getId(); | ||
} | ||
|
||
public List<EventModel> getEventList() { | ||
return Collections.unmodifiableList(eventList); | ||
} | ||
|
||
public List<EventModel> getVisibleEventList() { | ||
return eventList.stream().filter(e -> e.hasTag(Tag.VISIBLE)).toList(); | ||
} | ||
|
||
public List<EventModel> getEventModelsToShow() { | ||
return eventList.stream() | ||
.filter(e -> e.hasTag(Tag.VISIBLE) || e.isLocal() || e.isAssert()) | ||
.toList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.