Exemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (engine == null)
     {
         CreateEngine();
     }
     engine.FindAllFacts();
     textBox1.Text = engine.LogText;
     button1_Click(sender, e);
 }
Exemplo n.º 2
0
 private void button4_Click(object sender, EventArgs e)
 {
     using (StreamReader sr = new StreamReader("rules.txt"))
     {
         RI            = new RuleInterpreter(sr.ReadToEnd());
         textBox1.Text = RI.ToString();
         Context         context = new Context(new TestDeclares(), new TestOperations(), new TestSetters(), new Interpreter.BaseContext.BaseConstants());
         InferenceEngine engine  = new InferenceEngine(RI, context, factPool);
         engine.FindAllFacts();
         string res = "";
         for (int i = 0; i <= 200; ++i)
         {
             if (factPool.isDiagnal[i])
             {
                 res += i.ToString() + " ";
             }
         }
         textBox1.Text += engine.LogText;
         MessageBox.Show(res);
     }
 }