mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 19:35:50 +00:00
arrays (#4684)
* arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * fill Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * update drat and fix euf bugs Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * const qualifiers Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * reorg ba Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * reorg Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * build warnings Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d56dd1db7b
commit
796e2fd9eb
79 changed files with 2571 additions and 1850 deletions
58
src/sat/smt/ba_constraint.cpp
Normal file
58
src/sat/smt/ba_constraint.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*++
|
||||
Copyright (c) 2017 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
ba_constraint.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Interface for constraints.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2017-01-30
|
||||
|
||||
--*/
|
||||
|
||||
#include "sat/smt/ba_constraint.h"
|
||||
|
||||
namespace ba {
|
||||
|
||||
unsigned constraint::fold_max_var(unsigned w) const {
|
||||
if (lit() != sat::null_literal) w = std::max(w, lit().var());
|
||||
for (unsigned i = 0; i < size(); ++i) w = std::max(w, get_lit(i).var());
|
||||
return w;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, constraint const& cnstr) {
|
||||
if (cnstr.lit() != sat::null_literal) out << cnstr.lit() << " == ";
|
||||
return cnstr.display(out);
|
||||
}
|
||||
|
||||
bool constraint::is_watched(solver_interface const& s, literal lit) const {
|
||||
return s.get_wlist(~lit).contains(sat::watched(cindex()));
|
||||
}
|
||||
|
||||
void constraint::unwatch_literal(solver_interface& s, literal lit) {
|
||||
sat::watched w(cindex());
|
||||
s.get_wlist(~lit).erase(w);
|
||||
SASSERT(!is_watched(s, lit));
|
||||
}
|
||||
|
||||
void constraint::watch_literal(solver_interface& s, literal lit) {
|
||||
if (is_pure() && lit == ~this->lit()) return;
|
||||
SASSERT(!is_watched(s, lit));
|
||||
sat::watched w(cindex());
|
||||
s.get_wlist(~lit).push_back(w);
|
||||
}
|
||||
|
||||
void constraint::nullify_tracking_literal(solver_interface& s) {
|
||||
if (lit() != sat::null_literal) {
|
||||
unwatch_literal(s, lit());
|
||||
unwatch_literal(s, ~lit());
|
||||
nullify_literal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue