pub struct Drs { /* private fields */ }Implementations§
Source§impl Drs
impl Drs
pub fn new() -> Drs
pub fn enter_box(&mut self, box_type: BoxType) -> usize
pub fn exit_box(&mut self)
pub fn current_box_index(&self) -> usize
pub fn current_box_type(&self) -> Option<BoxType>
pub fn introduce_referent( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, )
Sourcepub fn introduce_referent_with_source(
&mut self,
variable: Symbol,
noun_class: Symbol,
gender: Gender,
number: Number,
source: ReferentSource,
)
pub fn introduce_referent_with_source( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, source: ReferentSource, )
Introduce a referent with an explicit source (used for negative quantifiers like “No X”)
Sourcepub fn introduce_referent_with_modifiers(
&mut self,
variable: Symbol,
noun_class: Symbol,
gender: Gender,
number: Number,
source: ReferentSource,
modifiers: Vec<Symbol>,
)
pub fn introduce_referent_with_modifiers( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, source: ReferentSource, modifiers: Vec<Symbol>, )
Introduce a referent carrying its distinguishing modifier(s) (the
adjective/gerund that does the referring in “the [modifier] [head]”).
These modifiers feed context-driven coreference for definite
descriptions — see Drs::resolve_definite_by_modifier.
Sourcepub fn introduce_referent_global(
&mut self,
variable: Symbol,
noun_class: Symbol,
gender: Gender,
number: Number,
source: ReferentSource,
)
pub fn introduce_referent_global( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, source: ReferentSource, )
Accommodate a referent at the MAIN (highest) box. Definites presuppose existence, so they project globally even when first mentioned inside an embedded box (Van der Sandt global accommodation).
pub fn introduce_proper_name( &mut self, variable: Symbol, name: Symbol, gender: Gender, )
Sourcepub fn is_rigid_referent(&self, symbol: Symbol) -> bool
pub fn is_rigid_referent(&self, symbol: Symbol) -> bool
Is this symbol a RIGID referent (proper name or deictic constant)? A pronoun resolving to a rigid referent denotes the constant itself, not a discourse-bound variable.
Sourcepub fn register_item_category(&mut self, item: Symbol, category: Symbol)
pub fn register_item_category(&mut self, item: Symbol, category: Symbol)
Record that item was declared under category noun category. Called
for each member of a coordinated category declaration; read back by a
definite-description label to drive category-based un-fusing.
Sourcepub fn item_category(&self, item: Symbol) -> Option<Symbol>
pub fn item_category(&self, item: Symbol) -> Option<Symbol>
The category noun item was declared under, if any.
Sourcepub fn is_accessible(&self, target_box: usize, from_box: usize) -> bool
pub fn is_accessible(&self, target_box: usize, from_box: usize) -> bool
Check if a referent in box from_box can access referents in box target_box
Sourcepub fn resolve_pronoun(
&mut self,
from_box: usize,
gender: Gender,
number: Number,
) -> Result<Symbol, ScopeError>
pub fn resolve_pronoun( &mut self, from_box: usize, gender: Gender, number: Number, ) -> Result<Symbol, ScopeError>
Resolve a pronoun by finding accessible referents matching gender and number
Sourcepub fn resolve_definite(
&self,
from_box: usize,
noun_class: Symbol,
) -> Option<Symbol>
pub fn resolve_definite( &self, from_box: usize, noun_class: Symbol, ) -> Option<Symbol>
Resolve a definite description by finding accessible referent matching noun class
Sourcepub fn resolve_definite_by_modifier(
&self,
interner: &Interner,
from_box: usize,
noun_class: Symbol,
modifiers: &[Symbol],
) -> Option<Symbol>
pub fn resolve_definite_by_modifier( &self, interner: &Interner, from_box: usize, noun_class: Symbol, modifiers: &[Symbol], ) -> Option<Symbol>
Context-driven coreference for MODIFIED definite descriptions.
When an exact head-noun match fails, two definite descriptions still
corefer when (a) their distinguishing modifier matches AND (b) their
head nouns are of a COMPATIBLE occasion sort. This is the
modifier-does-the-referring principle: in “the hunting vacation” /
“the hunting trip” the modifier Hunt identifies the entity and the
head noun (vacation/trip) is a soft type, so both descriptions denote
the same discourse referent.
This is NOT synonymy — no Vacation ↔ Trip axiom is asserted; the FOL
keeps Vacation(x) and Trip(x) literally. Coreference is purely a
referent-resolution step: the later description reuses the earlier
referent’s variable.
Guardrails (enforced here):
- The modifier sets must match EXACTLY (differing modifiers — “the hunting trip” vs “the skydiving trip” — never corefer), and a bare (modifier-less) description never coreferes through this path.
- BOTH head nouns must be of an OCCASION sort (
Sort::is_occasion) and mutually sort-compatible. Concrete objects (“the red box” / “the red ball”, bothPhysical) are excluded, so a shared modifier on non-occasion nouns never triggers coreference.
Sourcepub fn has_referent_by_variable(&self, var: Symbol) -> bool
pub fn has_referent_by_variable(&self, var: Symbol) -> bool
Check if a referent exists by variable name (for imperative mode variable validation)
Sourcepub fn resolve_bridging(
&self,
interner: &Interner,
noun_class: Symbol,
) -> Option<(Symbol, &'static str)>
pub fn resolve_bridging( &self, interner: &Interner, noun_class: Symbol, ) -> Option<(Symbol, &'static str)>
Resolve bridging anaphora by finding referents whose type contains the noun as a part. Returns matching referent and whole name for PartOf relation.
Sourcepub fn get_universal_referents(&self) -> Vec<Symbol>
pub fn get_universal_referents(&self) -> Vec<Symbol>
Get all referents that should receive universal quantification
Sourcepub fn get_existential_referents(&self) -> Vec<Symbol>
pub fn get_existential_referents(&self) -> Vec<Symbol>
Get all referents that should receive existential quantification
Sourcepub fn get_last_event_referent(&self, interner: &Interner) -> Option<Symbol>
pub fn get_last_event_referent(&self, interner: &Interner) -> Option<Symbol>
Get the most recent event referent (for binding weather adjectives to events)
Sourcepub fn in_conditional_antecedent(&self) -> bool
pub fn in_conditional_antecedent(&self) -> bool
Check if we’re currently in a conditional antecedent
Sourcepub fn in_universal_restrictor(&self) -> bool
pub fn in_universal_restrictor(&self) -> bool
Check if we’re currently in a universal restrictor
Sourcepub fn get_telescope_candidates(&self) -> Vec<TelescopeCandidate>
pub fn get_telescope_candidates(&self) -> Vec<TelescopeCandidate>
Get all referents that can telescope across sentence boundaries. Only includes referents from boxes where can_telescope() is true. Excludes referents blocked by negation or disjunction.
Sourcepub fn find_blocked_referent(
&self,
from_box: usize,
gender: Gender,
) -> Option<(Symbol, BoxType)>
pub fn find_blocked_referent( &self, from_box: usize, gender: Gender, ) -> Option<(Symbol, BoxType)>
Find a referent that matches but is blocked by scope. Used to generate informative error messages.
Sourcepub fn set_ownership(&mut self, noun_class: Symbol, state: OwnershipState)
pub fn set_ownership(&mut self, noun_class: Symbol, state: OwnershipState)
Set ownership state for a referent by noun class
Sourcepub fn set_ownership_by_var(&mut self, var: Symbol, state: OwnershipState)
pub fn set_ownership_by_var(&mut self, var: Symbol, state: OwnershipState)
Set ownership state for a referent by variable name
Sourcepub fn get_ownership(&self, noun_class: Symbol) -> Option<OwnershipState>
pub fn get_ownership(&self, noun_class: Symbol) -> Option<OwnershipState>
Get ownership state for a referent by noun class
Sourcepub fn get_ownership_by_var(&self, var: Symbol) -> Option<OwnershipState>
pub fn get_ownership_by_var(&self, var: Symbol) -> Option<OwnershipState>
Get ownership state for a referent by variable name
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Drs
impl RefUnwindSafe for Drs
impl Send for Drs
impl Sync for Drs
impl Unpin for Drs
impl UnsafeUnpin for Drs
impl UnwindSafe for Drs
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.