Skip to main content

Program

Struct Program 

Source
pub struct Program {
Show 14 fields pub vars: Vec<ProgVar>, pub states: Vec<ProgState>, pub conjuncts: Vec<Expr>, pub before: Vec<(u32, u32)>, pub dists: Vec<Dist>, pub real_vars: Vec<ProgRealVar>, pub real: RealProblem, pub arrays: Vec<ProgArray>, pub funcs: Vec<Func>, pub softs: Vec<Soft>, pub rand_handles: Vec<ProgHandle>, pub blocks: Vec<ProgBlock>, pub n_disables: usize, pub disable_keys: Vec<SoftKey>,
}
Expand description

One class template’s solver input, resolved to object-field locations.

Fields§

§vars: Vec<ProgVar>

Random variables, indexed by the IR’s VarId.

§states: Vec<ProgState>

State variables, indexed by the IR’s StateId.

§conjuncts: Vec<Expr>

One-bit expressions that must all hold.

§before: Vec<(u32, u32)>

solve ... before edges (first, later) over Self::vars (LRM 18.5.9). Acyclic (the builder checks). An edge whose variable is inactive (rand_mode(0)) is ignored for that call: it is a constant then, and there is nothing to order.

§dists: Vec<Dist>

The dist constraints (LRM 18.5.3). Dist j’s hidden selector variable appears in Self::conjuncts as Var(SELECTOR_BASE + j); it is not a field and is numbered after the active variables for each call.

§real_vars: Vec<ProgRealVar>

The real/shortreal random variables, indexed by the real problem’s variable ids (their own numbering, separate from Self::vars).

§real: RealProblem

The constraints over Self::real_vars (Task C9), solved after the integral variables with the same PRNG stream.

§arrays: Vec<ProgArray>

The dynamic arrays and queues the constraints reach (Task C14), indexed by the IR’s super::ir::ArrayId.

§funcs: Vec<Func>

The functions the constraints call (Task C13), indexed by the IR’s super::ir::FuncId.

§softs: Vec<Soft>

The soft constraints (Task C15, LRM 18.5.13): soft k’s discard flag appears in Self::conjuncts as Var(SOFT_BASE + k) (see super::priority). Empty for a class with none.

§rand_handles: Vec<ProgHandle>

The rand class-handle members (Task C17): the objects a joint solve reaches from an object of this class (super::joint).

§blocks: Vec<ProgBlock>

The named constraint blocks, by ordinal (Task C20): what constraint_mode(0) takes out of the solve. Empty for a program that did not come from a class (a fragment, a scope randomization).

§n_disables: usize

How many disable softs the program holds: the table Soft::disabled_by indexes and BlockItems::disables ranges over.

§disable_keys: Vec<SoftKey>

The targets of an inline fragment’s disable softs (empty for a class program), in the order of the last Self::n_disables entries: the overlay discards the base softs they reach (LRM 18.5.13.2, 18.7).

Trait Implementations§

Source§

impl Clone for Program

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 Program

Source§

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

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

impl Default for Program

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Program

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Program

Source§

impl PartialEq for Program

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 Serialize for Program

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Program

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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