2014-09-10 22:20:45 +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/expr.h"
|
|
|
|
#include "library/io_state.h"
|
2014-12-10 20:43:32 +00:00
|
|
|
#include "library/local_context.h"
|
2014-09-10 22:20:45 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/** \brief Create a metavariable, and attach choice constraint for generating
|
|
|
|
solutions using class-instances and tactic-hints.
|
|
|
|
|
|
|
|
\param ctx Local context where placeholder is located
|
|
|
|
\param prefix Prefix for metavariables that will be created by this procedure
|
2014-10-30 19:45:41 +00:00
|
|
|
\param suffix If provided, then it is added to the main metavariable created by this procedure.
|
2014-09-10 22:20:45 +00:00
|
|
|
\param relax True if opaque constants in the current module should be treated
|
|
|
|
as transparent
|
|
|
|
\param use_local_instances If instances in the local context should be used
|
|
|
|
in the class-instance resolution
|
|
|
|
\param is_strict True if constraint should fail if not solution is found,
|
|
|
|
False if empty solution should be returned if there is no solution
|
|
|
|
\param type Expected type for the placeholder (if known)
|
|
|
|
\param tag To be associated with new metavariables and expressions (for error localization).
|
|
|
|
*/
|
|
|
|
pair<expr, constraint> mk_placeholder_elaborator(
|
2014-09-25 17:11:41 +00:00
|
|
|
environment const & env, io_state const & ios, local_context const & ctx,
|
2014-10-30 19:45:41 +00:00
|
|
|
name const & prefix, optional<name> const & suffix, bool relax_opaque, bool use_local_instances,
|
2014-11-09 19:24:19 +00:00
|
|
|
bool is_strict, optional<expr> const & type, tag g, unifier_config const & cfg,
|
|
|
|
pos_info_provider const * pip);
|
2014-10-30 21:20:34 +00:00
|
|
|
|
|
|
|
void initialize_placeholder_elaborator();
|
|
|
|
void finalize_placeholder_elaborator();
|
2014-09-10 22:20:45 +00:00
|
|
|
}
|