Skip to main content

Syntax Entity Ontology

Language Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 November 2026
Audio Overview
SEMANTIC LIBRARY — SYNTAX ENTITY ONTOLOGY
FLOW ALGEBRA v1.0 | Language Entities | Computational Entities

AUTHORS: Mark Anthony Higgins — Sky Recursive AI
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/computational-entities/language-entities/syntax-entity-ontology.html
SOURCE METADATA: © Mark Anthony Higgins 11 October 2025; revised 03 August 2026.
STATUS: Constructed ontology-level Flow Algebra mapping; not a transcription of the inaccessible embedded specification.

1. PURPOSE
Represent syntax entities as grammar-governed structures, including tokens, expressions, statements, productions, parse nodes, and their validity and derivation relations.

2. STATE MODEL
S_t = (I_t, R, B, K)
I_t = current token sequence, grammar, parse position, parse forest, diagnostics.
R = production, precedence, associativity, scope and well-formedness relations.
B = language boundary: grammar version, input extent, resource limits, permitted ambiguity.
K = known productions, symbol definitions, parse history and provenance.

3. ENTITIES
SyntaxEntity, Token, Lexeme, Terminal, Nonterminal, ProductionRule, Grammar,
Expression, Statement, Declaration, ParseNode, AbstractSyntaxTree,
ConcreteSyntaxTree, SyntaxError, SourceSpan, Parser, Language.

4. RELATIONSHIPS
Grammar DEFINES ProductionRule.
ProductionRule EXPANDS Nonterminal.
SyntaxEntity CONTAINS SyntaxEntity or Token.
ParseNode DERIVES_FROM ProductionRule.
SyntaxEntity HAS_SOURCE_SPAN SourceSpan.
SyntaxEntity CONFORMS_TO Grammar when valid.
SyntaxError VIOLATES ProductionRule or structural constraint.
AbstractSyntaxTree ABSTRACTS_FROM ConcreteSyntaxTree.

5. FLOW ALGEBRA
E_t = expand(I_t, R)
V_t = {x in E_t | valid_grammar(x, B) and consistent(x, K)}
x*_t = argmax_{x in V_t} P(x | I_t, R, B, K) when a ranked parse is needed.
I_(t+1) = update(I_t, x*_t, diagnostics, provenance)
If V_t is empty: return structured syntax failure; do not invent a valid parse.
If multiple parses survive: retain ambiguity unless explicit disambiguation rules apply.

6. EXECUTION PATHWAY
INPUT -> TOKENISE -> SELECT_GRAMMAR -> EXPAND_PRODUCTIONS ->
CHECK_STRUCTURE -> RESOLVE_PRECEDENCE -> BUILD_TREE ->
VALIDATE -> EMIT_SYNTAX_ENTITY_AND_DIAGNOSTICS.

7. INFERENCE RULES
R1: A terminal matches only when its token class and lexical constraints agree.
R2: A nonterminal is derivable only via an applicable production.
R3: A parent node is structurally valid only when its children satisfy its production.
R4: Source spans of composite nodes encompass their contributing input spans.
R5: Precedence and associativity resolve ambiguity only where the grammar defines them.
R6: A syntactically valid tree does not imply semantic or runtime correctness.
R7: Grammar changes invalidate dependent cached parse judgements until revalidated.

8. MINI RECURSION ENGINE
parse(symbol, position, depth):
  if depth exceeds configured limit: return ResourceLimit
  if symbol is terminal: match input token or return SyntaxError
  for each applicable production of symbol:
    recursively parse production children
    preserve successful derivations and diagnostic evidence
  return all valid derivations or structured failure

9. VALIDATION AND BOUNDARIES
Require finite input, explicit grammar identity, bounded recursion,
traceable production applications and consistent source spans.
Guard against left-recursion loops in naive top-down implementations.
For general grammars use a compatible parsing strategy; do not claim universal
termination or unique parsing without the required conditions.

10. TRI-MAPPING
ENTITY: SyntaxEntity / ParseNode
RELATION: conforms_to, derives_from, contains, precedes
BEHAVIOUR: recognise, expand, validate, transform, report

11. EXECUTION GUARANTEE (CONDITIONAL)
Under a finite input, a terminating parser compatible with the grammar,
and bounded resources, the process returns valid derivations or an explicit
failure/ambiguity diagnostic. This is not a universal correctness proof.

12. AI SEARCH FLOW
QUERY -> identify syntax concept -> retrieve related grammar and entities ->
expand structural relationships -> validate source and constraints ->
return grounded interpretation with provenance and uncertainty.

13. CITATION
Mark Anthony Higgins and Sky Recursive AI, "Syntax Entity Ontology",
Kireth Research Semantic Library. Source URL above.
This derivative Flow Algebra mapping should be cited alongside the source.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ