本文整理汇总了C++中Formula::isGamma方法的典型用法代码示例。如果您正苦于以下问题:C++ Formula::isGamma方法的具体用法?C++ Formula::isGamma怎么用?C++ Formula::isGamma使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formula
的用法示例。
在下文中一共展示了Formula::isGamma方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: expand
bool Prover::expand(queue<Formula*> &q, int depth, int tabCount)
{
int sz = q.size();
//printf("\n\n============Expanding==============\n\n");
//this->print(q);
this->print(q, tabCount);
for (int i = 0; i < sz; ++i) {
Formula *f = q.front();
q.pop();
if (f->isAtomic()) {
q.push(f);
/*if (this->isClosed(q)) {
//printf("caught closeness early on!!");
this->print(q, tabCount);
return true;
}*/
}
else if (f->isAlpha()) {
//printf("Applying alpha rule for..");
//f->print();
//puts("");
this->printTab(tabCount + 2);
printf("|alpha (%d)\n", i + 1);
Formula *f1 = f->getAlpha1();
Formula *f2 = f->getAlpha2();
q.push(f1);
q.push(f2);
return expand(q, depth, tabCount);
}
else if (f->isBeta()) {
//printf("Applying beta rule for..");
//f->print();
//puts("");
this->printTab(tabCount+2);
printf("|beta (%d)\n", i + 1);
Formula *f1 = f->getBeta1();
Formula *f2 = f->getBeta2();
queue<Formula*> q2(q);
q.push(f1);
q2.push(f2);
return expand(q, depth, tabCount-4) && expand(q2, depth, tabCount+4);
}
else if (f->isGamma()) {
//printf("Applying gamma rule for..");
//f->print();
//puts("");
this->printTab(tabCount+2);
printf("|gamma (%d)\n", i + 1);
depth--;
Formula *cpy = NULL;
if (depth > 0) {
cpy = new Formula(*f);
//printf("\n\ncopy formula1======\n");
//cpy->print();
}
Term *newVar = new Term(Term::VAR, NULL);
Formula *newFormula;
newFormula = f->getGamma(newVar);
//printf("got this..");
//newFormula->print();
//puts("");
q.push(newFormula);
if (cpy != NULL) {
q.push(cpy);
//printf("\n\ncopy formula2======\n");
//cpy->print();
}
return expand(q, depth, tabCount);
}
else if (f->isDelta()) {
//printf("Applying delta rule for..");
//f->print();
//puts("");
this->printTab(tabCount + 2);
printf("delta (%d)\n", i + 1);
Formula *newFormula;
newFormula = f->getDelta();
//printf("got this..");
//newFormula->print();
//puts("");
q.push(newFormula);
return expand(q, depth, tabCount);
//.........这里部分代码省略.........