Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Execution Model #783

Merged
merged 42 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
005e4f5
version 1 of the new execution model
Nov 13, 2024
46b29c3
Remove some useless code
Nov 13, 2024
1a54115
Fix bugs of recursion handling
Nov 14, 2024
01024aa
Treat PO differently in execution graph visualizer
Nov 14, 2024
593937e
Fix usage of the method generateGraphvizFile in RefinementSolver
Nov 14, 2024
9b4ff4b
Fix usage of the method generateGraphvizFile in RefinementSolver
Nov 14, 2024
05ba329
Fix bug of relation renaming
Nov 15, 2024
5bcc4b0
Support DomainIdentity
Nov 15, 2024
c8ab05b
Support relations in GPU
Nov 15, 2024
b6def70
Add annotations
Nov 18, 2024
155d0d3
Tiny reformatted
Nov 18, 2024
cef925f
First attempt to fix build error
Nov 18, 2024
56cf82f
Second attempt to fix build error
Nov 19, 2024
71fe506
Undo changes to ExecutionModel and WMMSolver
Nov 25, 2024
8155adf
Undo changes to WMMSolver
Nov 25, 2024
ea8b93b
Decouple EncodingContext and SMT Model from ExecutionModelNext
Nov 25, 2024
d64926d
Add ThreadModel and remove useless data structures
Nov 26, 2024
b161f28
Make RelationModelManager be injected Config and make extraction of r…
Nov 26, 2024
9a10694
Reformat code and optimize some logics
Nov 26, 2024
b61490c
Optimize some logics
Nov 26, 2024
5154f0f
Optimize event extraction
Nov 27, 2024
b671fe6
Optimize logic for event extraction
Nov 27, 2024
107e5fc
Remove unnecessary change
Nov 27, 2024
8f3aac6
Fix extraction of redefined relations
Nov 29, 2024
bf9ae1f
Add exception catching
Nov 29, 2024
eaf4a79
Treat CO specially
Nov 29, 2024
8cf4620
Refactor and optimize the design
Dec 4, 2024
c23fe23
Optimize ThreadModel
Dec 4, 2024
8a10288
Add support to show original version of relation using name#0
Dec 5, 2024
d01f7dc
Make getRelationWithName() more general
Dec 5, 2024
9bb43d7
Reformat
Dec 5, 2024
8a0518e
Remove FromRead from default witness
Dec 5, 2024
a7809f3
Optimize some logics in ExecutionModelManager
Dec 6, 2024
a1d11da
Change default value of witness option and add some annotations
Dec 9, 2024
f56a4be
Add ValueModel to represent values in ExecutionModelNext
Dec 10, 2024
eef01cc
Remove type from ValueModel
Dec 11, 2024
23cd23a
Add result for AssertModel and represent address as ValueModel
Dec 12, 2024
f4a8d91
Use instanceof for all type checks of EventModel
Dec 12, 2024
c526690
Edit methods in ExecutionGraphVisualizer
Dec 13, 2024
2a6390a
Extract all relations at construction
Dec 13, 2024
f5dce65
Remove useless code
Dec 13, 2024
9f16080
Correct the logic to find right relation to show
Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions dartagnan/src/main/java/com/dat3m/dartagnan/Dartagnan.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.dat3m.dartagnan.utils.options.BaseOptions;
import com.dat3m.dartagnan.verification.VerificationTask;
import com.dat3m.dartagnan.verification.VerificationTask.VerificationTaskBuilder;
import com.dat3m.dartagnan.verification.model.ExecutionModel;
import com.dat3m.dartagnan.verification.solving.AssumeSolver;
import com.dat3m.dartagnan.verification.solving.DataRaceSolver;
import com.dat3m.dartagnan.verification.solving.ModelChecker;
Expand Down Expand Up @@ -230,19 +229,19 @@ public static File generateExecutionGraphFile(VerificationTask task, ProverEnvir
throws InvalidConfigurationException, SolverException, IOException {
Preconditions.checkArgument(modelChecker.hasModel(), "No execution graph to generate.");

final ExecutionModel m = ExecutionModel.withContext(modelChecker.getEncodingContext());
m.initialize(prover.getModel());
final EncodingContext encodingContext = modelChecker instanceof RefinementSolver refinementSolver ?
refinementSolver.getContextWithFullWmm() : modelChecker.getEncodingContext();
final SyntacticContextAnalysis synContext = newInstance(task.getProgram());
final String progName = task.getProgram().getName();
final int fileSuffixIndex = progName.lastIndexOf('.');
final String name = progName.isEmpty() ? "unnamed_program" :
(fileSuffixIndex == - 1) ? progName : progName.substring(0, fileSuffixIndex);
// RF edges give both ordering and data flow information, thus even when the pair is in PO
// we get some data flow information by observing the edge
// FR edges only give ordering information which is known if the pair is also in PO
// CO edges only give ordering information which is known if the pair is also in PO
return generateGraphvizFile(m, 1, (x, y) -> true, (x, y) -> !x.getThread().equals(y.getThread()),
(x, y) -> !x.getThread().equals(y.getThread()), getOrCreateOutputDirectory() + "/", name,
return generateGraphvizFile(encodingContext, prover.getModel(), 1, (x, y) -> true,
(x, y) -> !x.getThreadModel().getThread().equals(y.getThreadModel().getThread()),
getOrCreateOutputDirectory() + "/", name,
synContext, witnessType.convertToPng());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class OptionNames {

// Witness Options
public static final String WITNESS_ORIGINAL_PROGRAM_PATH = "witness.originalProgramFilePath";
public static final String WITNESS_SHOW = "witness.show";

// SVCOMP Options
public static final String PROPERTYPATH = "svcomp.property";
Expand Down
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> {
hernanponcedeleon marked this conversation as resolved.
Show resolved Hide resolved
hernanponcedeleon marked this conversation as resolved.
Show resolved Hide resolved
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ private void extractMemoryLayout() {
for (MemoryObject obj : getProgram().getMemory().getObjects()) {
final boolean isAllocated = obj.isStaticallyAllocated() || isTrue(encodingContext.execution(obj.getAllocationSite()));
if (isAllocated) {
final BigInteger address = (BigInteger) model.evaluate(encodingContext.address(obj));
final ValueModel address = new ValueModel(model.evaluate(encodingContext.address(obj)));
final BigInteger size = (BigInteger) model.evaluate(encodingContext.size(obj));
memoryLayoutMap.put(obj, new MemoryObjectModel(obj, address, size));
}
Expand Down
Loading
Loading