Expand description
Contains the variables which are used by the Solver.
A variable, in the context of the solver, is a view onto a domain. It may forward domain information unaltered, or apply transformations which can be performed without the need of constraints.
We define 2 types of variables:
- Integer Variables (
IntegerVariable) - These are represented byDomainIds when interacting with theSolver. These variables can be created usingSolver::new_bounded_integerwhen creating a variable with the domain between a lower-bound and an upper-bound or usingSolver::new_sparse_integerwhen creating a variable with holes in the domain. These variables can be transformed (according to the traitTransformableVariable) to create anAffineView. - Propositional Variables (
PropositionalVariable) - These specify booleans that can be used when interacting with theSolver. ALiteralis used when aPropositionalVariableis given a polarity (i.e. it is the positiveLiteralor its negated version). ALiteralcan be created usingSolver::new_literal.
Structs§
- Models the constraint
y = ax + b, by expressing the domain ofyas a transformation of the domain ofx. - A structure which represents the most basic
IntegerVariable; it is simply the id which links to a domain (hence the name). - A boolean variable in the solver; represents a
PropositionalVariablebut with a certain polarity (i.e. it is either the positivePropositionalVariableor its negation). - A boolean variable in the solver; unlike
Literal, this representation does not use a polarity.
Traits§
- A trait specifying the required behaviour of an integer variable such as retrieving a lower-bound (
IntegerVariable::lower_bound) or adjusting the bounds (IntegerVariable::set_lower_bound). - Trait for transforming a variable