pub enum Term {
Atom(AtomId),
Var(VarId),
Integer(i64),
Float(f64),
Compound {
functor: AtomId,
args: Vec<Term>,
},
List {
head: Box<Term>,
tail: Box<Term>,
},
}Expand description
Prolog term representation.
Variants§
Implementations§
Source§impl Term
impl Term
Sourcepub fn functor_arity(&self) -> Option<(AtomId, usize)>
pub fn functor_arity(&self) -> Option<(AtomId, usize)>
Extract functor AtomId and arity for a term used as a goal/head.
- Atom: (atom_id, 0)
- Compound: (functor, len(args))
- Others: None
Sourcepub fn first_arg_key(&self) -> Option<FirstArgKey>
pub fn first_arg_key(&self) -> Option<FirstArgKey>
Extract the first-argument indexing key from a term used as a clause head.
Trait Implementations§
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnsafeUnpin for Term
impl UnwindSafe for Term
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