2013-07-25 02:36:54 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
2013-08-20 03:00:35 +00:00
|
|
|
#include <memory>
|
2013-07-25 02:36:54 +00:00
|
|
|
#include "expr.h"
|
2013-07-30 07:25:19 +00:00
|
|
|
#include "environment.h"
|
|
|
|
#include "context.h"
|
2013-07-25 02:36:54 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2013-07-30 07:25:19 +00:00
|
|
|
class environment;
|
2013-08-20 03:00:35 +00:00
|
|
|
/** \brief Functional object for normalizing expressions */
|
|
|
|
class normalizer {
|
2013-08-20 23:34:10 +00:00
|
|
|
class imp;
|
2013-08-20 03:00:35 +00:00
|
|
|
std::unique_ptr<imp> m_ptr;
|
|
|
|
public:
|
|
|
|
normalizer(environment const & env);
|
|
|
|
~normalizer();
|
|
|
|
|
|
|
|
expr operator()(expr const & e, context const & ctx = context());
|
|
|
|
bool is_convertible(expr const & t1, expr const & t2, context const & ctx = context());
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
void set_interrupt(bool flag);
|
|
|
|
void interrupt() { set_interrupt(true); }
|
|
|
|
void reset_interrupt() { set_interrupt(false); }
|
|
|
|
};
|
2013-08-03 21:16:32 +00:00
|
|
|
/** \brief Normalize \c e using the environment \c env and context \c ctx */
|
2013-07-30 07:25:19 +00:00
|
|
|
expr normalize(expr const & e, environment const & env, context const & ctx = context());
|
2013-08-20 03:00:35 +00:00
|
|
|
bool is_convertible(expr const & t1, expr const & t2, environment const & env, context const & ctx = context());
|
2013-07-25 02:36:54 +00:00
|
|
|
}
|