Пример #1
0
		/// <summary>
		///   Checks whether the <paramref name="formula" /> holds in all states of the <paramref name="model" />.
		/// </summary>
		/// <param name="model">The model that should be checked.</param>
		/// <param name="formula">The formula that should be checked.</param>
		public AnalysisResult Check(ModelBase model, Formula formula)
		{
			Requires.NotNull(model, nameof(model));
			Requires.NotNull(formula, nameof(formula));

			var visitor = new IsLtlFormulaVisitor();
			visitor.Visit(formula);

			if (!visitor.IsLtlFormula)
				throw new NotSupportedException("CTL model checking is currently not supported with LtsMin.");

			var transformationVisitor = new LtsMinLtlTransformer();
			transformationVisitor.Visit(new UnaryFormula(formula, UnaryOperator.Next));

			return Check(model, formula, $"--ltl=\"{transformationVisitor.TransformedFormula}\"");
		}
Пример #2
0
        /// <summary>
        ///   Checks whether the <paramref name="formula" /> holds in all states of the <paramref name="model" />.
        /// </summary>
        /// <param name="createModel">The creator for the model that should be checked.</param>
        /// <param name="formula">The formula that should be checked.</param>
        public AnalysisResult <SafetySharpRuntimeModel> Check(CoupledExecutableModelCreator <SafetySharpRuntimeModel> createModel, Formula formula)
        {
            Requires.NotNull(createModel, nameof(createModel));
            Requires.NotNull(formula, nameof(formula));

            var visitor = new IsLtlFormulaVisitor();

            visitor.Visit(formula);

            if (!visitor.IsLtlFormula)
            {
                throw new NotSupportedException("CTL model checking is currently not supported with LtsMin.");
            }

            var transformationVisitor = new LtsMinLtlTransformer();

            transformationVisitor.Visit(new UnaryFormula(formula, UnaryOperator.Next));

            return(Check(createModel, $"--ltl=\"{transformationVisitor.TransformedFormula}\""));
        }
Пример #3
0
        /// <summary>
        ///   Checks whether the <paramref name="formula" /> holds in all states of the <paramref name="model" />.
        /// </summary>
        /// <param name="model">The model that should be checked.</param>
        /// <param name="formula">The formula that should be checked.</param>
        public AnalysisResult Check(ModelBase model, Formula formula)
        {
            Requires.NotNull(model, nameof(model));
            Requires.NotNull(formula, nameof(formula));

            var visitor = new IsLtlFormulaVisitor();

            visitor.Visit(formula);

            if (!visitor.IsLtlFormula)
            {
                throw new NotSupportedException("CTL model checking is currently not supported with LtsMin.");
            }

            var transformationVisitor = new LtsMinLtlTransformer();

            transformationVisitor.Visit(new UnaryFormula(formula, UnaryOperator.Next));

            return(Check(model, formula, $"--ltl=\"{transformationVisitor.TransformedFormula}\""));
        }