当前位置: 首页>>代码示例>>C++>>正文


C++ Formula::isGamma方法代码示例

本文整理汇总了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);
//.........这里部分代码省略.........
开发者ID:syeedibnfaiz,项目名称:Fotableau,代码行数:101,代码来源:fotableau.cpp


注:本文中的Formula::isGamma方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。