WorldState

Struct WorldState 

Source
pub struct WorldState {
    pub drs: Drs,
    /* private fields */
}
Expand description

The unified discourse state that persists across sentences.

Fields§

§drs: Drs

The global DRS (box hierarchy for scope tracking)

Implementations§

Source§

impl WorldState

Source

pub fn new() -> Self

Source

pub fn next_event_var(&mut self) -> String

Generate next event variable (e1, e2, e3…)

Source

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

Get event history for temporal ordering

Source

pub fn next_reference_time(&mut self) -> String

Generate next reference time (r1, r2, r3…)

Source

pub fn current_reference_time(&self) -> String

Get current reference time

Source

pub fn add_time_constraint( &mut self, left: String, relation: TimeRelation, right: String, )

Add a temporal constraint

Source

pub fn time_constraints(&self) -> &[TimeConstraint]

Get all time constraints

Source

pub fn clear_time_constraints(&mut self)

Clear time constraints (for sentence boundary reset if needed)

Source

pub fn end_sentence(&mut self)

Mark a sentence boundary - collect telescope candidates

Source

pub fn in_discourse_mode(&self) -> bool

Check if we’re in discourse mode (multi-sentence context) In discourse mode, unresolved pronouns should error instead of deictic fallback

Source

pub fn telescope_candidates(&self) -> &[TelescopeCandidate]

Get telescope candidates from previous sentence

Source

pub fn resolve_via_telescope( &mut self, gender: Gender, ) -> Option<TelescopeCandidate>

Try to resolve a pronoun via telescoping

Source

pub fn set_ownership(&mut self, noun_class: Symbol, state: OwnershipState)

Set ownership state for a referent by noun class

Source

pub fn get_ownership(&self, noun_class: Symbol) -> Option<OwnershipState>

Get ownership state for a referent by noun class

Source

pub fn set_ownership_by_var(&mut self, var: Symbol, state: OwnershipState)

Set ownership state for a referent by variable name

Source

pub fn get_ownership_by_var(&self, var: Symbol) -> Option<OwnershipState>

Get ownership state for a referent by variable name

Source

pub fn enter_modal_context(&mut self, is_epistemic: bool, force: f32)

Enter a modal context (e.g., “might”, “would”, “could”)

Source

pub fn exit_modal_context(&mut self)

Exit the current modal context

Source

pub fn in_modal_context(&self) -> bool

Check if we’re currently in a modal context

Source

pub fn has_prior_modal_context(&self) -> bool

Check if there’s a prior modal context for subordination

Source

pub fn can_subordinate(&self) -> bool

Check if current modal can subordinate to prior context “would” can continue a “might” world

Source

pub fn clear(&mut self)

Clear the world state (reset for new discourse)

Trait Implementations§

Source§

impl Clone for WorldState

Source§

fn clone(&self) -> WorldState

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 WorldState

Source§

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

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

impl Default for WorldState

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> 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V