refactor(kernel): move delayed_justification to justification.h

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-15 10:46:04 -07:00
parent 84c1cf9600
commit d58b8a8102
2 changed files with 9 additions and 9 deletions

View file

@ -8,15 +8,6 @@ Author: Leonardo de Moura
#include "kernel/environment.h"
namespace lean {
/** \brief Object to simulate delayed justification creation. */
class delayed_justification {
optional<justification> m_jst;
std::function<justification()> m_mk;
public:
template<typename Mk> delayed_justification(Mk && mk):m_mk(mk) {}
justification get() { if (!m_jst) { m_jst = m_mk(); } return *m_jst; }
};
/** \brief Auxiliary exception used to sign that constraints cannot be created when \c m_cnstrs_enabled flag is false. */
struct add_cnstr_exception {};

View file

@ -140,4 +140,13 @@ bool depends_on(justification const & j, unsigned i);
/** \brief Printer for debugging purposes */
std::ostream & operator<<(std::ostream & out, justification const & j);
/** \brief Object to simulate delayed justification creation. */
class delayed_justification {
optional<justification> m_jst;
std::function<justification()> m_mk;
public:
template<typename Mk> delayed_justification(Mk && mk):m_mk(mk) {}
justification get() { if (!m_jst) { m_jst = m_mk(); } return *m_jst; }
};
}