2014-05-01 01:42:01 +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 {
|
2014-06-22 20:52:47 +00:00
|
|
|
class type_checker;
|
|
|
|
|
2014-05-01 01:42:01 +00:00
|
|
|
class converter {
|
2014-06-22 20:52:47 +00:00
|
|
|
protected:
|
|
|
|
name mk_fresh_name(type_checker & tc);
|
|
|
|
expr infer_type(type_checker & tc, expr const & e);
|
|
|
|
void add_cnstr(type_checker & tc, constraint const & c);
|
|
|
|
extension_context & get_extension(type_checker & tc);
|
2014-05-01 01:42:01 +00:00
|
|
|
public:
|
|
|
|
virtual ~converter() {}
|
2014-06-22 20:52:47 +00:00
|
|
|
virtual expr whnf(expr const & e, type_checker & c) = 0;
|
|
|
|
virtual bool is_def_eq(expr const & t, expr const & s, type_checker & c, delayed_justification & j) = 0;
|
|
|
|
bool is_def_eq(expr const & t, expr const & s, type_checker & c);
|
2014-05-01 01:42:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::unique_ptr<converter> mk_dummy_converter();
|
|
|
|
std::unique_ptr<converter> mk_default_converter(environment const & env,
|
|
|
|
optional<module_idx> mod_idx = optional<module_idx>(),
|
2014-07-05 22:52:40 +00:00
|
|
|
bool memoize = true, name_set const & extra_opaque = name_set());
|
2014-07-05 16:43:16 +00:00
|
|
|
std::unique_ptr<converter> mk_default_converter(environment const & env, bool unfold_opaque_main,
|
|
|
|
bool memoize = true, name_set const & extra_opaque = name_set());
|
2014-07-05 19:05:23 +00:00
|
|
|
|
|
|
|
bool is_opaque(declaration const & d, name_set const & extra_opaque, optional<module_idx> const & mod_idx);
|
2014-07-05 22:52:40 +00:00
|
|
|
optional<declaration> is_delta(environment const & env, expr const & e, name_set const & extra_opaque, optional<module_idx> const & mod_idx);
|
|
|
|
optional<declaration> is_delta(environment const & env, expr const & e, name_set const & extra_opaque = name_set());
|
2014-05-01 01:42:01 +00:00
|
|
|
}
|