Exemplo n.º 1
0
        private void CheckIfIndexIsCorrect(Formula formula, int indexOfStateFormula)
        {
            var isequal = IsFormulasStructurallyEquivalentVisitor.Compare(formula, _formulasToCheck[indexOfStateFormula]);

            if (!isequal)
            {
                throw new Exception("Should be equivalent. the index seems to be corrupt");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Compares <paramref name="formula" /> with <paramref name="referenceFormula" />.
        /// </summary>
        public static bool Compare(Formula referenceFormula, Formula formula)
        {
            Requires.NotNull(referenceFormula, nameof(referenceFormula));
            Requires.NotNull(formula, nameof(formula));

            var visitor = new IsFormulasStructurallyEquivalentVisitor(referenceFormula);

            visitor.Visit(formula);
            return(visitor.IsEqual);
        }