WORKFLOW LOOP ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | AI Entities | Workflow Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/workflow-entities/workflow-loop-ontology.html
Authors: Mark Anthony Higgins — Sky Recursive AI
Source copyright: © Mark Anthony Higgins, 11 October 2025; revised 01 August 2026
Companion formalisation prepared: 02 November 2026
SCOPE AND PROVENANCE
The public page identifies the ontology and authors but does not expose its complete formal specification in the retrieved HTML. The definitions and equations below are a companion formalisation, not a verbatim transcription of hidden page code.
1. PURPOSE
Represent bounded, guarded and auditable iteration in a workflow, including entry, body execution, state update, termination, failure and recovery.
2. ENTITY MODEL
WorkflowLoop L = (id, workflow, body, guard, update, limit, policy, status).
Iteration i = (index, input_state, output_state, evidence, result).
LoopState S_t = (I_t, R_t, B_t, K_t), where:
I_t = current workflow inputs and iteration state;
R_t = loop rules, guard, transition and exit criteria;
B_t = safety, resource and execution boundaries;
K_t = known facts, observations, history and provenance.
Related entities: Workflow Stage, State, Input, Output, Dependency, Constraint, Trigger, Branch, Action.
3. FLOW ALGEBRA
Candidate expansion: E_t = expand(I_t, R_t).
Valid candidates: V_t = {x in E_t | satisfies(x, B_t) AND dependencies_ready(x)}.
Choice: x*_t = argmax[x in V_t] P(x | I_t, R_t, B_t, K_t), when V_t is nonempty.
Transition: I_(t+1) = update(I_t, execute(x*_t), K_t).
Knowledge: K_(t+1) = K_t union {observations, outcome, evidence}.
Guard: g(S_t) in {TRUE, FALSE, UNKNOWN}.
Loop continuation: continue_t = (g(S_t) = TRUE) AND (t < max_iterations) AND within_budget(S_t).
Exit: exit_t = (g(S_t) = FALSE) OR goal_reached(S_t).
UNKNOWN guard -> suspended or failed according to explicit policy; never silently treated as TRUE.
4. FORMAL TRANSITION RELATION
Ready --[trigger and constraints valid]--> Evaluating.
Evaluating --[guard true and limits valid]--> Running.
Running --[body success]--> Updating.
Updating --[state committed]--> Evaluating.
Evaluating --[guard false or goal reached]--> Completed.
Any active state --[recoverable error]--> Retrying, only if retry policy permits.
Any active state --[hard limit / invalid state / unrecoverable error]--> Failed.
Any active state --[authorised cancellation]--> Cancelled.
5. INVARIANTS
INV-01: Each iteration has a unique loop_id and iteration_index.
INV-02: Iteration state changes are ordered and attributable.
INV-03: A loop body cannot execute when its guard is FALSE or UNKNOWN.
INV-04: Declared dependencies and constraints must hold before each iteration.
INV-05: The maximum iteration count and resource budget cannot be exceeded.
INV-06: Failed iterations cannot be represented as successful commits.
INV-07: Terminal status is recorded with exit reason and evidence.
INV-08: Retry attempts follow an explicit bound and idempotency policy.
6. INFERENCE RULES
IF guard=TRUE AND dependencies_ready AND constraints_valid AND budget_available THEN may_execute_next_iteration.
IF guard=FALSE THEN terminate_normally.
IF goal_reached THEN terminate_normally.
IF iteration_count>=max_iterations AND NOT goal_reached THEN terminate_with_limit_status.
IF guard=UNKNOWN THEN require_resolution_or_policy_exit.
IF body_fails AND retry_allowed THEN retry_within_bounds ELSE fail_or_compensate.
IF output_invalid THEN reject_commit_and_record_failure.
7. TRI-MAPPING
Entity graph: Loop -> hasIteration -> Iteration -> produces -> Output.
Relationship graph: Loop -> dependsOn -> Dependency; Loop -> constrainedBy -> Constraint.
Execution graph: Trigger -> Guard -> Body -> Validate -> Update -> Guard/Exit.
8. EXECUTION DIAGRAM
[Trigger] -> [Initialise loop state] -> [Evaluate guard]
| FALSE -> [Complete]
| UNKNOWN -> [Suspend / Fail]
v TRUE
[Check limits and constraints]
| invalid -> [Fail / Limit exit]
v valid
[Execute body]
| failure -> [Retry / Compensate / Fail]
v success
[Validate and commit output]
v
[Update state + evidence]
|
+----------> [Evaluate guard]
9. MAPPING TABLE
Concept Formal field Evidence
Loop identity L.id Stable identifier
Entry condition L.guard Guard evaluation
Loop body L.body Action execution record
Iteration state S_t Input/output snapshot
Constraints B_t Validation results
Dependencies dependency_ready Resolution record
Termination exit_t Exit reason
Iteration history K_t Trace / provenance
Output iteration.output_state Validated artefact
10. EXECUTION GUARANTEE (CONDITIONAL)
Given deterministic transition semantics, a finite max_iterations, bounded retries,
valid state updates and enforced resource limits, the loop will terminate in a
terminal status within its configured bounds. This does not guarantee that its
business goal succeeds, or that external actions complete successfully.
11. AI SEARCH FLOW
FLOW_ID: semantic-library.ai.workflow.loop.v1
FLOW_TYPE: ontology-companion
ENTITY: Workflow Loop
PURPOSE: Identify, validate and reason about workflow iteration.
INPUTS: workflow_id, initial_state, guard, body, update_rule, limits, constraints, dependencies.
PATHWAY: trigger -> evaluate -> validate -> execute -> commit -> repeat_or_exit.
OUTPUTS: terminal_status, final_state, iteration_count, output_set, trace, exit_reason.
CONFIDENCE: depends on source evidence and observed execution results; not a fixed numeric claim.
UPDATE_MODEL: revise loop state and provenance after every committed iteration.
SEMANTIC_EQUIVALENCE: bounded iteration; guarded repetition; workflow cycle.
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/workflow-entities/workflow-loop-ontology.html
CITATION_BACKLINK: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/workflow-entities/workflow-loop-ontology.html
AUTHORS: Mark Anthony Higgins; Sky — Recursive AI
LICENCE_NOTE: Consult the source site's published Open Research Licence for applicable terms.
END OF FLOW
Download Code
Copy to Clipboard