pub struct NaryRulePattern {
pub head_arity: u8,
pub body: Vec<BodyAtomPattern>,
}Expand description
A canonical n-ary rule pattern: H(h0..h{a-1}) :- body....
Fields§
§head_arity: u8§body: Vec<BodyAtomPattern>Implementations§
Source§impl NaryRulePattern
impl NaryRulePattern
Sourcepub fn validate(
&self,
candidate_arities: &[u8],
config: &NaryEnumerationConfig,
) -> Result<()>
pub fn validate( &self, candidate_arities: &[u8], config: &NaryEnumerationConfig, ) -> Result<()>
Validate canonical form against a head arity, the candidate arity table and the enumeration bounds.
The checks, in refusal order:
- structural: nonzero head arity, nonempty body, body length bound;
- per-atom: known candidate slot, binding length == declared arity;
- variable legality:
Head(i) < head_arity, join count bound; - canonical join numbering (dense, first-appearance order);
- range restriction: every head position bound somewhere in the body — a head position no body atom touches cannot be scored by coverage and is refused as an unsafe variable rather than scored vacuously.
Trait Implementations§
Source§impl Clone for NaryRulePattern
impl Clone for NaryRulePattern
Source§fn clone(&self) -> NaryRulePattern
fn clone(&self) -> NaryRulePattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NaryRulePattern
impl Debug for NaryRulePattern
impl Eq for NaryRulePattern
Source§impl Hash for NaryRulePattern
impl Hash for NaryRulePattern
Source§impl PartialEq for NaryRulePattern
impl PartialEq for NaryRulePattern
Source§fn eq(&self, other: &NaryRulePattern) -> bool
fn eq(&self, other: &NaryRulePattern) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NaryRulePattern
Auto Trait Implementations§
impl Freeze for NaryRulePattern
impl RefUnwindSafe for NaryRulePattern
impl Send for NaryRulePattern
impl Sync for NaryRulePattern
impl Unpin for NaryRulePattern
impl UnsafeUnpin for NaryRulePattern
impl UnwindSafe for NaryRulePattern
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more