Local Sequence Legality¶
Core Idea¶
The acceptability of an arrangement of units from a finite inventory is decided by local constraints over short windows, prior to and independent of meaning. A finite alphabet, a positional grammar, and a local rule-set produce a binary legal/illegal verdict, and global legality is the composition of local verdicts — legal exactly when every window is.
How would you explain it like I'm…
Which Pieces Fit Next
Small-Window Rule Check
Local Grammar Gate
Broad Use¶
- Phonotactics: each language admits some phoneme sequences (English
str-onsets) and forbids others, judged on the syllable, not the meaning. - Formal grammars: regular expressions, context-free grammars, and tokenisation, where legality is decided before semantic analysis.
- Network protocols: HTTP request lines, SMTP commands, and JSON syntax, where a parser rejects illegal payloads at the gate.
- Molecular biology: DNA codon legality (start and stop codons in reading frame) and splice-site signals.
- Music and games: harmonic-progression rules and pitch-class legality; chess move legality — each a local rule over position classes.
- Configuration and chemistry: SKU configurators checked at edit time; valence legality governing which bonds can exist where.
Clarity¶
Separates syntactic gating (is this arrangement well-formed?) from semantic evaluation (does it mean anything useful?), making visible the leak when a parser tries to repair meaning or a reviewer marks a valid-but-unwanted input as "syntactically wrong."
Manages Complexity¶
Collapses apparently-unrelated correctness problems into one diagnostic — name the alphabet, the position classes, the local rules, run the gate — with a constant intervention vocabulary (extend the alphabet, tighten or relax a rule, introduce an escape, shift the window).
Abstract Reasoning¶
Licenses the inferences of layered defence (a strict local gate shrinks the downstream attack surface), expressive limits (legality requiring non-local information has left the local-grammar regime), and that local constraints can do global work by summing verdicts over short windows.
Knowledge Transfer¶
- Phonotactics to compilers: regular and context-free grammar formalism is the codification of local-legality reasoning, exported into parsers, protocols, and validation.
- Linguistics to bioinformatics: grammar-based reasoning identifies legal sequence motifs (codons, splice sites) using essentially the same machinery.
- Games to music: legal-move generators and voice-leading rules share the local-rule-over-position-class structure, both implementable as small rule-sets over short windows.
Example¶
A regex tokeniser decides whether 3.14 is a legal numeric literal before any layer asks what the number means — but it cannot match balanced parentheses to arbitrary depth, because that legality requires non-local information, so at the boundary the system must escalate to a context-free parser with a stack.
Relationships to Other Primes¶
Parents (1) — more general patterns this builds on
- Local Sequence Legality is a kind of Local-to-Global Aggregation — The file is explicit that local_sequence_legality is the "narrower, specifically grammatical case" of local_to_global_aggregation: a locally-checkable property promoted to a global verdict, where local_to_global_aggregation is "the broad mathematical pattern" with the general overlap-and-glue discipline and obstruction theory, and this prime "adds the pre-semantic, alphabet-and-position- class specificity." That is an is-a (specialization) relation, and its own cross-ref links local_to_global_aggregation. NOT the sequencing nearest (0.898), a deliberate non-confusion (ordering-for-outcome vs binary well-formedness). Medium because local_to_global_aggregation is a candidate; if it lands, this is the natural parent.
Path to root: Local Sequence Legality → Local-to-Global Aggregation
Not to Be Confused With¶
- Local Sequence Legality is not Sequencing because this prime is the pre-semantic binary well-formedness verdict, whereas sequencing concerns the order in which steps achieve a goal.
- Local Sequence Legality is not Local-to-Global Aggregation because this prime is the narrower finite-alphabet positional-grammar gate where the global verdict is "legal iff every window is," whereas aggregation is the broad overlap-and-glue pattern with obstruction theory.
- Local Sequence Legality is not a Formal System because this prime stops at well-formedness, whereas a formal system pairs it with axioms and inference rules generating theorems that carry meaning.