Search in sources :

Example 1 with ComponentImplementationImpl

use of org.osate.aadl2.impl.ComponentImplementationImpl in project AMASE by loonwerks.

the class FaultsVerifyAllHandler method isProbabilisticAnalysis.

private boolean isProbabilisticAnalysis() {
    List<Classifier> classifiers = getClassifiers();
    if (classifiers == null) {
        return false;
    }
    // TODO: Finish addressing this issue.
    for (Classifier cl : classifiers) {
        // Get impl of this level
        if (cl instanceof ComponentImplementationImpl) {
            List<AnnexSubclause> asList = cl.getOwnedAnnexSubclauses();
            for (AnnexSubclause as : asList) {
                if (as.getName().equalsIgnoreCase("safety")) {
                    if (as instanceof DefaultAnnexSubclauseImpl) {
                        DefaultAnnexSubclauseImpl defaultAnnex = (DefaultAnnexSubclauseImpl) as;
                        SafetyContractSubclauseImpl safetyAnnex = (SafetyContractSubclauseImpl) defaultAnnex.getParsedAnnexSubclause();
                        // Get analysis stmt
                        List<SpecStatement> specs = ((SafetyContract) safetyAnnex.getContract()).getSpecs();
                        for (SpecStatement spec : specs) {
                            if (spec instanceof AnalysisStatement) {
                                if (!(((AnalysisStatement) spec).getBehavior() instanceof ProbabilityBehavior)) {
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return true;
}
Also used : SafetyContractSubclauseImpl(edu.umn.cs.crisys.safety.safety.impl.SafetyContractSubclauseImpl) AnalysisStatement(edu.umn.cs.crisys.safety.safety.AnalysisStatement) ComponentImplementationImpl(org.osate.aadl2.impl.ComponentImplementationImpl) DefaultAnnexSubclauseImpl(org.osate.aadl2.impl.DefaultAnnexSubclauseImpl) ProbabilityBehavior(edu.umn.cs.crisys.safety.safety.ProbabilityBehavior) SpecStatement(edu.umn.cs.crisys.safety.safety.SpecStatement) Classifier(org.osate.aadl2.Classifier) SafetyContract(edu.umn.cs.crisys.safety.safety.SafetyContract) AnnexSubclause(org.osate.aadl2.AnnexSubclause)

Aggregations

AnalysisStatement (edu.umn.cs.crisys.safety.safety.AnalysisStatement)1 ProbabilityBehavior (edu.umn.cs.crisys.safety.safety.ProbabilityBehavior)1 SafetyContract (edu.umn.cs.crisys.safety.safety.SafetyContract)1 SpecStatement (edu.umn.cs.crisys.safety.safety.SpecStatement)1 SafetyContractSubclauseImpl (edu.umn.cs.crisys.safety.safety.impl.SafetyContractSubclauseImpl)1 AnnexSubclause (org.osate.aadl2.AnnexSubclause)1 Classifier (org.osate.aadl2.Classifier)1 ComponentImplementationImpl (org.osate.aadl2.impl.ComponentImplementationImpl)1 DefaultAnnexSubclauseImpl (org.osate.aadl2.impl.DefaultAnnexSubclauseImpl)1