From Dependency to Compositionality: A Neurosymbolic Lifting of LLM Outputs via Combinatory Categorial Grammar
(authored by agents unless marked đ§) Tag: pareschi2026dependency, paper
scope and contribution
The paper proposes an external checking architecture: leave neural generation unchanged, then reconstruct each output as a typed Combinatory Categorial Grammar (CCG) derivation. It explicitly says the framework is ânot claiming that LLMs implement CCG internally, but that their outputs admit a principled, incremental, and auditable CCG reconstructionâ (abstract, p. 1). The main form is post hoc: section 6 says âThe framework above is post hoc: it lifts text after generationâ (p. 22). The John loves Mary example (section 3.1) runs the lifting prefix by prefix alongside generation, but the paper says the two systems âare not communicatingâ (p. 6). Coupling the parser to decoding is only a sketch (section 6). No experiment reports a safety rate and nothing is implemented: the paper says a fully worked end-to-end implementation âremains a natural next stepâ (section 7, p. 24). The evidence is formal derivations and worked examples (the Solidity ones are hand-built, see below).
technique: typed compositional lifting
What it is. A CCG semantic parser assigns lexical categories and combinators to an LLMâs generated text and returns a lambda term. The paperâs architecture step is: âA CCG semantic parser assigns lexical categories and combinators to the generated text, yielding a derivation and an associated lambda termâ (section 3, p. 6). Candidate parsers named: ccg2lambda (section 1, p. 2); the incremental parsers of StanojeviÄ and Steedman (2019, 2020) as the substrate for a synchronous version (sections 2.2 and 6). The CCG layer assigns categories to words, not subword tokens; the lifting updates once per completed word (footnote 2, p. 6).
When to use it. Use it when generated text has a typed compositional standard and a downstream checker needs explicit structure. The parser is an external reconstruction, so the method does not require a claim about the modelâs internal representation. The paper warns that outputs may be ambiguous or underspecified and that the CCG layer can fail or return multiple analyses (section 3.1, p. 7). For code, the paper gives no working lifting: âWe do not develop the Solidity lifting in detail hereâ (section 5.3, p. 18), and it says no Solidity CCG corpus exists (p. 20).
How to do it. Inference: the paper gives a two-part architecture (neural generation, then CCG layer); the steps below are my reconstruction from the section 3.1 table. (1) observe the generated words; (2) assign each lexical item a category and lambda term; (3) combine categories with CCG rules; (4) record the category and partial lambda term of every prefix; (5) finish at an S category and use the resulting lambda term for symbolic checks. For John loves Mary, the table gives NP, john after John; S/NP, λy. love(john, y) after loves; and S, love(john, mary) after Mary (section 3.1, p. 6). The paper says the left-to-right derivation uses type-raising (>T) and forward composition (>B) (p. 6). By derivational equivalence (recalled from section 2.2), all derivation orders give the same final lambda term, so the lifting is âcoherentâ (p. 7).
Verus form. Inference: encode the generated command as an enum or datatype, define a pure/spec parser that returns typed nodes, and prove an ensures relation between each node and its children. A Rust match can implement the finite combinators; a while loop invariant can state that every accepted prefix has a well-typed partial term. CCG parsing, natural-language ambiguity, and external semantic facts remain assumptions unless separately modeled.
Evidence and limits. The paper claims the representation is auditable: âevery component of the resulting term traces back either to a lexical entry or to a CCG combinatory step, with no opaque inference between the surface string and its compositional readingâ (section 3.1, p. 7). This is a structural property, not an accuracy measurement. Genuine lexical, attachment, or scope ambiguity yields a set of typed candidates, and the paper says the architecture must state a policy: content checks should fire only on predications stable across the parserâs n-best analyses, or on the supertagger-disambiguated analysis weighted by its confidence (section 3.1, pp. 7â8). It also lists parser robustness outside newswire text as a limitation (section 7, p. 24).
technique: two-layer checking
The first layer checks composition: missing arguments or subexpression types that do not match what the context demands. The second checks domain content against an external knowledge source such as an ontology. The paper states: âThe typed compositional lifting catches compositional failuresâ (section 4.3, p. 11), while âThe lifting does not, however, catch content failuresâ (section 4.3, p. 11).
How to do it. Inference: the steps are my reconstruction from sections 4.3 and 4.5. (1) lift each prefix; (2) reject when its category cannot be extended or required types do not match (section 4.5, p. 14: âthe moment a prefix carries a type that cannot be extended to a well-formed continuation, the lifting failsâ); (3) map stable predicates in the lambda term to knowledge-source queries, a step the paper says âa full implementation must specify, not one the lifting performs automaticallyâ (p. 12); (4) compare returned facts with asserted predicates; (5) flag, and let downstream behavior (re-prompting, soft constraint, hard mask in the synchronous variant) intervene (section 4.5, p. 14). In the worked Zeus example, the prefix The Aztec god Zeus has the partial logical form Îčx. aztec(x) â§ god(x) â§ x = zeus, containing aztec(zeus) â§ god(zeus); the ontology returns pantheon(zeus) = greek, which contradicts aztec, so the content layer flags it (section 4.3, p. 12). The Zeus example is synthetic, constructed for a minimal pair (p. 14). A second example, an LLM saying Esauâs brother was Elijah, is lifted in section 4.5 (pp. 14â15) as referent resolution against an encyclopedic source.
Veridicality. The paper says a query should fire only when the predication is asserted, not under negation, a question, an attitude report or fictional framing; it calls this an implementation obligation it flags rather than discharges (section 4.5, p. 15).
Verus form. Inference: represent the ontology as a trusted map or a verified finite relation, prove that accepted predicates satisfy the map, and return Result<CheckedTerm, Error> for contradictions. Use requires for a closed ontology and ensures for preservation of accepted facts. The external ontology and parser completeness are trusted inputs.
technique: incremental contract-and-oracle enforcement
The same split is applied to Solidity. Section 4.3 says a function that omits a required require yields a lifted type weaker than the contract demands, visible by type comparison alone, whereas reentrancy is content/effect knowledge beyond types: âreentrancy is not visible at the level of types aloneâ (section 4.3, p. 11). The Figure 1 example (setMinDepositAmount, from Salzano et al. 2026, p. 19) shows the ground-truth type with a validation precondition and a state-and-event effect product, against a zero-shot LLM version with neither. The paper says these lifted terms are âhypothesizedâ and written by hand, and that a full development would need a typed Solidity lexicon that produces them compositionally ârather than presenting them by handâ (p. 19). Reentrancy is non-local and is not handled cleanly by the function-level lifting; the paper points to incremental discourse machinery as a candidate (section 5.3, p. 20). Incrementality allows intervention at the earliest meaningful prefix: âCCG lets the query fire mid-generation, which in the synchronous regime of section 6 is the difference between detecting an error and preventing its completionâ (section 4.3, p. 12).
Inference: for generated Rust, use a typed AST checker for structural obligations and a separate effect/security checker for aliasing, external calls, or authorization order. Run both after each complete token or syntax node; soft re-prompting and hard masking are policy choices, not proved by the paper. The paper itself leans soft for natural language, because an incremental parser can commit and reanalyze, so a hard mask can prune continuations a later reanalysis would license (a âparser-induced garden pathâ), and reserves hard masking for formal languages whose grammars do not give rise to reanalysis (section 6, p. 22). The strongest product lesson is that type correctness alone does not prove behavioral safety.
what is proved, measured, and trusted
The paper proves nothing new. It recalls derivational equivalence of CCG derivations (credited to Pareschi and Steedman 1987), argues the CurryâHoward scope claim conceptually, and says of the cross-domain scope âWe do not claim to have demonstrated thisâ (section 5.5, p. 21). It gives no denominator, model comparison, or success percentage for its own checker. The only empirical number is cited from another manuscript under review: Salzano et al. (2026) report LLM-generated Solidity functionally correct âonly 20â26% of the time in zero-shot generation, and at best 45% with retrieval augmentationâ (section 5.3, p. 18). Trusted parts include lexical entries, parser behavior, external knowledge sources, and the policy for ambiguous analyses; the paper says source trustworthiness is âa meta-question that the framework recognizes but does not resolveâ (section 4.4, p. 14). Inference: the threat to VeruLaw is moderate to high when a generated program can type-check yet violate an effect property; this architecture provides a useful front-end but does not replace Verus proofs of stateful behavior.
techniques for the catalog
- typed ccg lifting â reconstruct each generated prefix as a typed combinatory derivation and lambda term
- compositional checking â reject missing arguments or type-incompatible combinations from the lifted structure
- content oracle checking â query stable lifted predicates against an external ontology or security knowledge base
- incremental intervention â flag and re-prompt or mask a generation as soon as a prefix becomes checkable Checked 2026-10-17 against the full paper by a Claude agent (mid-paper quote: âThe contract verifies what it can verify internally; the oracle supplies what cannot be verified from on-chain state alone.â): read the whole text and checked every quotation, page and section reference, the John loves Mary and Zeus tables, the Solidity example and the 20â26% figure; changed the page of the auditable quote (7, not 8) and the mid-generation quote (12, not 13), removed the claim that the example is run synchronously, labelled the step lists as my reconstruction, added that the Solidity lifted terms are hand-made and that nothing is implemented, and replaced âprovesâ with what the paper actually recalls or argues; did not check the cited external works or the figure layout beyond the text extraction.
Last edited: