unicode-fol-kit¶
A Python toolkit for first-order logic with Unicode operators — parse, transform, and reason about formulas — with a reasoning layer that reaches well beyond classical FOL into modal, temporal, many-valued, fuzzy, intuitionistic, second-order, description, and a range of non-classical logics.
from unicode_fol_kit import MSFLParser, is_valid
phi = MSFLParser().parse("∀x (Human(x) → Mortal(x)) ∧ Human(socrates) → Mortal(socrates)")
print(is_valid(phi)) # True
One parser class (MSFLParser) feeds a full reasoning stack: four proof methods (a
built-in resolution prover, Fitch natural deduction with checker and searcher, the
Gentzen sequent calculi LK/LJ, and analytic tableaux), a finite model finder,
SMT (Z3) and external-prover (Prover9/Vampire) backends, truth tables, and dedicated
semantics for every logic. Formulas import/export to TPTP, Prover9, SMT-LIB, LaTeX,
and JSON.
Where to start¶
New here? Read Installation then Quickstart.
Looking for a specific capability? The Choosing a tool page maps a question (and a logic) to the entry point that answers it.
Want the exact signature of a function? See the API reference reference.
Guide
- Installation
- Quickstart
- The one import you always start with
- Parse and check validity
- Satisfiability and reading out a model
- Prove an entailment without any external solver
- Find a finite first-order model
- Finding counterexamples
- Read a formula back as English
- Round-trip to Unicode and LaTeX
- Working with propositional operators and precedence
- An end-to-end vignette
- One non-classical taster: modal validity
- Another taster: a three-valued truth table
- Formula normalization and transformation
- Extracting formula information
- When parsing fails
- Next steps
- Choosing a tool
- Parsing and the AST
- Transforming & exporting formulas
- Classical FOL / MSFOL reasoning
- Built-in resolution prover
- Satisfiability, validity, and models (Z3)
- Equivalence checking (Z3)
- External provers (Prover9 / Vampire)
- Natural deduction (Fitch proofs)
- Finding Fitch proofs (backtracking search)
- Sequent calculus (Gentzen LK, incl. second-order)
- Sequent calculus — intuitionistic LJ
- Analytic tableaux
- Finite model finder
- Truth tables (propositional)
- Modal, temporal, epistemic & deontic logic
- Quantified Modal Logic
- Higher-order proving: Isabelle / THF exporters
- What the exporters emit (and what they cannot decide)
- Classical FOL:
to_thf_fol/to_isabelle_fol - Many-sorted FOL:
to_thf_msfol/to_isabelle_msfol - Second-order:
to_thf_so/to_isabelle_so - The full modal family:
to_thf_modal_full/to_isabelle_modal - A sample emitted Isabelle theory
- Intuitionistic logic: the GMT translation
- Three-valued K3 / LP (bonus exporters)
- Actually running it: the Isabelle runner
- Deep and shallow embeddings with faithfulness proofs
- Many-valued logic
- Fuzzy (Łukasiewicz / BL) logic
- Intuitionistic logic
- Second-order logic
- Description logic ALC
- Hybrid logic H(@) — naming worlds
- Relevant logic
- Dependence logic and IF logic (team semantics)
- Substructural logics: linear and Lambek
- Further Non-Classical Logics
- Natural-language translation targets
- Syntax reference
Reference