Skip to content

Claude/add academic proofs g3z zu#10

Merged
hyperpolymath merged 12 commits into
mainfrom
claude/add-academic-proofs-G3zZU
Dec 31, 2025
Merged

Claude/add academic proofs g3z zu#10
hyperpolymath merged 12 commits into
mainfrom
claude/add-academic-proofs-G3zZU

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 12 commits December 31, 2025 12:35
This commit adds exhaustive academic documentation covering the theoretical
foundations of the Anvomidav DSL for figure skating choreography notation.

## Formal Specification
- grammar.adoc: Complete EBNF grammar, lexical specification, parsing complexity
- semantics.adoc: Operational, denotational, and axiomatic semantics
- automata-theory.adoc: DFAs, PDAs, timed automata, tree automata

## Type Theory
- type-system.adoc: Dependent types, refinement types, effect system, linear types
- category-theory-foundations.adoc: CCCs, monads, adjunctions, fibred categories

## Domain Mathematics
- rink-geometry.adoc: Coordinate systems, paths, collision detection, topology
- temporal-specification.adoc: LTL, MTL, duration calculus, timed CSP
- skating-physics.adoc: Mechanics, dynamics, biomechanics
- numerical-analysis.adoc: Integration, error analysis, constraint handling

## Verification
- rules-specification.adoc: Formal ISU rule encoding
- verification-methodology.adoc: Theorem proving, model checking, runtime verification
- abstract-interpretation.adoc: Abstract domains, Galois connections, static analysis
- computational-complexity.adoc: Time/space bounds, decision problems, FPT

## Proofs
- soundness-completeness.adoc: Type soundness, semantic correctness, compiler correctness

## White Papers
- anvomidav-overview.adoc: Technical white paper summarizing the language

Each document includes theorems, proofs (or proof sketches), definitions,
and clearly marked TODO sections for areas requiring further development.
Comprehensive architecture document covering:
- 14 crate workspace structure
- Dependency graph between crates
- Key Rust crate selections (logos, chumsky, z3, tower-lsp, etc.)
- API sketches for each component
- 6-phase development roadmap
- Testing strategy (unit, property-based, snapshot, integration)
- Error handling approach with miette
Add complete workspace structure with four crates:

- anv-core: Domain types (Time, Position, Edge, JumpKind, Rotations,
  SpinPosition, Level, Diagnostics) for figure skating semantics

- anv-syntax: Lexer using logos with figure skating-specific tokens
  (edges, jumps, spins, levels) and parser using chumsky producing
  a typed AST

- anv-types: Hindley-Milner type checker with domain-specific types
  (Jump, Spin, StepSequence, etc.) and skating rule validation

- anv-cli: Command-line interface with check, parse, lex, fmt, and
  new commands using clap and miette for error reporting

The language supports:
- Program structure with segments (short/free/pattern)
- Element sequences with jumps, spins, step sequences
- Timing constraints and position tracking
- ISU-compliant element validation
- Add 22 new tests covering parser and type checker (68 total)
- Fix clippy warnings (enum_variant_names, while_let_on_iterator, etc.)
- Use #[default] derive macro for RotationDirection and Level enums
- Document safety invariant in switch_foot with expect()
- Box recursive expression parser components to reduce stack usage
- Use is_some_and instead of deprecated map_or pattern
- Fix token naming consistency (toe_loop not toe)
- Update ignored test message with accurate chumsky 0.9 limitation note

All 68 tests pass with 2 ignored for known issues:
- Function definition requires chumsky 0.10+ upgrade
- Doc-test skipped due to expression parsing
- Add anv-semantics crate with ISU rules validation engine
  - Discipline-specific rules (singles, pairs, ice dance)
  - Element count validation per segment type
  - Constraint checking (no pairs elements in singles, etc.)

- Extend parser for pairs and ice dance elements:
  - Lifts (Gr1-Gr5) with levels
  - Throws with rotation counts
  - Twists with rotation and level
  - Death spirals with edge and level
  - Choreographic elements (spiral, spread, ina, hydroblading, pivot)

- Add rhythm and exhibition segment types

- Update README.adoc with:
  - Architecture diagram
  - Complete syntax documentation
  - CLI command reference
  - Examples for all disciplines
  - Current implementation status

- Update ROADMAP.adoc with:
  - Visual progress indicator
  - Detailed task completion tracking
  - Test coverage summary (90+ tests)
  - Technical debt section
Replace manual Default impl with #[derive(Default)] for cleaner code.
New crate providing a flat, timeline-based IR for skating programs:

- types.rs: TimeCode and Duration types with arithmetic
- rink.rs: Position, RinkDimensions, Heading for rink geometry
  - ISU Olympic rink dimensions (60m x 30m)
  - Named positions (center, corners, judges side)
- timeline.rs: Event-based timeline with ISU code generation
  - All element types (jumps, spins, steps, pairs, dance)
  - JSON export support
  - Event filtering and querying
- lower.rs: AST to IR lowering with position estimation

14 new tests, all passing. Total test count now 104+.
New crate for generating visual representations of skating programs:

- rink_svg.rs: SVG rink diagram renderer
  - Olympic rink dimensions with ice markings
  - Element position markers with ISU codes
  - Color-coded element types (jumps=red, spins=blue, etc.)
  - Skating path traces
  - Configurable options (size, labels, markings)

- timeline_svg.rs: SVG timeline chart renderer
  - Horizontal timeline with time axis
  - Segment markers
  - Element bars with duration
  - Color-coded by element type

Rendering functions:
- render_to_svg(timeline) -> String
- render_to_file(timeline, path) -> Result

4 new tests, all passing. Total test count now 108+.
- Add viz, export, and info commands to CLI with full pipeline integration
- Create 5 example .anv programs: men's short, ladies free, pairs short,
  ice dance rhythm, and exhibition/gala
- Wire up Parse → Check → Lower → Viz/Export workflow in CLI
- Fix clippy derivable_impls warning in StepPattern enum

CLI now supports:
- anv viz: Generate SVG rink diagrams and timeline charts
- anv export: Export to JSON format with IR timeline data
- anv info: Display program details and ISU rule validation
- Fix doc comment (///) parsing at program level
- Add contextual help to parse error messages
- Improve error display with proper message/label/help fields
- Add comprehensive --help examples to all CLI commands
- Update CONTRIBUTING.md with Anvomidav-specific guidelines
- Add TextMate grammar for GitHub syntax highlighting
- Add .anv linguist configuration in .gitattributes

Parser now properly handles:
  /// Documentation comments
  /// before program declarations
  program name { ... }

Error messages now include:
  - Clear expected/found information
  - Contextual help suggestions
  - Source location with labeled spans
Complete tree-sitter grammar with:
- Full syntax support for programs, segments, sequences, elements
- All skating-specific constructs (jumps, spins, steps, pairs elements)
- Timing expressions and levels
- Doc comments and line comments
- Expressions and functions

Includes:
- grammar.js: Full grammar definition
- queries/highlights.scm: Syntax highlighting queries
- test/corpus/: Test cases for parser validation
- package.json: Build configuration

The grammar enables:
- Precise syntax highlighting in editors
- Structural navigation (go to definition, references)
- Code folding
- Incremental parsing for IDE performance
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit 6d01607 into main Dec 31, 2025
2 of 3 checks passed
@hyperpolymath
hyperpolymath deleted the claude/add-academic-proofs-G3zZU branch December 31, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants