about
AST-Guided Translation of Natural Language into First-Order Logic with LLMs (arxiv.org)
2 points by PaulHoule 221 days ago | hide | past | pdf | discuss on HN

In plain words: It turns a sentence into a tree-shaped blueprint of its logic structure, then writes valid first-order logic code from it so a solver can check claims against facts. Nearly all outputs are valid syntax, and semantic correctness rises up to 30% over prior translators.

Abstract · NL2LOGIC: AST-Guided Translation of Natural Language into First-Order Logic with Large Language Models

Automated reasoning is critical in domains such as law and governance, where verifying claims against facts in documents requires both accuracy and interpretability. Recent work adopts structured reasoning pipelines that translate natural language into first-order logic and delegate inference to automated solvers. With the rise of large language models, approaches such as GCD and CODE4LOGIC leverage their reasoning and code generation capabilities to improve logic parsing. However, these methods suffer from fragile syntax control due to weak enforcement of global grammar constraints and low semantic faithfulness caused by insufficient clause-level semantic understanding. We propose NL2LOGIC, a first-order logic translation framework that introduces an abstract syntax tree as an intermediate representation. NL2LOGIC combines a recursive large language model based semantic parser with an abstract syntax tree guided generator that deterministically produces solver-ready logic code. Experiments on the FOLIO, LogicNLI, and ProofWriter benchmarks show that NL2LOGIC achieves 99 percent syntactic accuracy and improves semantic correctness by up to 30 percent over state-of-the-art baselines. Furthermore, integrating NL2LOGIC into Logic-LM yields near-perfect executability and improves downstream reasoning accuracy by 31 percent compared to Logic-LM's original few-shot unconstrained translation module.

Rizky Ramadhana Putra, Raihan Sultan Pasha Basuki, Yutong Cheng, Peng Gao
arXiv:2602.13237 · cs.AI, cs.CL · submitted Jan 29, 2026
abstract · pdf · html · Accepted to Findings of EACL 2026. 17 pages, 6 figures

add comment on HN