1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Traits and basic implementations for variables, literals, constraints and formulas for combinatorial solvers.
//!
//! # Supported Types
//! The current focus of this library is on pseudo-Boolean optimization problems problems. However, the library is designed to be extensible to support different combinatorial optimization problems.
//!
//! A variable [`VarIdx`](var_type::VarIdx) is just an index and has type [`VarType`](var_type::VarType), where the special case is the boolean variable type [`BooleanVar`](boolean_var::BooleanVar). A literal is represented as [`Lit`](lit::Lit). An [`Assignment`](assignment::Assignment) maps variables to values and a [`Substitution`](substitution) maps variables to literals or values.
//!
//! The only supported constraint type is a [`PBConstraint`](pb_constraint::PBConstraint). A [`Formula`](formula::Formula) is a collection of [`PBConstraint`](pb_constraint::PBConstraint) with a [`PBObjective`](pb_objective::PBObjective).
//!
//! ## Pseudo-Boolean Constraints
//! There are data structures for three types of pseudo-Boolean constraints:
//! - [`Clause`](clause::Clause): all coefficients and the right-hand side are 1.
//! - [`Cardinality`](cardinality::Cardinality): all coefficients are 1 and the right hand side can be any integer.
//! - [`GeneralPBConstraint`](general_pb_constraint::GeneralPBConstraint): all coefficients and the right-hand side can be any ointeger.
//!
//! # Design Philosophy
//! This crate is designed to be as general purpose and generic as possible (with the trade-off for performance).
//!
// Since fat/expanded PB constraint s are currently not used, it is disabled.
// pub mod fat_pb_constraint;