2014-07-06 01:58:20 +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 "kernel/environment.h"
|
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/*
|
|
|
|
Opaque hints are used to 'help/guide' the elaborator and unifier.
|
|
|
|
We can use them to mark additional definitions as opaque.
|
|
|
|
Note that we are not changing the status of the definitions, we are
|
|
|
|
only changing how the elaborator/unifier treats them.
|
|
|
|
|
|
|
|
These hints are not used when we type check a definition before
|
|
|
|
adding it to the kernel.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \brief Mark the definition named \c n as opaque for the elaborator/unifier. */
|
|
|
|
environment hide_definition(environment const & env, name const & n);
|
|
|
|
/** \brief Undo the modification made with \c hide_definition. */
|
|
|
|
environment expose_definition(environment const & env, name const & n);
|
2014-07-27 19:01:06 +00:00
|
|
|
/** \brief By default, the elaborator/unifier will treat the opaque definitions of the current/main
|
|
|
|
module as transparent (when allowed). We can change this behavior using this function.
|
2014-07-06 01:58:20 +00:00
|
|
|
*/
|
2014-07-27 19:01:06 +00:00
|
|
|
environment set_hide_main_opaque(environment const & env, bool f);
|
|
|
|
bool get_hide_main_opaque(environment const & env);
|
2014-07-06 01:58:20 +00:00
|
|
|
/** \brief Create a type checker that takes the hints into account. */
|
2014-07-27 19:01:06 +00:00
|
|
|
std::unique_ptr<type_checker> mk_type_checker_with_hints(environment const & env, name_generator const & ngen, bool relax_main_opaque);
|
2014-07-06 01:58:20 +00:00
|
|
|
}
|