mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
fix #3733 persist uninterpreted atoms across calls to incremental sat solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c70e9af09d
commit
031b3a55ef
6 changed files with 25 additions and 8 deletions
|
@ -11,8 +11,8 @@
|
|||
<abstract>
|
||||
|
||||
Author:
|
||||
Nikolaj Bjorner (nbjorner)
|
||||
Lev Nachmanson (levnach)
|
||||
Nikolaj Bjorner (nbjorner)
|
||||
|
||||
Revision History:
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ Revision History:
|
|||
|
||||
#include "util/vector.h"
|
||||
#include "util/region.h"
|
||||
#include "util/stacked_value.h"
|
||||
#include "math/lp/lp_utils.h"
|
||||
#include "math/lp/ul_pair.h"
|
||||
#include "math/lp/lar_term.h"
|
||||
#include "math/lp/column_namer.h"
|
||||
#include "math/lp/stacked_value.h"
|
||||
namespace lp {
|
||||
inline lconstraint_kind flip_kind(lconstraint_kind t) {
|
||||
return static_cast<lconstraint_kind>( - static_cast<int>(t));
|
||||
|
|
|
@ -29,7 +29,7 @@ Revision History:
|
|||
#include "math/lp/lp_primal_core_solver.h"
|
||||
#include "math/lp/stacked_vector.h"
|
||||
#include "math/lp/lar_solution_signature.h"
|
||||
#include "math/lp/stacked_value.h"
|
||||
#include "util/stacked_value.h"
|
||||
namespace lp {
|
||||
|
||||
class lar_core_solver {
|
||||
|
|
|
@ -34,7 +34,7 @@ Revision History:
|
|||
#include "math/lp/scaler.h"
|
||||
#include "math/lp/lp_primal_core_solver.h"
|
||||
#include "math/lp/random_updater.h"
|
||||
#include "math/lp/stacked_value.h"
|
||||
#include "util/stacked_value.h"
|
||||
#include "math/lp/stacked_vector.h"
|
||||
#include "math/lp/implied_bound.h"
|
||||
#include "math/lp/bound_analyzer_on_row.h"
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2017 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
<name>
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Lev Nachmanson (levnach)
|
||||
|
||||
Revision History:
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
// add to value the stack semantics
|
||||
#include <stack>
|
||||
namespace lp {
|
||||
template <typename T> class stacked_value {
|
||||
T m_value;
|
||||
std::stack<T> m_stack;
|
||||
public:
|
||||
void push() {
|
||||
m_stack.push(m_value);
|
||||
}
|
||||
|
||||
void clear() {
|
||||
m_stack.clear();
|
||||
}
|
||||
|
||||
unsigned stack_size() const {
|
||||
return static_cast<unsigned>(m_stack.size());
|
||||
}
|
||||
|
||||
void pop() {
|
||||
pop(1);
|
||||
}
|
||||
void pop(unsigned k) {
|
||||
while (k-- > 0) {
|
||||
if (m_stack.empty())
|
||||
return;
|
||||
m_value = m_stack.top();
|
||||
m_stack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
stacked_value() {}
|
||||
stacked_value(const T& m) {
|
||||
m_value = m;
|
||||
}
|
||||
stacked_value(const T&& m) {
|
||||
m_value = std::move(m);
|
||||
}
|
||||
|
||||
T& operator=(T arg) { // copy/move constructor
|
||||
m_value = arg;
|
||||
return m_value;
|
||||
}
|
||||
|
||||
operator T&() {
|
||||
return m_value;
|
||||
}
|
||||
|
||||
operator const T&() const {
|
||||
return m_value;
|
||||
}
|
||||
|
||||
T & operator()() {
|
||||
return m_value;
|
||||
}
|
||||
|
||||
const T & operator()() const {
|
||||
return m_value;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue