pub struct ConstraintSet {Show 15 fields
pub vars: Vec<VarInfo>,
pub states: Vec<StateInfo>,
pub conjuncts: Vec<Expr>,
pub domain_conjunct: Vec<Option<usize>>,
pub before: Vec<(VarId, VarId)>,
pub dists: Vec<Dist>,
pub real_vars: Vec<RealVarInfo>,
pub real: RealProblem,
pub arrays: Vec<ArrayInfo>,
pub funcs: Vec<Func>,
pub softs: Vec<Soft>,
pub captures: Vec<CaptureInfo>,
pub blocks: Vec<BlockInfo>,
pub disables: usize,
pub disable_keys: Vec<SoftKey>,
}Expand description
The builder’s product: variable tables plus the boolean conjuncts that must all hold.
Fields§
§vars: Vec<VarInfo>Random variables, indexed by super::ir::VarId.
states: Vec<StateInfo>State variables, indexed by super::ir::StateId.
conjuncts: Vec<Expr>One-bit expressions, all of which must be true (user constraints in source order, then the implicit enum-domain conjuncts).
domain_conjunct: Vec<Option<usize>>For each variable (indexed like Self::vars), the index into
Self::conjuncts of its implicit enum-domain conjunct, if any.
An inactive (rand_mode(0)) enum variable behaves as a state
variable (LRM 18.8) and so must not be forced into its enum domain;
the dispatcher drops exactly these conjuncts.
before: Vec<(VarId, VarId)>solve ... before edges (first, later) over Self::vars (LRM
18.5.9), in source order. Acyclic: Builder::finish checks.
dists: Vec<Dist>The dist constraints (LRM 18.5.3). Dist j’s hidden selector
variable is SELECTOR_BASE + j; its membership conjunct is already in
Self::conjuncts, and the weighting is applied when the solution is
drawn (see super::dist).
real_vars: Vec<RealVarInfo>The real/shortreal random variables, indexed by the real
namespace’s own ids (the Var ids of Self::real).
real: RealProblemThe constraints over Self::real_vars, solved after the integral
variables (see super::real_domain).
arrays: Vec<ArrayInfo>The dynamic arrays and queues the constraints reach, indexed by
super::ir::ArrayId (see ArrayInfo).
funcs: Vec<Func>The functions the constraints call, indexed by super::ir::FuncId.
softs: Vec<Soft>The soft constraints (LRM 18.5.13): soft k’s discard flag is
SOFT_BASE + k in Self::conjuncts (see priority). Those a
higher-priority disable soft reaches are already marked disabled.
captures: Vec<CaptureInfo>The call-site locals an inline constraint reads (empty outside
Builder::set_local_classifier mode); each is one of Self::states.
blocks: Vec<BlockInfo>One entry per Builder::add_block call, in call order: which of
Self::conjuncts the block produced and whether it can be switched
off (see BlockInfo).
disables: usizeHow many disable softs the constraints hold (the table
Soft::disabled_by indexes).
disable_keys: Vec<SoftKey>The target of each disable soft, in the order of Self::disables’s
table: an inline constraint’s are applied to the object’s own softs
when the fragment is overlaid (LRM 18.5.13.2, 18.7).
Trait Implementations§
Source§impl Clone for ConstraintSet
impl Clone for ConstraintSet
Source§impl Debug for ConstraintSet
impl Debug for ConstraintSet
Source§impl Default for ConstraintSet
impl Default for ConstraintSet
impl Eq for ConstraintSet
Source§impl PartialEq for ConstraintSet
impl PartialEq for ConstraintSet
impl StructuralPartialEq for ConstraintSet
Auto Trait Implementations§
impl Freeze for ConstraintSet
impl RefUnwindSafe for ConstraintSet
impl Send for ConstraintSet
impl Sync for ConstraintSet
impl Unpin for ConstraintSet
impl UnsafeUnpin for ConstraintSet
impl UnwindSafe for ConstraintSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.