AGENTS.md@src/gnn/execute/discopy · git:20260906.e62b9e9 · 2026-09-06 · sha256 2b716e02b634e73b

AGENTS.md@src/gnn/execute/discopy git:20260906.e62b9e9A

Immutable. This exact content is served forever at /api/v1/blob/2b716e02b634e73b.

# DisCoPy Execution Sub-module

## Overview

Execution module for DisCoPy categorical diagrams generated by Step 11 (Render). Validates and analyzes DisCoPy diagram structures, verifying compositional correctness and computing categorical properties.

## Architecture

```
discopy/
├── __init__.py            # Package exports and entry point
└── discopy_executor.py    # DisCoPy validation and analysis engine (436 lines)
```

## Key Functions

- **`execute_discopy(script_path, output_dir)`** — Validates and executes a rendered DisCoPy diagram script.
- **Diagram validation** — Verifies categorical composition rules (functoriality, naturality).
- **Property computation** — Computes diagram invariants and structural properties.
- **Result serialization** — Outputs execution results as JSON for downstream analysis.

## Dependencies

- `discopy` (optional, graceful degradation if missing)

## Parent Module

See [execute/AGENTS.md](../AGENTS.md) for the overall execution architecture.

**Version**: 3.2.0