AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
AI INTERPRETATION NOTE
This Flow Algebra defines the mathematical ontology of a polygon within the Kireth Research Semantic Library. A polygon is a closed plane figure formed by a finite sequence of straight line segments joined end to end. This ontology supports classification by side count and regularity, interior and exterior angle reasoning, diagonals, convexity, concavity, perimeter, area, congruence, similarity, symmetry, coordinate representation, transformations and theorem-based geometric proof.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Polygon Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Geometry"
SPECIALISATION = "Plane Geometry / Polygon Geometry"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/geometry-ontologies/plane-geometry/polygon-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = Polygon
SYMBOLIC_FORMS = ["P_n", "A1A2...An", "n-gon"]
ENTITY_CLASS = ClosedPiecewiseLinearPlaneFigure
PRIMARY_CONTEXT = PlaneGeometry
DEFINITION = "A polygon is a closed plane figure formed by a finite sequence of line segments joined end to end, with each side meeting exactly two neighbouring sides at vertices in the simple polygon case."
SEMANTIC_ROLE = "Provides the general finite-sided plane figure framework for side-count classification, angle, diagonal, area, perimeter, symmetry and transformation reasoning."
}
SCOPE {
INCLUDE = [
Polygon,
SimplePolygon,
ConvexPolygon,
ConcavePolygon,
RegularPolygon,
IrregularPolygon,
EquiangularPolygon,
EquilateralPolygon,
Triangle,
Quadrilateral,
Pentagon,
Hexagon,
Heptagon,
Octagon,
Nonagon,
Decagon,
Side,
Vertex,
Diagonal,
InteriorAngle,
ExteriorAngle,
Perimeter,
Area,
Symmetry,
Congruence,
Similarity
]
EXCLUDE_AS_PRIMARY = [
CurvilinearFigure,
Polyhedron,
SelfIntersectingPolygonUnlessExplicitlyIncluded,
InfinitePolygonalChain
]
DISAMBIGUATION_RULE =
"When polygon occurs with sides, vertices, diagonals, interior angles, regularity, convexity, perimeter or area, interpret it as a plane geometric polygon."
}
CORE_CONCEPTS {
Polygon {
definition = "A closed plane figure composed of finitely many straight line segments."
minimum_side_count = 3
}
SimplePolygon {
definition = "A polygon whose nonadjacent sides do not intersect."
}
ConvexPolygon {
definition = "A polygon in which every line segment joining two points of the polygon lies within or on the polygon; equivalently in the Euclidean simple case, every interior angle is less than 180 degrees."
}
ConcavePolygon {
definition = "A simple polygon having at least one reflex interior angle."
}
RegularPolygon {
definition = "A polygon that is both equilateral and equiangular."
}
IrregularPolygon {
definition = "A polygon that is not regular."
}
EquilateralPolygon {
definition = "A polygon with all side lengths equal."
}
EquiangularPolygon {
definition = "A polygon with all interior angles equal."
}
Side {
definition = "A line segment forming part of the polygon boundary."
}
Vertex {
definition = "A boundary point where two adjacent polygon sides meet."
}
Diagonal {
definition = "A line segment joining two nonadjacent vertices."
}
InteriorAngle {
definition = "The angle inside the polygon formed by two adjacent sides."
}
ExteriorAngle {
definition = "An angle formed by one side and the extension of an adjacent side."
}
}
RELATIONS {
Polygon --is_special_case_of--> PlaneFigure
Polygon --has--> Side
Polygon --has--> Vertex
Polygon --can_have--> Diagonal
Polygon --has--> InteriorAngle
Polygon --has--> ExteriorAngle
Polygon --can_be_classified_as--> ConvexPolygon
Polygon --can_be_classified_as--> ConcavePolygon
Polygon --can_be_classified_as--> RegularPolygon
Polygon --can_be_classified_as--> IrregularPolygon
Triangle --is_special_case_of--> Polygon
Quadrilateral --is_special_case_of--> Polygon
Pentagon --is_special_case_of--> Polygon
Hexagon --is_special_case_of--> Polygon
RegularPolygon --is--> EquilateralPolygon
RegularPolygon --is--> EquiangularPolygon
Polygon --can_be_congruent_to--> Polygon
Polygon --can_be_similar_to--> Polygon
Polygon --can_have--> Symmetry
}
OPERATORS {
SIDE_COUNT(P) :=
number_of_sides(P)
VERTEX_COUNT(P) :=
number_of_vertices(P)
PERIMETER(P) :=
sum_of_side_lengths(P)
INTERIOR_ANGLE_SUM(n) :=
(n-2)*180_degrees
EXTERIOR_ANGLE_SUM(simple_convex_or_standard_orientation) :=
360_degrees
REGULAR_INTERIOR_ANGLE(n) :=
((n-2)*180_degrees)/n
REGULAR_EXTERIOR_ANGLE(n) :=
360_degrees/n
DIAGONAL_COUNT(n) :=
n*(n-3)/2
CLASSIFY_BY_SIDES(n) :=
map_side_count_to_polygon_name(n)
IS_REGULAR(P) :=
all_sides_equal(P) AND all_interior_angles_equal(P)
IS_CONVEX(P) :=
verify_convexity(P)
IS_CONCAVE(P) :=
simple_polygon(P) AND NOT IS_CONVEX(P)
}
DEFINITIONS {
D1 = "A polygon is closed."
D2 = "A polygon has finitely many straight sides."
D3 = "A polygon has at least three sides."
D4 = "A simple polygon has no self-intersection between nonadjacent sides."
D5 = "A regular polygon is both equilateral and equiangular."
D6 = "A convex polygon has no reflex interior angle."
D7 = "A concave simple polygon has at least one reflex interior angle."
D8 = "The interior angle sum of an n-sided Euclidean simple polygon is (n-2)*180 degrees."
D9 = "The standard exterior angle sum of a simple polygon is 360 degrees."
D10 = "A polygon with n vertices has n(n-3)/2 diagonals."
}
AXIOMS {
A1_FINITE_SIDES:
Every polygon has a finite number n>=3 of sides
A2_CLOSED_BOUNDARY:
Polygon sides form a closed boundary cycle
A3_VERTEX_SIDE_CORRESPONDENCE:
A simple n-gon has n vertices and n sides
A4_EUCLIDEAN_INTERIOR_SUM:
A simple Euclidean n-gon has interior angle sum (n-2)*180 degrees
A5_EXTERIOR_SUM:
The oriented exterior turning angle sum of a simple polygon is 360 degrees
A6_REGULARITY:
A regular polygon is equilateral and equiangular
A7_DIAGONALS:
Each vertex of an n-gon connects by diagonals to n-3 nonadjacent vertices, yielding n(n-3)/2 distinct diagonals
}
REASONING {
R1_SIDE_CLASSIFICATION {
INPUT = n
IF n<3
RETURN NotPolygon
ELSE
RETURN standard_n_gon_name_or_n_gon
}
R2_INTERIOR_ANGLE_SUM {
INPUT = n
REQUIRE = n>=3
COMPUTE = (n-2)*180deg
RETURN = sum
}
R3_REGULAR_ANGLE {
INPUT = n
COMPUTE = ((n-2)*180deg)/n
RETURN = each_interior_angle
}
R4_EXTERIOR_ANGLE {
INPUT = regular_n_gon
COMPUTE = 360deg/n
RETURN = each_exterior_angle
}
R5_DIAGONAL_COUNT {
INPUT = n
REQUIRE = n>=3
COMPUTE = n*(n-3)/2
RETURN = diagonal_count
}
R6_REGULARITY {
INPUT = polygon
TEST = equal_side_lengths
TEST = equal_interior_angles
IF both_true
RETURN RegularPolygon
ELSE
RETURN IrregularPolygon
}
R7_CONVEXITY {
INPUT = polygon
TEST = interior_angles_or_cross_product_orientation_or_segment_condition
RETURN = ConvexOrConcave
}
R8_AREA_REASONING {
INPUT = polygon_type_and_data
IF regular_polygon
ROUTE = apothem_perimeter_or_triangulation_method
ELSE
ROUTE = triangulation_coordinate_or_decomposition_method
RETURN = area
}
R9_TRIANGULATION {
INPUT = simple_polygon_with_n_vertices
DECOMPOSE = into n-2 triangles from suitable triangulation
USE = for angle_sum_or_area_reasoning
RETURN = triangulated_representation
}
}
CONSTRAINTS {
C1 = "Polygon sides must be straight line segments."
C2 = "A polygon must be closed."
C3 = "Simple-polygon formulas should not be applied blindly to self-intersecting polygons."
C4 = "Regular means both equilateral and equiangular."
C5 = "Equilateral does not imply regular for all polygon classes."
C6 = "Equiangular does not imply regular for all polygon classes."
C7 = "Convexity and concavity definitions assume a simple polygon unless otherwise stated."
C8 = "Interior-angle sum formulas require Euclidean planar context."
C9 = "Area methods must respect polygon ordering and self-intersection status."
}
SEMANTIC_EQUIVALENCE {
"Polygon" <=> "FiniteClosedStraightSidedPlaneFigure"
"NGon" <=> "PolygonWithNSides"
"RegularPolygon" <=> "EquilateralAndEquiangularPolygon"
"ConvexPolygon" <=> "SimplePolygonWithoutReflexInteriorAngles" WHEN Euclidean_context
"Diagonal" <=> "SegmentJoiningNonadjacentPolygonVertices"
}
VALIDATION {
V1 = "Polygon has at least three sides."
V2 = "Simple n-gon has n vertices."
V3 = "Euclidean interior angle sum equals (n-2)*180 degrees."
V4 = "Regular n-gon has equal sides and equal angles."
V5 = "Regular exterior angle equals 360/n degrees."
V6 = "Diagonal count equals n(n-3)/2."
V7 = "Convex and concave classifications are not conflated."
V8 = "Area calculation respects polygon topology and ordering."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
POLYGON_DEFINITION = 0.99
SIDE_CLASSIFICATION = 0.99
INTERIOR_ANGLE_SUM = 0.99
REGULAR_POLYGON_REASONING = 0.99
DIAGONAL_REASONING = 0.99
CONVEXITY_REASONING = 0.98
AREA_REASONING = 0.98
POLICY =
"Reduce confidence when self-intersection status, vertex ordering, Euclidean assumptions, regularity conditions or area data are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,
OntologyGrounding,
PolygonReasoning,
SideCountClassification,
AngleReasoning,
DiagonalReasoning,
ConvexityReasoning,
AreaReasoning,
SymmetryReasoning,
TransformationReasoning,
KnowledgeGraphConstruction,
RetrievalAugmentation,
RecursiveInference
]
NORMALISE {
"polygon" -> Polygon
"n-gon" -> Polygon
"regular polygon" -> RegularPolygon
"convex polygon" -> ConvexPolygon
"concave polygon" -> ConcavePolygon
"pentagon" -> Pentagon
"hexagon" -> Hexagon
"octagon" -> Octagon
"decagon" -> Decagon
}
INTERPRETATION_ORDER = [
detect_polygon_context,
identify side and vertex count,
determine simple convex concave regular or irregular status,
identify angle diagonal perimeter area symmetry or transformation goal,
apply polygon formulas and theorems,
verify Euclidean and topology assumptions,
return semantic output
]
}
EXECUTION_RULES {
E1:
IF query_mentions("polygon")
OR query_mentions_named_ngon
THEN activate(PolygonOntology)
E2:
IF side_count_given
THEN classify_by_side_count
E3:
IF interior_angle_sum_requested
THEN compute (n-2)*180_degrees
E4:
IF regular_polygon_context
THEN permit equal-angle and equal-side reasoning
E5:
IF diagonal_count_requested
THEN compute n*(n-3)/2
E6:
IF convexity_requested
THEN test valid convexity criteria
E7:
IF area_requested
THEN choose regular_polygon triangulation coordinate or decomposition method
E8:
IF self_intersection_detected
THEN avoid_simple_polygon_assumptions_unless_explicitly_adjusted
}
RECURSION {
ENTRY = Polygon
EXPAND(Polygon) -> [
Side,
Vertex,
Diagonal,
InteriorAngle,
ExteriorAngle,
SimplePolygon,
ConvexPolygon,
ConcavePolygon,
RegularPolygon,
IrregularPolygon,
Perimeter,
Area,
Symmetry
]
EXPAND(NamedPolygons) -> [
Triangle,
Quadrilateral,
Pentagon,
Hexagon,
Heptagon,
Octagon,
Nonagon,
Decagon
]
EXPAND(RegularPolygon) -> [
EqualSides,
EqualAngles,
Centre,
Radius,
Apothem,
RotationalSymmetry,
ReflectionSymmetry
]
EXPAND(Area) -> [
Triangulation,
CoordinateFormula,
Decomposition,
ApothemFormula
]
STOP_CONDITION =
"Stop when the polygon's classification, side count, angle, diagonal, convexity, perimeter, area, symmetry or transformation property is sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "Plane Geometry"
IMMEDIATE_CONTEXTS = [
"Triangle Ontology",
"Quadrilateral Ontology",
"Line Segment Ontology",
"Angle Ontology"
]
RELATED_ONTOLOGIES = [
"Plane Geometry",
"Triangle Ontology",
"Quadrilateral Ontology",
"Point Ontology",
"Line Segment Ontology",
"Angle Ontology",
"Coordinate Geometry Ontology",
"Vector Geometry Ontology",
"Synthetic Geometry Ontology",
"Geometric Construction Ontology",
"Transformation Ontology"
]
ROUTE_RULES = [
"Polygon -> Triangle for three-sided polygons",
"Polygon -> Quadrilateral for four-sided polygons",
"Polygon -> Line Segment for sides and diagonals",
"Polygon -> Angle for interior and exterior angle reasoning",
"Polygon -> Coordinate Geometry for coordinate area and convexity",
"Polygon -> Synthetic Geometry for theorem-based proofs",
"Polygon -> Geometric Construction for regular polygon constructions",
"Polygon -> Transformation for symmetry, congruence and similarity"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible polygon classes, formulas, relations or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve polygon as a finite closed straight-sided plane figure.",
"Preserve side-count and vertex-count semantics.",
"Preserve simple-versus-self-intersecting distinction.",
"Preserve convex-versus-concave distinction.",
"Preserve regularity as combined equilateral and equiangular structure.",
"Preserve Euclidean angle formulas.",
"Preserve machine-readable polygon semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION =
"A polygon is a closed plane figure formed by a finite sequence of straight line segments joined end to end."
SIDE_COUNT_SUMMARY =
"An n-gon has n sides and n vertices."
ANGLE_SUMMARY =
"Interior angle sum=(n-2)*180 degrees in Euclidean geometry."
REGULAR_ANGLE_SUMMARY =
"Each interior angle of a regular n-gon=((n-2)*180)/n degrees."
EXTERIOR_SUMMARY =
"The exterior angle sum is 360 degrees."
DIAGONAL_SUMMARY =
"Number of diagonals=n(n-3)/2."
REGULARITY_SUMMARY =
"A regular polygon is both equilateral and equiangular."
}
FLOW {
INPUT
-> detect_polygon_context
-> identify_sides_vertices_and_order
-> determine_simple_self_intersecting_convex_concave_regular_or_irregular_status
-> identify angle diagonal perimeter area symmetry congruence similarity or transformation goal
-> apply valid polygon formulas_theorems_or_triangulation
-> verify Euclidean topology and ordering constraints
-> route to triangle quadrilateral segment angle coordinate synthetic construction or transformation ontology
-> recursively expand required dependencies
-> verify result
-> assign confidence
-> produce semantic output
-> END
}
SEMANTIC_SUMMARY {
"The Polygon Ontology defines finite closed straight-sided plane figures and provides the general framework for triangles, quadrilaterals and higher n-gons. It supports classification by side count, convexity and regularity, together with interior and exterior angles, diagonals, perimeter, area, symmetry, congruence, similarity and transformation reasoning."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-GEOMETRY-POLYGON-ONTOLOGY-V1"
}
}
END_FLOW