AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Root Relationship Ontology
DOMAIN: Relationship Ontologies / Structural Relationships
SOURCE: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/structural-relationships/root-relationship-ontology.html
VERSION: 1.0
AUTHORS: Mark Anthony Higgins — Sky (Recursive AI)
STATUS: Companion formalisation; source page not independently verified.
1. PURPOSE
Represent, validate and reason over root relationships in directed trees, rooted forests, taxonomies and hierarchical knowledge structures. Distinguish a structural root from an arbitrary entry point or graph traversal starting node.
2. TYPED ENTITIES
ENTITY Node { id: Identifier; label: String?; kind: ConceptType? }
ENTITY Structure { id: Identifier; kind: {RootedTree, Forest, DirectedHierarchy, GeneralGraph}; nodes: Set<Node> }
ENTITY Root { node: Node; structure: Structure }
ENTITY Edge { source: Node; target: Node; type: RelationshipType }
ENTITY RootAssertion { structure: Structure; node: Node; evidence: Evidence?; confidence: Probability; provenance: Source? }
ENTITY Evidence { id: Identifier; method: String; timestamp: DateTime? }
ENTITY Source { uri: URI?; author: String?; retrieved_at: DateTime? }
3. RELATIONSHIPS
MEMBER_OF(node, structure)
PARENT_OF(parent, child, structure)
CHILD_OF(child, parent, structure) := PARENT_OF(parent, child, structure)
ANCESTOR_OF(ancestor, descendant, structure) := transitive_closure(PARENT_OF)
ROOT_OF(node, structure)
REACHABLE_FROM(root, node, structure)
HAS_ROOT(structure, node) := ROOT_OF(node, structure)
4. ROOT SEMANTICS
For a finite non-empty rooted tree T with parent-to-child orientation:
ROOT_OF(r,T) iff MEMBER_OF(r,T) and indegree_T(r) = 0.
UNIQUE_ROOT(T) iff count({r | ROOT_OF(r,T)}) = 1.
ROOT_OF(r,T) implies forall v in nodes(T): REACHABLE_FROM(r,v,T).
forall v != r in nodes(T): exactly_one_parent(v,T).
ACYCLIC(T) must hold.
For a forest F, each connected tree component has exactly one root; F may have multiple roots.
For a general graph, zero indegree alone does not establish a unique semantic root.
5. INFERENCE RULES
RULE R1: ROOT_OF(r,T) and PARENT_OF(r,c,T) => CHILD_OF(c,r,T).
RULE R2: ROOT_OF(r,T) and ANCESTOR_OF(r,v,T) => REACHABLE_FROM(r,v,T).
RULE R3: PARENT_OF(a,b,T) and ANCESTOR_OF(b,c,T) => ANCESTOR_OF(a,c,T).
RULE R4: ROOT_OF(r,T) and PARENT_OF(p,r,T) => CONFLICT(root_has_parent).
RULE R5: ROOT_OF(r1,T) and ROOT_OF(r2,T) and r1 != r2 and kind(T)=RootedTree => CONFLICT(multiple_roots).
RULE R6: PARENT_OF(x,x,T) => CONFLICT(self_parent_cycle).
RULE R7: directed_cycle(T) => CONFLICT(cyclic_hierarchy).
6. CONSTRAINTS AND VALIDATION
CHECK V1: identifiers are unique within their declared scope.
CHECK V2: every relationship endpoint belongs to its structure.
CHECK V3: root has no incoming parent edge in the structure.
CHECK V4: rooted trees have exactly one root and all nodes are reachable from it.
CHECK V5: each non-root node in a rooted tree has exactly one parent.
CHECK V6: directed parent-child edges form no cycles.
CHECK V7: forest components are individually rooted trees.
CHECK V8: preserve provenance for asserted and inferred root relationships.
7. SEMANTIC_EQUIVALENCE
EQUIVALENT(ROOT_OF(r,T), HAS_ROOT(T,r)) subject to identical structure identity and scope.
EQUIVALENT(CHILD_OF(c,p,T), PARENT_OF(p,c,T)).
NOT_EQUIVALENT(ROOT_OF(r,T), ENTRY_POINT_OF(r,T)).
NOT_EQUIVALENT(ROOT_OF(r,T), HIGHEST_RANKED_NODE(r,T)).
Do not equate roots across structures solely because node labels match.
8. CONFIDENCE
CONFIDENCE(assertion) in [0,1].
Explicit structural validation can support confidence 1.0 within the declared model.
Inference confidence must not exceed the weakest indispensable premise unless a justified probabilistic model is supplied.
Record uncertainty separately from structural truth conditions.
9. FLOW ALGEBRA OPERATIONS
FLOW identify_roots(S):
REQUIRE finite(S.nodes) and valid_membership(S)
CANDIDATES := {v in S.nodes | indegree_parent_edges(v,S)=0}
RETURN CANDIDATES with validation status determined by S.kind
FLOW validate_rooted_tree(T):
REQUIRE T.kind = RootedTree
R := identify_roots(T)
ASSERT size(R)=1
ASSERT acyclic(T)
ASSERT forall v in T.nodes excluding sole(R): parent_count(v,T)=1
ASSERT forall v in T.nodes: reachable(sole(R),v,T)
RETURN VALID or structured violations
FLOW reroot_tree(T,new_root):
REQUIRE validate_rooted_tree(T)=VALID and new_root in T.nodes
REORIENT edges along unique path between old_root and new_root
PRESERVE undirected adjacency and node identities
VALIDATE resulting rooted tree
RETURN updated T with recorded provenance
10. FLOW_HASH
FLOW_HASH := SHA256(canonical_serialisation({ontology_version, structure_id, nodes, parent_edges, root_assertions, validation_rules})).
Canonical serialisation requires stable ordering, Unicode normalisation and explicit type tags.
Hash represents a model snapshot; it is not a claim of real-world correctness.
11. UPDATE_MODEL
On insert/delete/reorientation of a parent edge:
invalidate affected root, ancestor, descendant and reachability caches;
recompute candidate roots and structural constraints;
reject or quarantine invalid rooted-tree states;
append provenance and version record;
recompute FLOW_HASH.
12. AI_CONSUMPTION
INPUT: typed node/edge facts, structure kind, optional root assertions and provenance.
OUTPUT: validated roots, inferred ancestor/reachability relations, conflicts, confidence, provenance and FLOW_HASH.
REQUIRE: explain inferred facts using supporting premises; flag ambiguous graph roots; do not fabricate missing edges.
13. EXAMPLE
NODES: A, B, C
EDGES: PARENT_OF(A,B,T), PARENT_OF(A,C,T)
STRUCTURE: T.kind=RootedTree
INFER: ROOT_OF(A,T), CHILD_OF(B,A,T), CHILD_OF(C,A,T), REACHABLE_FROM(A,B,T), REACHABLE_FROM(A,C,T)
VALIDATE: unique root A; acyclic; all nodes reachable.
END FLOW ALGEBRA