|
SAT Solver Template
|
Namespace containing dimacs io utilities. More...
Functions | |
| Literal | from_dimacs (int val) noexcept |
| int | to_dimacs (Literal l) noexcept |
| auto | read_from_dimacs (std::istream &in) -> std::pair< std::vector< std::vector< Literal > >, std::size_t > |
| template<std::ranges::range R> | |
| std::string | to_dimacs (const R &clauses) |
| template<concepts::typed_range< Literal > L> | |
| std::string | to_dimacs (const L &literals) |
Namespace containing dimacs io utilities.
|
noexcept |
Converts an integer to a sat::Literal
| val | literal value. The value +5 for example corresponds to the positive literal of the variable with ID 5, whereas -5 corresponds to the negative literal |
| auto sat::inout::read_from_dimacs | ( | std::istream & | in | ) | -> std::pair< std::vector< std::vector< Literal > >, std::size_t > |
Reads a SAT problem from a stream
| in | input stream to read from |
| std::string sat::inout::to_dimacs | ( | const L & | literals | ) |
Converts a range of literals to dimacs format
| L | Literal range type |
| literals | the literals to convert |
| std::string sat::inout::to_dimacs | ( | const R & | clauses | ) |
Converts a range of clauses to dimacs format
| R | clause range type |
| clauses | A range of clauses |
References sat::Variable::get(), and sat::var().

|
noexcept |
Converts a sat::Literal to a dimacs literal
| l | Literal to convert |