Esempio n. 1
0
int main()
{
  cout << "* Euler Diagram Theorem Prover *\n" << endl;
  
  Ted ted;
  DiagramHolder holder;

  string command = "";
  
  while( command != "exit") 
    {
      cout << "Enter Command (help for help): " ;
      cin >> command;

      //Help-------------------------------
      if (command == "help")
	{
	  cout << "Commands are: \n" << endl;
	  
	  cout << " -l   = Load Diagram \n" << endl;
	  cout << " -p   = Prove Diagrams \n" << endl;
	  cout << " -c   = Clear Prover \n" << endl;
	  cout << " -dor = Apply Demorgan Or \n" <<endl;
	  cout << " -dand = Apply Demorgan And \n" <<endl;
	  cout << "\n" ;

	  cout << " exit = Quits the program \n" << endl;
	}
      
      //Load Diagram
	  
      else if(command == "-l")
	{
	  string dName = "";
	  cout << "Diagram File  Name: " ;

	  cin >> dName;

	  if (dName != "")
	    {
	      Diagram d = ted.getDiagram( dName);//load diagram
	      if(d.getLabel() == "EMPT")
		cout << "Error! Loading Diagram Failed" << endl;
	      else
		{
		  Rules rules(d);
		  d = rules.returnCurrentDiagram();
	      
		  holder.addDiagram(d);//save it
		}
	    }
	  else
	    cout << "File name error!" << endl;

	}

      //Prover--------------------------------
      else if( command == "-p")
void CompoundNodeTest::setLeftTest()
{
  Diagram d1("d1");
  Diagram d2("d2");
  Diagram d("empty");

  CompoundNode *p = new CompoundNode("root");
  CompoundNode *a = new CompoundNode(d1,"leaf");
  CompoundNode *b = new CompoundNode(d2,"leaf");
  
  Diagram dd = a->getPayload();
  cout << "Diagram is : " << dd.getLabel() << endl;
}