Skip to main content

Model

Struct Model 

Source
#[non_exhaustive]
pub struct Model { pub worlds: Vec<World>, pub world: u32, }
Expand description

A finite Kripke model: worlds, arrows from each world to the worlds directly above it, whose reflexive and transitive closure is the order, and the atoms each world forces. It names one world, the one it is about: for a countermodel, the world where the sequent fails.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§worlds: Vec<World>

The worlds, by index.

§world: u32

The world the model is about, by index.

Implementations§

Source§

impl Model

Source

pub const fn new(worlds: Vec<World>, world: u32) -> Self

Returns a model of these worlds about the world world.

Source

pub fn check_world(&self, world: u32) -> Result<(), Error>

Checks that the model has the world world.

§Errors

Error::IndexOutOfBounds in the space of worlds otherwise.

Source§

impl Model

Source

pub fn forcing( &self, sequent: &Sequent, logic: Logic, limits: &Limits, stop: impl FnMut(Progress) -> bool, ) -> Result<Forcing, Error>

Checks that the model is one of logic and computes what each of its worlds forces, for every formula of the sequent’s arena.

A model of the logic has:

  • at least one world, the model’s world among them;
  • every arrow to a world of the model, and no cycle of arrows (the order is a partial order: two worlds each above the other would be one world);
  • every world forcing the atoms, and ⊥, of every world below it;
  • ⊥ forced only in minimal logic;
  • one world in classical logic.

An atom the sequent does not name changes nothing the sequent’s formulas force, though it must grow along the arrows as the others do. An arrow written twice is one arrow.

Forcing is computed world by world, the worlds above first. An atom is forced where the world forces it, and ⊥ where the world forces it (minimal logic). ∧ and ∨ follow from their parts there. An implication, a negation (¬A read as A → ⊥) or an equivalence is forced where it holds there and is forced at every world directly above, which then forces it at every world above. The stop is asked once per world in each pass over the worlds. Besides the table (MODEL_CELLS) the check holds a few words per world, arrow and atom, which limits.memory_bytes bounds.

§Errors

Error::Model for a model that is not one of the logic, naming what fails; Error::Succedents for more than one formula right of ⊢ outside classical logic; Refusal::Memory where the check would compute more than MODEL_CELLS cells or hold more than limits.memory_bytes, and Refusal::Stopped when the stop fired, neither a verdict on the model.

Source

pub fn refutes( &self, sequent: &Sequent, logic: Logic, limits: &Limits, stop: impl FnMut(Progress) -> bool, ) -> Result<(), Error>

Checks that the model refutes the sequent in logic: it is a model of the logic (forcing), and its world forces every formula left of ⊢ and not the formula right of it (⊥ where there is none; classically, none of them).

§Errors

As forcing, and Error::Model naming the hypothesis the model’s world does not force or the conclusion it forces.

Trait Implementations§

Source§

impl Clone for Model

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 Model

Source§

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

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

impl<'a> Deserialize<'a> for Model

Source§

fn deserialize<D: Deserializer<'a>>(deserializer: D) -> Result<Self, D::Error>

Deserializes a model within the default limits, as wire::upgrade does.

Source§

impl Display for Model

Source§

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

Writes a line per world: what it forces and the worlds directly above it, the model’s world marked.

Source§

impl Eq for Model

Source§

impl PartialEq for Model

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Readable for Model

Source§

fn read<'de, D: Deserializer<'de>>( deserializer: D, limits: &Limits, ) -> Result<Self, D::Error>

Reads a model document, its names checked, not whether it is a model of a logic; a key it does not know is refused by name.

Source§

const FORM: &'static str = "Kripke model"

The form’s name, as an error names it: sequent, proof, …
Source§

impl Serialize for Model

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serializes the model as a document at level 13.

Source§

impl StructuralPartialEq for Model

Auto Trait Implementations§

§

impl Forget for Model

§

impl Freeze for Model

§

impl Move for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.