pub struct PredicateAnalysis<'a> { /* private fields */ }Expand description
Cached Boolean queries over one immutable graph level.
Shared Compute ancestry preserves correlated guards. The graph must be acyclic and predicates must name existing bit producers. The borrow prevents graph edits from invalidating retained predicates and query results.
Implementations§
Source§impl<'a> PredicateAnalysis<'a>
impl<'a> PredicateAnalysis<'a>
Sourcepub fn new(graph: &'a SubGraph) -> Self
pub fn new(graph: &'a SubGraph) -> Self
Start a query cache borrowing this graph level, with finite defaults.
Sourcepub fn with_limits(graph: &'a SubGraph, limits: BooleanLimits) -> Self
pub fn with_limits(graph: &'a SubGraph, limits: BooleanLimits) -> Self
Start a query cache with explicit decision-node and cumulative-work limits.
Sourcepub fn overlap(
&mut self,
left: Option<BloqNodeId>,
right: Option<BloqNodeId>,
) -> Result<bool, Error>
pub fn overlap( &mut self, left: Option<BloqNodeId>, right: Option<BloqNodeId>, ) -> Result<bool, Error>
Whether two guards can both hold; an absent guard is unconditional.
§Errors
Returns crate::lowering::NodeTemplateInstanceMergeError for malformed predicate
dataflow or exhausted Boolean resources.
Source§impl PredicateAnalysis<'_>
impl PredicateAnalysis<'_>
Sourcepub fn values_up_to(
&mut self,
predicates: &[BloqNodeId],
limit: usize,
) -> Result<Vec<Vec<bool>>, Error>
pub fn values_up_to( &mut self, predicates: &[BloqNodeId], limit: usize, ) -> Result<Vec<Vec<bool>>, Error>
Enumerate at most limit distinct, jointly reachable predicate tuples.
Shared Boolean ancestry preserves equal and complementary inputs without
enumerating all assignments to the underlying bit producers.
§Errors
Returns malformed predicate dataflow or exhausted Boolean resources.
Sourcepub fn assignment_reachable(
&mut self,
predicates: &[(BloqNodeId, bool)],
) -> Result<bool, Error>
pub fn assignment_reachable( &mut self, predicates: &[(BloqNodeId, bool)], ) -> Result<bool, Error>
Whether a joint assignment is consistent with the Boolean dataflow.
§Errors
Returns crate::lowering::NodeTemplateInstanceMergeError for malformed predicate
dataflow or exhausted Boolean resources.