Skip to main content

Flow Loop Ontology

Flow Algebra Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 05 November 2026
Audio Overview
FLOW LOOP ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | Flow Algebra Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/flow-algebra-entities/flow-loop-ontology.html
Authors (source page): Mark Anthony Higgins — Sky Recursive AI
Original interpretative formalisation | 05 November 2026

1. PURPOSE
A Flow Loop is a bounded or condition-controlled repetition of a flow body. It carries a state between iterations, checks a continuation condition, applies an update and emits a result or a declared failure. The formalisation below is a proposed operational interpretation, not a verbatim transcription of the page's embedded specification.

2. ENTITY MODEL
Loop L = (id, body, initial_state, guard, update, boundary, budget, exit, evidence)
Body: a composable flow or transition sequence.
Guard: predicate deciding whether another iteration is permitted.
Update: state transition following a successful body execution.
Boundary: admissible states, operations and side effects.
Budget: finite iteration, time or resource limits.
Exit: completion, guard-false, cancellation, failure or budget exhaustion.
Evidence: iteration records, provenance and outputs.

Related entities: Flow Entity, Flow Specification, Flow Input, Flow Output, Flow Variable, Flow Constant, Flow Rule, Flow Relationship, Flow Constraint, Flow State, Flow Transition, Flow Condition and Flow Branch.

3. FORMAL STATE MODEL
S_t = (I_t, R, B, K_t)
I_t: input and loop state at iteration t.
R: loop rules, body, guard and update operators.
B: boundary predicates, permissions and execution budget.
K_t: contextual knowledge and accumulated iteration evidence.

E_t = expand(I_t, R)
V_t = {x in E_t | valid(x, B) and guard(I_t, K_t)}
x*_t = argmax_{x in V_t} P(x | I_t, R, B, K_t)
I_(t+1) = update(I_t, x*_t)
K_(t+1) = K_t union {evidence(t, I_t, x*_t, I_(t+1))}

If V_t is empty, distinguish a false guard (normal termination) from an unsatisfied boundary or execution error (non-successful termination). argmax is only defined for non-empty candidate sets with a specified, well-defined selection policy; ties must be resolved deterministically or recorded.

4. LOOP OPERATOR
Loop(body, guard, update, S_0, B, N):
  t := 0
  S := S_0
  while guard(S) is true:
    require t < N and within_budget(B)
    require valid(S, B)
    result := execute(body, S)
    require result.status = success
    S := update(S, result)
    require valid(S, B)
    record(t, result, S)
    t := t + 1
  return (S, t, completed)

A failed requirement returns a typed status, not a success claim. N is a finite maximum iteration count. The loop body may itself contain loops if each nested invocation has its own finite budget and the aggregate resource budget is enforced.

5. FLOW ALGEBRA COMPOSITION
Sequence: A ; B — run B after successful A.
Conditional: if c then A else B — select a branch by c.
Iteration: repeat_c(A) — repeatedly apply A while c holds.
Bounded iteration: repeat_(c,N)(A) — apply at most N times.
Guarded transition: S_t --[c and B]--> S_(t+1).
Accumulation: K_(t+1) = merge(K_t, evidence_t).
Termination: not c(S_t) => exit(completed).
Exception: error(A) => exit(failed, diagnostic).

6. TRI-MAPPING
Semantic: Loop represents intentional repetition governed by a condition and boundary.
Structural: Loop links guard, body, state, transition, budget and exit entities.
Operational: Evaluate guard -> validate boundary -> execute body -> update state -> record evidence -> repeat or exit.

7. INFERENCE RULES
R1: isLoop(L) and hasBody(L,A) => repeats(L,A).
R2: guard(L,S)=false => terminates(L,completed).
R3: guard(L,S)=true and valid(S,B) and budgetAvailable(L) => mayExecuteBody(L).
R4: bodySuccess(L,S,S') and valid(S',B) => nextState(L,S').
R5: not valid(S,B) => terminates(L,boundary_violation).
R6: not budgetAvailable(L) and guard(L,S)=true => terminates(L,budget_exhausted).
R7: bodyFailure(L,e) => terminates(L,failed) and recordsDiagnostic(L,e).
R8: iterationRecorded(L,t) => hasProvenance(L,t).
R9: nestedLoop(L,M) => enforceAggregateBudget(L,M).

8. RECURSIVE RESOLUTION ENGINE
resolve_loop(L,S,K,t):
  if guard(L,S,K) is false: return completed(S,K)
  if t >= L.max_iterations: return budget_exhausted(S,K)
  if not valid(S,L.boundary): return boundary_violation(S,K)
  candidates := expand(S,L.rules)
  admissible := filter(candidates,L.boundary)
  if admissible is empty: return no_admissible_transition(S,K)
  choice := select(admissible,L.selection_policy)
  outcome := execute(L.body,choice)
  if outcome failed: return failed(S,K,outcome.error)
  S2 := update(S,outcome)
  if not valid(S2,L.boundary): return boundary_violation(S2,K)
  K2 := record(K,t,S,choice,S2,outcome)
  return resolve_loop(L,S2,K2,t+1)

9. FLOW DIAGRAM
[Initial Input / State]
         |
         v
[Evaluate Loop Guard] -- false --> [Completed Output]
         |
        true
         v
[Check Boundary and Budget] -- fail --> [Typed Failure + Diagnostic]
         |
        pass
         v
[Expand / Filter / Select] -- none --> [No Admissible Transition]
         |
         v
[Execute Flow Body] -- fail --> [Typed Failure + Diagnostic]
         |
         v
[Update State and Evidence]
         |
         +----------------------> [Evaluate Loop Guard]

10. RELATIONSHIP MAPPING TABLE
Loop -> Flow Condition : hasGuard
Loop -> Flow Entity : repeatsBody
Loop -> Flow State : readsState / writesState
Loop -> Flow Transition : appliesTransition
Loop -> Flow Constraint : respectsBoundary
Loop -> Flow Variable : updatesVariable
Loop -> Flow Input : consumesInput
Loop -> Flow Output : producesOutput
Loop -> Flow Rule : followsRule
Loop -> Flow Branch : mayContainBranch
Loop -> Flow Loop : mayContainNestedLoop
Loop -> Evidence Record : recordsIteration

11. CONDITIONAL EXECUTION GUARANTEE
Under finite N, total guard and update functions, terminating body invocations, enforceable resource limits and deterministic exception handling, the engine terminates with either a completed result or a typed failure in at most N body iterations. This is a conditional property of the specified engine, not a guarantee that arbitrary user-supplied loops or code terminate successfully. Semantic correctness additionally depends on accurate rules, validated inputs and boundary definitions.

12. AI SEARCH FLOW
FLOW_ID: semantic-library.flow-loop-ontology
VERSION: 1.0
LANGUAGE: en-GB
ENTITY_TYPE: FlowLoop
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/flow-algebra-entities/flow-loop-ontology.html
CITATION_BACKLINK: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/flow-algebra-entities/flow-loop-ontology.html
PURPOSE: Resolve and describe guarded, bounded, recursive flow iteration.
STATE_MODEL: S_t=(I_t,R,B,K_t)
ENTITIES: Loop, Guard, Body, State, Transition, Boundary, Budget, Exit, Evidence
PATHWAYS: initialise -> test -> validate -> execute -> update -> record -> repeat/exit
MINI_RECURSION_ENGINE: resolve_loop(L,S,K,t)
INFERENCE_RULES: R1-R9
CONFIDENCE: Depends on validated source data, rules and execution evidence; not a fixed score.
SEMANTIC_EQUIVALENCE: guarded iteration ~ bounded repetition, only when exit and state semantics match.
FLOW_HASH: To be computed from canonicalised published flow content; not fabricated.
UPDATE_MODEL: Version changes require provenance, compatibility checks and revision history.

13. HOW TO READ
The loop does not merely repeat a command. It is a stateful flow in which every iteration is admitted by a guard, constrained by boundaries, tracked by evidence and required to terminate or return a diagnostic status. The recursion is operationally bounded and does not imply unrestricted self-modification.

LICENCE NOTE
Source attribution is retained. Consult the published Kireth Research Open Research Licence for applicable reuse terms. This TXT is an original interpretative companion specification.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ