3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

porting to windows

This commit is contained in:
U-REDMOND\kenmcmil 2013-03-27 12:17:52 -07:00
parent 78848f3ddd
commit 28266786f3
7 changed files with 56 additions and 46 deletions

View file

@ -243,6 +243,7 @@ bool iz3base::is_sat(ast f){
Z3_pop(ctx,1);
return res != Z3_L_FALSE;
#endif
return false;
}

View file

@ -145,7 +145,7 @@ class iz3base : public iz3mgr, public scopes {
ast simplify_and(std::vector<ast> &conjuncts);
ast simplify_with_lit_rec(ast n, ast lit, stl_ext::hash_map<ast,ast> &memo, int depth);
ast simplify_with_lit(ast n, ast lit);
void find_children(const stl_ext::hash_set<ast> &cnsts_set,
void find_children(const hash_set<ast> &cnsts_set,
const ast &tree,
std::vector<ast> &cnsts,
std::vector<int> &parents,

View file

@ -114,7 +114,7 @@ class ast_r : public ast_i {
};
// to make ast_r hashable
namespace stl_ext {
namespace hash_space {
template <>
class hash<ast_r> {
public:
@ -124,12 +124,21 @@ namespace stl_ext {
};
}
// to make ast_r hashable in windows
#ifdef WIN32
template <> inline
size_t stdext::hash_value<ast_r >(const ast_r& s)
{
return s.raw()->get_id();
}
#endif
// to make ast_r usable in ordered collections
namespace std {
template <>
class less<ast_r> {
public:
size_t operator()(const ast_r &s, const ast_r &t) const {
bool operator()(const ast_r &s, const ast_r &t) const {
return s.raw() < t.raw(); // s.raw()->get_id() < t.raw()->get_id();
}
};

View file

@ -81,8 +81,8 @@ namespace std {
class less<Z3_resolvent > {
public:
bool operator()(const Z3_resolvent &x, const Z3_resolvent &y) const {
size_t ixproof = (size_t) x.proof;
size_t iyproof = (size_t) y.proof;
size_t ixproof = (size_t) x.proof.raw();
size_t iyproof = (size_t) y.proof.raw();
if(ixproof < iyproof) return true;
if(ixproof > iyproof) return false;
return x.pivot < y.pivot;