Skip to content

feat(typesetting): the math names a property after itself, and the reading page gives the tables of sets and properties - #4

Draft
FBumann wants to merge 2 commits into
claude/sets-properties-prototype-9m3zu6-3-mergingfrom
claude/sets-properties-prototype-9m3zu6-4-typesetting
Draft

FBumann wants to merge 2 commits into
claude/sets-properties-prototype-9m3zu6-3-mergingfrom
claude/sets-properties-prototype-9m3zu6-4-typesetting

Conversation

@FBumann

@FBumann FBumann commented Oct 23, 2026

Copy link
Copy Markdown

Prompt: 4. Typesetting and the data contract: the legend for sets and properties in LaTeX, Typst and Markdown, and the canonical tables in docs/reference/reading.md.

Note

The following content was generated by AI.

What this changes

A property read prints as bus(g) in all three formats, rather than as the name of its table, generator.bus(g). The legend maps each property from its subject. docs/reference/reading.md gives the canonical tables, the inner join, and the wide form an engine may accept. Stacked on #3.

Why

This is PR 4 of the stack in which sets and properties replace relations.

What prints
written LaTeX
sum(x, over=generator, by=generator[bus, carrier]) \sum_{g \in \mathcal{G} \,:\, \mathrm{bus}(g) = b \wedge \mathrm{carrier}(g) = c} x_{g,t}
where: line[bus1] \mathrm{bus1}(l) \text{ is defined}
at(price, by=generator_period[zone]) \mathrm{price}_{\mathrm{zone}(g,\ r),r}
legend, property of a dimension \mathrm{bus}: \mathcal{G} \to \mathcal{B}
legend, property of a set \mathrm{zone}: \mathrm{generator\_period} \to \mathcal{Z}
legend, missing: absent `line[bus1]` is `absent` where the data has no row
  • A property of a set maps from the set by name, because a property of a sparse set is defined only on the rows the set lists.
  • The golden model gains a set, a property of a dimension and one of a set, and three constraints that read them. The golden test requires model.yaml to reach every line the typesetter can print, so they have to be there. The golden files and docs/reference/notation.md are regenerated; the diff is the review.
  • reading.md has a new section, "The tables of sets and properties". Its Python block runs in tests/test_reading_page.py, which now checks 30 claims (it checked 24).
Departures, and what this PR does not do
  • Two subjects with a property of one name print the same function, such as bus(g) and bus(l). The argument tells them apart, and the legend lists both under the dimension they map into.
  • The examples still use relations:, so their generated pages do not change here. That is PR 5.
Gates, and the mutation table
guard deleted suite
a property read prints as the property caught (17)
the legend maps a property from its subject caught (17)
a property of a set maps from the set by name caught (7)
the absent note spells subject[property] caught (7)

Generated by Claude Code

…ading page gives the tables of sets and properties

A property read prints as `bus(g)`, and the legend maps it from its
subject: `bus: G → B`, or `zone: generator_period → Z` for a property of a
set. `docs/reference/reading.md` gives the canonical tables and the wide
form an engine may accept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6yvGzZN2iR4WyA9RumvvJ
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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