This page requires javascript to work

[][src]Enum minitt::ast::GenericTelescope

pub enum GenericTelescope<Value: Clone> {
    Nil,
    UpDec(Rc<Self>, Declaration),
    UpVar(Rc<Self>, Pattern, Value),
}

Generic definition for two kinds of telescopes.
Value can be specialized with Value or NormalExpression.

Implementing Eq because of NormalExpression

Variants

Nil

$()$, Empty telescope.

UpDec(Rc<Self>, Declaration)

$\rho, p=D$, In Mini-TT, checked declarations are put here. However, it's not possible to store a recursive declaration as an Expression (which is a member of Declaration) here.

The problem is quite complicated and can be reproduced by checking out 0.1.5 revision and type-check this code (Type was U and Sum was sum at that time):

This example is not tested
rec nat : U = sum { Zero 1 | Suc nat };
-- Inductive definition of nat

let one : nat = Zero 0;
let two : nat = Suc one;
-- Unresolved reference
UpVar(Rc<Self>, Pattern, Value)

$\rho, p=v$, Usually a local variable, introduced in your telescope

Methods

impl GenericTelescope<Value>[src]

pub fn resolve(&self, name: &str) -> Result<Value, String>[src]

$$ \textnormal{If} \ x \ \textnormal{is\ in}\ p, \\ \begin{alignedat}{2} & (\rho, p=v)(x) &&= \textsf{proj}^p_x(v) \\ & (\rho, p:A=M)(x) &&= \textsf{proj}^p_x(⟦ M ⟧ \rho) \\ & (\rho, \textsf{rec}\ p:A=M)(x) &&= \textsf{proj}^p_x(⟦ M ⟧ (\rho, \textsf{rec}\ p:A=M)) \end{alignedat} \\ \textnormal{If} \ x \ \textnormal{is\ not\ in}\ p, \\ \begin{alignedat}{2} & (\rho, p=v)(x) &&= \rho(x) \\ & (\rho, D)(x) &&= \rho(x) \\ \end{alignedat} $$ getRho in Mini-TT.

Trait Implementations

impl<'_> ReadBack for &'_ GenericTelescope<Value>[src]

type NormalForm = NormalTelescope

Corresponding normal form type for the read-backable structures. This is needed because Rust does not support Higher-Kinded Types :( Read more

fn read_back(self, index: u32) -> Self::NormalForm[src]

$$ \begin{alignedat}{2} & \textsf{R}_i (\rho,p=v) &&= \textsf{R}_i\ \rho,p=\textsf{R}_i\ v \\ & \textsf{R}_i (\rho,D) &&= \textsf{R}_i\ \rho,D \\ & \textsf{R}_i () &&= () \end{alignedat} $$ rbRho in Mini-TT.

impl<Value: Eq + Clone> Eq for GenericTelescope<Value>[src]

impl<Value: Clone> Clone for GenericTelescope<Value>[src]

impl<Value: PartialEq + Clone> PartialEq<GenericTelescope<Value>> for GenericTelescope<Value>[src]

impl<Value: Debug + Clone> Debug for GenericTelescope<Value>[src]

impl<Value: Clone + Display> Display for GenericTelescope<Value>[src]

Actually it's for NeutralTelescope

Auto Trait Implementations

impl<Value> !Send for GenericTelescope<Value>

impl<Value> Unpin for GenericTelescope<Value> where
    Value: Unpin

impl<Value> !Sync for GenericTelescope<Value>

impl<Value> !UnwindSafe for GenericTelescope<Value>

impl<Value> !RefUnwindSafe for GenericTelescope<Value>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]