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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Putra, Rizky Ramadhana, Basuki, Raihan Sultan Pasha, Cheng, Yutong, Gao, Peng
Format: Preprint
Publié: 2026
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866912904172797952
author Putra, Rizky Ramadhana
Basuki, Raihan Sultan Pasha
Cheng, Yutong
Gao, Peng
author_facet Putra, Rizky Ramadhana
Basuki, Raihan Sultan Pasha
Cheng, Yutong
Gao, Peng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2602_13237
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle NL2LOGIC: AST-Guided Translation of Natural Language into First-Order Logic with Large Language Models
Putra, Rizky Ramadhana
Basuki, Raihan Sultan Pasha
Cheng, Yutong
Gao, Peng
Artificial Intelligence
Computation and Language
I.2.3; I.2.7
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.
title NL2LOGIC: AST-Guided Translation of Natural Language into First-Order Logic with Large Language Models
topic Artificial Intelligence
Computation and Language
I.2.3; I.2.7
url https://arxiv.org/abs/2602.13237