diff options
Diffstat (limited to 'impl/Expression.hpp')
-rw-r--r-- | impl/Expression.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/impl/Expression.hpp b/impl/Expression.hpp index 00bc9cd..0d48d70 100644 --- a/impl/Expression.hpp +++ b/impl/Expression.hpp @@ -27,6 +27,10 @@ struct Expression { return NULL; } + virtual MaxExpression<Domain>* toMaxExpression() { + return NULL; + } + virtual Domain eval(const VariableAssignment<Domain>&) const = 0; virtual Domain eval(const VariableAssignment<Domain>& rho, const MaxStrategy<Domain>&) const { @@ -145,6 +149,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) { } + MaxExpression* toMaxExpression() { + return this; + } + const MaxExpression* toMaxExpression() const { return this; } |