3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-17 08:42:15 +00:00

merge with opt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-04-30 08:27:54 -07:00
commit 859c68c2ac
58 changed files with 1329 additions and 526 deletions

View file

@ -19,10 +19,11 @@ Revision History:
#ifndef SAT_CLAUSE_H_
#define SAT_CLAUSE_H_
#include "sat/sat_types.h"
#include "util/small_object_allocator.h"
#include "util/id_gen.h"
#include "util/map.h"
#include "sat/sat_types.h"
#include "sat/sat_allocator.h"
#ifdef _MSC_VER
#pragma warning(disable : 4200)
@ -97,6 +98,8 @@ namespace sat {
unsigned glue() const { return m_glue; }
void set_psm(unsigned psm) { m_psm = psm > 255 ? 255 : psm; }
unsigned psm() const { return m_psm; }
clause_offset get_new_offset() const;
void set_new_offset(clause_offset off);
bool on_reinit_stack() const { return m_reinit_stack; }
void set_reinit_stack(bool f) { m_reinit_stack = f; }
@ -133,13 +136,16 @@ namespace sat {
\brief Simple clause allocator that allows uint (32bit integers) to be used to reference clauses (even in 64bit machines).
*/
class clause_allocator {
small_object_allocator m_allocator;
id_gen m_id_gen;
small_object_allocator m_allocator;
id_gen m_id_gen;
public:
clause_allocator();
void finalize();
size_t get_allocation_size() const { return m_allocator.get_allocation_size(); }
clause * get_clause(clause_offset cls_off) const;
clause_offset get_offset(clause const * ptr) const;
clause * mk_clause(unsigned num_lits, literal const * lits, bool learned);
clause * copy_clause(clause const& other);
void del_clause(clause * cls);
};