AI INTERPRETATION NOTE
This Flow Algebra defines the mathematical ontology of length within the Kireth Research Semantic Library. Length is a one-dimensional geometric measure of extent and applies to line segments, polygonal paths, curves, arcs, boundaries and other one-dimensional geometric structures. This ontology supports Euclidean segment length, coordinate distance, polygonal path length, arc length, curve length, scaling, units, dimensional analysis, exact and approximate values, metric dependence and relationships with perimeter, circumference, distance and geometric measurement.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Length Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Geometry"
SPECIALISATION = "Geometric Measurement / Length"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/geometry-ontologies/geometric-measurement/length-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = Length
SYMBOLIC_FORMS = [
"L",
"|AB|",
"d(A,B)",
"integral ||gamma'(t)|| dt"
]
ENTITY_CLASS = OneDimensionalGeometricMeasure
PRIMARY_CONTEXT = GeometricMeasurement
DEFINITION = "Length is the nonnegative one-dimensional measure of the extent of a geometric object or path."
SEMANTIC_ROLE = "Provides the fundamental one-dimensional measurement framework for segments, paths, curves, arcs, perimeters, circumferences, scaling and unit-aware geometric reasoning."
}
SCOPE {
INCLUDE = [
Length,
SegmentLength,
Distance,
EuclideanLength,
CoordinateLength,
PathLength,
PolylineLength,
CurveLength,
ArcLength,
Perimeter,
Circumference,
Radius,
Diameter,
ScaleFactor,
Unit,
UnitConversion,
ExactLength,
ApproximateLength,
MeasurementPrecision,
ErrorBound,
Metric
]
EXCLUDE_AS_PRIMARY = [
Area,
SurfaceArea,
Volume,
Duration,
NonGeometricLengthUsageWithoutSpatialMeaning
]
DISAMBIGUATION_RULE =
"When length refers to spatial extent, segment magnitude, path distance, curve length, arc length, perimeter or circumference, interpret it as a geometric one-dimensional measure."
}
CORE_CONCEPTS {
Length {
definition = "A one-dimensional measure of geometric extent."
dimension = "L"
}
SegmentLength {
definition = "The distance between the endpoints of a line segment."
}
EuclideanLength {
definition = "Length induced by the Euclidean norm."
}
CoordinateLength {
definition = "Length computed from coordinate differences under a declared metric."
}
PathLength {
definition = "The accumulated length along a path."
}
PolylineLength {
definition = "The sum of the lengths of consecutive line segments in a polyline."
}
CurveLength {
definition = "The supremum of polygonal approximations or, for sufficiently smooth curves, the integral of speed."
}
ArcLength {
definition = "The length measured along an arc or parametrised curve."
}
Perimeter {
definition = "The total boundary length of a planar figure."
}
Circumference {
definition = "The perimeter of a circle."
}
ScaleFactor {
definition = "A multiplicative factor changing lengths linearly."
}
}
RELATIONS {
Length --is_measure_of--> OneDimensionalExtent
SegmentLength --is_special_case_of--> Length
Distance --can_equal--> SegmentLength
PathLength --is_special_case_of--> Length
CurveLength --is_special_case_of--> PathLength
ArcLength --is_special_case_of--> CurveLength
PolylineLength --is_sum_of--> SegmentLength
Perimeter --is_total_boundary--> Length
Circumference --is_special_case_of--> Perimeter
Radius --is--> Length
Diameter --is--> Length
Diameter --equals--> TwiceRadius
ScaleFactor --transforms--> Length
UnitConversion --preserves--> LengthMagnitude
Metric --determines--> Distance
}
OPERATORS {
SEGMENT_LENGTH_2D((x1,y1),(x2,y2)) :=
sqrt((x2-x1)^2+(y2-y1)^2)
SEGMENT_LENGTH_3D((x1,y1,z1),(x2,y2,z2)) :=
sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
VECTOR_LENGTH(v) :=
sqrt(sum_i v_i^2)
WHEN Euclidean_metric
POLYLINE_LENGTH(P_0,...,P_n) :=
sum_{i=0}^{n-1} distance(P_i,P_{i+1})
CURVE_LENGTH(gamma,a,b) :=
integral_a^b norm(gamma'(t)) dt
WHEN gamma_is_piecewise_C1
CIRCLE_ARC_LENGTH(r,theta_radians) :=
r*theta_radians
CIRCUMFERENCE(r) :=
2*pi*r
PERIMETER_POLYGON(vertices) :=
sum_of_consecutive_edge_lengths
SCALE_LENGTH(L,k) :=
abs(k)*L
WHEN geometric_similarity_scale
CONVERT_LENGTH(L,unit_from,unit_to) :=
L*conversion_factor(unit_from,unit_to)
}
DEFINITIONS {
D1 = "Length has physical dimension L."
D2 = "Length is nonnegative."
D3 = "Segment length equals endpoint distance under the chosen metric."
D4 = "Polyline length is additive over consecutive segments."
D5 = "Smooth curve length is the integral of speed."
D6 = "Arc length on a circle is r*theta when theta is in radians."
D7 = "Circumference is 2*pi*r."
D8 = "A similarity scale factor k changes lengths by |k|."
D9 = "Unit conversion changes representation, not magnitude."
D10 = "Length depends on the metric when the ambient space is non-Euclidean or otherwise specified."
}
AXIOMS {
A1_NONNEGATIVITY:
Length >= 0
A2_ZERO_LENGTH:
A nondegenerate metric segment has zero length iff its endpoints coincide
A3_SEGMENT_METRIC:
Segment length equals the metric distance between endpoints
A4_POLYLINE_ADDITIVITY:
Polyline length is the sum of constituent segment lengths
A5_CURVE_REPARAMETERISATION:
Curve length is invariant under suitable monotone regular reparameterisation
A6_SCALE:
Similarity transformation with scale factor k multiplies length by |k|
A7_UNIT_INVARIANCE:
Correct unit conversion preserves physical magnitude
A8_DIMENSION:
Length quantities carry dimension L
}
REASONING {
R1_LENGTH_CLASSIFICATION {
INPUT = measurement_problem
IDENTIFY = segment_vector_polyline_curve_arc_boundary_or_other_object
IDENTIFY = metric
RETURN = length_type
}
R2_SEGMENT_LENGTH {
INPUT = endpoints_and_metric
IF Euclidean_2D
APPLY = Euclidean_distance_2D
ELSE IF Euclidean_3D
APPLY = Euclidean_distance_3D
ELSE
APPLY = metric_distance
RETURN = segment_length
}
R3_POLYLINE_LENGTH {
INPUT = ordered_points
COMPUTE = consecutive_segment_lengths
SUM = segment_lengths
RETURN = polyline_length
}
R4_CURVE_LENGTH {
INPUT = parametrised_curve
VERIFY = sufficient_regular_or_piecewise_smooth_conditions
COMPUTE = speed
INTEGRATE = speed_over_parameter_interval
RETURN = curve_length
}
R5_ARC_LENGTH {
INPUT = circle_radius_and_angle
VERIFY = angle_unit
IF degrees
CONVERT = to_radians
COMPUTE = r*theta
RETURN = arc_length
}
R6_PERIMETER {
INPUT = boundary_segments_or_curve
COMPUTE = total_boundary_length
RETURN = perimeter
}
R7_SCALE {
INPUT = original_length_and_scale_factor
COMPUTE = abs(k)*L
RETURN = scaled_length
}
R8_UNIT_CONVERSION {
INPUT = value_source_unit_target_unit
VERIFY = both_units_length_dimension
APPLY = conversion_factor
RETURN = converted_length
}
R9_PRECISION {
INPUT = approximate_length
TRACK = significant_figures_decimal_places_or_error_bound
RETURN = precision_aware_length
}
}
CONSTRAINTS {
C1 = "Length values cannot be negative."
C2 = "The metric must be identified when non-Euclidean distance is possible."
C3 = "Degrees must be converted to radians before using s=r*theta."
C4 = "Curve-length integration requires sufficient regularity."
C5 = "A path length may exceed straight-line endpoint distance."
C6 = "Perimeter and area must not be conflated."
C7 = "Unit conversion must preserve length dimension."
C8 = "Scale factors affect length linearly, not quadratically or cubically."
C9 = "Approximate measurements must not be represented as exact."
}
SEMANTIC_EQUIVALENCE {
"Length" <=> "OneDimensionalMeasure"
"SegmentLength" <=> "EndpointDistance"
"CurveLength" <=> "ArcLengthOfParametrisedCurve"
"PolylineLength" <=> "SumOfConsecutiveSegmentLengths"
"Circumference" <=> "CircleBoundaryLength"
"Perimeter" <=> "BoundaryLength"
}
VALIDATION {
V1 = "Result is nonnegative."
V2 = "Output unit is a length unit."
V3 = "Metric is appropriate to the space."
V4 = "Polyline segments follow the declared order."
V5 = "Curve length uses norm of derivative."
V6 = "Arc-length angle is interpreted in radians."
V7 = "Scale factor uses first power."
V8 = "Precision status is preserved."
V9 = "Dimensional result is L."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
LENGTH_DEFINITION = 0.99
SEGMENT_REASONING = 0.99
POLYLINE_REASONING = 0.99
CURVE_LENGTH_REASONING = 0.99
ARC_LENGTH_REASONING = 0.99
UNIT_REASONING = 0.99
SCALE_REASONING = 0.99
PRECISION_REASONING = 0.98
POLICY =
"Reduce confidence when metric, units, curve regularity, angle units, scale convention or measurement precision are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,
OntologyGrounding,
LengthReasoning,
GeometricMeasurementReasoning,
SegmentReasoning,
CoordinateDistanceReasoning,
PathLengthReasoning,
CurveLengthReasoning,
ArcLengthReasoning,
PerimeterReasoning,
CircumferenceReasoning,
ScaleReasoning,
UnitConversionReasoning,
DimensionalAnalysis,
KnowledgeGraphConstruction,
RetrievalAugmentation,
RecursiveInference
]
NORMALISE {
"length" -> Length WHEN geometry_context
"segment length" -> SegmentLength
"line length" -> SegmentLength WHEN line_segment_context
"path length" -> PathLength
"polyline length" -> PolylineLength
"curve length" -> CurveLength
"arc length" -> ArcLength
"perimeter" -> Perimeter
"circumference" -> Circumference
}
INTERPRETATION_ORDER = [
detect_length_context,
identify geometric_object_metric_coordinates_units_and_precision,
classify segment_polyline_curve_arc_perimeter_circumference_or_scaled_length goal,
select valid_formula_or_metric,
compute length,
verify nonnegativity_dimension_units_and_assumptions,
return semantic output
]
}
EXECUTION_RULES {
E1:
IF query_mentions("length")
AND geometric_measurement_context
THEN activate(LengthOntology)
E2:
IF segment_endpoints_given
THEN use metric_distance
E3:
IF ordered_polyline_points_given
THEN sum consecutive_segment_lengths
E4:
IF parametrised_curve_given
THEN integrate norm(gamma'(t))
E5:
IF circular_arc_given
THEN use s=r*theta with theta_in_radians
E6:
IF perimeter_requested
THEN sum all boundary_length_components
E7:
IF similarity_scale_given
THEN multiply length by abs(k)
E8:
IF unit_conversion_requested
THEN validate both units as length units
E9:
IF approximate_inputs
THEN preserve error_or_precision metadata
}
RECURSION {
ENTRY = Length
EXPAND(Length) -> [
SegmentLength,
Distance,
EuclideanLength,
CoordinateLength,
PathLength,
PolylineLength,
CurveLength,
ArcLength,
Perimeter,
Circumference,
Radius,
Diameter,
ScaleFactor,
Unit,
UnitConversion,
ExactLength,
ApproximateLength,
ErrorBound
]
EXPAND(CurveLength) -> [
ParametricCurve,
Speed,
ArcLengthIntegral,
Reparameterisation
]
EXPAND(Perimeter) -> [
PolygonBoundary,
SegmentLength,
Circumference,
PiecewiseCurveLength
]
EXPAND(UnitConversion) -> [
LengthUnit,
ConversionFactor,
DimensionalConsistency
]
STOP_CONDITION =
"Stop when the requested length, formula, metric, unit, scale, exactness and precision status are sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "Geometric Measurement"
IMMEDIATE_CONTEXTS = [
"Geometric Measurement",
"Coordinate Geometry Ontology",
"Line Segment Ontology",
"Curve Ontology"
]
RELATED_ONTOLOGIES = [
"Geometric Measurement",
"Coordinate Geometry Ontology",
"Line Segment Ontology",
"Curve Ontology",
"Circle Ontology",
"Polygon Ontology",
"Distance Ontologies",
"Measurement & Units Ontologies",
"Calculus & Analysis Ontologies",
"Vector Geometry Ontology"
]
ROUTE_RULES = [
"Length -> Geometric Measurement for parent quantitative semantics",
"Length -> Coordinate Geometry for endpoint and coordinate computation",
"Length -> Line Segment for finite straight-line geometry",
"Length -> Curve for arc-length and path-length reasoning",
"Length -> Circle for radius, diameter, circumference and circular arcs",
"Length -> Polygon for perimeter",
"Length -> Measurement & Units for unit conversion",
"Length -> Calculus for curve-length integration",
"Length -> Vector Geometry for vector norm interpretation"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible length measures, metrics, formulas or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve one-dimensional measure semantics.",
"Preserve nonnegativity.",
"Preserve metric dependence.",
"Preserve curve-length reparameterisation invariance.",
"Preserve unit dimensionality.",
"Preserve first-power scaling.",
"Preserve exact-versus-approximate distinction.",
"Preserve machine-readable length semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION =
"Length is the nonnegative one-dimensional measure of geometric extent."
DIMENSION_SUMMARY =
"Length has dimension L."
SEGMENT_SUMMARY =
"A line-segment length equals the distance between its endpoints."
POLYLINE_SUMMARY =
"Polyline length is the sum of consecutive segment lengths."
CURVE_SUMMARY =
"For a sufficiently smooth curve, L=integral ||gamma'(t)|| dt."
ARC_SUMMARY =
"For a circular arc, s=r*theta when theta is measured in radians."
SCALE_SUMMARY =
"A similarity scale factor k changes length by |k|."
UNIT_SUMMARY =
"Length-unit conversion preserves the underlying magnitude."
}
FLOW {
INPUT
-> detect_length_context
-> identify object_coordinates_metric_units_angle_convention_scale_and_precision
-> classify segment_vector_polyline_curve_arc_perimeter_circumference_or_other length
-> select metric_formula_or_integral
-> compute length
-> apply scaling_or_unit_conversion when required
-> verify nonnegativity_dimension_units_metric_and_precision constraints
-> route to geometric_measurement coordinate line_segment curve circle polygon units calculus_or_vector ontology
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
SEMANTIC_SUMMARY {
"The Length Ontology defines one-dimensional geometric measurement and supports segment distance, coordinate length, polyline and path length, curve and arc length, perimeter, circumference, similarity scaling, units, conversion, precision and metric-aware reasoning."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-GEOMETRY-LENGTH-ONTOLOGY-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard