Search in sources :

Example 1 with HWFaultASTBuilder

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;
}
Also used : HWFaultStatement(edu.umn.cs.crisys.safety.safety.HWFaultStatement) HWFaultASTBuilder(edu.umn.cs.crisys.safety.analysis.transform.HWFaultASTBuilder) ArrayList(java.util.ArrayList) SpecStatement(edu.umn.cs.crisys.safety.safety.SpecStatement) HWFault(edu.umn.cs.crisys.safety.analysis.transform.HWFault)

Aggregations

HWFault (edu.umn.cs.crisys.safety.analysis.transform.HWFault)1 HWFaultASTBuilder (edu.umn.cs.crisys.safety.analysis.transform.HWFaultASTBuilder)1 HWFaultStatement (edu.umn.cs.crisys.safety.safety.HWFaultStatement)1 SpecStatement (edu.umn.cs.crisys.safety.safety.SpecStatement)1 ArrayList (java.util.ArrayList)1