Enum erg_compiler::ty::Predicate
source · [−]pub enum Predicate {
Value(ValueObj),
Const(Str),
Equal {
lhs: Str,
rhs: TyParam,
},
GreaterEqual {
lhs: Str,
rhs: TyParam,
},
LessEqual {
lhs: Str,
rhs: TyParam,
},
NotEqual {
lhs: Str,
rhs: TyParam,
},
Or(Box<Predicate>, Box<Predicate>),
And(Box<Predicate>, Box<Predicate>),
Not(Box<Predicate>, Box<Predicate>),
}
Variants
Value(ValueObj)
Const(Str)
Equal
i == 0 => Eq{ lhs: “i”, rhs: 0 }
GreaterEqual
i > 0 => i >= 0+ε => GreaterEqual{ lhs: “i”, rhs: 0+ε }
LessEqual
NotEqual
Or(Box<Predicate>, Box<Predicate>)
And(Box<Predicate>, Box<Predicate>)
Not(Box<Predicate>, Box<Predicate>)
Implementations
sourceimpl Predicate
impl Predicate
pub const fn eq(lhs: Str, rhs: TyParam) -> Self
pub const fn ne(lhs: Str, rhs: TyParam) -> Self
pub fn and(lhs: Predicate, rhs: Predicate) -> Self
pub fn or(lhs: Predicate, rhs: Predicate) -> Self
pub fn not(lhs: Predicate, rhs: Predicate) -> Self
pub fn is_equal(&self) -> bool
pub fn subject(&self) -> Option<&str>
pub fn change_subject_name(self, name: Str) -> Self
pub fn mentions(&self, name: &str) -> bool
pub fn can_be_false(&self) -> bool
pub fn has_qvar(&self) -> bool
pub fn is_cachable(&self) -> bool
pub fn has_unbound_var(&self) -> bool
pub fn min_max<'a>(
&'a self,
min: Option<&'a TyParam>,
max: Option<&'a TyParam>
) -> (Option<&'a TyParam>, Option<&'a TyParam>)
pub fn typarams(&self) -> Vec<&TyParam>
pub fn typarams_mut(&mut self) -> Vec<&mut TyParam>
Trait Implementations
impl Eq for Predicate
impl StructuralEq for Predicate
impl StructuralPartialEq for Predicate
Auto Trait Implementations
impl !RefUnwindSafe for Predicate
impl !Send for Predicate
impl !Sync for Predicate
impl Unpin for Predicate
impl !UnwindSafe for Predicate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more