Module drs

Module drs 

Source
Expand description

Discourse Representation Structure (DRS) for anaphora resolution and scope tracking.

This module implements a simplified DRS following the theory developed by Hans Kamp and Uwe Reyle. The DRS tracks referents (discourse entities) across sentences and handles pronoun resolution, donkey anaphora, and quantifier scope.

§Core Concepts

  • Box: A scope container holding referents and conditions. Boxes nest to form scope islands (conditionals, quantifiers, negation).
  • Referent: A discourse entity with a variable, noun class, gender, and number. Introduced by indefinites, proper names, or quantifiers.
  • Accessibility: Whether a referent can be accessed from a given scope. Negation and disjunction block accessibility outward.

§Key Types

TypePurpose
DrsThe box hierarchy tracking referents and their scopes
WorldStateUnified discourse state persisting across sentences
BoxTypeClassification of scope containers (Main, Negation, Modal, etc.)
ReferentA discourse entity with gender, number, and source information
ScopeErrorError when pronoun resolution fails due to scope constraints

§Accessibility Rules

A pronoun in box B can access referent R in box A if:

  1. A is B (same box)
  2. A is an ancestor of B (parent chain)
  3. A is a conditional antecedent and B is the consequent of the same conditional
  4. A is a universal restrictor and B is the universal scope

Referents in negation or disjunction boxes are NEVER accessible from outside.

§Example

“If a farmer owns a donkey, he beats it.”

  • “a farmer” introduces referent x in conditional antecedent box
  • “a donkey” introduces referent y in conditional antecedent box
  • “he” resolves to x (accessible from consequent)
  • “it” resolves to y (accessible from consequent)
  • Both receive universal quantification due to conditional DRS signature

Structs§

Drs
DrsBox
ModalContext
Modal context for tracking hypothetical worlds across sentences. Enables modal subordination: “A wolf might walk in. It would eat you.”
Referent
TelescopeCandidate
A referent that may be accessed via telescoping across sentence boundaries
TimeConstraint
WorldState
The unified discourse state that persists across sentences.

Enums§

BoxType
Case
Grammatical case (for pronouns).
Gender
Grammatical gender (for pronouns and agreement).
Number
Grammatical number for nouns and agreement.
OwnershipState
ReferentSource
ScopeError
Error when pronoun resolution fails due to scope constraints
ScopePath
Path segment for navigating to insertion point during AST restructuring
TimeRelation