use of verdict.vdm.vdm_lustre.Expression in project VERDICT by ge-high-assurance.
the class VDM2Lustre method visit.
public void visit(ContractSpec contractSpec) {
for (SymbolDefinition symbol : contractSpec.getSymbol()) {
DataType data_type = symbol.getDataType();
String user_defined_type = data_type.getUserDefinedType();
if (user_defined_type != null) {
user_defined_type = user_defined_type.replace(".", "_dot_");
user_defined_type = user_defined_type.replace("::", "_double_colon_");
boolean implemented_type = typeDeclarations.containsKey(user_defined_type);
if (implemented_type) {
data_type.setUserDefinedType(user_defined_type);
}
}
Expression expr = symbol.getDefinition();
expr = visitExpression(expr);
symbol.setDefinition(expr);
recordLiteral(expr);
}
String mbas_fml = "((.+):(.+):(.+))|((.+):Formula$)";
Pattern fml_pattern = Pattern.compile(mbas_fml);
List<ContractItem> mbas_guarantee = new ArrayList<ContractItem>();
// guarantee
for (ContractItem contractItem : contractSpec.getGuarantee()) {
if (contractItem.getName() != null) {
Matcher m = fml_pattern.matcher(contractItem.getName());
if (m.find()) {
mbas_guarantee.add(contractItem);
} else {
// Normal Formula
visit(contractItem);
}
} else {
visit(contractItem);
}
}
// remove MBAS guarantee
contractSpec.getGuarantee().removeAll(mbas_guarantee);
}
use of verdict.vdm.vdm_lustre.Expression in project VERDICT by ge-high-assurance.
the class VDM2Lustre method visit.
public void visit(ConstantDeclaration constantDeclaration) {
// String identifier = constantDeclaration.getName();
DataType data_type = constantDeclaration.getDataType();
String user_defined_type = data_type.getUserDefinedType();
if (user_defined_type != null) {
user_defined_type = user_defined_type.replace(".", "_dot_");
user_defined_type = user_defined_type.replace("::", "_double_colon_");
boolean implemented_type = typeDeclarations.containsKey(user_defined_type);
if (implemented_type) {
data_type.setUserDefinedType(user_defined_type);
}
Expression expr = constantDeclaration.getDefinition();
recordLiteral(expr);
}
}
use of verdict.vdm.vdm_lustre.Expression in project VERDICT by ge-high-assurance.
the class VDM2Lustre method visit.
// protected void visitNodeEq(NodeEquation node_eq) {
//
// Expression rhs_expr = node_eq.getRhs();
// visitExpression(rhs_expr);
// }
public void visit(NodeEquation node_equation) {
Expression expr = node_equation.getRhs();
recordLiteral(expr);
// expr = visitExpression(expr);
// node_equation.setRhs(expr);
}
use of verdict.vdm.vdm_lustre.Expression in project VERDICT by ge-high-assurance.
the class VDM2Lustre method binaryOP.
protected BinaryOperation binaryOP(BinaryOperation op) {
BinaryOperation op_exp = new BinaryOperation();
Expression lhs = op.getLhsOperand();
lhs = visitExpression(lhs);
Expression rhs = op.getRhsOperand();
rhs = visitExpression(rhs);
op_exp.setLhsOperand(lhs);
op_exp.setRhsOperand(rhs);
return op_exp;
}
use of verdict.vdm.vdm_lustre.Expression in project VERDICT by ge-high-assurance.
the class PrettyPrinter method visit.
public void visit(NodeEquation neq) {
NodeEquationLHS leq = neq.getLhs();
Expression expr = neq.getRhs();
}
Aggregations