Пример #1
0
void DPLLFormulaParseLOP(Scanner_p in, Sig_p sig, DPLLFormula_p form)
{
   Clause_p clause;
   DPLLClause_p pclause;
   TB_p terms = TBAlloc(sig);
   
   while(ClauseStartsMaybe(in))
   {
      clause = ClauseParse(in, terms);
      pclause = DPLLClauseFromClause(form->sig, clause);
      ClauseFree(clause);
      fprintf(GlobalOut, "New clause: ");
      DPLLClausePrintLOP(GlobalOut, form->sig, pclause);
      if(DPLLClauseNormalize(pclause))
      {
	 fprintf(GlobalOut, "...discarded (tautology)\n");
	 DPLLClauseFree(pclause);
	 continue;
      }
      DPLLFormulaInsertClause(form, pclause);
      fprintf(GlobalOut, "...accepted\n");
   }
   terms->sig = NULL;
   TBFree(terms);
}
Пример #2
0
void process_clauses(char* infile, TB_p terms, OCB_p ocb, ClauseSet_p *demodulators)
{
   Clause_p clause;
   Scanner_p in;
   
   if(infile)
   {
      in = CreateScanner(StreamTypeFile, infile, true, NULL);
      ScannerSetFormat(in, parse_format);
      while(!TestInpTok(in, NoToken))
      {
         clause  = ClauseParse(in, terms);
         ClausePrint(GlobalOut, clause, true);
         ClauseComputeLINormalform(ocb, terms, clause,
                                      demodulators,
                                      1, false);
         fprintf(GlobalOut, " ==> ");
         ClausePrint(GlobalOut, clause, true);
         fprintf(GlobalOut, "\n");
         ClauseFree(clause);
      }
      DestroyScanner(in);   
   }
}