# Deductive Systems, Rule Schemas, and Span Components

The abstract framework for weighted deductive parsing, organized into three layers:

## Deductive Systems

Five abstract primitives for weighted deductive parsing (Shieber, Schabes & Pereira 1995; Goodman 1999). All parsing algorithms are instances of this framework.

- **`Axiom`** — Creates and populates the initial chart from input.
- **`Deduction`** — A weighted inference step (chart → chart).
- **`Goal`** — Extracts the result from a completed chart.
- **`Schedule`** — Evaluation strategy (CKY bottom-up, Earley, agenda-based).
- **`DeductiveSystem`** — Ties axiom, deductions, goal, schedule, and semiring into a single `nn.Module`.

::: quivers.stochastic.deduction

## Rule Schemas

Composable functors `CategorySystem → RuleSystem`. Schemas are the abstract building blocks of grammar formalisms: each schema defines a structural rule pattern, and concrete rule instances are generated by instantiating the pattern over a finite category inventory.

Schemas compose via `|` (union) and can carry default weights via `.weighted(w)`. Grammar formalisms are specific compositions:

- `CCG = EVALUATION | HARMONIC_COMPOSITION | CROSSED_COMPOSITION`
- `LAMBEK = EVALUATION | ADJUNCTION_UNITS | TENSOR_INTRODUCTION | TENSOR_PROJECTION`
- `NL = EVALUATION`
- `LP = EVALUATION | COMMUTATIVE_EVALUATION | ADJUNCTION_UNITS`

The ~20 atomic schemas (e.g. `ForwardApplication`, `BackwardApplication`) compose into 13 bundled schemas (e.g. `EVALUATION`, `HARMONIC_COMPOSITION`), which compose into grammar presets (`CCG`, `LAMBEK`, `NL`, `LP`).

::: quivers.stochastic.schema

## Span-Based CKY Components

Span-based instantiation of the abstract deductive framework for CKY chart parsing:

- **`LexicalAxiom`** — Populates length-1 spans from a learnable lexicon.
- **`BinarySpanDeduction`** — Applies binary structural rules with learnable weights.
- **`UnarySpanDeduction`** — Applies unary rules to convergence.
- **`SpanGoal`** — Extracts the start-symbol score for the full span.
- **`CKYSchedule`** — Bottom-up evaluation by span length.

::: quivers.stochastic.span
