Search in sources :

Example 1 with ObligationSet

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);
}
Also used : ObligationSet(com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet)

Example 2 with ObligationSet

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;
}
Also used : ObligationSet(com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet)

Example 3 with ObligationSet

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;
}
Also used : ObligationSet(com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet) RecordAccessExpr(jkind.lustre.RecordAccessExpr) TupleExpr(jkind.lustre.TupleExpr) UnaryExpr(jkind.lustre.UnaryExpr) RecordUpdateExpr(jkind.lustre.RecordUpdateExpr) CondactExpr(jkind.lustre.CondactExpr) Expr(jkind.lustre.Expr) CastExpr(jkind.lustre.CastExpr) IntExpr(jkind.lustre.IntExpr) NodeCallExpr(jkind.lustre.NodeCallExpr) RecordExpr(jkind.lustre.RecordExpr) BoolExpr(jkind.lustre.BoolExpr) BinaryExpr(jkind.lustre.BinaryExpr) RealExpr(jkind.lustre.RealExpr) ArrayAccessExpr(jkind.lustre.ArrayAccessExpr) ArrayExpr(jkind.lustre.ArrayExpr) IdExpr(jkind.lustre.IdExpr) ArrayUpdateExpr(jkind.lustre.ArrayUpdateExpr) FunctionCallExpr(jkind.lustre.FunctionCallExpr) IfThenElseExpr(jkind.lustre.IfThenElseExpr)

Example 4 with ObligationSet

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);
}
Also used : ObligationSet(com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet)

Example 5 with ObligationSet

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;
}
Also used : ObligationSet(com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet) RecordAccessExpr(jkind.lustre.RecordAccessExpr) TupleExpr(jkind.lustre.TupleExpr) UnaryExpr(jkind.lustre.UnaryExpr) RecordUpdateExpr(jkind.lustre.RecordUpdateExpr) CondactExpr(jkind.lustre.CondactExpr) Expr(jkind.lustre.Expr) CastExpr(jkind.lustre.CastExpr) IntExpr(jkind.lustre.IntExpr) NodeCallExpr(jkind.lustre.NodeCallExpr) RecordExpr(jkind.lustre.RecordExpr) BoolExpr(jkind.lustre.BoolExpr) BinaryExpr(jkind.lustre.BinaryExpr) RealExpr(jkind.lustre.RealExpr) ArrayAccessExpr(jkind.lustre.ArrayAccessExpr) ArrayExpr(jkind.lustre.ArrayExpr) IdExpr(jkind.lustre.IdExpr) ArrayUpdateExpr(jkind.lustre.ArrayUpdateExpr) FunctionCallExpr(jkind.lustre.FunctionCallExpr) IfThenElseExpr(jkind.lustre.IfThenElseExpr) Equation(jkind.lustre.Equation)

Aggregations

ObligationSet (com.rockwellcollins.atc.tcg.obligations.ufc.ObligationSet)9 ArrayAccessExpr (jkind.lustre.ArrayAccessExpr)3 ArrayExpr (jkind.lustre.ArrayExpr)3 ArrayUpdateExpr (jkind.lustre.ArrayUpdateExpr)3 BinaryExpr (jkind.lustre.BinaryExpr)3 BoolExpr (jkind.lustre.BoolExpr)3 CastExpr (jkind.lustre.CastExpr)3 CondactExpr (jkind.lustre.CondactExpr)3 Expr (jkind.lustre.Expr)3 FunctionCallExpr (jkind.lustre.FunctionCallExpr)3 IdExpr (jkind.lustre.IdExpr)3 IfThenElseExpr (jkind.lustre.IfThenElseExpr)3 IntExpr (jkind.lustre.IntExpr)3 NodeCallExpr (jkind.lustre.NodeCallExpr)3 RealExpr (jkind.lustre.RealExpr)3 RecordAccessExpr (jkind.lustre.RecordAccessExpr)3 RecordExpr (jkind.lustre.RecordExpr)3 RecordUpdateExpr (jkind.lustre.RecordUpdateExpr)3 TupleExpr (jkind.lustre.TupleExpr)3 UnaryExpr (jkind.lustre.UnaryExpr)3