2014-07-02 02:05:22 +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
|
2014-07-02 03:43:53 +00:00
|
|
|
#include "kernel/pos_info_provider.h"
|
2014-07-02 02:05:22 +00:00
|
|
|
#include "library/tactic/tactic.h"
|
|
|
|
|
|
|
|
namespace lean {
|
2014-07-02 21:09:01 +00:00
|
|
|
class expr_to_tactic_exception : public tactic_exception {
|
|
|
|
public: expr_to_tactic_exception(expr const & e, char const * msg):tactic_exception(e, msg) {}
|
2014-07-02 17:35:43 +00:00
|
|
|
};
|
|
|
|
|
2014-07-02 17:52:45 +00:00
|
|
|
typedef std::function<tactic(type_checker & tc, expr const & e, pos_info_provider const *)> expr_to_tactic_fn;
|
2014-07-02 02:05:22 +00:00
|
|
|
void register_expr_to_tactic(name const & n, expr_to_tactic_fn const & fn);
|
|
|
|
struct register_tac {
|
|
|
|
register_tac(name const & n, expr_to_tactic_fn fn) { register_expr_to_tactic(n, fn); }
|
|
|
|
};
|
2014-07-02 03:43:53 +00:00
|
|
|
struct register_simple_tac {
|
|
|
|
register_simple_tac(name const & n, std::function<tactic()> f);
|
|
|
|
};
|
2014-07-02 02:05:22 +00:00
|
|
|
struct register_bin_tac {
|
|
|
|
register_bin_tac(name const & n, std::function<tactic(tactic const &, tactic const &)> f);
|
|
|
|
};
|
|
|
|
struct register_unary_tac {
|
|
|
|
register_unary_tac(name const & n, std::function<tactic(tactic const &)> f);
|
|
|
|
};
|
|
|
|
|
2014-07-02 03:43:53 +00:00
|
|
|
tactic expr_to_tactic(environment const & env, expr const & e, pos_info_provider const *p);
|
2014-07-02 02:05:22 +00:00
|
|
|
expr mk_by(expr const & e);
|
|
|
|
bool is_by(expr const & e);
|
|
|
|
expr const & get_by_arg(expr const & e);
|
|
|
|
}
|