public static AtomicTableau GetAtomicTableau(this Formula formula, TruthLabel truthLabel) { switch (formula) { case ConjuctionFormula conjunction: return(new ConjunctionTableau(conjunction, truthLabel)); case DisjunctionFormula disjunction: return(new DisjunctionTableau(disjunction, truthLabel)); case EquivalenceFormula equivalence: return(new EquivalenceTableau(equivalence, truthLabel)); case ImplicationFormula implication: return(new ImplicationTableau(implication, truthLabel)); case NegationFormula negation: return(new NegationTableau(negation, truthLabel)); case VariableFormula variable: return(new VariableTableau(variable, truthLabel)); } throw new ArgumentException(); }
public static string GetStringRepresentation(this TruthLabel truthLabel) { if (truthLabel == TruthLabel.True) { return("T"); } if (truthLabel == TruthLabel.False) { return("F"); } else { throw new InvalidOperationException(); } }
internal ConjunctionTableau(ConjuctionFormula formula, TruthLabel truthLabel) { Formula = Conjunction = formula; TruthLabel = truthLabel; }
internal EquivalenceTableau(EquivalenceFormula formula, TruthLabel truthLabel) { Formula = Equivalence = formula; TruthLabel = truthLabel; }
internal Literal(char symbol, TruthLabel truthLabel) { Symbol = symbol; TruthLabel = truthLabel; }
public NegationTableau(NegationFormula formula, TruthLabel truthLabel) { Formula = Negation = formula; TruthLabel = truthLabel; }
protected override void HandleFalseCase(Branch branch) { branch.AddNewFormula(new BranchItem(Negation.Subformula, TruthLabel.GetOpposite())); ComputeRepresentingNode(branch); }
internal VariableTableau(VariableFormula formula, TruthLabel truthLabel) { Formula = Variable = formula; TruthLabel = truthLabel; }
public static string ToString(this TruthLabel truthLabel) { return((truthLabel == TruthLabel.True) ? "True" : "False"); }
public static int GetBinaryValue(this TruthLabel label) { return((label == TruthLabel.True) ? 1 : 0); }
public static TruthLabel GetOpposite(this TruthLabel label) { var oppositeValue = TruthLabel.True == label ? TruthLabel.False : TruthLabel.True; return(oppositeValue); }
internal BranchItem(Formula formula, TruthLabel truthLabel) { Formula = formula; TruthLabel = truthLabel; }
internal BranchItem(TableauInputNode tableauInputNode) { Formula = tableauInputNode.Formula; TruthLabel = tableauInputNode.TruthLabel; }
internal DisjunctionTableau(DisjunctionFormula formula, TruthLabel truthLabel) { Formula = Disjunction = formula; TruthLabel = truthLabel; }
internal ImplicationTableau(ImplicationFormula formula, TruthLabel truthLabel) { Formula = Implication = formula; TruthLabel = truthLabel; }