Esempio n. 1
0
        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();
     }
 }
Esempio n. 3
0
 internal ConjunctionTableau(ConjuctionFormula formula, TruthLabel truthLabel)
 {
     Formula    = Conjunction = formula;
     TruthLabel = truthLabel;
 }
 internal EquivalenceTableau(EquivalenceFormula formula, TruthLabel truthLabel)
 {
     Formula    = Equivalence = formula;
     TruthLabel = truthLabel;
 }
Esempio n. 5
0
 internal Literal(char symbol, TruthLabel truthLabel)
 {
     Symbol     = symbol;
     TruthLabel = truthLabel;
 }
Esempio n. 6
0
 public NegationTableau(NegationFormula formula, TruthLabel truthLabel)
 {
     Formula    = Negation = formula;
     TruthLabel = truthLabel;
 }
Esempio n. 7
0
 protected override void HandleFalseCase(Branch branch)
 {
     branch.AddNewFormula(new BranchItem(Negation.Subformula, TruthLabel.GetOpposite()));
     ComputeRepresentingNode(branch);
 }
Esempio n. 8
0
 internal VariableTableau(VariableFormula formula, TruthLabel truthLabel)
 {
     Formula    = Variable = formula;
     TruthLabel = truthLabel;
 }
Esempio n. 9
0
 public static string ToString(this TruthLabel truthLabel)
 {
     return((truthLabel == TruthLabel.True) ? "True" : "False");
 }
Esempio n. 10
0
 public static int GetBinaryValue(this TruthLabel label)
 {
     return((label == TruthLabel.True) ? 1 : 0);
 }
Esempio n. 11
0
        public static TruthLabel GetOpposite(this TruthLabel label)
        {
            var oppositeValue = TruthLabel.True == label ? TruthLabel.False : TruthLabel.True;

            return(oppositeValue);
        }
Esempio n. 12
0
 internal BranchItem(Formula formula, TruthLabel truthLabel)
 {
     Formula    = formula;
     TruthLabel = truthLabel;
 }
Esempio n. 13
0
 internal BranchItem(TableauInputNode tableauInputNode)
 {
     Formula    = tableauInputNode.Formula;
     TruthLabel = tableauInputNode.TruthLabel;
 }
Esempio n. 14
0
 internal DisjunctionTableau(DisjunctionFormula formula, TruthLabel truthLabel)
 {
     Formula    = Disjunction = formula;
     TruthLabel = truthLabel;
 }
Esempio n. 15
0
 internal ImplicationTableau(ImplicationFormula formula, TruthLabel truthLabel)
 {
     Formula    = Implication = formula;
     TruthLabel = truthLabel;
 }