use of org.sireum.hamr.ir.BTSVariableDeclaration 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;
}
use of org.sireum.hamr.ir.BTSVariableDeclaration in project osate-plugin by sireum.
the class BAVisitor method caseBehaviorVariable.
@Override
public Boolean caseBehaviorVariable(BehaviorVariable object) {
Option<BTSVariableCategory.Type> category = toNone();
List<BTSVariableDeclaration> names = new ArrayList<>();
DataClassifier dc = object.getDataClassifier();
this.v.processDataType(dc);
Classifier c = Classifier$.MODULE$.apply(dc.getQualifiedName());
BTSType varType = BTSClassifier$.MODULE$.apply(c);
Name name = toSimpleName(object.getName());
Option<BTSExp> assignExpression = toNone();
assert object.getOwnedValueConstant() == null : "Need to handle ba variable const init " + object;
Option<BLESSIntConst> arraySize = toNone();
// NA for BA
Option<BTSAssertion> variableAssertion = toNone();
BTSVariableDeclaration vd = BTSVariableDeclaration$.MODULE$.apply(name, category, varType, assignExpression, arraySize, variableAssertion);
names.add(vd);
push(names);
return false;
}
Aggregations