arXiv:2611.01825cs.FLNov 2026

Manuscript Offprint

arXiv:2611.01825

The Scope Grammar of Natural-Language Rules: Counting and Enumerating Readings modulo Logical Equivalence

Sherzod Turaev, Mary John

Abstract

Automated reasoning can certify a rule only once that rule has been written in logic, yet the rules for which such certification is now wanted, from authorization and business policies to clinical eligibility criteria and academic regulations, exist first as text written for people. Such a text fixes which atomic conditions and which connectives occur, but it leaves open how those connectives are bracketed, and each bracketing is a different logical reading that an autoformalizer must either resolve or expose. We investigate the combinatorial object behind this choice, the scope grammar, a small and deliberately ambiguous context-free grammar whose derivation trees are the readings of a connective skeleton and whose quotient by logical equivalence is what matters downstream. A connective skeleton with kk binary connectives and no negation has CkC_k derivation trees, the kk-th Catalan number, but far fewer logically distinct readings, because associativity and the laws of the Boolean algebra identify many of the trees. For the positive fragment, repetition-free and negation-free, we make the gap exact: a reading computes a read-once function, and the uniqueness of the read-once normal form lets us characterize the realizable normal forms by the labels of lowest common ancestors and count them with a two-label recurrence over the operator word, which we verify against exhaustive enumeration for every pattern up to eleven atoms. The count is invariant under reversal and under the ∧/∨\wedge/\vee duality, and is therefore a function of the composition of operator runs. We prove that a positive skeleton is logically ambiguous if and only if it uses both ∧\wedge and ∨\vee, a one-pass test, and that the number of reading classes is at least 2⌊n/3⌋2^{\lfloor n/3 \rfloor} on nn atoms. For every pattern up to fifteen atoms the maximally alternating pattern is the worst case, and we determine its class count exactly: its generating function is algebraic of degree three, the count is the 3-Schröder sequence (OEIS A137842), and its growth base is φ5/2=(11+55)/2≈3.330\varphi^{5/2} = \sqrt{(11 + 5\sqrt{5})/2} \approx 3.330, the five-halves power of the golden ratio and strictly below the Catalan base 4. The maximality itself we reduce to an inequality on increments, verified to sixteen atoms, and we explain why local exchange arguments cannot establish it. We then treat negation, exceptions, and background hyponymy axioms, where normal-form uniqueness still decides equivalence though the counting law does not transfer, and we locate the work among the ambiguity of context-free grammars, read-once and series-parallel enumeration, and the underspecification of quantifier scope in computational semantics.

Keywords scope ambiguity · context-free grammar ambiguity · read-once Boolean functions · Catalan numbers · Schröder numbers · autoformalization · enumeration

*Corresponding author: sherzod@uaeu.ac.ae. ORCID 0000-0001-6661-8469. †ORCID 0000-0001-8797-8471.

1 Introduction

Automated reasoning can give guarantees about a rule only once that rule has been written in logic, and in the settings where such guarantees are now wanted, from authorization and business policies to clinical eligibility criteria and academic regulations, the rules exist first as text that people wrote for other people. Translating them is the task of autoformalization, which large language models now perform fluently [1, 2], and on which industrial systems have begun to depend, for example in the Automated Reasoning checks of Amazon Bedrock Guardrails.³ The value of every downstream proof is bounded by the fidelity of this translation, and a principal way fidelity fails is scope ambiguity: a sentence fixes which atomic conditions and which connectives occur, yet leaves open how the conjunctions, disjunctions, negations, and exceptions are bracketed, so that “no AA or BB within thirty days” has several logical readings that disagree about who is covered. A measurement study of this phenomenon, reported separately, finds that for roughly one clinical eligibility criterion in six a plausibility judge retains two or more grammar-generated readings as readings of the text [3].

It is therefore natural to separate a translation into a stage that commits to what the atoms and connectives are, which a language model does well, and a stage that enumerates how they may be bracketed, which a small context-free grammar can do exhaustively. The grammar in question,

E→E∧E∣E∨E∣E∧E∣¬E∣a,a∈A,E \to E \land E \mid E \lor E \mid E \land E \mid \neg E \mid a,\quad a \in A,

which we call the scope grammar, is ambiguous by design, and its derivation trees over a fixed sequence of atoms and connectives, the skeleton, are exactly the candidate readings. What matters downstream is not the trees themselves but their quotient by logical equivalence, because two bracketings that denote the same Boolean function are the same rule. Consider the skeleton a∧b∨c∧da \land b \lor c \land d: it has C3=5C_3 = 5 bracketings, but only four are logically distinct, because (a∧(b∨c))∧d(a \land (b \lor c)) \land d and a∧((b∨c)∧d)a \land ((b \lor c) \land d) are the same function by associativity of conjunction (Figure 1). The questions this raises are how many trees a skeleton admits, how many equivalence classes, which syntactic restrictions reduce the class count, and how cheaply the classes can be decided and enumerated.

We answer these questions for the positive fragment, repetition-free and negation-free, where a complete theory is available, and we treat negation and background axioms in part. The object sits at the meeting of three established lines of work, the ambiguity of context-free grammars, the theory of read-once Boolean functions, and the underspecification of scope in computational semantics, which we survey in Section 2. Though each of these lines illuminates a facet of the object, none of them counts the Boolean quotient of the bracketings of a single skeleton, which is precisely the quantity an autoformalizer must control. In the current research, we make the following contributions.

  1. We give a dynamic program that enumerates the reading classes directly over Boolean functions, under span-local admissibility constraints, with a correctness proof and a complexity bound (Sections 5 and 6).

  2. For a positive skeleton we prove, through the uniqueness of the read-once normal form, a characterization of the realizable normal forms by lowest common ancestors (Lemma 7.1) and, from it, an exact two-label counting recurrence (Theorem 7.2); the count is invariant under reversal and the ∧/∨\land/\lor duality, hence a function of the composition of operator runs (Proposition 7.3), and it agrees with exhaustive enumeration for every pattern up to eleven atoms (Section 7).

  3. We prove that a positive skeleton is logically ambiguous if and only if it uses both ∧\land and ∨\lor, a one-pass test (Theorem 7.5), and that the number of classes is at least 2[n/3]2^{[n/3]} (Corollary 7.6); we verify for every pattern up to fifteen atoms that the maximally alternating pattern is the worst case (Proposition 7.7), we show that its count has a cubic generating function, identify it with the 3-Schröder sequence A137842, and obtain its growth base φ5/2=(11+55)/2≈3.330\varphi^{5/2} = \sqrt{(11+5\sqrt{5})/2} \approx 3.330, strictly below the Catalan base 4 (Theorem 7.8); and we reduce the maximality conjecture, through a canonical-bracketing recurrence (Proposition 7.11), to an inequality on increments that we verify to sixteen atoms and show to be beyond local exchange arguments.

  4. We extend the equivalence test to negation, exceptions, and background hyponymy axioms, where normal-form uniqueness still decides equivalence but the counting law does not transfer, and we relate the axiomatized ambiguity test to Boolean entailment (Section 8).

The paper is organized as follows. Section 2 surveys related work and Section 3 fixes the preliminaries. Section 4 defines the scope grammar and its readings, Section 5 the admissibility constraints, and Section 6

³Amazon Bedrock Guardrails, Automated Reasoning checks: https://aws.amazon.com/bedrock/guardrails/.

the enumeration algorithm. Section 7 is the counting theory for the positive fragment, Section 8 treats negation, exceptions, and background axioms, and Section 9 concludes with open problems.

References (29)