pub struct LogicalRelation {
pub ty: SimpleType,
/* private fields */
}Expand description
A logical relation for a simple type system: maps types to relations between elements of the denotation. Relations are represented as predicate closures.
Fields§
§ty: SimpleTypeName of the type
Implementations§
Source§impl LogicalRelation
impl LogicalRelation
Sourcepub fn base(
name: impl Into<String>,
pred: impl Fn(&str, &str) -> bool + 'static,
) -> Self
pub fn base( name: impl Into<String>, pred: impl Fn(&str, &str) -> bool + 'static, ) -> Self
Build the logical relation for a base type using a supplied predicate.
Sourcepub fn arrow(dom: LogicalRelation, cod: LogicalRelation) -> Self
pub fn arrow(dom: LogicalRelation, cod: LogicalRelation) -> Self
Build the logical relation for A → B from relations for A and B.
(f, g) ∈ [A→B] iff ∀ (a,b) ∈ [A], (f a, g b) ∈ [B].
Check the fundamental property: every closed term is related to itself.
Auto Trait Implementations§
impl Freeze for LogicalRelation
impl !RefUnwindSafe for LogicalRelation
impl !Send for LogicalRelation
impl !Sync for LogicalRelation
impl Unpin for LogicalRelation
impl UnsafeUnpin for LogicalRelation
impl !UnwindSafe for LogicalRelation
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