Scope Types #
Theory-neutral data types for scope readings and preferences.
A scope reading: an ordering of scope-taking elements.
- ordering : List String
Identifiers for scope-taking elements, in scope order (widest first)
Instances For
Equations
- ScopeTheory.instDecidableEqScopeReading.decEq { ordering := a } { ordering := b } = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ScopeTheory.instReprScopeReading = { reprPrec := ScopeTheory.instReprScopeReading.repr }
Equations
Equations
- ScopeTheory.instInhabitedScopeReading.default = { ordering := default }
Instances For
The surface scope reading (linear order = scope order)
Equations
- ScopeTheory.ScopeReading.surface elements = { ordering := elements }
Instances For
Reverse (inverse) scope reading
Equations
- ScopeTheory.ScopeReading.inverse elements = { ordering := elements.reverse }
Instances For
The set of available scope readings for a form.
- readings : List ScopeReading
All available scope readings
- nonempty : self.readings ≠ []
At least one reading must be available
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ScopeTheory.instReprAvailableScopes = { reprPrec := ScopeTheory.instReprAvailableScopes.repr }
Singleton: only one reading available
Equations
- ScopeTheory.AvailableScopes.singleton r = { readings := [r], nonempty := ⋯ }
Instances For
Binary: exactly two readings (surface and inverse)
Equations
- ScopeTheory.AvailableScopes.binary surface inverse = { readings := [surface, inverse], nonempty := ⋯ }
Instances For
Equations
Is the scope ambiguous (more than one reading)?
Equations
- a.isAmbiguous = (a.readings.length > 1)
Instances For
A ranked preference over scope readings.
- ranking : List ScopeReading
Readings ranked by preference (most preferred first)
- scores : List Float
Scores for each reading (higher = more preferred)
Rankings and scores must align
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ScopeTheory.instReprScopePreference = { reprPrec := ScopeTheory.instReprScopePreference.repr }
Specialized interface for binary scope ambiguity.
- form : α
The form/derivation
- scopeTaker1 : String
First scope-taker (surface-wide)
- scopeTaker2 : String
Second scope-taker (surface-narrow)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ScopeTheory.instReprBinaryScopeForm = { reprPrec := ScopeTheory.instReprBinaryScopeForm.repr }
Binary scope availability: surface only, inverse only, or both.
- surfaceOnly : BinaryScopeAvailability
- inverseOnly : BinaryScopeAvailability
- ambiguous : BinaryScopeAvailability
Instances For
Equations
- ScopeTheory.instDecidableEqBinaryScopeAvailability x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Convert to general AvailableScopes
Equations
- One or more equations did not get rendered due to their size.
- ScopeTheory.BinaryScopeAvailability.surfaceOnly.toAvailableScopes s1 s2 = ScopeTheory.AvailableScopes.singleton (ScopeTheory.ScopeReading.surface [s1, s2])
- ScopeTheory.BinaryScopeAvailability.inverseOnly.toAvailableScopes s1 s2 = ScopeTheory.AvailableScopes.singleton (ScopeTheory.ScopeReading.inverse [s1, s2])