mirror of
https://github.com/Z3Prover/z3
synced 2025-05-05 23:05:46 +00:00
Polysat: fixes in solver, forbidden intervals for eq_constraint (#5240)
* Rename to neg_cond * Add some logging utilities * Implement case of forbidden interval covering the whole domain * Implement diseq_narrow * Do not activate constraint if we are in a conflict state * comments * Assert that lemma isn't undefined * Update revert_decision to work in the case where narrowing causes propagation * Fix case of non-disjunctive lemma from forbidden intervals * Conflict should not leak outside user scope * Add guard to decide(), some notes * Add test case * Add constraints to watchlist of unassigned variable during propagation * Move common propagation functionality into base class * Combine eq/diseq narrow * Compute forbidden interval for equality constraints by considering them as p <=u 0 (or p >u 0 for disequalities)
This commit is contained in:
parent
04876ba8b7
commit
f7e476a4a0
15 changed files with 350 additions and 130 deletions
44
src/math/polysat/log_helper.h
Normal file
44
src/math/polysat/log_helper.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*++
|
||||
Copyright (c) 2021 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
Logging support
|
||||
|
||||
Abstract:
|
||||
|
||||
Utilities for logging.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2021-03-19
|
||||
Jakob Rath 2021-04-6
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include "util/util.h"
|
||||
|
||||
template <typename T>
|
||||
struct show_deref_t {
|
||||
T* ptr;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
std::ostream& operator<<(std::ostream& os, show_deref_t<T> s) {
|
||||
if (s.ptr)
|
||||
return os << *s.ptr;
|
||||
else
|
||||
return os << "<null>";
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
show_deref_t<T> show_deref(T* ptr) {
|
||||
return show_deref_t<T>{ptr};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
show_deref_t<T> show_deref(scoped_ptr<T> const& ptr) {
|
||||
return show_deref_t<T>{ptr.get()};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue