pub struct Parser<'a, 'ctx, 'int> {
pub fragment_mode: bool,
/* private fields */
}Fields§
§fragment_mode: boolWhether this parse is a single ## block re-parsed on its own (the editor’s per-block
recovery, L11), rather than a whole file. pub, not pub(super): logicaffeine_lsp sets
it before calling Parser::parse_program on tokens that are only one block — false for
every other caller (a whole file), which is the default a fresh Parser starts with.
Gates exactly the four checks in parse_program that only mean something once every ##
block in the file has been seen (Mount names something real, a page mounts itself, and
the LGX resolution pass that synthesizes render/router functions for the whole program) —
a single re-parsed block has no OTHER block to check Mount/routes against, so running
them against ONLY this block’s own statements would report false refusals for names the
REST of the file declares.
★ THIS DOES NOT YET MAKE CROSS-BLOCK LGX CHECKS (resolve_store_calls, check_wire_ contract, …) CORRECT INSIDE A FRAGMENT — it makes them ABSENT there instead of WRONG,
which is the fix this session’s grant covers. Giving them the whole program’s name tables
from inside a fragment reparse needs each one retrofitted to read persistent, incrementally
-updated tables instead of the statements slice handed to resolve_lgx — resolve_lgx’s
OWN twelve sub-passes are cross-block-dependent throughout, not only in this file’s four
gated calls, and doing that safely is real, separate work this grant did not scope. A
fragment reparse gets its full, correct LGX resolution from the next WHOLE-file reparse
(on save, or whatever the editor’s own debounce already does) — this flag only stops a
fragment reparse from reporting a WRONG error about the rest of the file in the meantime.
Implementations§
Source§impl<'a, 'ctx, 'int> Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> Parser<'a, 'ctx, 'int>
Sourcepub fn new(
tokens: Vec<Token>,
world_state: &'ctx mut WorldState,
interner: &'int mut Interner,
ctx: AstContext<'a>,
types: TypeRegistry,
) -> Self
pub fn new( tokens: Vec<Token>, world_state: &'ctx mut WorldState, interner: &'int mut Interner, ctx: AstContext<'a>, types: TypeRegistry, ) -> Self
Create a parser with WorldState for discourse-level parsing. WorldState is REQUIRED - there is no “single sentence mode”. A single sentence is just a discourse of length 1.
Sourcepub fn stmt_spans(&self) -> &[Span]
pub fn stmt_spans(&self) -> &[Span]
The span of each top-level statement from the last parse_program
call, aligned 1:1 with the returned statement list.
Sourcepub fn nested_stmt_spans(&self) -> &NestedStmtSpans
pub fn nested_stmt_spans(&self) -> &NestedStmtSpans
The span of every statement read inside a block — a function’s body, a
loop’s, a branch’s — from the last parse_program call.
Sourcepub fn failure_sites(&self) -> &[FailureSite]
pub fn failure_sites(&self) -> &[FailureSite]
Every Stmt::Site marker’s own (component, action, span), indexed by the id a
Stmt::Site(id) in the returned program names — failure_sites()[id] answers what a
runtime failure at that site means. See crate::ast::stmt::FailureSite’s own doc comment
for why a single “current site” is enough, with no call stack, to answer “where did this
trap happen”.
pub fn set_discourse_event_var(&mut self, var: Symbol)
Sourcepub fn drs_mut(&mut self) -> &mut Drs
pub fn drs_mut(&mut self) -> &mut Drs
Get mutable reference to the active DRS (from WorldState).
Sourcepub fn swap_drs_with_world_state(&mut self)
pub fn swap_drs_with_world_state(&mut self)
Swap DRS between Parser and WorldState. Call at start of parsing to get the accumulated DRS from WorldState. Call at end of parsing to save the updated DRS back to WorldState.
Sourcepub fn has_world_state(&self) -> bool
pub fn has_world_state(&self) -> bool
WorldState is always present (no “single sentence mode”)
pub fn mode(&self) -> ParserMode
Sourcepub fn is_known_type(&self, sym: Symbol) -> bool
pub fn is_known_type(&self, sym: Symbol) -> bool
Check if a symbol is a known type in the registry. Used to disambiguate “Stack of Integers” (generic type) vs “Owner of House” (possessive).
Sourcepub fn is_generic_type(&self, sym: Symbol) -> bool
pub fn is_generic_type(&self, sym: Symbol) -> bool
Check if a symbol is a known generic type (takes type parameters). Used to parse “Stack of Integers” as generic instantiation.
pub fn process_block_headers(&mut self)
pub fn get_event_var(&mut self) -> Symbol
pub fn capture_event_template( &mut self, verb: Symbol, roles: &[(ThematicRole, Term<'a>)], modifiers: &[Symbol], )
pub fn set_pp_attachment_mode(&mut self, attach_to_noun: bool)
pub fn set_noun_priority_mode(&mut self, mode: bool)
pub fn set_collective_mode(&mut self, mode: bool)
Sourcepub fn set_distributive_marker(&mut self, on: bool)
pub fn set_distributive_marker(&mut self, on: bool)
Force the distributive (per-member) reading of mixed verbs with definite plurals — the readings enumerator’s counterpart to the default collective reading.
Sourcepub fn set_pragmatic_mode(&mut self, on: bool)
pub fn set_pragmatic_mode(&mut self, on: bool)
Enable pragmatic enrichment (scalar implicatures, degree standards) for whole-program parses — the defeasible theorem door needs the implicature channel that the literal parse omits.
pub fn set_event_reading_mode(&mut self, mode: bool)
pub fn set_negative_scope_mode(&mut self, mode: NegativeScopeMode)
pub fn set_modal_preference(&mut self, pref: ModalPreference)
pub fn guard(&mut self) -> ParserGuard<'_, 'a, 'ctx, 'int>
Sourcepub fn parse(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
pub fn parse(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Parses the token stream into a logical expression.
This is the main entry point for declarative/FOL parsing. It handles multi-sentence inputs by conjoining them with logical AND, and processes various sentence types including declaratives, questions, and imperatives.
§Returns
An arena-allocated LogicExpr representing the parsed input, or
a ParseError with source location and Socratic explanation.
§Discourse State
The parser maintains discourse state across sentences, enabling anaphora resolution (“he”, “she”, “they” refer to prior entities) and temporal coherence (tense interpretation relative to reference time).
Sourcepub fn parse_pragmatic(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
pub fn parse_pragmatic(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Parses with pragmatic enrichment: the truth-conditional parse PLUS scalar
implicature (§8.7). The literal parse() is unchanged; here a leading weak
scalar “some” is strengthened to ∃… +> ¬∀…. Used by the pragmatic compile
path so the implicature appears as a separate labeled component.
Sourcepub fn views(&self) -> &[ViewDef<'a>]
pub fn views(&self) -> &[ViewDef<'a>]
Parses a LOGOS program into a list of statements.
This is the main entry point for imperative/executable LOGOS code. It handles block structures (Definition, Policy, Procedure, Theorem), function definitions, type definitions, and executable statements.
§Returns
A vector of arena-allocated Stmt representing the program, or
a ParseError with source location and Socratic explanation.
§Block Types
- Definition: Type definitions (structs, enums, generics)
- Policy: Security predicates and capability rules
- Procedure: Executable code blocks
- Theorem: Logical propositions with proof strategies
The view IR trees this parse built, in source order (see
viewsfield).
Sourcepub fn take_views(&mut self) -> Vec<ViewDef<'a>>
pub fn take_views(&mut self) -> Vec<ViewDef<'a>>
Move the view IR trees out of the parser (they borrow only the AST arenas, never the parser), so a caller can release the parser’s interner borrow and keep them.
Sourcepub fn into_type_registry(self) -> TypeRegistry
pub fn into_type_registry(self) -> TypeRegistry
The type registry as this parse left it: every type the discovery pass read off the tokens,
plus every record the parse itself declared — a ## Store’s record (lgx_lower::stores),
typed by the rule that builds it. An engine lays a record out from this registry, the one
that holds what the parse declared, and from no copy taken before the parse ran.
Sourcepub fn lgx_findings(&self) -> &[Finding]
pub fn lgx_findings(&self) -> &[Finding]
The template WARNINGS this parse collected, in source order — accessibility lint and anything else worth saying that must not stop a page from running. Errors never appear here: they stop the parse at the point they are found, which is what makes them errors.
Sourcepub fn value_copy_findings(&self) -> &[Finding]
pub fn value_copy_findings(&self) -> &[Finding]
The value-semantics copy lint’s own WARNINGS this parse collected, in source order — see
crate::lint.
pub fn parse_program(&mut self) -> Result<Vec<Stmt<'a>>, ParseError>
Sourcepub fn program_opt_flags(&self) -> OptimizationConfig
pub fn program_opt_flags(&self) -> OptimizationConfig
The program-wide optimization config from file-level ## No <X> decorators
(all-on minus the file-level disables). The compile entry combines this with
from_env and per-function flags.
Sourcepub fn program_tier_pins(&self) -> PinSet
pub fn program_tier_pins(&self) -> PinSet
The program-wide tiered-optimizer pins from file-level ## Tier <opt> <value>
decorators (HOTSWAP §8). The run-path engine overlays these onto the env
crate::optimization::HotswapConfig before optimizing.
Sourcepub fn required_optimizations(&self) -> Vec<Opt>
pub fn required_optimizations(&self) -> Vec<Opt>
Optimizations demanded via ## Require <opt> — each must have fired for
the compile, or it fails. Read after parse_program.
Trait Implementations§
Source§impl<'a, 'ctx, 'int> ClauseParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> ClauseParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
Source§fn is_reduced_relative_verb(&self, vp: usize) -> bool
fn is_reduced_relative_verb(&self, vp: usize) -> bool
True when the verb at vp heads a reduced object relative — i.e. it is the
finite verb of a relativizer-dropped clause modifying a preceding noun head,
not a main-clause verb. The relative’s overt subject (a ProperName or
Pronoun) sits at vp - 1, and the relativized head is the determiner-headed
common noun that immediately precedes that subject (“the friend [Simon] went”,
“the waterfall [Derrick] photographed”). The determiner requirement is what
distinguishes this from a true main clause whose initial word is a subject
(“Set A has …” — “A” has no determiner-headed noun before it).
Source§fn try_parse_fronted_temporal_adjunct(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_fronted_temporal_adjunct( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
A sentence-initial temporal NP that FRAMES the clause rather than serving as
its subject: “Every year Simon takes a holiday” → HAB over the whole clause.
Fires only for “Every/All
Source§fn parse_either_or(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_either_or(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Parse “Either NP1 or NP2 is/are PRED” or “Either S1 or S2”
Handles coordination: “Either Alice or Bob is guilty” should become guilty(Alice) ∨ guilty(Bob), not Alice ∨ guilty(Bob)
Source§fn parse_gapped_clause(
&mut self,
borrowed_verb: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_gapped_clause( &mut self, borrowed_verb: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Phase 46: Generalized gapping with template-guided reconstruction. Handles NPs, PPs, temporal adverbs, and preserves roles from EventTemplate.
Source§fn parse_disjunction(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_disjunction(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Parse disjunction (Or/Iff) - lowest precedence logical connectives. Calls parse_conjunction for operands to ensure And binds tighter.
Source§fn extract_copular_subject(&self, expr: &'a LogicExpr<'a>) -> Option<Symbol>
fn extract_copular_subject(&self, expr: &'a LogicExpr<'a>) -> Option<Symbol>
Parse conjunction (And) - higher precedence than Or.
Calls parse_atom for operands.
Extracts the subject of a copular predication (the first Constant argument
of a copular Predicate), digging through degree/aspect/boolean wrappers.
Returns None for event predications (NeoEvent) and variable subjects, so
only true copular clauses (“X is ADJ/NP”) trigger predicate coordination.
Source§fn try_parse_copular_predicate(
&mut self,
subject: Symbol,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_copular_predicate( &mut self, subject: Symbol, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
Parses a bare copular-predicate remnant — an adjective (“wealthy”) or a
predicate nominal (“a philanthropist”) — as Predicate(subject). Returns
None (consuming nothing) if the next tokens are not such a remnant.
Source§fn try_parse_imperative(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_imperative( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
None (restoring position) when the input
is not verb-initial / not a hortative or negative command.Source§fn clause_has_later_finite_verb(&self, from: usize) -> bool
fn clause_has_later_finite_verb(&self, from: usize) -> bool
from, before the clause terminator. Used to distinguish an imperative
(command verb is the only finite verb) from a declarative whose initial word
is a subject (“Set A has cardinality 5.”).Source§fn try_parse_cleft(&mut self) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_cleft(&mut self) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
None (restoring position) otherwise.Source§fn try_parse_exclamative(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_exclamative( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
None otherwise.Source§fn try_parse_optative(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_optative( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
None (restoring position) otherwise.Source§fn try_parse_correlative(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_correlative( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
None otherwise.Source§fn try_parse_inverted_conditional(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_inverted_conditional( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
Should-fronting. None otherwise.Source§fn parse_sentence(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_sentence(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
AstTooDeep
instead of a parser stack overflow. The body lives in parse_sentence_inner.Source§fn parse_sentence_inner(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_sentence_inner(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Self::parse_sentence; call the guarded wrapper, never this.Source§fn check_wh_word(&self) -> bool
fn check_wh_word(&self) -> bool
Source§fn parse_conditional(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_conditional(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn is_counterfactual_context(&self) -> bool
fn is_counterfactual_context(&self) -> bool
Source§fn parse_counterfactual_antecedent(
&mut self,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_counterfactual_antecedent( &mut self, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_counterfactual_consequent(
&mut self,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_counterfactual_consequent( &mut self, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn extract_verb_from_expr(&self, expr: &LogicExpr<'a>) -> Option<Symbol>
fn extract_verb_from_expr(&self, expr: &LogicExpr<'a>) -> Option<Symbol>
Source§fn is_complete_clause(&self, expr: &LogicExpr<'a>) -> bool
fn is_complete_clause(&self, expr: &LogicExpr<'a>) -> bool
Source§fn parse_conjunction(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_conjunction(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_relative_clause(
&mut self,
gap_var: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_relative_clause( &mut self, gap_var: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn check_ellipsis_auxiliary(&self) -> bool
fn check_ellipsis_auxiliary(&self) -> bool
Source§fn check_ellipsis_terminator(&self) -> bool
fn check_ellipsis_terminator(&self) -> bool
Source§fn try_parse_ellipsis(
&mut self,
) -> Option<Result<&'a LogicExpr<'a>, ParseError>>
fn try_parse_ellipsis( &mut self, ) -> Option<Result<&'a LogicExpr<'a>, ParseError>>
Source§fn try_parse_of_pair_xor(
&mut self,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_of_pair_xor( &mut self, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
None otherwise.Source§impl<'a, 'ctx, 'int> LogicVerbParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> LogicVerbParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
Source§fn build_group_predicate(
&mut self,
subjects: &[Symbol],
verb: Symbol,
verb_time: Time,
) -> &'a LogicExpr<'a>
fn build_group_predicate( &mut self, subjects: &[Symbol], verb: Symbol, verb_time: Time, ) -> &'a LogicExpr<'a>
Build a group predicate for intransitive verbs
Source§fn build_group_transitive(
&mut self,
subjects: &[Symbol],
objects: &[Symbol],
verb: Symbol,
verb_time: Time,
) -> &'a LogicExpr<'a>
fn build_group_transitive( &mut self, subjects: &[Symbol], objects: &[Symbol], verb: Symbol, verb_time: Time, ) -> &'a LogicExpr<'a>
Build a transitive predicate with group subject and group object
Source§fn parse_predicate_with_subject(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_predicate_with_subject( &mut self, subject_symbol: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_predicate_with_subject_as_var(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_predicate_with_subject_as_var( &mut self, subject_symbol: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn try_parse_plural_subject(
&mut self,
first_subject: &NounPhrase<'a>,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_plural_subject( &mut self, first_subject: &NounPhrase<'a>, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
Ok(Some(expr)) on success, Ok(None) if not plural, Err on semantic error.Source§fn parse_control_structure(
&mut self,
subject: &NounPhrase<'a>,
verb: Symbol,
verb_time: Time,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_control_structure( &mut self, subject: &NounPhrase<'a>, verb: Symbol, verb_time: Time, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn is_control_verb(&self, verb: Symbol) -> bool
fn is_control_verb(&self, verb: Symbol) -> bool
Source§impl<'a, 'ctx, 'int> ModalParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> ModalParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
Source§fn parse_modal(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_modal(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_aspect_chain(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_aspect_chain( &mut self, subject_symbol: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_aspect_chain_with_term(
&mut self,
subject_term: Term<'a>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_aspect_chain_with_term( &mut self, subject_term: Term<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn token_to_vector(&self, token: &TokenType) -> ModalVector
fn token_to_vector(&self, token: &TokenType) -> ModalVector
Source§impl<'a, 'ctx, 'int> NounParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> NounParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
Source§fn peek_reduced_object_relative(&self) -> bool
fn peek_reduced_object_relative(&self) -> bool
Whether the cursor is at the SUBJECT of an active object-gap reduced relative (“the prize | Tara won”, cursor at “Tara”). The PROPER, deterministic test (no trial-parse): a proper-name / pronoun subject, then a TRANSITIVE verb (only a transitive verb has an object slot for the head to fill — an intransitive “the dancer Tara performed” is apposition, not a relative), then an EMPTY object slot — the token after the verb does NOT start a direct object (an overt object “the dancer Tara won THE PRIZE” is apposition, not a gap). The caller additionally requires a determiner-headed NP.
Source§fn parse_noun_phrase(
&mut self,
greedy: bool,
) -> Result<NounPhrase<'a>, ParseError>
fn parse_noun_phrase( &mut self, greedy: bool, ) -> Result<NounPhrase<'a>, ParseError>
Source§fn parse_noun_phrase_for_relative(
&mut self,
) -> Result<NounPhrase<'a>, ParseError>
fn parse_noun_phrase_for_relative( &mut self, ) -> Result<NounPhrase<'a>, ParseError>
Source§fn noun_phrase_to_term(&self, np: &NounPhrase<'a>) -> Term<'a>
fn noun_phrase_to_term(&self, np: &NounPhrase<'a>) -> Term<'a>
Source§fn numeric_label_head(
&mut self,
n: i64,
head: Symbol,
definiteness: Option<Definiteness>,
measure_restrictors: &mut Vec<&'a LogicExpr<'a>>,
) -> Symbol
fn numeric_label_head( &mut self, n: i64, head: Symbol, definiteness: Option<Definiteness>, measure_restrictors: &mut Vec<&'a LogicExpr<'a>>, ) -> Symbol
2003_holiday) by default, but UN-FUSED to the
bare head plus a category relation restrictor (pushed onto
measure_restrictors) when n names a DRS-declared item whose category
maps to a preposition.Source§fn consume_label_head_noun_first(&mut self) -> Result<Symbol, ParseError>
fn consume_label_head_noun_first(&mut self) -> Result<Symbol, ParseError>
2001_trip, not the verb lemma 2001_Trip). A verb-only head (“stamp”)
has no noun reading and keeps its lemma; a plain noun (“holiday”) is already
the noun. (The un-fused predicate is capitalized downstream regardless.)Source§fn check_possessive(&self) -> bool
fn check_possessive(&self) -> bool
Source§fn peek_definite_reduced_relative_object(&self) -> bool
fn peek_definite_reduced_relative_object(&self) -> bool
parse_noun_phrase machinery instead
of pre-consuming the article (which would hide the relative).Source§fn check_of_preposition(&self) -> bool
fn check_of_preposition(&self) -> bool
Source§fn check_proper_name_or_label(&self) -> bool
fn check_proper_name_or_label(&self) -> bool
Source§fn is_proper_name_or_label(&self, kind: &TokenType) -> bool
fn is_proper_name_or_label(&self, kind: &TokenType) -> bool
Source§fn check_possessive_pronoun(&self) -> bool
fn check_possessive_pronoun(&self) -> bool
Source§impl<'a, 'ctx, 'int> PragmaticsParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> PragmaticsParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
Source§fn parse_equative(
&mut self,
subject: &NounPhrase<'a>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_equative( &mut self, subject: &NounPhrase<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
Parses the equative frame “X is as ADJ as Y” → an at-least (≥) degree
comparison. The parser is positioned at the first “as”; the subject’s
definiteness wrapping is applied by the caller.
Source§fn parse_focus(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_focus(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_measure(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_measure(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_presupposition(
&mut self,
subject: &NounPhrase<'a>,
presup_kind: PresupKind,
negated: bool,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_presupposition( &mut self, subject: &NounPhrase<'a>, presup_kind: PresupKind, negated: bool, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_presupposition_for_term(
&mut self,
subject_term: Term<'a>,
presup_kind: PresupKind,
negated: bool,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_presupposition_for_term( &mut self, subject_term: Term<'a>, presup_kind: PresupKind, negated: bool, ) -> Result<&'a LogicExpr<'a>, ParseError>
Self::parse_presupposition — the subject is a
TERM (constant or a relativized variable) so the same presupposition
grammar composes over a relative-clause subject (“the person who won
started skydiving 2 years after …”).Source§fn parse_predicate_for_subject(
&mut self,
subject: &NounPhrase<'a>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_predicate_for_subject( &mut self, subject: &NounPhrase<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_scopal_adverb(
&mut self,
subject: &NounPhrase<'a>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_scopal_adverb( &mut self, subject: &NounPhrase<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_superlative(
&mut self,
subject: &NounPhrase<'a>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_superlative( &mut self, subject: &NounPhrase<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_comparative(
&mut self,
subject: &NounPhrase<'a>,
_copula_time: Time,
difference: Option<&'a Term<'a>>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_comparative( &mut self, subject: &NounPhrase<'a>, _copula_time: Time, difference: Option<&'a Term<'a>>, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn check_number(&self) -> bool
fn check_number(&self) -> bool
Source§fn parse_measure_phrase(&mut self) -> Result<&'a Term<'a>, ParseError>
fn parse_measure_phrase(&mut self) -> Result<&'a Term<'a>, ParseError>
Source§impl<'a, 'ctx, 'int> QuantifierParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
impl<'a, 'ctx, 'int> QuantifierParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>
Source§fn adjective_restriction(
&mut self,
adj: Symbol,
var: Symbol,
noun: Symbol,
) -> &'a LogicExpr<'a>
fn adjective_restriction( &mut self, adj: Symbol, var: Symbol, noun: Symbol, ) -> &'a LogicExpr<'a>
Build the restriction conjunct contributed by a pre-nominal adjective, dispatching on the adjective’s lexical class. This is the single shared site every NP-restriction path routes through, so the four classes are modeled identically everywhere (universal, indefinite, definite, copular):
- Relational / pertainymic (lexicon
relational): predicate of a kind by default —Rel(x, ^Base)(no ∃) — or, atlevel: Instance, an existential over a base-noun individual —∃y(Base(y) ∧ Rel(x, y)). (McNally & Boleda 2004.) - Subsective:
Adj(x, ^Noun)— graded against the head-noun kind. - Intersective / other (incl. NonIntersective, whose privative
meaning is supplied later by the axiom layer): flat
Adj(x).
Source§fn parse_copula_pp_complement(
&mut self,
subj_var: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_copula_pp_complement( &mut self, subj_var: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
subj_var being the bound
variable. Captures the or-coordination (“or in B” repeats the preposition,
“or B” reuses it) that the backtracking fallback path otherwise drops.Source§fn parse_quantified(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_quantified(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_quantified_core(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_quantified_core(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>
parse_quantified wraps its result with any pending
partitive-superset presupposition (§5.3).Source§fn parse_restriction(
&mut self,
var_name: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_restriction( &mut self, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn parse_verb_phrase_for_restriction(
&mut self,
var_name: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_verb_phrase_for_restriction( &mut self, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn combine_with_and(
&self,
exprs: Vec<&'a LogicExpr<'a>>,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn combine_with_and( &self, exprs: Vec<&'a LogicExpr<'a>>, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn wrap_with_definiteness_full( &mut self, np: &NounPhrase<'a>, predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn wrap_with_definiteness( &mut self, definiteness: Option<Definiteness>, noun: Symbol, predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn wrap_with_definiteness_and_adjectives( &mut self, definiteness: Option<Definiteness>, noun: Symbol, adjectives: &[Symbol], predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn wrap_with_definiteness_and_adjectives_and_pps( &mut self, definiteness: Option<Definiteness>, noun: Symbol, adjectives: &[Symbol], pps: &[&'a LogicExpr<'a>], predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn wrap_with_definiteness_for_object( &mut self, definiteness: Option<Definiteness>, noun: Symbol, predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn substitute_pp_placeholder( &mut self, pp: &'a LogicExpr<'a>, var: Symbol, ) -> &'a LogicExpr<'a>
fn substitute_constant_with_var( &self, expr: &'a LogicExpr<'a>, constant_name: Symbol, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
fn substitute_constant_with_var_sym( &self, expr: &'a LogicExpr<'a>, constant_name: Symbol, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Source§fn substitute_variable_with_constant(
&self,
expr: &'a LogicExpr<'a>,
from_var: Symbol,
to_const: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn substitute_variable_with_constant( &self, expr: &'a LogicExpr<'a>, from_var: Symbol, to_const: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
from_var) can be folded into a
predicate keyed on to_const and then re-bound uniformly by
wrap_with_definiteness.