You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.2 KiB
29 lines
1.2 KiB
#include "src/logic/BinaryBooleanStateFormula.h"
|
|
|
|
namespace storm {
|
|
namespace logic {
|
|
BinaryBooleanStateFormula::BinaryBooleanStateFormula(OperatorType operatorType, std::shared_ptr<Formula> const& leftSubformula, std::shared_ptr<Formula> const& rightSubformula) : BinaryStateFormula(leftSubformula, rightSubformula), operatorType(operatorType) {
|
|
// Intentionally left empty.
|
|
}
|
|
|
|
bool BinaryBooleanStateFormula::isBinaryBooleanStateFormula() const {
|
|
return true;
|
|
}
|
|
|
|
bool BinaryBooleanStateFormula::isPropositionalFormula() const {
|
|
return this->getLeftSubformula().isPropositionalFormula() && this->getRightSubformula().isPropositionalFormula();
|
|
}
|
|
|
|
std::ostream& BinaryBooleanStateFormula::writeToStream(std::ostream& out) const {
|
|
out << "(";
|
|
this->getLeftSubformula().writeToStream(out);
|
|
switch (operatorType) {
|
|
case OperatorType::And: out << " & "; break;
|
|
case OperatorType::Or: out << " | "; break;
|
|
}
|
|
this->getRightSubformula().writeToStream(out);
|
|
out << ")";
|
|
return out;
|
|
}
|
|
}
|
|
}
|