Skip to content

Local Sequence Legality

Prime #
966
Origin domain
Language And Communication
Subdomain
formal grammars → Language And Communication

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

In English, some letters just can't sit next to each other — like a word starting with 'tk'. You can tell something looks wrong by checking just the little neighbors, before you even know what the word means. Local Sequence Legality is having simple rules about which pieces are allowed next to which. Break a rule and it's an automatic 'nope.'

Small-Window Rule Check

Local Sequence Legality is about deciding whether an arrangement of things is allowed by checking small windows of it, before worrying about what it means. You start with a limited set of allowed pieces — like letters of the alphabet — and rules about which pieces can sit next to which. If every little neighborhood follows the rules, the whole thing is legal. A legal sequence might still be nonsense or wrong, but at least it passed the basic spelling-style check. The neat trick is that you never need one big rule for the whole thing — you just add up the verdicts from all the tiny windows.

Local Grammar Gate

Local Sequence Legality is the pattern where the acceptability of an arrangement of units from a finite inventory is decided by local constraints over short windows of context, before and independent of any higher-level meaning. A finite alphabet, a set of position classes (start, end, after-X, before-Y), and a rule-set over adjacent or near-adjacent positions together give a yes/no legal verdict on a candidate sequence. The constraints are pre-semantic: legality is fixed before you ask what the sequence means, so illegal arrangements get filtered before deeper layers process them, while legal ones may still turn out meaningless or wrong. Globalness comes from composition of local verdicts: a sequence is legal exactly when every window is legal, so a rich legality regime is built by adding up short-window verdicts with no global rule-checker. The boundary of the pattern is where legality needs non-local information, like matching brackets across any distance, at which point you have left the local-grammar regime.

 

Local Sequence Legality is the structural pattern in which the acceptability of an arrangement of units drawn from a finite inventory is decided by local constraints over short windows of context, prior to and independent of higher-level interpretation. A finite alphabet, a set of position classes, and a rule-set over adjacent (or near-adjacent) positions jointly define a binary legal/illegal verdict on candidate sequences. The constraint set is pre-semantic: legality is fixed before the sequence is asked what it means. Illegal arrangements are filtered before downstream layers process them; legal arrangements may still be meaningless, ambiguous, or wrong, but they have at least cleared the syntactic gate. Globalness is achieved by composition of local verdicts: a sequence is legal exactly when every window is, so a rich legality regime is implemented by summing verdicts on short windows without any global rule-evaluator. The structural commitment has three load-bearing parts: a finite alphabet of units; a positional grammar of local context classes (start, end, after-X, before-Y, adjacent-to-Z); and a local rule-set deciding each window's verdict. This is the signature of regular and context-free grammars, but it names the pattern wherever it appears, carrying no normative or institutional content. The architectural insight is that local constraints can do global work, and the pattern's boundary is precisely where legality requires non-local information (matching brackets across arbitrary distance, agreement across unbounded context).

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

One-hop neighborhood: parents above, mutual partners to the right, children below.Local SequenceLegalitysubsumption: Local-to-Global AggregationLocal-to-GlobalAggregation

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 LegalityLocal-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.