lean2/src/library/elaborator/elaborator.cpp

60 lines
1.7 KiB
C++
Raw Normal View History

/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include "library/elaborator/elaborator.h"
namespace lean {
class elaborator::imp {
environment const & m_env;
std::shared_ptr<synthesizer> m_synthesizer;
std::shared_ptr<elaborator_plugin> m_plugin;
bool m_interrupted;
public:
imp(environment const & env, metavar_env const &, unsigned, unification_constraint const *,
std::shared_ptr<synthesizer> const & s, std::shared_ptr<elaborator_plugin> const & p):
m_env(env),
m_synthesizer(s),
m_plugin(p) {
m_interrupted = false;
}
substitution next() {
// TODO(Leo)
return substitution();
}
void interrupt() {
m_interrupted = true;
}
};
elaborator::elaborator(environment const & env,
metavar_env const & menv,
unsigned num_cnstrs,
unification_constraint const * cnstrs,
std::shared_ptr<synthesizer> const & s,
std::shared_ptr<elaborator_plugin> const & p):
m_ptr(new imp(env, menv, num_cnstrs, cnstrs, s, p)) {
}
elaborator::elaborator(environment const & env,
metavar_env const & menv,
context const & ctx, expr const & lhs, expr const & rhs):
elaborator(env, menv, { mk_eq_constraint(ctx, lhs, rhs, trace()) }) {
}
elaborator::~elaborator() {
}
substitution elaborator::next() {
return m_ptr->next();
}
void elaborator::interrupt() {
m_ptr->interrupt();
}
}