Search in sources :

Example 1 with BTSStateDeclaration

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

the class BAVisitor method caseBehaviorAnnex.

@Override
public Boolean caseBehaviorAnnex(BehaviorAnnex o) {
    // NA for BA
    boolean doNotProve = true;
    // NA for BA
    List<BTSAssertion> _assertions = new ArrayList<>();
    // NA for BA
    Option<BTSAssertion> _invariant = toNone();
    List<BTSVariableDeclaration> _variables = new ArrayList<>();
    if (o.getVariables() != null) {
        for (BehaviorVariable bv : o.getVariables()) {
            visit(bv);
            _variables.addAll(pop());
        }
    }
    List<BTSStateDeclaration> _states = new ArrayList<>();
    for (BehaviorState bs : o.getStates()) {
        visit(bs);
        _states.add(pop());
    }
    List<BTSTransition> _transitions = new ArrayList<>();
    for (BehaviorTransition bt : o.getTransitions()) {
        visit(bt);
        _transitions.add(pop());
    }
    BTSBLESSAnnexClause b = BTSBLESSAnnexClause$.MODULE$.apply(doNotProve, VisitorUtil.toISZ(_assertions), _invariant, VisitorUtil.toISZ(_variables), VisitorUtil.toISZ(_states), VisitorUtil.toISZ(_transitions));
    push(b);
    return false;
}
Also used : BehaviorVariable(org.osate.ba.aadlba.BehaviorVariable) ArrayList(java.util.ArrayList) BehaviorTransition(org.osate.ba.aadlba.BehaviorTransition) BTSAssertion(org.sireum.hamr.ir.BTSAssertion) BTSTransition(org.sireum.hamr.ir.BTSTransition) BTSVariableDeclaration(org.sireum.hamr.ir.BTSVariableDeclaration) BehaviorState(org.osate.ba.aadlba.BehaviorState) BTSStateDeclaration(org.sireum.hamr.ir.BTSStateDeclaration) BTSBLESSAnnexClause(org.sireum.hamr.ir.BTSBLESSAnnexClause)

Example 2 with BTSStateDeclaration

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

the class BAVisitor method caseBehaviorState.

@Override
public Boolean caseBehaviorState(BehaviorState object) {
    Name id = toSimpleName(object.getName());
    List<BTSStateCategory.Type> categories = new ArrayList<>();
    if (object.isInitial()) {
        categories.add(BTSStateCategory.byName("Initial").get());
    }
    if (object.isComplete()) {
        categories.add(BTSStateCategory.byName("Complete").get());
    }
    if (object.isFinal()) {
        categories.add(BTSStateCategory.byName("Final").get());
    }
    if (categories.isEmpty()) {
        categories.add(BTSStateCategory.byName("Execute").get());
    }
    // NA for BA
    Option<BTSAssertion> assertion = toNone();
    BTSStateDeclaration bsd = BTSStateDeclaration$.MODULE$.apply(id, VisitorUtil.toISZ(categories), assertion);
    push(bsd);
    return false;
}
Also used : BTSAssertion(org.sireum.hamr.ir.BTSAssertion) BTSType(org.sireum.hamr.ir.BTSType) BTSLiteralType(org.sireum.hamr.ir.BTSLiteralType) ArrayList(java.util.ArrayList) Name(org.sireum.hamr.ir.Name) BTSStateDeclaration(org.sireum.hamr.ir.BTSStateDeclaration)

Aggregations

ArrayList (java.util.ArrayList)2 BTSAssertion (org.sireum.hamr.ir.BTSAssertion)2 BTSStateDeclaration (org.sireum.hamr.ir.BTSStateDeclaration)2 BehaviorState (org.osate.ba.aadlba.BehaviorState)1 BehaviorTransition (org.osate.ba.aadlba.BehaviorTransition)1 BehaviorVariable (org.osate.ba.aadlba.BehaviorVariable)1 BTSBLESSAnnexClause (org.sireum.hamr.ir.BTSBLESSAnnexClause)1 BTSLiteralType (org.sireum.hamr.ir.BTSLiteralType)1 BTSTransition (org.sireum.hamr.ir.BTSTransition)1 BTSType (org.sireum.hamr.ir.BTSType)1 BTSVariableDeclaration (org.sireum.hamr.ir.BTSVariableDeclaration)1 Name (org.sireum.hamr.ir.Name)1