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:
parent
3f9edad676
commit
e9eab22e5c
1186 changed files with 381859 additions and 0 deletions
56
lib/sat_clause_set.h
Normal file
56
lib/sat_clause_set.h
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*++
|
||||
Copyright (c) 2011 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
sat_clause_set.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Set of clauses
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2011-05-25.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _SAT_CLAUSE_SET_H_
|
||||
#define _SAT_CLAUSE_SET_H_
|
||||
|
||||
#include"sat_clause.h"
|
||||
|
||||
namespace sat {
|
||||
|
||||
class clause_set {
|
||||
unsigned_vector m_id2pos;
|
||||
clause_vector m_set;
|
||||
public:
|
||||
typedef clause_vector::const_iterator iterator;
|
||||
|
||||
bool contains(clause const & cls) const {
|
||||
if (cls.id() >= m_id2pos.size())
|
||||
return false;
|
||||
return m_id2pos[cls.id()] != UINT_MAX;
|
||||
}
|
||||
bool empty() const { return m_set.empty(); }
|
||||
unsigned size() const { return m_set.size(); }
|
||||
void insert(clause & c);
|
||||
void erase(clause & c);
|
||||
|
||||
// erase some clause from the set
|
||||
clause & erase();
|
||||
|
||||
void reset() { m_id2pos.reset(); m_set.reset(); }
|
||||
void finalize() { m_id2pos.finalize(); m_set.finalize(); }
|
||||
|
||||
iterator begin() const { return m_set.begin(); }
|
||||
iterator end() const { return m_set.end(); }
|
||||
|
||||
bool check_invariant() const;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue