Formal Languages
Authors:
MArk Anthony Higgins - Sky Recursive Ai
MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: July 6th 2026
Revised Date: July 6th 2026
AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Formal Languages
DOMAIN: Discrete Mathematics / Formal Languages
TYPE: Foundational Parent-Page Ontology
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/formal-languages.html
VERSION: 1.0
DATE: 2026-10-11
AUTHORS: Mark Higgins — Sky (Recursive AI)
SOURCE_STATUS: Mathematical synthesis; live page not independently verified.
1. PURPOSE
Represent formal languages as mathematically defined sets of finite strings over alphabets, with grammars, automata, transformations, and decidable properties.
2. TYPED ENTITIES
Alphabet := finite nonempty set of symbols (Sigma)
Symbol := atomic element of Sigma
String := finite sequence over Sigma, including empty string epsilon
StringLength := nonnegative integer |w|
Language := subset L of Sigma* (possibly empty or infinite)
Grammar := tuple (N, Sigma, P, S) with nonterminals, terminals, productions and start symbol
Production := permitted rewriting rule
Derivation := finite sequence of valid production applications
Automaton := abstract machine recognising or accepting strings
RegularExpression := expression denoting a regular language
ParseTree := rooted tree recording grammatical derivation
LanguageClass := class in the Chomsky hierarchy
DecisionProblem := question about strings, grammars or languages
3. CORE RELATIONSHIPS
MEMBER_OF(w, L) iff w in L
OVER_ALPHABET(L, Sigma) iff L subseteq Sigma*
GENERATES(G, L) iff L = {w in Sigma* | S =>* w}
RECOGNISES(M, L) iff L = {w | M accepts w}
EQUIVALENT_LANGUAGE(A, B) iff L(A) = L(B)
SUBLANGUAGE(L1, L2) iff L1 subseteq L2
DERIVES(G, u, v) iff u =>* v under G
4. FORMAL OPERATIONS
CONCAT(L1,L2) := {xy | x in L1 and y in L2}
UNION(L1,L2) := L1 union L2
INTERSECTION(L1,L2) := L1 intersection L2
DIFFERENCE(L1,L2) := L1 minus L2
COMPLEMENT(L,Sigma) := Sigma* minus L
KLEENE_STAR(L) := union_{n>=0} L^n; L^0={epsilon}
KLEENE_PLUS(L) := L CONCAT KLEENE_STAR(L)
REVERSE(L) := {reverse(w) | w in L}
HOMOMORPHIC_IMAGE(h,L) := {h(w) | w in L}
LEFT_QUOTIENT(K,L) := {w | exists x in K: xw in L}
5. CHOMSKY HIERARCHY
Type 3: Regular languages; finite automata; regular expressions; regular grammars.
Type 2: Context-free languages; context-free grammars; nondeterministic pushdown automata.
Type 1: Context-sensitive languages; noncontracting grammars (standard qualifications); linear bounded automata.
Type 0: Recursively enumerable languages; unrestricted grammars; Turing-machine recognition.
INCLUSION: Regular subseteq ContextFree subseteq ContextSensitive subseteq RecursivelyEnumerable.
All inclusions are proper.
6. ALGEBRAIC IDENTITIES
L union empty = L
L CONCAT {epsilon} = L
L CONCAT empty = empty
(L1 CONCAT L2) CONCAT L3 = L1 CONCAT (L2 CONCAT L3)
L CONCAT (K union M) = (L CONCAT K) union (L CONCAT M)
(K union M) CONCAT L = (K CONCAT L) union (M CONCAT L)
KLEENE_STAR(empty) = {epsilon}
KLEENE_STAR({epsilon}) = {epsilon}
L subseteq KLEENE_STAR(L)
KLEENE_STAR(KLEENE_STAR(L)) = KLEENE_STAR(L)
NOTE: Concatenation is not generally commutative.
7. INFERENCE RULES
MEMBERSHIP_CONCAT: x in A and y in B => xy in CONCAT(A,B).
MEMBERSHIP_UNION: x in A => x in UNION(A,B).
STAR_BASE: epsilon in KLEENE_STAR(L).
STAR_STEP: x in L and y in KLEENE_STAR(L) => xy in KLEENE_STAR(L).
GRAMMAR_ACCEPTANCE: S =>* w and w in Sigma* => w in L(G).
DFA_ACCEPTANCE: extended_delta(q0,w) in F => w in L(M).
EQUIVALENCE_TRANSFER: EQUIVALENT_LANGUAGE(A,B) and w in L(A) => w in L(B).
8. CLOSURE AND DECIDABILITY
Regular languages are closed under union, intersection, complement, difference, concatenation, star and reversal.
Context-free languages are closed under union, concatenation, star and reversal; not generally under intersection or complement; closed under intersection with a regular language.
Regular-language membership, emptiness and equivalence are decidable for standard finite representations.
Context-free membership and emptiness are decidable; context-free grammar equivalence and universality are undecidable in general.
For arbitrary Turing machines, language acceptance is semi-decidable, not decidable in general.
9. VALIDATION
V01: Alphabet symbols and string encodings are well-defined.
V02: Every generated terminal string uses the grammar terminal alphabet.
V03: Production rules conform to the declared grammar class.
V04: Automaton transitions have valid state and symbol types.
V05: Claims of language equivalence require proof or verified procedure.
V06: Complement is evaluated relative to an explicit Sigma*.
V07: Epsilon and empty language are never conflated.
V08: Closure claims specify the language class.
V09: Undecidability claims do not imply that every individual instance is unresolvable.
10. SEMANTIC_EQUIVALENCE
"formal language" == "set of strings over an alphabet" (in this mathematical context).
"empty word" == "epsilon".
"Kleene closure" == "Kleene star".
"recognised language" == "accepted language" (when machine semantics match).
NOT_EQUIVALENT: empty language != language containing epsilon.
NOT_EQUIVALENT: grammar != language generated by grammar.
NOT_EQUIVALENT: recognisable != decidable.
11. CONFIDENCE
DEFINITIONS: 1.00 (standard mathematical definitions)
ALGEBRAIC_IDENTITIES: 1.00 (subject to stated typing)
CLASSIFICATION: 0.99 (standard hierarchy and conventional qualifications)
SOURCE_ALIGNMENT: unverified (live page not independently inspected)
Confidence values express authoring assessment, not measured empirical probabilities.
12. FLOW_HASH
MODEL: SHA-256 over canonical UTF-8 text of the flow excluding the FLOW_HASH value field.
VALUE: NOT_COMPUTED_IN_TEXT; calculate after final publication/canonicalisation.
PURPOSE: Detect content changes and support provenance and version comparison.
13. UPDATE_MODEL
TRIGGER: New formal result, corrected definition, altered page scope or ontology version.
STEPS: inspect source; validate theorem/definition; revise affected entities and rules; update version and date; recompute FLOW_HASH; record change log.
DEPENDENCIES: automata theory, computability, mathematical logic, discrete mathematics, grammars, language recognition.
14. AI_CONSUMPTION
INPUT: mathematical question, alphabet, language specification, grammar or automaton.
PIPELINE: parse -> type-check -> identify language class -> select transformations/decision procedures -> derive -> validate -> explain with proof obligations.
OUTPUT: typed formal representation, operations, justified inferences, class constraints, confidence and provenance.
GUARDRAILS: distinguish recogniser from decider; avoid unsupported equivalence or closure claims; preserve epsilon/empty distinction.
15. EXAMPLE
Sigma={a,b}; L={a,b}; L^2={aa,ab,ba,bb}; L* = Sigma*.
Grammar S -> aS | bS | epsilon generates Sigma*.
DFA with one accepting state and self-loops on a and b recognises the same language.
END FLOW ALGEBRA