Skip to main content

RealizabilityModel

Struct RealizabilityModel 

Source
pub struct RealizabilityModel {
    pub ty: PcfType,
}
Expand description

A realizability model for PCF types.

Each type is interpreted as a set of realizers (PCA elements), with the partial equivalence relation identifying equivalent realizers.

Fields§

§ty: PcfType

The PCF type being modeled

Implementations§

Source§

impl RealizabilityModel

Source

pub fn new(ty: PcfType) -> Self

Create a model for a given PCF type.

Source

pub fn is_realizer(&self, val: &PcfValue) -> bool

Check if a value is a valid realizer for this model’s type.

Source

pub fn per_equiv(&self, v1: &PcfValue, v2: &PcfValue) -> bool

The PER (partial equivalence relation) for this type. Two values are PER-equivalent if they are both valid realizers and computationally equivalent.

Source

pub fn domain(&self) -> impl Fn(&PcfValue) -> bool + '_

The domain of the PER: values related to themselves.

Auto Trait Implementations§

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> 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, 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.