本文整理汇总了C++中Formula::print方法的典型用法代码示例。如果您正苦于以下问题:C++ Formula::print方法的具体用法?C++ Formula::print怎么用?C++ Formula::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formula
的用法示例。
在下文中一共展示了Formula::print方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyConsTest
void copyConsTest()
{
char str[100];
while (gets(str)) {
Parser p(str);
Formula *f = p.parse();
f->print();
puts("");
Predicate *pred = f->getPredicate();
Term *t = pred->getTermList()->getList()->at(0);
puts("here");
Term w = *t;
w.print();
puts("here");
w.setName("chan");
w.print();
puts("");
f->print();
puts("");
}
}
示例2: formulaTest
void formulaTest()
{
TermList *list = new TermList();
list->addTerm(new Term(Term::VAR, "x"));
list->addTerm(new Term(Term::VAR, NULL));
list->addTerm(new Term(Term::CONS, "A"));
Formula *f = new Formula(new Predicate("P", list));
Formula *g = new Formula(f);
Formula *q = new Formula(f, g, '&');
Formula *r = new Formula(new Term(Term::VAR, NULL), q, Formula::UNIV);
r->print();
Term *x = new Term(Term::VAR, "xy");
Term *y = new Term(Term::VAR, "x");
TermList *list2 = new TermList();
list2->addTerm(x);
list2->addTerm(y);
Term *f2 = new Term("f10", list2);
Term *g2 = new Term("f10", list2);
f2->print();
puts("");
g2->print();
puts("");
if (!(*f2 != *g2)) {
printf("yes! equal!");
}
}
示例3: parseTest
void parseTest()
{
char str[100];
while (gets(str)) {
Parser p(str);
Formula *f = p.parse();
f->print();
formulaFeatureTest(f);
}
}
示例4: print
void Prover::print(std::queue<Formula*> &q, int tabCount)
{
puts("\n");
this->printTab(tabCount);
printf("========================\n");
int sz = q.size();
for (int i = 0; i < sz; i++) {
Formula *f = q.front();
q.pop();
this->printTab(tabCount+1);
printf("(%d):\t", i+1);
f->print();
puts("");
q.push(f);
}
this->printTab(tabCount);
printf("========================\n");
}