2014-02-16 17:53:55 +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
|
|
|
|
#include <memory>
|
|
|
|
#include "util/interrupt.h"
|
|
|
|
#include "kernel/expr.h"
|
|
|
|
#include "kernel/expr_sets.h"
|
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/**
|
|
|
|
\brief Functional object for comparing expressions.
|
|
|
|
*/
|
|
|
|
class expr_eq_fn {
|
2014-05-15 00:14:57 +00:00
|
|
|
bool m_compare_binder_info;
|
2014-02-16 17:53:55 +00:00
|
|
|
std::unique_ptr<expr_cell_pair_set> m_eq_visited;
|
|
|
|
bool apply(expr const & a, expr const & b);
|
|
|
|
public:
|
2014-05-15 00:14:57 +00:00
|
|
|
/** \brief If \c is true, then functional object will also compare binder information attached to lambda and Pi expressions */
|
|
|
|
expr_eq_fn(bool c = false):m_compare_binder_info(c) {}
|
2014-02-16 17:53:55 +00:00
|
|
|
bool operator()(expr const & a, expr const & b) { return apply(a, b); }
|
|
|
|
void clear() { m_eq_visited.reset(); }
|
|
|
|
};
|
|
|
|
}
|