3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-03 18:00:23 +00:00

Z3 sources

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-02 11:35:25 -07:00
parent 3f9edad676
commit e9eab22e5c
1186 changed files with 381859 additions and 0 deletions

53
lib/cached_var_subst.h Normal file
View file

@ -0,0 +1,53 @@
/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
cached_var_subst.h
Abstract:
<abstract>
Author:
Leonardo de Moura (leonardo) 2009-01-23.
Revision History:
--*/
#ifndef _CACHED_VAR_SUBST_H_
#define _CACHED_VAR_SUBST_H_
#include"var_subst.h"
#include"map.h"
#include"smt_enode.h"
class cached_var_subst {
struct key {
quantifier * m_qa;
unsigned m_num_bindings;
expr * m_bindings[0];
};
struct key_hash_proc {
unsigned operator()(key * k) const {
return string_hash(reinterpret_cast<char const *>(k->m_bindings), sizeof(expr *) * k->m_num_bindings, k->m_qa->get_id());
}
};
struct key_eq_proc {
bool operator()(key * k1, key * k2) const;
};
typedef map<key *, expr *, key_hash_proc, key_eq_proc> instances;
var_subst m_proc;
expr_ref_vector m_refs;
instances m_instances;
region m_region;
ptr_vector<key> m_new_keys; // mapping from num_bindings -> next key
public:
cached_var_subst(ast_manager & m);
void operator()(quantifier * qa, unsigned num_bindings, smt::enode * const * bindings, expr_ref & result);
void reset();
};
#endif /* _CACHED_VAR_SUBST_H_ */