bool Formula::isBeta() { if (this->isCompound() && (this->cntv == '|' || this->cntv=='>')) { return true; } else if (this->isNegated()) { Formula *next = this->getNext(); if (next->isCompound() && next->getCntv()=='&') { return true; } else return false; } else return false; }
/* * Special Copy Constructor * Only pointers to free vars are retained * Used for copying gamma formulas */ Formula::Formula(Formula &f) { this->type = f.getType(); this->cntv = f.getCntv(); if (f.isAtomic()) { TermList *list = new TermList(); this->copy(f.getPredicate()->getTermList(), list); this->predicate = new Predicate(f.getPredicate()->getName(), list); } else if (f.isNegated()) { this->nextFormula = new Formula(*f.getNext()); } else if (f.isQuantified()) { this->qVar = new Term(*f.getQVar()); this->nextFormula = new Formula(*f.getNext()); } else if (f.isCompound()) { this->formula1 = new Formula(*f.getLeft()); this->formula2 = new Formula(*f.getRight()); } }