Exemplo n.º 1
0
 public bool ApplyAlphaRule()
 {
     foreach (var prop in CurrentNode)
     {
         var set = new HashSet <Proposition>(CurrentNode);
         set.Remove(prop);
         if (prop is Negation n && n.Operand is Negation n1)
         {
             set.Add(n1.Operand);
             var tableau = new SemanticTableau(set, ActiveVariables, PropositionsProcessedByGamma);
             ChildrenNodes.Add(tableau);
             stack.Push(tableau);
             return(true);
         }
Exemplo n.º 2
0
        private void ButtonSTableaux_Click(object sender, EventArgs e)
        {
            try {
                int index    = 1;
                var tableaux = new SemanticTableau(new HashSet <Proposition> {
                    new Negation(proposition)
                });
                tableaux.CreateSemanticTableaux();
                string str = "graph logic { \r\nnode [ shape=box, fontname = \"Sans serif\" ] " + tableaux.CreateGraph(ref index) + "\r\n}";
                File.WriteAllText(@"tableaux.dot", str);

                Process dot = new Process();
                dot.StartInfo.FileName  = @"dot.exe";
                dot.StartInfo.Arguments = "-Tpng -otableaux.png tableaux.dot";
                dot.Start();
                dot.WaitForExit();

                Process.Start(@"tableaux.png");
            }
            catch (Exception ex) {
                MessageBox.Show(ex.ToString());
                ResetForm();
            }
        }