mirror of
https://github.com/Z3Prover/z3
synced 2025-08-24 03:57:51 +00:00
split into parts, add stats
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
21baa2a70a
commit
57486f0b3d
7 changed files with 215 additions and 112 deletions
44
src/math/polysat/justification.h
Normal file
44
src/math/polysat/justification.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*++
|
||||
Copyright (c) 2021 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
polysat justification
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2021-03-19
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
#include "math/polysat/types.h"
|
||||
|
||||
|
||||
namespace polysat {
|
||||
|
||||
|
||||
/**
|
||||
* Justification kind for a variable assignment.
|
||||
*/
|
||||
enum justification_k { unassigned, decision, propagation };
|
||||
|
||||
class justification {
|
||||
justification_k m_kind;
|
||||
unsigned m_level;
|
||||
justification(justification_k k, unsigned lvl): m_kind(k), m_level(lvl) {}
|
||||
public:
|
||||
justification(): m_kind(justification_k::unassigned) {}
|
||||
static justification unassigned() { return justification(justification_k::unassigned, 0); }
|
||||
static justification decision(unsigned lvl) { return justification(justification_k::decision, lvl); }
|
||||
static justification propagation(unsigned lvl) { return justification(justification_k::propagation, lvl); }
|
||||
bool is_decision() const { return m_kind == justification_k::decision; }
|
||||
bool is_unassigned() const { return m_kind == justification_k::unassigned; }
|
||||
bool is_propagation() const { return m_kind == justification_k::propagation; }
|
||||
justification_k kind() const { return m_kind; }
|
||||
unsigned level() const { return m_level; }
|
||||
std::ostream& display(std::ostream& out) const;
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, justification const& j) { return j.display(out); }
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue