FOL-Proof: Verifying LLM Text-to-Logic Translations via Deterministic Semantics
Organizations: The Hebrew University of Jerusalem, Jerusalem, Israel
Abstract
Large Language Models (LLMs) are increasingly used to translate natural-language statements into first-order logic (FOL) to improve reasoning. However, LLMs are prone to errors, and so a semantically unfaithful FOL formula could corrupt downstream reasoning. We present FOL-Proof, a semantic firewall pipeline that validates LLM-generated FOL translations against independently derived linguistic interpretations. FOL-Proof operates by deterministically obtaining a pool of candidate translations via semantic analysis tools, such as the English Resource Grammar and Minimal Recursion Semantics; then applying an SMT solver to check each derived reading for logical equivalence to the LLM-generated formula. If the translation is faithful it is accepted; otherwise, it is rejected, or optionally repaired via repeated invocations to the LLM. The procedure is conservative: incomplete search, unsupported constructions, or inconclusive checks yield abstention rather than false rejection. We evaluated FOL-Proof on established benchmarks (ProofWriter, RuleTaker and PrOntoQA), and also on a new adversarial benchmark (LongFaithCheck). Our experiments show that FOL-Proof attains near perfect selective accuracy, while direct LLM judges and round-trip baselines show substantially worse performance.
Figures & tables
| ProofWriter (25,881) | PrOntoQA (36,749) | LongFaithCheck (2,000) | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | Rec. | Spec. | Bal. | Rec. | Spec. | Bal. | Rec. | Spec. | Bal. |
| FOL-Proof | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 |
| Direct judge (Qwen) | 80.1 | 97.8 | 89.0 | 94.6 | 98.4 | 96.5 | 98.8 | 49.9 | 74.4 |
| Direct judge (majority) | 99.4 | 61.1 | 80.2 | 97.1 | 64.9 | 81.0 | 99.9 | 26.8 | 63.4 |
| Formal round-trip equiv. | 90.3 | 22.0 | 56.2 | 94.2 | 16.0 | 55.1 | 0.9 | 98.8 | 49.9 |
| Monty clausal cov. (Qwen) | 53.0 | 86.3 | 69.7 | 97.7 | 97.6 | 97.6 | 59.1 | 68.4 | 63.8 |
| Method | LongFaith. | PrOntoQA | RuleTaker | ProofWriter |
|---|---|---|---|---|
| FOL-Proof | 99.7 / 99.8 | 99.7 / 99.4 | 99.9 / 100.0 | 100.0 / 100.0 |
| Direct judge | 30.3 / 53.4 (P) | 76.0 / 73.4 (Q) | 60.6 / 61.0 (Q) | 69.7 / 65.1 (Q) |
| Formal round-trip equiv. | 78.3 / 58.3 (Q) | 82.4 / 72.2 (Q) | 65.9 / 70.4 (M) | 83.9 / 86.0 (Q) |
| Monty clausal cov. | 70.2 / 63.9 (Q) | 83.7 / 71.0 (Q) | 82.2 / 81.9 (P) | 83.0 / 83.3 (P) |
| ProofWriter | RuleTaker | PrOntoQA | ||||
|---|---|---|---|---|---|---|
| ( =20,058) | ( =19,021) | ( =9,000) | ||||
| Selection policy | Yield | Sel. | Yield | Sel. | Yield | Sel. |
| Best raw single model | 40.7 | 87.2 | 62.7 | 88.9 | 52.7 | 98.8 |
| First compilable | 76.5 | 85.2 | 85.3 | 88.4 | 51.1 | 98.6 |
| Cert. + raw fallback | 79.0 | 88.0 | 92.8 | 96.1 | 87.4 | 100.0 |
| FOL-Proof strict gating | 25.5 | 100.0 | 70.2 | 100.0 | 56.7 | 100.0 |
| Feedback shown | Outcome | |||||
|---|---|---|---|---|---|---|
| Arm | Diag. | Str. | Form. | CM | Cert. | Rate (%) |
| Try again | 24 | 4.8 | ||||
| Diagnostic only | ✓ | 114 | 22.8 | |||
| Components | ✓ | ✓ | 111 | 22.2 | ||
| Full, formulas/CM removed | ✓ | ✓ | 116 | 23.2 | ||
| Readings | ✓ | ✓ | ✓ | 313 | 62.6 | |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Profile | Extension to the compact ERG-to-FOL adapter |
|---|---|
| compact | Default compact fragment. |
| proofwriter_* | Controlled generic rules with aligned pronouns; the entities variant also maps simple definite noun phrases to constants and supports selected binary literals. |
| controlled_extended | Lemma-named verbs and controlled readings of only and not all . |
| soft_reasoner | Controlled rules and entities, including selected ground literals and extended operators. |
| nl_fol_pairs | Controlled rules with aligned pronouns and proper-name constants. |
| prontoqa | Exact ontology predicate fusions, numeral notation, and bare-plural subject genericity. |
| Benchmark | Additional conventions |
|---|---|
| ProofWriter | Proper names and simple definite entities denote constants. Adjectives become unary predicates; relation verbs become ordered binary predicates named by their lemmas. In rules, someone / something and aligned they / it denote the same universally quantified variable. Preserve explicit negation and implication direction. |
| RuleTaker | Simple definite entities denote constants; “the bald eagle” denotes BaldEagle . Adjectives become unary predicates and relation verbs become ordered binary predicates named by their lemmas. In rules, something and aligned it denote the same universally quantified variable. Preserve explicit negation and implication direction. |
| PrOntoQA | Proper names denote constants. Statements about named or numeric individuals are ground facts. Every , Each , and bare-plural rule subjects introduce universal quantification. Copular class statements apply the complement predicate directly. Multiword classes become fused PascalCase predicates. A numeral denotes the opaque constant NumberN , without arithmetic interpretation. Do not add equality, functions, background knowledge, or unstated predicates. |
| LongFaithCheck | No benchmark-specific lexical conventions. Use capital-initial constants and lowercase bound variables; preserve predicates, argument direction, negation, connectives, quantifiers, and implication direction. |
| Arm | Feedback exposed |
|---|---|
| try_again | Rejection signal only. |
| diagnostic_only | Compact validator diagnostic. |
| components | Diagnostic, structural differences, and distance vectors for selected licensed readings. |
| readings | The components fields plus complete formulas for selected licensed readings. |
| full_no_reading_formulas | The same substantive fields as components : complete licensed-reading formulas and countermodels are removed from full-mode feedback. |
| full | The readings fields plus available countermodels. |
| ProofWriter (25,881) | PrOntoQA (36,749) | LongFaithCheck (2,000) | |||||||
| Method | Rec. | Spec. | Bal. | Rec. | Spec. | Bal. | Rec. | Spec. | Bal. |
| FOL-Proof | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 |
| Direct judge (maj.) | 99.42 | 61.06 | 80.24 | 97.08 | 64.89 | 80.98 | 99.90 | 26.80 | 63.35 |
| Direct judge (Q) | 80.15 | 97.83 | 88.99 | 94.62 | 98.43 | 96.53 | 98.80 | 49.90 | 74.35 |
| Direct judge (P) | 100.00 | 53.92 | 76.96 | 98.82 | 41.94 | 70.38 | 98.90 | 29.30 | 64.10 |
| Direct judge (M) | 96.70 | 41.93 | 69.31 | 83.07 | 60.53 | 71.80 | 100.00 | 5.00 | 52.50 |
| Family | Model | Acc. | Bal. | Cov. | Accept rec. | Reject spec. | FA | FR |
|---|---|---|---|---|---|---|---|---|
| FOL-Proof | — | 99.67 | 99.78 | 100.00 | 100.00 | 99.57 | 10 | 0 |
| Always reject | — | 76.93 | 50.00 | 100.00 | 0.00 | 100.00 | 0 | 692 |
| Direct judge | Qwen | 41.90 | 45.29 | 100.00 | 51.59 | 38.99 | 1,408 | 335 |
| Direct judge | Mistral | 26.23 | 51.30 | 100.00 | 97.83 | 4.77 | 2,198 | 15 |
| Direct judge | Phi | 30.27 | 53.36 | 99.43 | 96.24 | 10.49 | 2,052 | 23 |
| Bidirectional NLI | Qwen | 75.00 | 63.16 | 100.00 | 41.18 | 85.14 | 343 | 407 |
| Method | PrOntoQA | RuleTaker | ProofWriter | LongFaith. |
|---|---|---|---|---|
| FOL-Proof | 99.67/99.37/100.00 | 99.92/100.00/99.92 | 100.00/100.00/100.00 | 99.67/99.78/100.00 |
| Always reject | 26.38/50.00/100.00 | 27.32/50.00/100.00 | 33.88/50.00/100.00 | 76.93/50.00/100.00 |
| Direct judges | ||||
| Direct judge (maj.) | 77.46/62.32/99.84 | 73.82/53.45/99.93 | 73.88/61.74/99.99 | 29.13/52.22/99.70 |
| Direct judge (Q) | 75.97/73.43/100.00 | 60.64/60.96/100.00 | 69.72/65.07/100.00 | 41.90/45.29/100.00 |
| Direct judge (P) | 76.69/56.35/99.27 | 73.75/51.97/99.85 | 70.96/57.19/99.78 | 30.27/53.36/99.43 |
| ProofWriter | RuleTaker | PrOntoQA | ||||
|---|---|---|---|---|---|---|
| Method | Cov. | Sel. | Cov. | Sel. | Cov. | Sel. |
| Raw Phi-3.5 | 46.68 | 87.20 | 70.49 | 88.92 | 37.37 | 98.42 |
| Raw Qwen2.5-7B | 23.57 | 76.86 | 23.69 | 84.87 | 27.83 | 99.68 |
| Raw Mistral-7B | 8.64 | 77.80 | 23.16 | 91.03 | 53.37 | 98.79 |
| First compilable | 89.78 | 85.17 | 96.49 | 88.44 | 51.88 | 98.59 |
| Cert. + raw fallback | 89.78 | 88.02 | 96.60 | 96.09 | 87.39 | 100.0 |
| Benchmark | Comparison | Common | Wins | Losses |
|---|---|---|---|---|
| ProofWriter | Strict vs. unguided | 5,116 | 372 | 0 |
| RuleTaker | Strict vs. unguided | 13,333 | 1,287 | 0 |
| RuleTaker | Cert. + fallback vs. unguided | 18,354 | 1,700 | 297 |
| PrOntoQA | Strict vs. unguided | 3,149 | 50 | 0 |