Symbolic dependency mapping, formal pseudocode, and G-Index generation (`G.1`–`G.601`) for Euclid's *Elements*.
geometor.elements is the symbolic logic and serialization layer of the GEOMETOR Euclid project. While the sister repository geometor/euclid focuses on semantic discovery and compiling the 3-volume Heath Edition, geometor.elements codifies the logical structure of the Elements into a computable directed acyclic dependency graph—the G-Index (G.1 through G.601)—and renders a 3-track Book Codex powered by photon-platform/publish.
- Graph Crawl, Atomic Splitting & Term Wiring (``graph.py``):
- Crawls the composed Heath Edition in
../euclid/docsrc/heath/, splitting definitions, postulates, common notions, and propositions into discrete anchored nodes in anetworkx.DiGraph. - Resolves explicit proposition justifications and :term: vocabulary references as structural dependencies, attaches semantic categories and tags (book-i–book-xiii), copies recalibrated SVG diagrams, and pairs foundational rules and propositions with symbolicgeometor.modelconstruction scripts (resources/constructions/<id>/g1.py). - Topological Sequencing & G-Index Assignment (``g_index.py``):
- Sequences all 601 connected definitions, postulates, common notions, and propositions into a strict dependency order (G.1–G.601) with concise lowercase verb-phrase titles (e.g.,
G.17 construct an equilateral triangle), while tracking the 5 unreferenced definitions indocsrc/elements2/orphans.rst. - Generates per-element Graphviz dependency trees showing immediate ancestors and descendants. - Formal Pseudocode & Composable Functions (``pseudocode.py``):
- Distills Heath's prose enunciations into concise symbolic fact statements (resources/enunciations.json), normalizing finite straight line to segment and curve boundaries to arcs.
- Generates formal
.. signature::blocks (theorem, problem, or rule) declaringgiven,construct, andproveparameters with :sig: type annotations (segment, point, line, circle, angle, triangle, polygon, magnitude, number, ratio). - Converts Euclidean constructions and proofs into structured.. step:: <kind>sequences (given, construct with composable:fn:calls such as segment, circle, equilateral_triangle, bisect_angle, bisect_segment, perpendicular_at, perpendicular_from, copy_angle, parallel_line, square, symbolic intersect with∩, assert, and conclude) paired with semantic rule justifications and two-point circle notation( A B )(centerA, defining radius pointB). - 3-Track Book Codex Generation (`docsrc/elements2/G.<n>/`):
- Pseudocode Track (`index.rst`): Formal
.. enunciation::, interactive SVG figure with step-by-step playback controls,.. signature::block, and symbolic.. step::sequence with explicit GEOMETOR indications (/ A B /,[ A B ],( A B ),< B A C ),< A B C >,A),:eq:equality tick-mark assertions, and:coincide:(≃) superposition assertions. - Code Track (`code.rst`): Callable.. function::header, executablegeometor.modelPython construction script (g1.py), and interactive dependency graph. - Heath Track (`heath.rst`): Classical Heath prose translation with:g:symbolic indications andG.<k>justification pills, deep-linked viaintersphinxto geometor/euclid.
- Uses
:layout: bookin photon-platform/publish to provide instant tab switching between Pseudocode, Code, and Heath tracks across all 601 G-Index elements. - Leverages
geometor_interactive.jsso stepping through.. step::directives in the Pseudocode track progressively reveals the corresponding geometric primitives in the SVG diagram and highlights equal segments/angles with center tick marks. - Exports resources/enunciations.json and docs/objects.inv for cross-repository tooltips and intersphinx references.
# Generate the complete G-Index (G.1..G.525) into docsrc/elements2/
python3 -m geometor.elements
# Build and serve the 3-track Book Codex locally
publish test- Live Edition: https://geometor.github.io/elements
- Source Code: https://github.com/geometor/elements
- GEOMETOR • euclid: 3-volume Heath Edition source text and commentary.
- GEOMETOR • model: Symbolic geometric construction engine.
- PHOTON • publish: Sphinx Book Codex publishing engine and theme.