Skip to main content

QuantifierParsing

Trait QuantifierParsing 

Source
pub trait QuantifierParsing<'a, 'ctx, 'int> {
Show 20 methods // Required methods fn parse_quantified(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>; fn parse_quantified_core(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>; fn parse_restriction( &mut self, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>; fn adjective_restriction( &mut self, adj: Symbol, var: Symbol, noun: Symbol, ) -> &'a LogicExpr<'a>; fn parse_verb_phrase_for_restriction( &mut self, var_name: Symbol, ) -> 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>; fn substitute_constant_with_sigma( &self, expr: &'a LogicExpr<'a>, constant_name: Symbol, sigma_term: Term<'a>, ) -> 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>; fn find_main_verb_name(&self, expr: &LogicExpr<'a>) -> Option<Symbol>; fn transform_cardinal_to_group( &mut self, expr: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>; fn build_verb_neo_event( &mut self, verb: Symbol, subject_var: Symbol, object: Option<Term<'a>>, modifiers: Vec<Symbol>, ) -> &'a LogicExpr<'a>; fn parse_copula_pp_complement( &mut self, subj_var: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>;
}
Expand description

Trait for parsing quantified expressions and managing scope.

Provides methods for parsing quantifiers (every, some, no, most), their restrictions, and wrapping expressions with appropriate scope.

Required Methods§

Source

fn parse_quantified(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>

Parses a quantified expression from a quantifier determiner.

Source

fn parse_quantified_core(&mut self) -> Result<&'a LogicExpr<'a>, ParseError>

The quantifier-parsing body; 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>

Parses the restrictor clause for a quantifier.

Source

fn adjective_restriction( &mut self, adj: Symbol, var: Symbol, noun: Symbol, ) -> &'a LogicExpr<'a>

Builds the restriction conjunct for one pre-nominal adjective, dispatching on its lexical class (relational/subsective/intersective). Shared by every NP-restriction path so all paths model adjective classes identically.

Source

fn parse_verb_phrase_for_restriction( &mut self, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>

Parses a verb phrase as the nuclear scope of a quantifier.

Source

fn combine_with_and( &self, exprs: Vec<&'a LogicExpr<'a>>, ) -> Result<&'a LogicExpr<'a>, ParseError>

Combines multiple expressions with conjunction.

Source

fn wrap_with_definiteness_full( &mut self, np: &NounPhrase<'a>, predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>

Source

fn wrap_with_definiteness( &mut self, definiteness: Option<Definiteness>, noun: Symbol, predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>

Source

fn wrap_with_definiteness_and_adjectives( &mut self, definiteness: Option<Definiteness>, noun: Symbol, adjectives: &[Symbol], predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>

Source

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>

Source

fn wrap_with_definiteness_for_object( &mut self, definiteness: Option<Definiteness>, noun: Symbol, predicate: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>

Source

fn substitute_pp_placeholder( &mut self, pp: &'a LogicExpr<'a>, var: Symbol, ) -> &'a LogicExpr<'a>

Source

fn substitute_constant_with_var( &self, expr: &'a LogicExpr<'a>, constant_name: Symbol, var_name: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>

Source

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_constant_with_sigma( &self, expr: &'a LogicExpr<'a>, constant_name: Symbol, sigma_term: Term<'a>, ) -> 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>

Rewrite a relativized gap variable into a constant, so a subject’s relative-clause restriction (built over from_var) can be folded into a predicate keyed on to_const and then re-bound uniformly by wrap_with_definiteness.

Source

fn find_main_verb_name(&self, expr: &LogicExpr<'a>) -> Option<Symbol>

Source

fn transform_cardinal_to_group( &mut self, expr: &'a LogicExpr<'a>, ) -> Result<&'a LogicExpr<'a>, ParseError>

Source

fn build_verb_neo_event( &mut self, verb: Symbol, subject_var: Symbol, object: Option<Term<'a>>, modifiers: Vec<Symbol>, ) -> &'a LogicExpr<'a>

Source

fn parse_copula_pp_complement( &mut self, subj_var: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>

Parse a copula PP complement under a quantifier — “is in Florida or in Maine” → In(subj,Florida) ∨ In(subj,Maine), 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.

Implementors§

Source§

impl<'a, 'ctx, 'int> QuantifierParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>