use of com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet in project AGREE by loonwerks.
the class GenerateUfcObligationsVisitor method visit.
@Override
public ObligationSet visit(RecordUpdateExpr e) {
ObligationSet obs1 = e.record.accept(this);
ObligationSet obs2 = e.value.accept(this);
obs1.addAll(obs2);
return baseExpr(e, obs1);
}
use of com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet in project AGREE by loonwerks.
the class GenerateUfcObligationsVisitor method visit.
@Override
public ObligationSet visit(IfThenElseExpr e) {
ObligationSet obs1 = e.cond.accept(this);
ObligationSet obs2 = e.thenExpr.accept(this);
ObligationSet obs3 = e.elseExpr.accept(this);
obs2.extendContext(e.cond);
obs3.extendContext(notExpr(e.cond));
obs1.addAll(obs2);
obs1.addAll(obs3);
return obs1;
}
use of com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet in project AGREE by loonwerks.
the class GenerateUfcObligationsVisitor method visit.
// TODO: double check this for init expression args.
@Override
public ObligationSet visit(CondactExpr e) {
ObligationSet obs1 = e.clock.accept(this);
ObligationSet obs2 = e.call.accept(this);
ObligationSet obs3 = new ObligationSet();
for (Expr arg : e.args) {
obs3.addAll(arg.accept(this));
}
// inputs are only ``effecting'' when clock is true.
obs2.extendContext(e.clock);
// initial arguments are only effecting before the first clock, not just instants
// when the clock is low, but we would need a fresh variable to describe this
// situation, so we are being somewhat inaccurate.
obs3.extendContext(notExpr(e.clock));
obs1.addAll(obs2);
obs1.addAll(obs3);
return obs1;
}
use of com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet in project AGREE by loonwerks.
the class GenerateUfcObligationsVisitor method visit.
@Override
public ObligationSet visit(ArrayAccessExpr e) {
ObligationSet obs1 = e.array.accept(this);
ObligationSet obs2 = e.index.accept(this);
obs1.addAll(obs2);
return baseExpr(e, obs1);
}
use of com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet in project AGREE by loonwerks.
the class GenerateUfcObligationsVisitor method visit.
@Override
public ObligationSet visit(Node node) {
typeReconstructor.setNodeContext(node);
if (node.id.equals(initialProgram.main) || !this.generateForMainNodeObligationsOnly) {
typeReconstructor.setNodeContext(node);
currentNode = node;
ObligationSet allExprs = new ObligationSet();
for (Equation equation : node.equations) {
allExprs.addAll(equation.accept(this));
}
for (Expr assertion : node.assertions) {
allExprs.addAll(assertion(assertion));
}
if (!node.properties.isEmpty()) {
for (String property : node.properties) {
allExprs.addAll(property(property));
}
}
obligations.put(node, allExprs);
currentNode = null;
} else {
obligations.put(node, new ObligationSet());
}
return null;
}
Aggregations