2014-06-24 19:11:27 +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 "util/lua.h"
|
|
|
|
#include "kernel/expr.h"
|
|
|
|
|
|
|
|
namespace lean {
|
2014-07-19 08:55:34 +00:00
|
|
|
/** \brief Create an explicit expression '@ f'.
|
2014-06-24 19:11:27 +00:00
|
|
|
This only affects the elaborator behavior.
|
|
|
|
*/
|
|
|
|
expr mk_explicit(expr const & e);
|
|
|
|
/** \brief Return true iff \c e is an explicit expression. */
|
|
|
|
bool is_explicit(expr const & e);
|
2014-09-04 18:18:16 +00:00
|
|
|
/** \brief See #is_nested_annotation */
|
|
|
|
bool is_nested_explicit(expr const & e);
|
2014-10-02 00:13:41 +00:00
|
|
|
/** \brief Return the argument of an explicit expression.
|
|
|
|
\pre is_explicit(e)
|
|
|
|
*/
|
|
|
|
expr const & get_explicit_arg(expr const & e);
|
|
|
|
|
2014-07-19 08:55:34 +00:00
|
|
|
/** \brief Create an explicit expression that is accepted as is
|
2014-07-14 05:27:36 +00:00
|
|
|
by the elaborator.
|
|
|
|
*/
|
|
|
|
expr mk_as_is(expr const & e);
|
|
|
|
/** \brief Return true iff \c e was created with mk_as_is. */
|
|
|
|
bool is_as_is(expr const & e);
|
2014-10-02 00:13:41 +00:00
|
|
|
/** \brief Return the argument of an expression created using mk_as_is.
|
|
|
|
\pre is_as_is(e)
|
|
|
|
*/
|
|
|
|
expr const & get_as_is_arg(expr const & e);
|
|
|
|
|
2014-07-19 08:55:34 +00:00
|
|
|
/** \brief Create an implicit expression '@^-1 f'.
|
|
|
|
This only affects the elaborator behavior. This expression "cancels" the effect of '@'
|
|
|
|
*/
|
|
|
|
expr mk_implicit(expr const & e);
|
|
|
|
/** \brief Return true iff \c e is an implicit expression. */
|
|
|
|
bool is_implicit(expr const & e);
|
|
|
|
/** \brief Return the argument of an implicit expression.
|
|
|
|
\pre is_implicit(e)
|
|
|
|
*/
|
|
|
|
expr const & get_implicit_arg(expr const & e);
|
2014-10-02 00:13:41 +00:00
|
|
|
|
|
|
|
/** \brief Create the expression '! e'.
|
|
|
|
This only affects the elaborator behavior.
|
|
|
|
It instructs the elaborator to keep adding '_'
|
|
|
|
for \c e arguments.
|
|
|
|
*/
|
|
|
|
expr mk_consume_args(expr const & e);
|
|
|
|
/** \brief Return true iff \c e is an '!f' expression. */
|
|
|
|
bool is_consume_args(expr const & e);
|
|
|
|
expr const & get_consume_args_arg(expr const & e);
|
|
|
|
|
2014-06-24 19:11:27 +00:00
|
|
|
void open_explicit(lua_State * L);
|
2014-09-22 22:26:41 +00:00
|
|
|
void initialize_explicit();
|
|
|
|
void finalize_explicit();
|
2014-06-24 19:11:27 +00:00
|
|
|
}
|