refactor(kernel): move delayed_justification to justification.h
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
84c1cf9600
commit
d58b8a8102
2 changed files with 9 additions and 9 deletions
|
@ -8,15 +8,6 @@ Author: Leonardo de Moura
|
||||||
#include "kernel/environment.h"
|
#include "kernel/environment.h"
|
||||||
|
|
||||||
namespace lean {
|
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. */
|
/** \brief Auxiliary exception used to sign that constraints cannot be created when \c m_cnstrs_enabled flag is false. */
|
||||||
struct add_cnstr_exception {};
|
struct add_cnstr_exception {};
|
||||||
|
|
||||||
|
|
|
@ -140,4 +140,13 @@ bool depends_on(justification const & j, unsigned i);
|
||||||
|
|
||||||
/** \brief Printer for debugging purposes */
|
/** \brief Printer for debugging purposes */
|
||||||
std::ostream & operator<<(std::ostream & out, justification const & j);
|
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; }
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue