mirror of
https://github.com/Z3Prover/z3
synced 2025-05-09 00:35:47 +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
69
lib/spc_asserted_literals.h
Normal file
69
lib/spc_asserted_literals.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
spc_asserted_literals.h
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2008-02-14.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _SPC_ASSERTED_LITERALS_H_
|
||||
#define _SPC_ASSERTED_LITERALS_H_
|
||||
|
||||
#include"spc_clause.h"
|
||||
#include"substitution_tree.h"
|
||||
#include"obj_hashtable.h"
|
||||
|
||||
namespace spc {
|
||||
|
||||
/**
|
||||
\brief Index for the asserted literals in the logical context.
|
||||
|
||||
This index is used to implement forward unit subsumption,
|
||||
equality subsumption, positive simplify-reflect, and
|
||||
negative simplify-reflect.
|
||||
*/
|
||||
class asserted_literals {
|
||||
protected:
|
||||
typedef obj_map<expr, clause*> expr2clause;
|
||||
ast_manager & m_manager;
|
||||
substitution_tree * m_st[2];
|
||||
expr2clause * m_expr2clause[2];
|
||||
substitution m_subst;
|
||||
tmp_app m_tmp_eq1;
|
||||
tmp_app m_tmp_eq2;
|
||||
public:
|
||||
asserted_literals(ast_manager & m);
|
||||
~asserted_literals();
|
||||
|
||||
void insert(clause * cls);
|
||||
void erase(clause * cls);
|
||||
void reset();
|
||||
void reserve_vars(unsigned num_vars) { m_subst.reserve_vars(num_vars); }
|
||||
|
||||
clause * gen(literal const & l) {
|
||||
return gen(l.atom(), l.sign());
|
||||
}
|
||||
|
||||
clause * gen(expr * atom, bool neg);
|
||||
clause * gen_eq(expr * lhs, expr * rhs);
|
||||
clause * subsumes(expr * lhs, expr * rhs);
|
||||
|
||||
bool has_pos_literals() const { return !m_st[0]->empty(); }
|
||||
bool has_neg_literals() const { return !m_st[1]->empty(); }
|
||||
bool has_literals() const { return has_pos_literals() || has_neg_literals(); }
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif /* _SPC_ASSERTED_LITERALS_H_ */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue