Skip to main content

Expr

Enum Expr 

Source
pub enum Expr<T: Types> {
Show 17 variants Constant(Constant<T>), Var(T::Var), App(Box<Self>, Option<Vec<Sort<T>>>, Vec<Self>, Option<Sort<T>>), Neg(Box<Self>), BinaryOp(BinOp, Box<[Self; 2]>), IfThenElse(Box<[Self; 3]>), And(Vec<Self>), Or(Vec<Self>), Not(Box<Self>), Imp(Box<[Self; 2]>), Iff(Box<[Self; 2]>), Atom(BinRel, Box<[Self; 2]>), Let(T::Var, Box<[Self; 2]>), ThyFunc(ThyFunc), IsCtor(T::Var, Box<Self>), Quantifier(Quantifier, Vec<(T::Var, Sort<T>)>, Box<Self>), WKVar(WKVar<T>),
}

Variants§

§

Constant(Constant<T>)

§

Var(T::Var)

§

App(Box<Self>, Option<Vec<Sort<T>>>, Vec<Self>, Option<Sort<T>>)

§

Neg(Box<Self>)

§

BinaryOp(BinOp, Box<[Self; 2]>)

§

IfThenElse(Box<[Self; 3]>)

§

And(Vec<Self>)

§

Or(Vec<Self>)

§

Not(Box<Self>)

§

Imp(Box<[Self; 2]>)

§

Iff(Box<[Self; 2]>)

§

Atom(BinRel, Box<[Self; 2]>)

§

Let(T::Var, Box<[Self; 2]>)

§

ThyFunc(ThyFunc)

§

IsCtor(T::Var, Box<Self>)

§

Quantifier(Quantifier, Vec<(T::Var, Sort<T>)>, Box<Self>)

§

WKVar(WKVar<T>)

NOTE: WKVars are for internal use and we serialize them as UIFs using the var argument. We also don’t emit WKVars that are in head position when translating to fixpoint.

In an ideal world fixpoint would deal with weak kvars itself.

Implementations§

Source§

impl<T: Types> Expr<T>

Source

pub const FALSE: Self

Source

pub const TRUE: Self

Source

pub const fn int(val: u128) -> Expr<T>

Source

pub fn eq(self, other: Self) -> Self

Source

pub fn and(exprs: Vec<Self>) -> Self

Source

pub fn var_sorts_to_int(&mut self)

Source

pub fn free_vars(&self) -> FxIndexSet<T::Var>

Source

pub fn is_trivially_true(&self) -> bool

Source

pub fn substitute(&self, subst: &FxIndexMap<T::Var, Self>) -> Self

Source

pub fn wkvars_in_conj(&self) -> Vec<WKVar<T>>

Source

pub fn uncurry(&self) -> Self

Source

pub fn has_wkvar_reachable_by_split(&self) -> bool

Source

pub fn hoist_exists(&self) -> (Vec<(<T as Types>::Var, Sort<T>)>, Expr<T>)

Source

pub fn as_conjunction(self) -> Vec<Self>

Source

pub fn strip_wkvars(&self) -> Self

Source

pub fn total_num_disjuncts(&self) -> usize

Trait Implementations§

Source§

impl<T: Types> Clone for Expr<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Types> Debug for Expr<T>

Source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Types> Display for Expr<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Types> From<Constant<T>> for Expr<T>

Source§

fn from(v: Constant<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Types> Hash for Expr<T>

Source§

fn hash<__H: Hasher>(&self, __state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Types> PartialEq for Expr<T>

Source§

fn eq(&self, __other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Types> Eq for Expr<T>

Auto Trait Implementations§

§

impl<T> Freeze for Expr<T>
where <T as Types>::Var: Freeze, <T as Types>::Real: Freeze, <T as Types>::String: Freeze, <T as Types>::Sort: Freeze,

§

impl<T> RefUnwindSafe for Expr<T>

§

impl<T> Send for Expr<T>
where <T as Types>::Var: Send, <T as Types>::Real: Send, <T as Types>::String: Send, <T as Types>::Sort: Send,

§

impl<T> Sync for Expr<T>
where <T as Types>::Var: Sync, <T as Types>::Real: Sync, <T as Types>::String: Sync, <T as Types>::Sort: Sync,

§

impl<T> Unpin for Expr<T>
where <T as Types>::Var: Unpin, <T as Types>::Real: Unpin, <T as Types>::String: Unpin, <T as Types>::Sort: Unpin,

§

impl<T> UnwindSafe for Expr<T>
where <T as Types>::Var: UnwindSafe, <T as Types>::Real: UnwindSafe, <T as Types>::String: UnwindSafe, <T as Types>::Sort: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.