-
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.
Signed-off-by: Tianrui Zheng <[email protected]> Co-authored-by: Tianrui Zheng <[email protected]>
- Loading branch information
Showing
25 changed files
with
1,494 additions
and
149 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
45 changes: 45 additions & 0 deletions
45
dartagnan/src/main/java/com/dat3m/dartagnan/solver/caat4wmm/EventDomainNext.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,45 @@ | ||
package com.dat3m.dartagnan.solver.caat4wmm; | ||
|
||
import com.dat3m.dartagnan.solver.caat.domain.Domain; | ||
import com.dat3m.dartagnan.verification.model.event.EventModel; | ||
import com.dat3m.dartagnan.verification.model.ExecutionModelNext; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
|
||
// TODO: this class is temporary and needs to be merged into EventDomain | ||
// once there is one ExecutionModel for all use cases. | ||
public class EventDomainNext implements Domain<EventModel> { | ||
private final ExecutionModelNext executionModel; | ||
private final List<EventModel> eventList; | ||
|
||
public EventDomainNext(ExecutionModelNext executionModel) { | ||
this.executionModel = executionModel; | ||
eventList = executionModel.getEventModels(); | ||
} | ||
|
||
@Override | ||
public int size() { | ||
return eventList.size(); | ||
} | ||
|
||
@Override | ||
public Collection<EventModel> getElements() { | ||
return eventList; | ||
} | ||
|
||
@Override | ||
public int getId(Object obj) { | ||
if (obj instanceof EventModel em) { | ||
return em.getId(); | ||
} else { | ||
throw new IllegalArgumentException(obj + " is not of type EventModel"); | ||
} | ||
} | ||
|
||
@Override | ||
public EventModel getObjectById(int id) { | ||
return eventList.get(id); | ||
} | ||
} |
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.