3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Merge branch 'master' of https://github.com/Z3Prover/z3 into csp

This commit is contained in:
Nikolaj Bjorner 2018-10-21 12:26:53 -07:00
commit ccca063e54
254 changed files with 1194 additions and 1753 deletions

View file

@ -2862,7 +2862,7 @@ namespace sat {
* ~lit does not occur in clauses
* ~lit is only in one constraint use list
* lit == C
* -> ignore assignemnts to ~lit for C
* -> ignore assignments to ~lit for C
*
* ~lit does not occur in clauses
* lit is only in one constraint use list

View file

@ -87,7 +87,7 @@ namespace sat {
try {
return apply_rec(arg1, arg2, op);
}
catch (mem_out) {
catch (const mem_out &) {
try_reorder();
if (!first) throw;
first = false;
@ -546,7 +546,7 @@ namespace sat {
try {
return bdd(mk_not_rec(b.root), this);
}
catch (mem_out) {
catch (const mem_out &) {
try_reorder();
if (!first) throw;
first = false;
@ -575,7 +575,7 @@ namespace sat {
try {
return bdd(mk_ite_rec(c.root, t.root, e.root), this);
}
catch (mem_out) {
catch (const mem_out &) {
try_reorder();
if (!first) throw;
first = false;

View file

@ -118,7 +118,7 @@ namespace sat {
local_search_config m_config;
// objective function: maximize
svector<ob_term> ob_constraint; // the objective function *constraint*, sorted in decending order
svector<ob_term> ob_constraint; // the objective function *constraint*, sorted in descending order
// information about the variable
int_vector coefficient_in_ob_constraint; // var! initialized to be 0
@ -169,8 +169,8 @@ namespace sat {
// unsat constraint stack
bool m_is_unsat;
unsigned_vector m_unsat_stack; // store all the unsat constraits
unsigned_vector m_index_in_unsat_stack; // which position is a contraint in the unsat_stack
unsigned_vector m_unsat_stack; // store all the unsat constraints
unsigned_vector m_index_in_unsat_stack; // which position is a constraint in the unsat_stack
// configuration changed decreasing variables (score>0 and conf_change==true)
bool_var_vector m_goodvar_stack;

View file

@ -1220,7 +1220,7 @@ namespace sat {
double operator()(literal l) override { return lh.literal_occs(l); }
};
// Ternary clause managagement:
// Ternary clause management:
void lookahead::add_ternary(literal u, literal v, literal w) {
SASSERT(u != w && u != v && v != w && ~u != w && ~u != v && ~w != v);
@ -1377,7 +1377,7 @@ namespace sat {
}
// new n-ary clause managment
// new n-ary clause management
void lookahead::add_clause(clause const& c) {
SASSERT(c.size() > 3);
@ -1636,7 +1636,7 @@ namespace sat {
}
// Sum_{ clause C that contains ~l } 1
// FIXME: counts occurences of ~l; misleading
// FIXME: counts occurrences of ~l; misleading
double lookahead::literal_occs(literal l) {
double result = m_binary[l.index()].size();
result += literal_big_occs(l);
@ -1644,7 +1644,7 @@ namespace sat {
}
// Sum_{ clause C that contains ~l such that |C| > 2} 1
// FIXME: counts occurences of ~l; misleading
// FIXME: counts occurrences of ~l; misleading
double lookahead::literal_big_occs(literal l) {
double result = m_nary_count[(~l).index()];
result += m_ternary_count[(~l).index()];
@ -1718,7 +1718,7 @@ namespace sat {
}
// VERIFY(!missed_propagation());
if (unsat) {
TRACE("sat", tout << "backtracking and settting " << ~lit << "\n";);
TRACE("sat", tout << "backtracking and setting " << ~lit << "\n";);
lookahead_backtrack();
assign(~lit);
propagate();

View file

@ -471,7 +471,7 @@ namespace sat {
watch_list& get_wlist(literal l) { return m_watches[l.index()]; }
watch_list const& get_wlist(literal l) const { return m_watches[l.index()]; }
// new clause managment:
// new clause management:
void add_ternary(literal u, literal v, literal w);
void propagate_ternary(literal l);
lbool propagate_ternary(literal l1, literal l2);

View file

@ -232,7 +232,7 @@ namespace sat {
}
if (m_consumer_ready && (m_num_clauses == 0 || (m_num_clauses > s.m_clauses.size()))) {
// time to update local search with new clauses.
// there could be multiple local search engines runing at the same time.
// there could be multiple local search engines running at the same time.
IF_VERBOSE(1, verbose_stream() << "(sat-parallel refresh :from " << m_num_clauses << " :to " << s.m_clauses.size() << ")\n";);
m_solver_copy = alloc(solver, s.m_params, s.rlimit());
m_solver_copy->copy(s);

View file

@ -984,7 +984,7 @@ namespace sat {
queue m_queue;
literal_vector m_covered_clause; // covered clause
svector<clause_ante> m_covered_antecedent; // explainations for literals in covered clause
svector<clause_ante> m_covered_antecedent; // explanations for literals in covered clause
literal_vector m_intersection; // current resolution intersection
literal_vector m_tautology; // literals that are used in blocking tautology
literal_vector m_new_intersection;

View file

@ -74,7 +74,7 @@ namespace sat {
// config
bool m_abce; // block clauses using asymmetric added literals
bool m_cce; // covered clause elimination
bool m_acce; // cce with asymetric literal addition
bool m_acce; // cce with asymmetric literal addition
bool m_bca; // blocked (binary) clause addition.
unsigned m_bce_delay;
bool m_bce; // blocked clause elimination

View file

@ -1100,6 +1100,10 @@ namespace sat {
m_restart_threshold = m_config.m_restart_initial;
}
if (reached_max_conflicts()) {
return l_undef;
}
// iff3_finder(*this)();
simplify_problem();
if (check_inconsistent()) return l_false;
@ -1137,7 +1141,7 @@ namespace sat {
}
}
catch (abort_solver) {
catch (const abort_solver &) {
m_reason_unknown = "sat.giveup";
return l_undef;
}
@ -1712,17 +1716,6 @@ namespace sat {
#endif
}
unsigned solver::get_hash() const {
unsigned result = 0;
for (clause* cp : m_clauses) {
result = combine_hash(cp->size(), combine_hash(result, cp->id()));
}
for (clause* cp : m_learned) {
result = combine_hash(cp->size(), combine_hash(result, cp->id()));
}
return result;
}
bool solver::set_root(literal l, literal r) {
return !m_ext || m_ext->set_root(l, r);
}

View file

@ -569,8 +569,6 @@ namespace sat {
private:
unsigned get_hash() const;
typedef hashtable<unsigned, u_hash, u_eq> index_set;
u_map<index_set> m_antecedents;