Skip to main content

PTerm

Enum PTerm 

Source
pub enum PTerm {
    Ident(String),
    App(Box<PTerm>, Vec<PTerm>),
    Tuple(Vec<PTerm>),
    Hole,
    Op(&'static str, Box<PTerm>, Box<PTerm>),
}
Expand description

A term as a proof SCRIPT writes it — the argument of exact, have, refine, use.

One syntax serves two languages, because Lean’s does: the same ⟨a, b⟩ is a conjunction proof against p ∧ q and a witness-and-proof pair against ∃x. φ, and the same bare name is a hypothesis in a proof position and a variable in a value position. Which language a term is read in is decided by the position, never by the term (ProofState::exact_term checks it as a proof, ProofState::value_term as a value).

Variants§

§

Ident(String)

A bare name: a hypothesis, a bound variable, or a constant.

§

App(Box<PTerm>, Vec<PTerm>)

Juxtaposition — f a b. Modus ponens over an implication, instantiation over a universal, a function application in a value position.

§

Tuple(Vec<PTerm>)

The anonymous constructor (a, b) / ⟨a, b⟩.

§

Hole

A ?_ / ?name hole — a subgoal under refine, and an error anywhere else.

§

Op(&'static str, Box<PTerm>, Box<PTerm>)

An infix arithmetic operator, by its ProofTerm function name (add/sub/mul).

Trait Implementations§

Source§

impl Clone for PTerm

Source§

fn clone(&self) -> PTerm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PTerm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PTerm

Source§

fn eq(&self, other: &PTerm) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PTerm

Auto Trait Implementations§

§

impl Freeze for PTerm

§

impl RefUnwindSafe for PTerm

§

impl Send for PTerm

§

impl Sync for PTerm

§

impl Unpin for PTerm

§

impl UnsafeUnpin for PTerm

§

impl UnwindSafe for PTerm

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.