Exemplo n.º 1
0
Formula* Formula::getDelta(Term *newFunc)
{
	Formula *f;
	Term *v;
	if (this->type == EXIST) {
		f = this->nextFormula;
		v = this->qVar;
	}
	else {
		f = new Formula(this->nextFormula->getNext());
		v = this->nextFormula->getQVar();
	}

	if (newFunc == NULL) {

		TermList *list = new TermList();
		f->getFreeVarList(list);

		newFunc = new Term(NULL, list);

	}

	f->replace(v, newFunc);
	return f;


}
Exemplo n.º 2
0
Formula* Formula::getGamma(Term *newV)
{
	Formula *f;
	Term *v;
	if (this->type == UNIV) {
		f = this->nextFormula;
		v = this->qVar;
	}
	else {
		f = new Formula(this->nextFormula->getNext());
		v = this->nextFormula->getQVar();
	}

	f->replace(v, newV);
	return f;
}