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

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