コード例 #1
0
ファイル: Spin.cs プロジェクト: cubeme/safety-sharp
		/// <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(" }");
			}
		}
コード例 #2
0
ファイル: Spin.cs プロジェクト: cubeme/safety-sharp
		/// <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));
		}
コード例 #3
0
		protected void Check(LtlFormula actual, Formula expected)
		{
			Check(actual.Formula, expected);
		}
コード例 #4
0
ファイル: LtlFormula.cs プロジェクト: cubeme/safety-sharp
		/// <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));
		}
コード例 #5
0
ファイル: LtlFormula.cs プロジェクト: cubeme/safety-sharp
		/// <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));
		}
コード例 #6
0
ファイル: method access.cs プロジェクト: cubeme/safety-sharp
			public C1()
			{
				F = M0() == M2(1, true);
			}
コード例 #7
0
		private void CheckArgumentConversion(LtlFormula actual, Formula expected)
		{
			Check(actual, expected);
		}