2014-06-26 01:12:23 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <utility>
|
|
|
|
#include "util/list.h"
|
|
|
|
#include "kernel/environment.h"
|
|
|
|
#include "kernel/metavar.h"
|
|
|
|
#include "library/io_state.h"
|
2014-07-06 23:46:34 +00:00
|
|
|
#include "frontends/lean/local_decls.h"
|
2014-08-07 02:35:26 +00:00
|
|
|
#include "frontends/lean/info_manager.h"
|
2014-06-26 01:12:23 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2014-08-13 01:43:56 +00:00
|
|
|
/** \brief Environment for elaboration, it contains all the information that is "scope-indenpendent" */
|
2014-08-13 19:45:57 +00:00
|
|
|
class elaborator_context {
|
2014-08-13 01:43:56 +00:00
|
|
|
environment m_env;
|
|
|
|
io_state m_ios;
|
|
|
|
local_decls<level> m_lls; // local universe levels
|
|
|
|
pos_info_provider const * m_pos_provider;
|
|
|
|
info_manager * m_info_manager;
|
|
|
|
|
|
|
|
// configuration
|
|
|
|
bool m_check_unassigned;
|
|
|
|
bool m_use_local_instances;
|
|
|
|
friend class elaborator;
|
|
|
|
public:
|
2014-08-13 19:45:57 +00:00
|
|
|
elaborator_context(environment const & env, io_state const & ios, local_decls<level> const & lls,
|
|
|
|
pos_info_provider const * pp = nullptr, info_manager * info = nullptr, bool check_unassigned = true);
|
2014-08-13 01:43:56 +00:00
|
|
|
};
|
|
|
|
|
2014-08-13 19:45:57 +00:00
|
|
|
std::tuple<expr, level_param_names> elaborate(elaborator_context & env, list<expr> const & ctx, expr const & e,
|
2014-08-13 01:43:56 +00:00
|
|
|
bool relax_main_opaque, bool ensure_type = false);
|
|
|
|
|
2014-08-13 19:45:57 +00:00
|
|
|
std::tuple<expr, expr, level_param_names> elaborate(elaborator_context & env, name const & n, expr const & t, expr const & v,
|
2014-08-13 01:43:56 +00:00
|
|
|
bool is_opaque);
|
2014-06-26 01:12:23 +00:00
|
|
|
}
|