17 if (lhs.
var.get_id() < rhs.
var.get_id())
return std::strong_ordering::less;
18 if (lhs.
var.get_id() > rhs.
var.get_id())
return std::strong_ordering::greater;
19 if (lhs.
truth < rhs.
truth)
return std::strong_ordering::less;
20 if (lhs.
truth > rhs.
truth)
return std::strong_ordering::greater;
21 return std::strong_ordering::equal;
25 return lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
28 return std::lexicographical_compare_three_way(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
31std::ostream &operator<<(std::ostream &os,
const Literal &literal) {
32 return os << (literal.truth ?
"" :
"¬") << literal.var;
35std::ostream &operator<<(std::ostream &os,
const LiteralSet &literal_set) {
37 for (
const auto &lit : literal_set) os << lit <<
" ";
41std::ostream &operator<<(std::ostream &os,
const std::vector<Variable> &variables) {
43 for (
const auto &var : variables) os << var <<
" ";
47std::ostream &operator<<(std::ostream &os,
const std::vector<Literal> &literals) {
49 for (
const auto &lit : literals) os << lit <<
" ";
53std::ostream &operator<<(std::ostream &os,
const Model &model) {
54 os <<
"Boolean model:\n";
55 for (
const auto &lit : model.first) os << lit <<
" ";
56 os <<
"\nTheory model:\n";
57 for (
const auto &lit : model.second) os << lit <<
" ";
bool equal_to(const Variable &v) const
Checks the equality of two variables based on their ID values.
Global namespace for the dlinear library.
std::set< Literal > LiteralSet
A set of literals.
std::pair< std::vector< Literal >, std::vector< Literal > > Model
A model is a pair of two vectors of literals.
A literal is a variable with an associated truth value, indicating whether it is true or false.