QueryInterfaceStruct ctInterface = queryInterface(Simulator.CT, ctProxy);
engineInfo(Simulator.ALL, "Validating interfaces...");
for (IVariable var : contract.getControlledVariables())
{
QueryInterfaceStructoutputsStruct varOut = interfaceContainsOuput(dtInterface, var.getName());
if (varOut == null)
{
abort(Simulator.DE, "Missing-output controlled variable: "
+ var);
return false;
}
else
{
// Cannot check in VDM
// if(!checkIfSameDimensions(var,varOut.size))
// {
// abort(Simulator.DE, "Dimensions of variable \"" + var + "\" do not match with contract");
// return false;
// }
}
QueryInterfaceStructinputsStruct varIn = interfaceContainsInput(ctInterface, var.getName());
if (varIn == null)
{
abort(Simulator.CT, "Missing-input controlled variable: " + var);
return false;
}
else
{
if(!checkIfSameDimensions(var,varIn.size))
{
abort(Simulator.CT, "Dimensions of variable \"" + var + "\" does not match with contract");
return false;
}
}
}
for (IVariable var : contract.getMonitoredVariables())
{
QueryInterfaceStructinputsStruct varIn = interfaceContainsInput(dtInterface, var.getName());
if (varIn == null)
{
abort(Simulator.DE, "Missing-input monitored variable: " + var);
return false;
}
else
{
// Cannot check in VDM
// if(!checkIfSameDimensions(var,varIn.size))
// {
// abort(Simulator.DE, "Dimensions of variable \"" + var + "\" do not match with contract");
// return false;
// }
}
QueryInterfaceStructoutputsStruct varOut = interfaceContainsOuput(ctInterface, var.getName());
if (varOut == null)
{
abort(Simulator.CT, "Missing-output monitored variable: " + var);
return false;
}