Skip to main content

Perimeter Ontology

Geometric Measurement
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 perimeter within the Kireth Research Semantic Library. Perimeter is the total length of the boundary of a planar geometric figure. This ontology supports polygons, rectangles, squares, triangles, regular polygons, circles through circumference, composite figures, piecewise boundaries, coordinate geometry, scaling, units, dimensional analysis, exact and approximate values and relationships with length, area and geometric measurement.

FLOW_ALGEBRA_RECORD {

METADATA {
 FLOW_NAME = "Perimeter Ontology"
 FLOW_TYPE = "Mathematical Ontology"
 DOMAIN = "Mathematics"
 SUBDOMAIN = "Geometry"
 SPECIALISATION = "Geometric Measurement / Perimeter"
 CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/geometry-ontologies/geometric-measurement/perimeter-ontology.html"
 LANGUAGE = "en-GB"
 VERSION = "1.0"
 STATUS = "active"
}

IDENTITY {
 PRIMARY_ENTITY = Perimeter
 SYMBOLIC_FORMS = [
  "P",
  "P=sum side lengths",
  "P=boundary length"
 ]
 ENTITY_CLASS = BoundaryLengthMeasure
 PRIMARY_CONTEXT = GeometricMeasurement
 DEFINITION = "Perimeter is the total one-dimensional measure of the boundary of a planar geometric figure."
 SEMANTIC_ROLE = "Provides the boundary-length framework for polygons, circles, composite figures, coordinate geometry, scaling, units and dimensionally valid geometric measurement."
}

SCOPE {
 INCLUDE = [
  Perimeter,
  BoundaryLength,
  PolygonPerimeter,
  TrianglePerimeter,
  RectanglePerimeter,
  SquarePerimeter,
  RegularPolygonPerimeter,
  CompositeFigurePerimeter,
  Circumference,
  SideLength,
  EdgeLength,
  ArcLength,
  PiecewiseBoundary,
  CoordinatePerimeter,
  ScaleFactor,
  Unit,
  UnitConversion,
  ExactPerimeter,
  ApproximatePerimeter,
  MeasurementPrecision,
  ErrorBound
 ]

 EXCLUDE_AS_PRIMARY = [
  Area,
  SurfaceArea,
  Volume,
  InteriorLengthNotOnBoundary,
  GeneralCurveLengthUnlessServingAsBoundary
 ]

 DISAMBIGUATION_RULE =
  "When the task asks for the total length around a planar figure, sum of boundary edges, or circle boundary length, interpret the quantity as perimeter."
}

CORE_CONCEPTS {

 Perimeter {
  definition = "The total length of the boundary of a planar figure."
  dimension = "L"
 }

 BoundaryLength {
  definition = "The accumulated one-dimensional measure around the boundary of a region."
 }

 PolygonPerimeter {
  definition = "The sum of all polygon side lengths."
 }

 TrianglePerimeter {
  relation = "P=a+b+c"
 }

 RectanglePerimeter {
  relation = "P=2(l+w)"
 }

 SquarePerimeter {
  relation = "P=4s"
 }

 RegularPolygonPerimeter {
  relation = "P=n*s"
 }

 CompositeFigurePerimeter {
  definition = "The length of the external boundary of a figure assembled from simpler pieces."
 }

 Circumference {
  definition = "The perimeter of a circle."
  relation = "C=2*pi*r=pi*d"
 }

 PiecewiseBoundary {
  definition = "A boundary formed from multiple line segments and/or curve arcs."
 }
}

RELATIONS {
 Perimeter --is_special_case_of--> Length
 Perimeter --measures--> Boundary
 PolygonPerimeter --is_sum_of--> SideLength
 TrianglePerimeter --is_special_case_of--> PolygonPerimeter
 RectanglePerimeter --is_special_case_of--> PolygonPerimeter
 SquarePerimeter --is_special_case_of--> RectanglePerimeter
 RegularPolygonPerimeter --is_special_case_of--> PolygonPerimeter
 Circumference --is_special_case_of--> Perimeter
 CompositeFigurePerimeter --is_sum_of--> ExposedBoundaryComponents
 ArcLength --contributes_to--> Perimeter
 CoordinateGeometry --supports--> CoordinatePerimeter
 ScaleFactor --transforms--> Perimeter
 UnitConversion --preserves--> PerimeterMagnitude
}

OPERATORS {
 POLYGON_PERIMETER(vertices) :=
  sum_of_consecutive_edge_lengths_including_closing_edge

 TRIANGLE_PERIMETER(a,b,c) :=
  a+b+c

 RECTANGLE_PERIMETER(l,w) :=
  2*(l+w)

 SQUARE_PERIMETER(s) :=
  4*s

 REGULAR_POLYGON_PERIMETER(n,s) :=
  n*s

 CIRCLE_PERIMETER(r) :=
  2*pi*r

 CIRCLE_PERIMETER_DIAMETER(d) :=
  pi*d

 COMPOSITE_PERIMETER(boundary_components) :=
  sum_of_lengths_of_exposed_boundary_components

 COORDINATE_PERIMETER(P_1,...,P_n) :=
  sum_i distance(P_i,P_{i+1})
  WITH P_{n+1}=P_1

 SCALE_PERIMETER(P,k) :=
  abs(k)*P

 CONVERT_PERIMETER(P,unit_from,unit_to) :=
  P*conversion_factor(unit_from,unit_to)
}

DEFINITIONS {
 D1 = "Perimeter has dimension L."
 D2 = "Perimeter is nonnegative."
 D3 = "Polygon perimeter is the sum of side lengths."
 D4 = "Circumference is the perimeter of a circle."
 D5 = "Composite perimeter includes only exposed outer and specified inner boundaries."
 D6 = "Shared internal edges of joined shapes are excluded from external perimeter."
 D7 = "Coordinate perimeter is obtained by summing consecutive point distances."
 D8 = "Similarity scale factor k changes perimeter by |k|."
 D9 = "Perimeter and area are different dimensions."
 D10 = "Unit conversion preserves the underlying boundary length."
}

AXIOMS {
 A1_NONNEGATIVITY:
  Perimeter >= 0

 A2_BOUNDARY_MEASURE:
  Perimeter equals the one-dimensional measure of the boundary

 A3_POLYGON_SUM:
  Polygon perimeter equals the sum of all side lengths

 A4_COMPOSITE_BOUNDARY:
  Composite perimeter counts exposed boundary exactly once

 A5_CIRCUMFERENCE:
  Circle perimeter equals 2*pi*r

 A6_SCALE:
  Similarity transformation with factor k multiplies perimeter by abs(k)

 A7_UNIT_INVARIANCE:
  Correct unit conversion preserves perimeter magnitude

 A8_DIMENSION:
  Perimeter has dimension L
}

REASONING {

 R1_PERIMETER_CLASSIFICATION {
  INPUT = geometric_figure
  IDENTIFY = polygon_circle_composite_coordinate_or_piecewise_boundary
  RETURN = perimeter_type
 }

 R2_POLYGON_PERIMETER {
  INPUT = side_lengths_or_vertices
  IF side_lengths_given
   SUM = all_side_lengths
  ELSE
   COMPUTE = consecutive_coordinate_distances
   SUM = all_edges_including_closing_edge
  RETURN = perimeter
 }

 R3_REGULAR_POLYGON {
  INPUT = number_of_sides_n_and_side_length_s
  COMPUTE = n*s
  RETURN = perimeter
 }

 R4_RECTANGLE_SQUARE {
  INPUT = dimensions
  IF square
   COMPUTE = 4*s
  ELSE IF rectangle
   COMPUTE = 2*(l+w)
  RETURN = perimeter
 }

 R5_CIRCLE {
  INPUT = radius_or_diameter
  IF radius_given
   COMPUTE = 2*pi*r
  ELSE IF diameter_given
   COMPUTE = pi*d
  RETURN = circumference
 }

 R6_COMPOSITE_FIGURE {
  INPUT = component_shapes_and_adjacencies
  IDENTIFY = external_boundary
  REMOVE = shared_internal_edges
  INCLUDE = required_inner_boundaries_if_domain_has_holes
  SUM = boundary_lengths
  RETURN = perimeter
 }

 R7_PIECEWISE_BOUNDARY {
  INPUT = segments_and_arcs
  COMPUTE = segment_lengths
  COMPUTE = arc_lengths
  SUM = all_boundary_components
  RETURN = perimeter
 }

 R8_SCALE {
  INPUT = original_perimeter_and_scale_factor
  COMPUTE = abs(k)*P
  RETURN = scaled_perimeter
 }

 R9_UNIT_CONVERSION {
  INPUT = perimeter_value_source_unit_target_unit
  VERIFY = both_are_length_units
  APPLY = conversion_factor
  RETURN = converted_perimeter
 }
}

CONSTRAINTS {
 C1 = "Only boundary components contribute to perimeter."
 C2 = "Internal shared edges of composite figures must not be double-counted."
 C3 = "Perimeter and area must not be conflated."
 C4 = "Coordinate polygons must include the closing edge."
 C5 = "Arc lengths require angle units to be interpreted correctly."
 C6 = "Holes may contribute additional boundary length if the problem defines total boundary."
 C7 = "Scale factors affect perimeter linearly."
 C8 = "Perimeter units are length units, not squared units."
 C9 = "Approximate side lengths produce approximate perimeter."
}

SEMANTIC_EQUIVALENCE {
 "Perimeter" <=> "BoundaryLength"
 "PolygonPerimeter" <=> "SumOfPolygonSideLengths"
 "Circumference" <=> "CirclePerimeter"
 "CompositePerimeter" <=> "TotalExposedBoundaryLength"
 "CoordinatePerimeter" <=> "ClosedPolylineLength"
}

VALIDATION {
 V1 = "All boundary components are included exactly once."
 V2 = "Internal shared edges are excluded where appropriate."
 V3 = "Polygon boundary is closed."
 V4 = "Circle formula uses radius or diameter consistently."
 V5 = "Arc length uses correct angle units."
 V6 = "Result is nonnegative."
 V7 = "Scale factor uses first power."
 V8 = "Output unit has dimension L."
 V9 = "Approximation status is preserved."
}

CONFIDENCE {
 BASE_CONFIDENCE = 0.99
 PERIMETER_DEFINITION = 0.99
 POLYGON_REASONING = 0.99
 COORDINATE_REASONING = 0.99
 COMPOSITE_REASONING = 0.98
 CIRCLE_REASONING = 0.99
 SCALE_REASONING = 0.99
 UNIT_REASONING = 0.99

 POLICY =
  "Reduce confidence when figure boundary, holes, shared edges, angle units, scale factor, units or approximation precision are underspecified."
}

AI_CONSUMPTION {
 PURPOSES = [
  SemanticSearch,
  OntologyGrounding,
  PerimeterReasoning,
  GeometricMeasurementReasoning,
  PolygonReasoning,
  CoordinateGeometryReasoning,
  CompositeFigureReasoning,
  CircumferenceReasoning,
  ArcLengthReasoning,
  ScaleReasoning,
  UnitConversionReasoning,
  DimensionalAnalysis,
  KnowledgeGraphConstruction,
  RetrievalAugmentation,
  RecursiveInference
 ]

 NORMALISE {
  "perimeter" -> Perimeter
  "boundary length" -> BoundaryLength
  "polygon perimeter" -> PolygonPerimeter
  "triangle perimeter" -> TrianglePerimeter
  "rectangle perimeter" -> RectanglePerimeter
  "square perimeter" -> SquarePerimeter
  "regular polygon perimeter" -> RegularPolygonPerimeter
  "circumference" -> Circumference
 }

 INTERPRETATION_ORDER = [
  detect_perimeter_context,
  identify figure_type_boundary_structure_dimensions_coordinates_units_and_scale,
  classify polygon_circle_composite_or_piecewise boundary,
  select boundary_length formula_or_decomposition,
  compute exposed_boundary_length,
  verify closure_internal_edge_unit_and_dimension constraints,
  return semantic output
 ]
}

EXECUTION_RULES {
 E1:
  IF query_mentions("perimeter")
  OR query_mentions("boundary length")
  THEN activate(PerimeterOntology)

 E2:
  IF polygon_side_lengths_given
  THEN sum all side lengths

 E3:
  IF polygon_coordinates_given
  THEN sum consecutive distances including closing edge

 E4:
  IF regular_polygon
  THEN use n*s

 E5:
  IF circle
  THEN use 2*pi*r or pi*d

 E6:
  IF composite_figure
  THEN remove shared_internal_edges before summing boundary

 E7:
  IF piecewise_boundary_contains_arcs
  THEN compute arc_lengths_with_radian_consistency

 E8:
  IF similarity_scale_given
  THEN multiply perimeter by abs(k)

 E9:
  IF unit_conversion_requested
  THEN verify length-unit compatibility
}

RECURSION {
 ENTRY = Perimeter

 EXPAND(Perimeter) -> [
  BoundaryLength,
  PolygonPerimeter,
  TrianglePerimeter,
  RectanglePerimeter,
  SquarePerimeter,
  RegularPolygonPerimeter,
  CompositeFigurePerimeter,
  Circumference,
  SideLength,
  ArcLength,
  CoordinatePerimeter,
  ScaleFactor,
  Unit,
  UnitConversion,
  ErrorBound
 ]

 EXPAND(PolygonPerimeter) -> [
  EdgeLength,
  CoordinateDistance,
  ClosingEdge,
  RegularPolygonPerimeter
 ]

 EXPAND(CompositeFigurePerimeter) -> [
  ExposedBoundary,
  SharedInternalEdge,
  HoleBoundary,
  PiecewiseBoundary
 ]

 EXPAND(Circumference) -> [
  Radius,
  Diameter,
  Pi,
  Circle
 ]

 STOP_CONDITION =
  "Stop when the requested boundary, component lengths, perimeter formula, unit, scale and precision status are sufficiently resolved."
}

ROUTING {
 PARENT_ONTOLOGY = "Geometric Measurement"

 IMMEDIATE_CONTEXTS = [
  "Geometric Measurement",
  "Length Ontology",
  "Polygon Ontology",
  "Circle Ontology"
 ]

 RELATED_ONTOLOGIES = [
  "Geometric Measurement",
  "Length Ontology",
  "Distance Ontology",
  "Triangle Ontology",
  "Quadrilateral Ontology",
  "Polygon Ontology",
  "Circle Ontology",
  "Coordinate Geometry Ontology",
  "Arc Length Ontologies",
  "Measurement & Units Ontologies"
 ]

 ROUTE_RULES = [
  "Perimeter -> Geometric Measurement for parent quantitative semantics",
  "Perimeter -> Length for one-dimensional boundary measure",
  "Perimeter -> Polygon for side and edge structure",
  "Perimeter -> Circle for circumference",
  "Perimeter -> Coordinate Geometry for coordinate-based edge lengths",
  "Perimeter -> Arc Length for curved boundary components",
  "Perimeter -> Measurement & Units for unit conversion",
  "Perimeter -> Distance for endpoint-based edge computation"
 ]
}

UPDATE_MODEL {
 MODE = "append-compatible semantic versioning"

 MAJOR = "ontology-breaking conceptual change"
 MINOR = "new compatible boundary types, formulas or reasoning pathways"
 PATCH = "clarification, metadata or formatting correction"

 RULES = [
  "Preserve boundary-length semantics.",
  "Preserve one-dimensional dimensionality.",
  "Preserve internal-edge exclusion for external perimeter.",
  "Preserve circumference as circle perimeter.",
  "Preserve closed-boundary reasoning.",
  "Preserve linear scale behaviour.",
  "Preserve unit compatibility.",
  "Preserve machine-readable perimeter semantics."
 ]
}

OUTPUT {
 CANONICAL_DEFINITION =
  "Perimeter is the total length of the boundary of a planar geometric figure."

 DIMENSION_SUMMARY =
  "Perimeter has dimension L."

 POLYGON_SUMMARY =
  "Polygon perimeter is the sum of all side lengths."

 RECTANGLE_SUMMARY =
  "P=2(l+w)."

 SQUARE_SUMMARY =
  "P=4s."

 REGULAR_POLYGON_SUMMARY =
  "P=n*s."

 CIRCLE_SUMMARY =
  "Circumference C=2*pi*r=pi*d."

 COMPOSITE_SUMMARY =
  "Composite perimeter sums exposed boundary components and excludes shared internal edges."

 SCALE_SUMMARY =
  "A similarity scale factor k changes perimeter by |k|."
}

FLOW {
 INPUT
 -> detect_perimeter_context
 -> identify figure_type_boundary_components_dimensions_coordinates_arcs_units_scale_and_precision
 -> classify polygon_regular_polygon_circle_composite_or_piecewise boundary
 -> select perimeter_formula_or_boundary_decomposition
 -> compute total_exposed_boundary_length
 -> apply scale_or_unit_conversion when required
 -> verify boundary_closure_internal_edge_angle_unit_dimension_and_precision constraints
 -> route to geometric_measurement length distance polygon circle coordinate arc_length_or_units ontology
 -> recursively_expand_required_dependencies
 -> verify_result
 -> assign_confidence
 -> produce_semantic_output
 -> END
}

SEMANTIC_SUMMARY {
 "The Perimeter Ontology defines the one-dimensional measure of a planar figure's boundary and supports polygons, triangles, rectangles, squares, regular polygons, circles through circumference, composite and piecewise boundaries, coordinate computation, arc contributions, similarity scaling, units and dimensional validation."
}

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

}

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