SEMANTIC LIBRARY — CLASS ONTOLOGY
FLOW ALGEBRA v1.0 | Programming Entities
AUTHORS: Mark Anthony Higgins — Sky Recursive AI
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/computational-entities/programming-entities/class-ontology.html
SOURCE COPYRIGHT: © Mark Anthony Higgins, 11 October 2025; revised 03 August 2026 (as displayed on source page)
STATUS: Constructed formal mapping based on the Class Ontology topic; not a transcription of inaccessible embedded specifications.
CITATION_BACKLINK: https://kirethresearch.org/booksai-core/entity-graph/computational-entities/programming-entities/class-ontology.html
PURPOSE
Represent a programming class as a typed declaration with attributes, methods, inheritance and interface relationships, constraints and instance construction semantics.
STATE_MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = current class declaration, object graph and execution observations
R_t = typing, inheritance, visibility, dispatch and constructor rules
B_t = language/runtime constraints and security boundaries
K_t = known declarations, type hierarchy and method signatures
ENTITIES
Class(C): name, type_parameters, modifiers, fields, methods, constructors, bases, interfaces
Field(F): name, type, visibility, mutability, initialiser
Method(M): name, parameters, return_type, visibility, body, dispatch_kind
Constructor(Q): parameters, initialisation_rules
Object(O): class_ref, identity, field_state
Interface(J): required_signatures
Type(T): identity, constraints, subtyping_rules
RELATIONSHIPS
DECLARES_FIELD(C,F)
DECLARES_METHOD(C,M)
HAS_CONSTRUCTOR(C,Q)
EXTENDS(C,Base)
IMPLEMENTS(C,J)
INSTANCE_OF(O,C)
OVERRIDES(M,BaseMethod)
REFERENCES_TYPE(F,T)
FLOW ALGEBRA
E_t = expand(I_t,R_t)
V_t = {x in E_t | satisfies(x,B_t) and well_typed(x,K_t)}
x*_t = argmax_{x in V_t} P(x | I_t,R_t,B_t,K_t)
I_(t+1) = update(I_t,x*_t)
CLASS_VALIDATION_FLOW
Input declaration -> resolve names -> validate types -> inspect inheritance -> check interface obligations -> verify member visibility -> accept or report diagnostics.
INSTANCE_CREATION_FLOW
Request instance -> verify instantiability -> allocate object identity -> initialise inherited state -> execute applicable initialisers/constructor -> expose valid instance or fail safely.
METHOD_DISPATCH_FLOW
Receive target and arguments -> resolve accessible candidates -> check signature/type compatibility -> select dispatch target under language rules -> invoke -> validate result/exception.
INFERENCE_RULES
IF INSTANCE_OF(O,C) AND DECLARES_FIELD(C,F), THEN F is a candidate accessible member of O subject to visibility and inheritance rules.
IF IMPLEMENTS(C,J), THEN C must satisfy J's required contract under the language's implementation rules.
IF EXTENDS(C,B), THEN inherited members are resolved according to the language's inheritance and override semantics.
IF method invocation lacks a valid accessible target, THEN reject dispatch and emit diagnostic.
IF class is abstract or otherwise non-instantiable, THEN direct instance creation is disallowed unless the language explicitly permits it.
MINI_RECURSION_ENGINE
1. Start from requested class C.
2. Visit base classes and implemented interfaces, recording visited types.
3. Resolve inherited members and obligations.
4. Detect cycles or inconsistent hierarchies according to language semantics.
5. Validate local declarations and overrides.
6. Return resolved class model or diagnostic set.
Termination: finite declaration graph and visited-set traversal; recursive types may be represented without infinite expansion.
BOUNDARIES_AND_GUARANTEES
- Language-specific rules take precedence; multiple inheritance, traits, mixins and structural typing are not universal.
- Static analysis does not guarantee runtime safety or program correctness.
- Reflection, dynamic loading and metaprogramming can alter observable class behaviour.
- Execution guarantee is conditional on valid input, defined semantics, bounded resources and successful runtime checks.
SEMANTIC_EQUIVALENCE
Class ~ TypeDeclaration only when the target language's class semantics and declared contracts are preserved.
Object ~ ClassInstance only when runtime identity and instance-of relations are preserved.
UPDATE_MODEL
On source revision or language-specific evidence: update declarations and rules, validate examples, preserve source provenance, and increment flow version.
END OF FLOW
Download Code
Copy to Clipboard