Skip to main content

ConstraintSet

Struct ConstraintSet 

Source
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: RealProblem

The 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: usize

How 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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConstraintSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConstraintSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ConstraintSet

Source§

impl PartialEq for ConstraintSet

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConstraintSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V