pub struct Expr(/* private fields */);Expand description
An expression: an immutable value, cheap to clone and share.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn relation(r: &Relation) -> Expr
pub fn relation(r: &Relation) -> Expr
The relation as an expression. A relation of arity 0 gives an
ill-formed expression (arity.zero).
Sourcepub fn own_errors(&self) -> &[Error]
pub fn own_errors(&self) -> &[Error]
The errors recorded when this node was built, not its parts’.
Sourcepub fn placed(&self, place: Place) -> Expr
pub fn placed(&self, place: Place) -> Expr
The same node, at another place: for a node built from model text, the place in the text. Errors recorded at this node move with it.
Sourcepub fn apply_binary(&self, op: BinaryOp, other: &Expr) -> Expr
pub fn apply_binary(&self, op: BinaryOp, other: &Expr) -> Expr
self op other, for any binary operator.
Sourcepub fn apply_unary(&self, op: UnaryOp) -> Expr
pub fn apply_unary(&self, op: UnaryOp) -> Expr
op self, for any unary operator.
Sourcepub fn apply_multiplicity(&self, m: Multiplicity) -> Formula
pub fn apply_multiplicity(&self, m: Multiplicity) -> Formula
m self, for any multiplicity.
Sourcepub fn intersection(&self, other: &Expr) -> Expr
pub fn intersection(&self, other: &Expr) -> Expr
self & other
Sourcepub fn difference(&self, other: &Expr) -> Expr
pub fn difference(&self, other: &Expr) -> Expr
self - other
Sourcepub fn override_with(&self, other: &Expr) -> Expr
pub fn override_with(&self, other: &Expr) -> Expr
self ++ other
Sourcepub fn domain_restriction(&self, other: &Expr) -> Expr
pub fn domain_restriction(&self, other: &Expr) -> Expr
self <: other, with self the set.
Sourcepub fn range_restriction(&self, other: &Expr) -> Expr
pub fn range_restriction(&self, other: &Expr) -> Expr
self :> other, with other the set.
Sourcepub fn reflexive_closure(&self) -> Expr
pub fn reflexive_closure(&self) -> Expr
*self
Sourcepub fn comprehension(decls: Vec<Decl>, formula: &Formula) -> Expr
pub fn comprehension(decls: Vec<Decl>, formula: &Formula) -> Expr
{x1: e1, ..., xm: em | formula}, of arity m.
Sourcepub fn if_then_else(condition: &Formula, then: &Expr, otherwise: &Expr) -> Expr
pub fn if_then_else(condition: &Formula, then: &Expr, otherwise: &Expr) -> Expr
condition => then else otherwise
Trait Implementations§
Source§impl Display for Expr
Expressions are written fully parenthesized, so the text is unambiguous.
impl Display for Expr
Expressions are written fully parenthesized, so the text is unambiguous.
Auto Trait Implementations§
impl Forget for Expr
impl Freeze for Expr
impl Move for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Exprwhere
*const ArcInner<ExprNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<ExprNode>>: UnsafeUnpin,
impl UnwindSafe for Exprwhere
Arc<ExprNode>: UnwindSafe,
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