2013-07-23 02:31:27 +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 <unordered_map>
|
2013-12-18 19:42:43 +00:00
|
|
|
#include <functional>
|
2013-09-13 10:35:29 +00:00
|
|
|
#include "kernel/expr.h"
|
2013-07-23 02:31:27 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2013-12-18 19:42:43 +00:00
|
|
|
// Maps based on pointer equality. That is, two keys are equal iff they are pointer equal
|
2013-07-23 02:31:27 +00:00
|
|
|
template<typename T>
|
2013-11-14 10:31:54 +00:00
|
|
|
using expr_map = typename std::unordered_map<expr, T, expr_hash_alloc, expr_eqp>;
|
2013-07-23 02:31:27 +00:00
|
|
|
|
2013-07-24 07:04:05 +00:00
|
|
|
template<typename T>
|
|
|
|
using expr_offset_map = typename std::unordered_map<expr_offset, T, expr_offset_hash, expr_offset_eqp>;
|
|
|
|
|
2013-07-23 02:31:27 +00:00
|
|
|
template<typename T>
|
|
|
|
using expr_cell_map = typename std::unordered_map<expr_cell *, T, expr_cell_hash, expr_cell_eqp>;
|
|
|
|
|
2013-07-24 07:04:05 +00:00
|
|
|
template<typename T>
|
|
|
|
using expr_cell_offset_map = typename std::unordered_map<expr_cell_offset, T, expr_cell_offset_hash, expr_cell_offset_eqp>;
|
|
|
|
|
2013-12-18 19:42:43 +00:00
|
|
|
// Maps based on structural equality. That is, two keys are equal iff they are structurally equal
|
|
|
|
template<typename T>
|
|
|
|
using expr_struct_map = typename std::unordered_map<expr, T, expr_hash, std::equal_to<expr>>;
|
2014-05-15 00:14:57 +00:00
|
|
|
// The following map also takes into account binder information
|
|
|
|
template<typename T>
|
|
|
|
using expr_bi_struct_map = typename std::unordered_map<expr, T, expr_hash, is_bi_equal_proc>;
|
2013-07-23 02:31:27 +00:00
|
|
|
};
|