summaryrefslogtreecommitdiff
path: root/impl/Expression.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/Expression.hpp')
-rw-r--r--impl/Expression.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/impl/Expression.hpp b/impl/Expression.hpp
index eedaa52..00bc9cd 100644
--- a/impl/Expression.hpp
+++ b/impl/Expression.hpp
@@ -23,6 +23,10 @@ template<typename Domain>
struct Expression {
virtual ~Expression() { }
+ virtual const MaxExpression<Domain>* toMaxExpression() const {
+ return NULL;
+ }
+
virtual Domain eval(const VariableAssignment<Domain>&) const = 0;
virtual Domain eval(const VariableAssignment<Domain>& rho,
const MaxStrategy<Domain>&) const {
@@ -141,6 +145,10 @@ struct MaxExpression : public OperatorExpression<Domain> {
MaxExpression(const unsigned int& id, const Maximum<Domain>& op, const std::vector<Expression<Domain>*>& arguments)
: OperatorExpression<Domain>(op, arguments), _id(id) { }
+ const MaxExpression* toMaxExpression() const {
+ return this;
+ }
+
virtual Domain eval(const VariableAssignment<Domain>& rho, const MaxStrategy<Domain>& strat) const {
return this->_arguments[strat.get(*this)]->eval(rho, strat);
}