Struct air_ir::AlgebraicGraph
source · pub struct AlgebraicGraph { /* private fields */ }
Expand description
The AlgebraicGraph is a directed acyclic graph used to represent integrity constraints. To store it compactly, it is represented as a vector of nodes where each node references other nodes by their index in the vector.
Within the graph, constraint expressions can overlap and share subgraphs, since new expressions reuse matching existing nodes when they are added, rather than creating new nodes.
- Leaf nodes (with no outgoing edges) are constants or references to trace cells (i.e. column 0 in the current row or column 5 in the next row).
- Tip nodes with no incoming edges (no parent nodes) always represent constraints, although they do not necessarily represent all constraints. There could be constraints which are also subgraphs of other constraints.
Implementations§
source§impl AlgebraicGraph
impl AlgebraicGraph
sourcepub fn degree(&self, index: &NodeIndex) -> IntegrityConstraintDegree
pub fn degree(&self, index: &NodeIndex) -> IntegrityConstraintDegree
Returns the degree of the subgraph which has the specified node as its tip.
sourcepub fn node_details(
&self,
index: &NodeIndex,
default_domain: ConstraintDomain
) -> Result<(TraceSegmentId, ConstraintDomain), ConstraintError>
pub fn node_details( &self, index: &NodeIndex, default_domain: ConstraintDomain ) -> Result<(TraceSegmentId, ConstraintDomain), ConstraintError>
TODO: docs
Trait Implementations§
source§impl Clone for AlgebraicGraph
impl Clone for AlgebraicGraph
source§fn clone(&self) -> AlgebraicGraph
fn clone(&self) -> AlgebraicGraph
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AlgebraicGraph
impl Debug for AlgebraicGraph
source§impl Default for AlgebraicGraph
impl Default for AlgebraicGraph
source§fn default() -> AlgebraicGraph
fn default() -> AlgebraicGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for AlgebraicGraph
impl Send for AlgebraicGraph
impl Sync for AlgebraicGraph
impl Unpin for AlgebraicGraph
impl UnwindSafe for AlgebraicGraph
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
Mutably borrows from an owned value. Read more