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"); } }
/// <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); }