unicode_fol_kit.parse_latex¶
- unicode_fol_kit.parse_latex(text, many_sorted=False, fuzzy=False, modal=False, second_order=False)[source]¶
Parse a LaTeX math-mode formula into an AST node.
Translates
textto the toolkit’s Unicode surface syntax withlatex_to_unicode(), then parses it withMSFLParserin the selected mode. The mode flags are passed straight through.The Unicode surface syntax produced by the translation must be valid for the chosen mode: e.g. modal operators require
modal=True, sort annotations requiremany_sorted=True, and Łukasiewicz strong connectives (⊗ ⊕) requirefuzzy=True. Mismatched flags surface as the parser’s usual NamingError / ParsingError.- Parameters:
text (str) – a LaTeX math-mode formula (no surrounding
$…$needed).many_sorted (bool) – parse in MSFOL/MSFL mode (sorted quantifiers/constants).
fuzzy (bool) – parse with Łukasiewicz operators.
modal (bool) – parse classical unsorted FOL plus modal/temporal/deontic operators.
second_order (bool) – parse classical unsorted FOL plus second-order quantifiers.
- Returns:
The parsed AST
Node.- Return type: