pub struct RefinementType {
pub base: String,
pub predicate: String,
}Expand description
A refinement type used in liquid type synthesis.
Fields§
§base: StringThe base type (e.g., “Int”, “Bool”).
predicate: StringThe refinement predicate as a string (e.g., “v > 0”).
Implementations§
Source§impl RefinementType
impl RefinementType
Sourcepub fn new(base: impl Into<String>, predicate: impl Into<String>) -> Self
pub fn new(base: impl Into<String>, predicate: impl Into<String>) -> Self
Construct a new refinement type.
use oxilean_std::program_synthesis::RefinementType;
let rt = RefinementType::new("Int", "v >= 0");
assert_eq!(rt.base, "Int");Sourcepub fn is_trivial(&self) -> bool
pub fn is_trivial(&self) -> bool
Check whether the predicate is trivially true (empty string).
Sourcepub fn strengthen(&self, extra: impl Into<String>) -> Self
pub fn strengthen(&self, extra: impl Into<String>) -> Self
Return a strengthened type by conjoining an extra predicate.
Trait Implementations§
Source§impl Clone for RefinementType
impl Clone for RefinementType
Source§fn clone(&self) -> RefinementType
fn clone(&self) -> RefinementType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefinementType
impl Debug for RefinementType
Source§impl PartialEq for RefinementType
impl PartialEq for RefinementType
impl Eq for RefinementType
impl StructuralPartialEq for RefinementType
Auto Trait Implementations§
impl Freeze for RefinementType
impl RefUnwindSafe for RefinementType
impl Send for RefinementType
impl Sync for RefinementType
impl Unpin for RefinementType
impl UnsafeUnpin for RefinementType
impl UnwindSafe for RefinementType
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