[−][src]Struct kontroli::Typing
Normalised, verified form of introduction commands.
An introduction command can have many shapes:
x: A
, x := t
, x: A := t
, ...
A typing provides a uniform presentation of introduction commands
with respect to type checking.
Fields
typ: T
term: Option<(T, Check)>
rewritable: bool
Implementations
impl<'s> Typing<RTerm<'s>>
[src]
pub fn declare(
typ: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
[src]
typ: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
pub fn define(
oty: Option<RTerm<'s>>,
term: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
[src]
oty: Option<RTerm<'s>>,
term: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
pub fn check(self, sig: &Signature<'s>) -> Result<Self, Error>
[src]
Verify whether t: A
if this was not previously checked.
Return a typing registering that t: A
has been checked.
pub fn new(it: Intro<'s>, sig: &Signature<'s>) -> Result<Self, Error>
[src]
Construct a typing from an introduction command.
An introduction command can have many shapes, such as
x: A
, x := t
, x: A := t
, ...
The type A
of the newly introduced symbol is
(a) inferred from its defining term t
if not given and
(b) verified to be of a proper sort.
In case a defining term t
is given, t
is registered,
along with the information whether the type A
was inferred from it.
Constructing a typing from a command of the shape x: A := t
does not check whether t: A
. For this, the check
function can be used.
This allows us to postpone and parallelise type checking.
impl<'s> Typing<RTerm<'s>>
[src]
pub fn declare(
typ: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
[src]
typ: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
pub fn define(
oty: Option<RTerm<'s>>,
term: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
[src]
oty: Option<RTerm<'s>>,
term: RTerm<'s>,
rewritable: bool,
sig: &Signature<'s>
) -> Result<Self, Error>
pub fn check(self, sig: &Signature<'s>) -> Result<Self, Error>
[src]
Verify whether t: A
if this was not previously checked.
Return a typing registering that t: A
has been checked.
pub fn new(it: Intro<'s>, sig: &Signature<'s>) -> Result<Self, Error>
[src]
Construct a typing from an introduction command.
An introduction command can have many shapes, such as
x: A
, x := t
, x: A := t
, ...
The type A
of the newly introduced symbol is
(a) inferred from its defining term t
if not given and
(b) verified to be of a proper sort.
In case a defining term t
is given, t
is registered,
along with the information whether the type A
was inferred from it.
Constructing a typing from a command of the shape x: A := t
does not check whether t: A
. For this, the check
function can be used.
This allows us to postpone and parallelise type checking.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Typing<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Typing<T> where
T: Send,
T: Send,
impl<T> Sync for Typing<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Typing<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Typing<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,