use of com.dat3m.dartagnan.wmm.relation.RecursiveRelation in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitLetRecAndDefinition.
@Override
public Object visitLetRecAndDefinition(CatParser.LetRecAndDefinitionContext ctx) {
RecursiveRelation rRecursive = (RecursiveRelation) relationRepository.getRelation(RecursiveRelation.class, ctx.n.getText());
Relation rConcrete = ctx.e.accept(relationVisitor);
if (rRecursive == null || rConcrete == null) {
throw new ParsingException(ctx.getText());
}
rRecursive.setConcreteRelation(rConcrete);
recursiveGroup.add(rRecursive);
return null;
}
use of com.dat3m.dartagnan.wmm.relation.RecursiveRelation in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitLetRecDefinition.
@Override
public Object visitLetRecDefinition(CatParser.LetRecDefinitionContext ctx) {
recursiveGroup = new HashSet<>();
recursiveDef = true;
RecursiveRelation rRecursive = (RecursiveRelation) relationRepository.getRelation(RecursiveRelation.class, ctx.n.getText());
Relation rConcrete = ctx.e.accept(relationVisitor);
if (rRecursive == null || rConcrete == null) {
throw new ParsingException(ctx.getText());
}
rRecursive.setConcreteRelation(rConcrete);
recursiveGroup.add(rRecursive);
for (CatParser.LetRecAndDefinitionContext c : ctx.letRecAndDefinition()) {
c.accept(this);
}
wmm.addRecursiveGroup(recursiveGroup);
recursiveDef = false;
return null;
}
use of com.dat3m.dartagnan.wmm.relation.RecursiveRelation in project Dat3M by hernanponcedeleon.
the class RecursiveGroup method initMinTupleSets.
public void initMinTupleSets() {
boolean changed = true;
while (changed) {
changed = false;
for (RecursiveRelation relation : relations) {
relation.setDoRecurse();
int oldSize = relation.getMinTupleSet().size();
if (oldSize != relation.getMinTupleSetRecursive().size()) {
changed = true;
}
}
}
}
use of com.dat3m.dartagnan.wmm.relation.RecursiveRelation in project Dat3M by hernanponcedeleon.
the class RecursiveGroup method updateEncodeTupleSets.
public void updateEncodeTupleSets() {
Map<Relation, Integer> encodeSetSizes = new HashMap<>();
for (Relation relation : relations) {
encodeSetSizes.put(relation, 0);
}
boolean changed = true;
while (changed) {
changed = false;
for (RecursiveRelation relation : relations) {
relation.setDoRecurse();
relation.addEncodeTupleSet(relation.getEncodeTupleSet());
int newSize = relation.getEncodeTupleSet().size();
if (newSize != encodeSetSizes.get(relation)) {
encodeSetSizes.put(relation, newSize);
changed = true;
}
}
}
}
use of com.dat3m.dartagnan.wmm.relation.RecursiveRelation in project Dat3M by hernanponcedeleon.
the class RecursiveGroup method initMaxTupleSets.
public void initMaxTupleSets() {
boolean changed = true;
while (changed) {
changed = false;
for (RecursiveRelation relation : relations) {
relation.setDoRecurse();
int oldSize = relation.getMaxTupleSet().size();
if (oldSize != relation.getMaxTupleSetRecursive().size()) {
changed = true;
}
}
}
}
Aggregations