[][src]Struct polar_core::kb::KnowledgeBase

pub struct KnowledgeBase {
    pub constants: Bindings,
    pub types: HashMap<Symbol, Type>,
    pub rules: HashMap<Symbol, GenericRule>,
    pub sources: Sources,
    pub inline_queries: Vec<Term>,
    // some fields omitted
}

Fields

constants: Bindingstypes: HashMap<Symbol, Type>rules: HashMap<Symbol, GenericRule>sources: Sourcesinline_queries: Vec<Term>

Implementations

impl KnowledgeBase[src]

pub fn new() -> Self[src]

pub fn new_id(&self) -> u64[src]

Return a monotonically increasing integer ID.

Wraps around at 52 bits of precision so that it can be safely coerced to an IEEE-754 double-float (f64).

pub fn gensym(&self, prefix: &str) -> Symbol[src]

Generate a new symbol.

pub fn constant(&mut self, name: Symbol, value: Term)[src]

Define a constant variable.

pub fn is_constant(&self, name: &Symbol) -> bool[src]

Return true if a constant with the given name has been defined.

Trait Implementations

impl Default for KnowledgeBase[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.