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
impl Formulas
Sourcepub fn node(&self, id: NodeId) -> Node
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.
Sourcepub fn atom_names(&self) -> &[String]
pub fn atom_names(&self) -> &[String]
Returns the atom names, in the order of their indices.
Sourcepub fn add(&mut self, node: Node) -> Result<NodeId, Error>
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.
Sourcepub fn atom(&mut self, name: &str) -> Result<NodeId, Error>
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.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Formulas
impl Freeze for Formulas
impl Move for Formulas
impl RefUnwindSafe for Formulas
impl Send for Formulas
impl Sync for Formulas
impl Unpin for Formulas
impl UnsafeUnpin for Formulas
impl UnwindSafe for Formulas
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.