#pragma once
#include <Exp/ILogicalExp.h>

namespace planning
{
  class InvalidLogicalExp : public ILogicalExp
  {
  public:
    static const InvalidLogicalExp* getInstance() { return &s_instance; }

    virtual bool evaluate(const IClosedWorld* world, const Bindings* bindings) const
    {
      unused(world);
      unused(bindings);

      throw std::runtime_error("InvalidLogicalExp::evaluate() was called");
    }

    virtual void enumerateSatisfyingWorlds(PartialWorldSet& worlds) const
    {
      unused(worlds);

      throw std::runtime_error("InvalidLogicalExp::enumerateSatisfyingWorlds() was called");
    }

  protected:
    virtual void _output(std::ostream& out) const
    {
      out << "InvalidLogicalExp";
    }

    virtual size_t _calculateHashCode() const
    {
      return 7690377;
    }

    virtual const IExp* _internalApply(const Bindings* bindings) const
    {
      unused(bindings);

      throw std::runtime_error("InvalidLogicalExp::_internalApply() was called");
    }

    virtual int _internalCompareTo(const IExp& other) const
    {
      unused(other);

      throw std::runtime_error("InvalidLogicalExp::_internalCompareTo() was called");
    }

  private:
    static InvalidLogicalExp s_instance;
    InvalidLogicalExp();
  };
}
