Enum air_ir::ConstraintDomain
source · pub enum ConstraintDomain {
FirstRow,
LastRow,
EveryRow,
EveryFrame(usize),
}
Expand description
ConstraintDomain corresponds to the domain over which a constraint is applied.
See the docs on each variant for more details.
Variants§
FirstRow
For boundary constraints which apply to the first row
LastRow
For boundary constraints which apply to the last row
EveryRow
For constraints which apply to every row of the trace
This is used for validity constraints
EveryFrame(usize)
For constraints which apply across multiple rows at once.
A “frame” is a window over rows in the trace, i.e. a constraint over a frame of size 2 is a constraint that observes 2 rows at a time, at each step of the trace, e.g. current and next rows. Such a constraint verifies that certain properties hold in the transition between every pair of rows.
This is used for transition constraints.
Implementations§
source§impl ConstraintDomain
impl ConstraintDomain
sourcepub fn is_boundary(&self) -> bool
pub fn is_boundary(&self) -> bool
Returns true if this domain is a boundary domain (e.g. first or last)
sourcepub fn is_integrity(&self) -> bool
pub fn is_integrity(&self) -> bool
Returns true if this domain is an integrity constraint domain.
sourcepub fn from_offset(offset: usize) -> Self
pub fn from_offset(offset: usize) -> Self
Returns a ConstraintDomain corresponding to the given row offset.
offset == 0
corresponds to every rowoffset > 0
corresponds to a frame size ofoffset + 1
sourcepub fn merge(self, other: Self) -> Result<Self, ConstraintError>
pub fn merge(self, other: Self) -> Result<Self, ConstraintError>
Combines two compatible ConstraintDomains into a single ConstraintDomain that represents the maximum of the two.
For example, if one domain is [ConstraintDomain::EveryFrame(2)] and the other is [ConstraintDomain::EveryFrame(3)], then the result will be [ConstraintDomain::EveryFrame(3)].
NOTE: Domains for boundary constraints (FirstRow and LastRow) cannot be merged with other domains.
Trait Implementations§
source§impl Clone for ConstraintDomain
impl Clone for ConstraintDomain
source§fn clone(&self) -> ConstraintDomain
fn clone(&self) -> ConstraintDomain
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConstraintDomain
impl Debug for ConstraintDomain
source§impl Display for ConstraintDomain
impl Display for ConstraintDomain
source§impl From<Boundary> for ConstraintDomain
impl From<Boundary> for ConstraintDomain
source§impl Ord for ConstraintDomain
impl Ord for ConstraintDomain
source§fn cmp(&self, other: &ConstraintDomain) -> Ordering
fn cmp(&self, other: &ConstraintDomain) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<ConstraintDomain> for ConstraintDomain
impl PartialEq<ConstraintDomain> for ConstraintDomain
source§fn eq(&self, other: &ConstraintDomain) -> bool
fn eq(&self, other: &ConstraintDomain) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ConstraintDomain> for ConstraintDomain
impl PartialOrd<ConstraintDomain> for ConstraintDomain
source§fn partial_cmp(&self, other: &ConstraintDomain) -> Option<Ordering>
fn partial_cmp(&self, other: &ConstraintDomain) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ConstraintDomain
impl Eq for ConstraintDomain
impl StructuralEq for ConstraintDomain
impl StructuralPartialEq for ConstraintDomain
Auto Trait Implementations§
impl RefUnwindSafe for ConstraintDomain
impl Send for ConstraintDomain
impl Sync for ConstraintDomain
impl Unpin for ConstraintDomain
impl UnwindSafe for ConstraintDomain
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.