Search in sources :

Example 1 with BTSAction

use of org.sireum.hamr.ir.BTSAction in project osate-plugin by sireum.

the class BAVisitor method caseBehaviorActionBlock.

@Override
public Boolean caseBehaviorActionBlock(BehaviorActionBlock object) {
    BehaviorTime bt = object.getTimeout();
    assert bt == null : "Need to handle " + bt;
    visit(object.getContent());
    Object r = pop();
    if (r instanceof BTSBehaviorActions) {
        push(r);
    } else {
        BTSAction baa = (BTSAction) r;
        Option<BTSAssertion> pre = toNone();
        Option<BTSAssertion> post = toNone();
        BTSAssertedAction baa2 = BTSAssertedAction$.MODULE$.apply(pre, baa, post);
        push(BTSBehaviorActions$.MODULE$.apply(Sequential, VisitorUtil.toISZ(baa2)));
    }
    return false;
}
Also used : BTSAssertion(org.sireum.hamr.ir.BTSAssertion) BehaviorTime(org.osate.ba.aadlba.BehaviorTime) BTSAction(org.sireum.hamr.ir.BTSAction) EObject(org.eclipse.emf.ecore.EObject) BTSAssertedAction(org.sireum.hamr.ir.BTSAssertedAction) BTSBehaviorActions(org.sireum.hamr.ir.BTSBehaviorActions)

Example 2 with BTSAction

use of org.sireum.hamr.ir.BTSAction in project osate-plugin by sireum.

the class BAVisitor method caseBehaviorActionCollection.

@Override
public Boolean caseBehaviorActionCollection(BehaviorActionCollection object) {
    List<BTSAssertedAction> actions = new ArrayList<>();
    for (BehaviorAction ba : object.getActions()) {
        visit(ba);
        BTSAction action = pop();
        // NA for BA
        Option<BTSAssertion> pre = toNone();
        // NA for BA
        Option<BTSAssertion> post = toNone();
        actions.add(BTSAssertedAction$.MODULE$.apply(pre, action, post));
    }
    // TODO: how to determine execution order
    push(BTSBehaviorActions$.MODULE$.apply(Sequential, VisitorUtil.toISZ(actions)));
    return false;
}
Also used : BTSAssertion(org.sireum.hamr.ir.BTSAssertion) BehaviorAction(org.osate.ba.aadlba.BehaviorAction) BTSAction(org.sireum.hamr.ir.BTSAction) ArrayList(java.util.ArrayList) BTSAssertedAction(org.sireum.hamr.ir.BTSAssertedAction)

Aggregations

BTSAction (org.sireum.hamr.ir.BTSAction)2 BTSAssertedAction (org.sireum.hamr.ir.BTSAssertedAction)2 BTSAssertion (org.sireum.hamr.ir.BTSAssertion)2 ArrayList (java.util.ArrayList)1 EObject (org.eclipse.emf.ecore.EObject)1 BehaviorAction (org.osate.ba.aadlba.BehaviorAction)1 BehaviorTime (org.osate.ba.aadlba.BehaviorTime)1 BTSBehaviorActions (org.sireum.hamr.ir.BTSBehaviorActions)1