Skip to main content

Formulas

Struct Formulas 

Source
pub struct Formulas { /* private fields */ }
Expand description

The formulas of ordinary sequents, as an arena in which every subformula precedes the formulas built from it and equal formulas are one node, so that two formulas are equal exactly when their ids are.

Implementations§

Source§

impl Formulas

Source

pub const MOST: usize

The most nodes an arena holds: the ids are u32.

Source

pub fn node(&self, id: NodeId) -> Node

Returns the node with the id given, which must belong to this arena.

§Panics

If the id is past the arena’s end, as an id of another arena may be.

Source

pub fn len(&self) -> usize

Returns the number of nodes.

Source

pub fn is_empty(&self) -> bool

Returns whether the arena has no node.

Source

pub fn atom_name(&self, atom: u32) -> &str

Returns the name of the atom with the index given.

Source

pub fn atom_names(&self) -> &[String]

Returns the atom names, in the order of their indices.

Source

pub fn add(&mut self, node: Node) -> Result<NodeId, Error>

Returns the id of node, adding it unless the arena has it.

§Errors

Error::IndexOutOfBounds for a subformula that is no node of this arena (an id of another one) or an atom that is not one of its names, and Refusal::Index when the arena is full.

Source

pub fn atom(&mut self, name: &str) -> Result<NodeId, Error>

Returns the atom named name, adding it unless the arena has it. The name is kept in Unicode normal form NFC, so one name is one atom however its accents are encoded. It must be an identifier of the text syntax and no keyword, so that a formula written as text reads back as itself: not true or false, and no keyword of the linear syntax either, since the translations keep the atom’s name.

§Errors

Error::AtomName for a name that is no identifier, a keyword or a word reserved for a later version of the syntax (forall, exists), and Refusal::Index when the arena is full.

Source

pub fn formula(&self, id: NodeId) -> Formula<'_>

Returns the formula at id as a value that prints it.

Trait Implementations§

Source§

impl Clone for Formulas

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Formulas

Source§

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

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

impl Default for Formulas

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.