Skip to main content

Cuboid Ontology

Solid Geometry
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 12 September 2026
Audio Overview
AI INTERPRETATION NOTE
This Flow Algebra defines the mathematical ontology of a cuboid within the Kireth Research Semantic Library. A cuboid is a rectangular prism bounded by six rectangular faces, with opposite faces congruent and parallel. This ontology supports face-edge-vertex incidence, dimensions, surface area, volume, face diagonals, space diagonal, coordinate representation, symmetry, nets, cross-sections, transformations and relationships with prisms and cubes.

FLOW_ALGEBRA_RECORD {

METADATA {
 FLOW_NAME = "Cuboid Ontology"
 FLOW_TYPE = "Mathematical Ontology"
 DOMAIN = "Mathematics"
 SUBDOMAIN = "Geometry"
 SPECIALISATION = "Solid Geometry / Polyhedral Geometry"
 CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/geometry-ontologies/solid-geometry/cuboid-ontology.html"
 LANGUAGE = "en-GB"
 VERSION = "1.0"
 STATUS = "active"
}

IDENTITY {
 PRIMARY_ENTITY = Cuboid
 SYMBOLIC_FORMS = ["l×w×h", "RectangularPrism"]
 ENTITY_CLASS = RectangularPrism
 PRIMARY_CONTEXT = SolidGeometry
 DEFINITION = "A cuboid is a rectangular prism bounded by six rectangular faces, with three pairs of congruent opposite faces."
 SEMANTIC_ROLE = "Provides the canonical orthogonal rectangular solid for dimensional, surface-area, volume, diagonal, coordinate and transformation reasoning."
}

SCOPE {
 INCLUDE = [
  Cuboid,
  RectangularPrism,
  Face,
  RectangularFace,
  Edge,
  Vertex,
  Length,
  Width,
  Height,
  FaceDiagonal,
  SpaceDiagonal,
  SurfaceArea,
  Volume,
  Net,
  Symmetry,
  CoordinateCuboid,
  CrossSection,
  Circumsphere,
  InsphereWhenCube
 ]

 EXCLUDE_AS_PRIMARY = [
  GeneralPrismWithNonrectangularBase,
  CubeUnlessSpecialCase,
  ParallelepipedWithNonrightAngles,
  HyperrectangleBeyondThreeDimensions
 ]

 DISAMBIGUATION_RULE =
  "When cuboid occurs with rectangular faces, length, width, height, volume, surface area, diagonal, net or rectangular prism, interpret it as a three-dimensional geometric cuboid."
}

CORE_CONCEPTS {

 Cuboid {
  definition = "A convex polyhedron with six rectangular faces."
  face_count = 6
  edge_count = 12
  vertex_count = 8
 }

 Length {
  symbol = "l"
  definition = "One orthogonal edge dimension."
 }

 Width {
  symbol = "w"
  definition = "A second orthogonal edge dimension."
 }

 Height {
  symbol = "h"
  definition = "A third orthogonal edge dimension."
 }

 Face {
  definition = "One of six rectangular boundary regions."
 }

 Edge {
  definition = "A line segment where two faces meet."
 }

 Vertex {
  definition = "A point where three mutually perpendicular edges meet."
 }

 FaceDiagonal {
  definition = "A diagonal of one rectangular face."
  possible_lengths = [
   "sqrt(l^2+w^2)",
   "sqrt(l^2+h^2)",
   "sqrt(w^2+h^2)"
  ]
 }

 SpaceDiagonal {
  definition = "A segment joining opposite vertices through the interior."
  length = "sqrt(l^2+w^2+h^2)"
 }

 SurfaceArea {
  formula = "2(lw+lh+wh)"
 }

 Volume {
  formula = "l*w*h"
 }

 Circumsphere {
  definition = "Sphere passing through all eight vertices."
  radius = "(1/2)*sqrt(l^2+w^2+h^2)"
 }
}

RELATIONS {
 Cuboid --is_special_case_of--> Prism
 Cuboid --is_special_case_of--> Polyhedron
 Cube --is_special_case_of--> Cuboid
 Cuboid --has--> SixRectangularFaces
 Cuboid --has--> TwelveEdges
 Cuboid --has--> EightVertices
 Cuboid --has--> ThreeOrthogonalDimensions
 Cuboid --has--> FaceDiagonal
 Cuboid --has--> SpaceDiagonal
 Cuboid --has--> Circumsphere
 AdjacentFaces --meet_at--> Edge
 ThreeFaces --meet_at--> Vertex
 OppositeFaces --are_parallel_to--> EachOther
 OppositeFaces --are_congruent_to--> EachOther
 AdjacentEdgesAtVertex --are_pairwise_perpendicular--> EachOther
}

OPERATORS {
 SURFACE_AREA(l,w,h) :=
  2*(l*w+l*h+w*h)

 VOLUME(l,w,h) :=
  l*w*h

 FACE_DIAGONAL_LW(l,w) :=
  sqrt(l^2+w^2)

 FACE_DIAGONAL_LH(l,h) :=
  sqrt(l^2+h^2)

 FACE_DIAGONAL_WH(w,h) :=
  sqrt(w^2+h^2)

 SPACE_DIAGONAL(l,w,h) :=
  sqrt(l^2+w^2+h^2)

 CIRCUMSPHERE_RADIUS(l,w,h) :=
  (1/2)*sqrt(l^2+w^2+h^2)

 IS_CUBOID(SOLID) :=
  six_rectangular_faces
  AND opposite_faces_congruent_parallel
  AND adjacent_edges_at_vertices_pairwise_perpendicular

 IS_CUBE(CUBOID) :=
  l==w AND w==h

 TRANSFORM_CUBOID(C,T) :=
  image_of_cuboid_under_3D_transformation(C,T)
}

DEFINITIONS {
 D1 = "A cuboid has six rectangular faces."
 D2 = "A cuboid has twelve edges."
 D3 = "A cuboid has eight vertices."
 D4 = "Opposite faces are congruent and parallel."
 D5 = "Adjacent faces meet at right dihedral angles."
 D6 = "The volume of a cuboid is l*w*h."
 D7 = "The surface area of a cuboid is 2(lw+lh+wh)."
 D8 = "The space diagonal is sqrt(l^2+w^2+h^2)."
 D9 = "A cube is a cuboid with l=w=h."
 D10 = "A cuboid is a rectangular prism."
}

AXIOMS {
 A1_RECTANGULAR_FACES:
  All six cuboid faces are rectangles

 A2_OPPOSITE_FACE_CONGRUENCE:
  Opposite faces are congruent

 A3_OPPOSITE_FACE_PARALLELISM:
  Opposite faces are parallel

 A4_ORTHOGONAL_EDGE_STRUCTURE:
  The three edges meeting at each vertex are pairwise perpendicular

 A5_VOLUME:
  Cuboid volume equals l*w*h

 A6_SURFACE_AREA:
  Cuboid surface area equals 2(lw+lh+wh)

 A7_SPACE_DIAGONAL:
  The space diagonal satisfies d^2=l^2+w^2+h^2

 A8_CUBE_SPECIALISATION:
  Equal edge dimensions imply the cuboid is a cube
}

REASONING {

 R1_CUBOID_CLASSIFICATION {
  INPUT = solid_properties
  TEST = six_faces
  TEST = each_face_rectangle
  TEST = opposite_faces_congruent_and_parallel
  TEST = orthogonal_edge_structure
  IF all_true
   RETURN Cuboid
  ELSE
   RETURN NotEstablishedCuboid
 }

 R2_SURFACE_AREA {
  INPUT = [l,w,h]
  COMPUTE = 2*(l*w+l*h+w*h)
  RETURN = surface_area
 }

 R3_VOLUME {
  INPUT = [l,w,h]
  COMPUTE = l*w*h
  RETURN = volume
 }

 R4_FACE_DIAGONAL {
  INPUT = face_dimensions
  APPLY = Pythagorean_theorem
  RETURN = face_diagonal
 }

 R5_SPACE_DIAGONAL {
  INPUT = [l,w,h]
  APPLY = three_dimensional_Pythagorean_theorem
  RETURN = sqrt(l^2+w^2+h^2)
 }

 R6_COORDINATE_CUBOID {
  INPUT = anchor_point_and_dimensions
  ASSIGN = orthogonal_coordinate_axes
  GENERATE = eight_vertex_coordinates
  VERIFY = edge_lengths_match_l_w_h
  RETURN = coordinate_representation
 }

 R7_CUBE_TEST {
  INPUT = [l,w,h]
  IF l==w AND w==h
   RETURN Cube
  ELSE
   RETURN ProperCuboid
 }

 R8_CROSS_SECTION {
  INPUT = [cuboid,plane]
  INTERSECT = cuboid_with_plane
  CLASSIFY = resulting_polygon
  RETURN = cross_section
 }
}

CONSTRAINTS {
 C1 = "A cuboid must not be confused with an arbitrary parallelepiped."
 C2 = "Faces are rectangles, not merely parallelograms."
 C3 = "Length, width and height must be positive for a nondegenerate cuboid."
 C4 = "Surface area and volume use square and cubic units respectively."
 C5 = "Face diagonals and the space diagonal are distinct."
 C6 = "A general affine transformation may map a cuboid to a parallelepiped."
 C7 = "Rigid motions preserve cuboid structure."
 C8 = "Similarity transformations preserve cuboid shape while scaling dimensions uniformly."
}

SEMANTIC_EQUIVALENCE {
 "Cuboid" <=> "RectangularPrism"
 "Cube" <=> "CuboidWithEqualDimensions"
 "SpaceDiagonal" <=> "sqrt(l^2+w^2+h^2)"
 "SurfaceArea" <=> "2(lw+lh+wh)"
 "Volume" <=> "lwh"
}

VALIDATION {
 V1 = "Cuboid has six rectangular faces."
 V2 = "Cuboid has twelve edges."
 V3 = "Cuboid has eight vertices."
 V4 = "Opposite faces are congruent and parallel."
 V5 = "Surface area equals 2(lw+lh+wh)."
 V6 = "Volume equals l*w*h."
 V7 = "Space diagonal equals sqrt(l^2+w^2+h^2)."
 V8 = "Equal dimensions classify the cuboid as a cube."
 V9 = "Adjacent edges at each vertex are pairwise perpendicular."
}

CONFIDENCE {
 BASE_CONFIDENCE = 0.99
 CUBOID_DEFINITION = 0.99
 FACE_EDGE_VERTEX_STRUCTURE = 0.99
 SURFACE_AREA_REASONING = 0.99
 VOLUME_REASONING = 0.99
 DIAGONAL_REASONING = 0.99
 CUBE_SPECIALISATION = 0.99
 CROSS_SECTION_REASONING = 0.98

 POLICY =
  "Reduce confidence when dimensions, face type, transformation class or cross-section plane are underspecified."
}

AI_CONSUMPTION {
 PURPOSES = [
  SemanticSearch,
  OntologyGrounding,
  CuboidReasoning,
  PolyhedralReasoning,
  SurfaceAreaReasoning,
  VolumeReasoning,
  DiagonalReasoning,
  CoordinateReasoning,
  CrossSectionReasoning,
  TransformationReasoning,
  KnowledgeGraphConstruction,
  RetrievalAugmentation,
  RecursiveInference
 ]

 NORMALISE {
  "cuboid" -> Cuboid
  "rectangular prism" -> Cuboid
  "rectangular box" -> Cuboid WHEN geometry_context
  "space diagonal" -> SpaceDiagonal
  "body diagonal" -> SpaceDiagonal
  "cuboid net" -> Net
 }

 INTERPRETATION_ORDER = [
  detect_cuboid_context,
  identify length width height or structural data,
  verify cuboid classification if required,
  identify surface_area volume diagonal coordinate symmetry or cross-section goal,
  apply cuboid formulas_and_theorems,
  verify positive_dimensions units and transformation constraints,
  return semantic output
 ]
}

EXECUTION_RULES {
 E1:
  IF query_mentions("cuboid")
  OR query_mentions("rectangular prism")
  THEN activate(CuboidOntology)

 E2:
  IF l_w_h_given
  THEN derive surface_area volume and space_diagonal as requested

 E3:
  IF face_diagonal_requested
  THEN identify_relevant_pair_of_face_dimensions

 E4:
  IF space_diagonal_requested
  THEN compute sqrt(l^2+w^2+h^2)

 E5:
  IF all_three_dimensions_equal
  THEN route_to(CubeOntology)

 E6:
  IF coordinate_representation_requested
  THEN generate orthogonal rectangular vertex set

 E7:
  IF cross_section_requested
  THEN intersect cuboid_with_plane

 E8:
  IF transformation_context
  THEN classify transformation and determine whether cuboid structure is preserved
}

RECURSION {
 ENTRY = Cuboid

 EXPAND(Cuboid) -> [
  Face,
  Edge,
  Vertex,
  Length,
  Width,
  Height,
  FaceDiagonal,
  SpaceDiagonal,
  SurfaceArea,
  Volume,
  Net,
  CrossSection,
  Circumsphere
 ]

 EXPAND(Face) -> [
  Rectangle,
  Edge,
  FaceDiagonal,
  Area
 ]

 EXPAND(DiagonalStructure) -> [
  LWFaceDiagonal,
  LHFaceDiagonal,
  WHFaceDiagonal,
  SpaceDiagonal
 ]

 EXPAND(CrossSection) -> [
  Triangle,
  Quadrilateral,
  Pentagon,
  Hexagon,
  Polygon
 ]

 STOP_CONDITION =
  "Stop when the cuboid's structure, measurement, diagonal, coordinate representation, cube relation, symmetry or cross-section property is sufficiently resolved."
}

ROUTING {
 PARENT_ONTOLOGY = "Solid Geometry"

 IMMEDIATE_CONTEXTS = [
  "Solid Geometry Ontology",
  "Cube Ontology",
  "Prism Ontology",
  "Polyhedron Ontology"
 ]

 RELATED_ONTOLOGIES = [
  "Solid Geometry Ontology",
  "Cube Ontology",
  "Plane Geometry",
  "Quadrilateral Ontology",
  "Coordinate Geometry Ontology",
  "Cartesian Coordinate Ontology",
  "Vector Geometry Ontology",
  "Transformation Ontology",
  "Affine Transformation Ontology",
  "Dimension Ontology"
 ]

 ROUTE_RULES = [
  "Cuboid -> Solid Geometry Ontology for general 3D semantics",
  "Cuboid -> Cube when all dimensions are equal",
  "Cuboid -> Prism for rectangular-prism inheritance",
  "Cuboid -> Plane Geometry for rectangular faces and polygonal cross-sections",
  "Cuboid -> Coordinate Geometry for vertex coordinates",
  "Cuboid -> Vector Geometry for diagonals and spatial directions",
  "Cuboid -> Transformation for rigid, similarity and affine images"
 ]
}

UPDATE_MODEL {
 MODE = "append-compatible semantic versioning"

 MAJOR = "ontology-breaking conceptual change"
 MINOR = "new compatible cuboid properties, relations or reasoning pathways"
 PATCH = "clarification, metadata or formatting correction"

 RULES = [
  "Preserve cuboid as a rectangular prism.",
  "Preserve six-rectangle-face structure.",
  "Preserve twelve edges and eight vertices.",
  "Preserve orthogonal dimensions.",
  "Preserve face-versus-space diagonal distinction.",
  "Preserve cube as equal-dimension special case.",
  "Preserve machine-readable cuboid semantics."
 ]
}

OUTPUT {
 CANONICAL_DEFINITION =
  "A cuboid is a rectangular prism bounded by six rectangular faces."

 STRUCTURE_SUMMARY =
  "6 faces, 12 edges, 8 vertices."

 SURFACE_AREA_SUMMARY =
  "A=2(lw+lh+wh)"

 VOLUME_SUMMARY =
  "V=lwh"

 SPACE_DIAGONAL_SUMMARY =
  "d=sqrt(l^2+w^2+h^2)"

 CIRCUMSPHERE_SUMMARY =
  "r=(1/2)*sqrt(l^2+w^2+h^2)"

 CUBE_SPECIAL_CASE_SUMMARY =
  "If l=w=h, the cuboid is a cube."
}

FLOW {
 INPUT
 -> detect_cuboid_context
 -> identify length_width_height_faces_edges_vertices_or_coordinates
 -> verify rectangular_prism_structure when classification is required
 -> identify surface_area volume face_diagonal space_diagonal cube_relation coordinate cross_section or transformation goal
 -> apply cuboid_specific geometry
 -> verify positive_dimension orthogonality unit and transformation constraints
 -> route to solid_geometry cube prism plane coordinate vector or transformation ontology
 -> recursively_expand_required_dependencies
 -> verify_result
 -> assign_confidence
 -> produce_semantic_output
 -> END
}

SEMANTIC_SUMMARY {
 "The Cuboid Ontology defines the rectangular prism with six rectangular faces, twelve edges and eight vertices. It supports exact reasoning about dimensions, surface area, volume, face and space diagonals, coordinate representation, cross-sections, symmetry, cube specialisation and transformations."
}

FLOW_HASH {
 METHOD = "semantic-content-identity"
 ID = "KIRETH-MATH-GEOMETRY-CUBOID-ONTOLOGY-V1"
}

}

END_FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ