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
|
2014-09-18 00:05:13 +00:00
|
|
|
#include <functional>
|
2014-05-01 01:42:01 +00:00
|
|
|
#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);
|
2014-08-20 05:31:26 +00:00
|
|
|
pair<expr, constraint_seq> infer_type(type_checker & tc, expr const & e);
|
2014-06-22 20:52:47 +00:00
|
|
|
extension_context & get_extension(type_checker & tc);
|
2014-05-01 01:42:01 +00:00
|
|
|
public:
|
|
|
|
virtual ~converter() {}
|
2014-09-25 18:19:54 +00:00
|
|
|
virtual bool is_opaque(declaration const & d) const = 0;
|
2015-02-08 04:14:19 +00:00
|
|
|
virtual optional<declaration> is_delta(expr const & e) const = 0;
|
2015-02-08 04:36:26 +00:00
|
|
|
|
2015-04-27 18:20:15 +00:00
|
|
|
virtual bool is_stuck(expr const & e, type_checker & c) = 0;
|
2015-02-08 04:36:26 +00:00
|
|
|
virtual pair<expr, constraint_seq> whnf(expr const & e, type_checker & c) = 0;
|
|
|
|
virtual pair<bool, constraint_seq> is_def_eq(expr const & t, expr const & s, type_checker & c, delayed_justification & j) = 0;
|
|
|
|
|
2014-08-20 05:31:26 +00:00
|
|
|
pair<bool, constraint_seq> 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();
|
2014-07-05 19:05:23 +00:00
|
|
|
|
2014-09-23 19:09:13 +00:00
|
|
|
void initialize_converter();
|
|
|
|
void finalize_converter();
|
2014-05-01 01:42:01 +00:00
|
|
|
}
|