pub struct Atom {
pub predicate: PredicateSymbol,
pub terms: Vec<Term>,
}Expand description
Datalog atom: predicate(term_1, ..., term_n).
Fields§
§predicate: PredicateSymbolPredicate identifier.
terms: Vec<Term>Ordered list of terms.
Implementations§
Source§impl Atom
impl Atom
Sourcepub fn variables(&self) -> BTreeSet<VariableSymbol>
pub fn variables(&self) -> BTreeSet<VariableSymbol>
Distinct variables in stable symbol order, recursively including triple terms and Skolem arguments. Relation names and constants are excluded. The result is bounded by this finite authored atom, not a fact relation.
Sourcepub fn visit_variables<'a>(
&'a self,
visitor: &mut impl FnMut(&'a VariableSymbol),
)
pub fn visit_variables<'a>( &'a self, visitor: &mut impl FnMut(&'a VariableSymbol), )
Visit borrowed variable occurrences in operand order, recursively through triple terms and Skolem arguments. Repeated occurrences are retained.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Atom
impl<'de> Deserialize<'de> for Atom
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Display for Atom
Display an Atom as predicate(term_1, term_2, …). Used
directly by Term’s std::fmt::Display impl for non-2-arity
triple terms and available to error messages / debugging.
impl Display for Atom
Display an Atom as predicate(term_1, term_2, …). Used
directly by Term’s std::fmt::Display impl for non-2-arity
triple terms and available to error messages / debugging.
impl Eq for Atom
Source§impl From<Atom> for HeadConjunction
impl From<Atom> for HeadConjunction
impl StructuralPartialEq for Atom
Auto Trait Implementations§
impl Forget for Atom
impl Freeze for Atom
impl Move for Atom
impl RefUnwindSafe for Atom
impl Send for Atom
impl Sync for Atom
impl Unpin for Atom
impl UnsafeUnpin for Atom
impl UnwindSafe for Atom
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