qgrammar: A Certified Grammar Compiler for Chiral Gauge Matter — typed record alphabets, anomaly certificates, repair searches, and UFO back ends
David Elliman · Neuro-Symbolic Ltd · 8 July 2026
Abstract
The engineering close of the grammar trilogy: the certified attribute grammar said what the Standard Model's interaction rules are, the semiring-parsing sequel said how amplitudes evaluate over them, and this paper ships the compiler. The public package qgrammar defines a typed particle record, a finite response alphabet, vertex productions as typed rewrite rules, exact anomaly-cancellation certificates derived from the same typed records the vertex checker uses (itemised per left-Weyl multiplet and computed from the particle content rather than a hand-maintained table, so perturbing any hypercharge, chirality, or weak representation makes it fail — a machine-checkable regression test on the grammar), a grammar well-formedness linter, a small semiring parser, grammar-driven s/t/u tree-diagram skeletons whose mediators follow from the vertex rules (the gluon excluded from a leptonic annihilation, the photon from a neutrino pair), a minimal repair engine for illegal processes, and scaffold exporters for both the Universal FeynRules Output (UFO) format and FeynRules. The aim is deliberately modest but useful: not to replace MadGraph, Pythia, Geant4, or other mature high-energy-physics tools, but to provide a certified front end that checks whether a proposed particle grammar is a consistent chiral gauge theory before it is handed to those tools. The current release certifies one Standard-Model generation with a right-handed neutrino: sixteen Weyl states, four gauge/gravitational anomaly sums that are exactly zero plus the Witten SU(2) global anomaly, twenty-nine primitive vertex classes, correct photon and Z read typing, left-handed charged-current typing, sterile-neutrino exclusion from neutral reads, and structured repair candidates for illegal signals — a sterile photon read, μ → eγ, and anomalous mono-photon plus missing-energy events. Written as a numerate graduate-level bridge between the conceptual grammar papers and a reproducible software tool.
Keywords
How to cite
Elliman, D. (2026). qgrammar: A Certified Grammar Compiler for Chiral Gauge Matter — typed record alphabets, anomaly certificates, repair searches, and UFO back ends. Neuro-Symbolic Ltd technical report. https://doi.org/10.5281/zenodo.21251774
@techreport{elliman2026qgrammarcompiler,
author = {Elliman, David},
title = {qgrammar: A Certified Grammar Compiler for Chiral Gauge Matter — typed record alphabets, anomaly certificates, repair searches, and UFO back ends},
institution = {Neuro-Symbolic Ltd},
year = {2026},
doi = {10.5281/zenodo.21251774},
url = {https://neusym.ai/papers/qgrammar_compiler/}
} The version of record is archived on Zenodo at the DOI above; this page and PDF are the publisher copies at neusym.ai. See the full list of papers for the rest of the programme.