use of edu.umn.cs.crisys.safety.analysis.transform.HWFaultASTBuilder in project AMASE by loonwerks.
the class AddFaultsToNodeVisitor method gatherHWFaults.
/**
* Gather hardware faults (dep faults) from the agree node fault statements and
* process them.
*
* @param globalLustreNodes List of Nodes
* @param node Agree node
* @param isTop flag states if this agree node is top of program.
* @return List of hardware faults in the agree node annex.
*/
public List<HWFault> gatherHWFaults(List<Node> globalLustreNodes, AgreeNode node, boolean isTop) {
List<SpecStatement> specs = SafetyUtil.collapseAnnexes(SafetyUtil.getSafetyAnnexes(node, isTop));
List<HWFault> hwFaults = new ArrayList<>();
for (SpecStatement s : specs) {
if (s instanceof HWFaultStatement) {
HWFaultStatement hwfs = (HWFaultStatement) s;
HWFaultASTBuilder builder = new HWFaultASTBuilder(globalLustreNodes, node);
HWFault safetyFault = builder.buildHWFault(hwfs);
hwFaults.add(safetyFault);
}
}
return hwFaults;
}
Aggregations