/// <summary> /// Computes the minimal critical sets for the <paramref name="hazard" />. /// </summary> /// <param name="hazard">The hazard the minimal critical sets should be computed for.</param> public void ComputeMinimalCriticalSets(LtlFormula hazard) { Requires.NotNull(hazard, () => hazard); Requires.That(!hazard.Formula.IsTemporal, "The hazard must be a non-temporal formula."); var transformedFormula = LtlFormulaTransformation.Transform(hazard); var propositionalFormula = ScmVerificationElements.ToPropositionalFormula(transformedFormula); var minimalCriticalSets = _analysis.DccaWithPromela(propositionalFormula); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("======================"); Console.WriteLine("Minimal Critical Sets:"); Console.WriteLine("======================"); foreach (var minimalCriticalSet in minimalCriticalSets) { Console.Write("{ "); Console.Write(String.Join(", ", minimalCriticalSet.Select(fault => { var component = String.Join(".", fault.Item1.Reverse().Skip(1)); return String.Format("{0}.{1}", component, fault.Item2); }))); Console.WriteLine(" }"); } }
/// <summary> /// Checks whether the <paramref name="formula" /> holds. /// </summary> /// <param name="formula">The formula that should be checked.</param> public bool Check(LtlFormula formula) { Requires.NotNull(formula, () => formula); return _analysis.AnalyzeWithPromela(LtlFormulaTransformation.Transform(formula)); }
protected void Check(LtlFormula actual, Formula expected) { Check(actual.Formula, expected); }
/// <summary> /// Returns a <see cref="LtlFormula" /> that applies the equivalence operator to this instance and /// <paramref name="formula" />. /// </summary> /// <param name="formula">The formula that should be equivalent.</param> public LtlFormula EquivalentTo(LtlFormula formula) { Requires.NotNull(formula, () => formula); return new LtlFormula(new BinaryFormula(Formula, BinaryFormulaOperator.Equivalence, PathQuantifier.None, formula.Formula)); }
/// <summary> /// Returns a <see cref="LtlFormula" /> that applies the implication operator to this instance (the antecedent) and /// <paramref name="formula" /> (the succedent). /// </summary> /// <param name="formula">The formula representing the succedent of the implication.</param> public LtlFormula Implies(LtlFormula formula) { Requires.NotNull(formula, () => formula); return new LtlFormula(new BinaryFormula(Formula, BinaryFormulaOperator.Implication, PathQuantifier.None, formula.Formula)); }
public C1() { F = M0() == M2(1, true); }
private void CheckArgumentConversion(LtlFormula actual, Formula expected) { Check(actual, expected); }