[][src]Enum avalog::Expr

pub enum Expr {
    Sym(Arc<String>),
    Rel(Box<Expr>, Box<Expr>),
    Ava(Box<Expr>, Box<Expr>),
    Inner(Box<Expr>),
    UniqAva(Box<Expr>),
    RoleOf(Box<Expr>, Box<Expr>),
    Eq(Box<Expr>, Box<Expr>),
    Neq(Box<Expr>, Box<Expr>),
    Has(Box<Expr>, Box<Expr>),
    App(Box<Expr>, Box<Expr>),
    AmbiguousRole(Box<Expr>, Box<Expr>, Box<Expr>),
    AmbiguousRel(Box<Expr>, Box<Expr>, Box<Expr>),
    Rule(Box<Expr>, Vec<Expr>),
    Ambiguity(bool),
    Tail,
    TailSym(Arc<String>),
    List(Vec<Expr>),
}

Represents an expression.

Variants

Sym(Arc<String>)

A symbol.

Rel(Box<Expr>, Box<Expr>)

A relation between two symbols.

Ava(Box<Expr>, Box<Expr>)

A 1-avatar of some expression.

Inner(Box<Expr>)

Unwraps 1-avatar.

UniqAva(Box<Expr>)

A 1-avatar q'(b) such that p(a) = q'(b).

RoleOf(Box<Expr>, Box<Expr>)

A role of expression.

Eq(Box<Expr>, Box<Expr>)

An equality, e.g. p(a) = b.

Neq(Box<Expr>, Box<Expr>)

An inequality, e.g. X != a.

Has(Box<Expr>, Box<Expr>)

A set membership relation, e.g. p(a) ∋ b.

App(Box<Expr>, Box<Expr>)

Apply an argument to a role, e.g. p(a).

AmbiguousRole(Box<Expr>, Box<Expr>, Box<Expr>)

There is an ambiguous role.

AmbiguousRel(Box<Expr>, Box<Expr>, Box<Expr>)

There is an ambiguous relation.

Rule(Box<Expr>, Vec<Expr>)

Defines a rule.

Ambiguity(bool)

Ambiguity summary.

This is true when some ambiguity is found, and false when no ambiguity is found.

Tail

Represents the tail of an argument list ...

TailSym(Arc<String>)

Represents the tail of an argument list bound a symbol ..x.

List(Vec<Expr>)

Represents a list.

Implementations

impl Expr[src]

pub fn eval_lift(&self, eval: &Arc<String>, top: bool) -> Expr[src]

Lifts apply with an eval role.

pub fn is_const(&self) -> bool[src]

Returns true if expression contains no variables.

pub fn is_tail(&self) -> bool[src]

Returns true if expression is a tail pattern.

pub fn arity(&self) -> usize[src]

Returns the number of arguments in apply expression.

Trait Implementations

impl Clone for Expr[src]

impl Debug for Expr[src]

impl Display for Expr[src]

impl Eq for Expr[src]

impl From<&'static str> for Expr[src]

impl Hash for Expr[src]

impl Ord for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl PartialOrd<Expr> for Expr[src]

impl StructuralEq for Expr[src]

impl StructuralPartialEq for Expr[src]

Auto Trait Implementations

impl RefUnwindSafe for Expr

impl Send for Expr

impl Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.