Skip to content

Pretty-print equations in models of discrete theories#1085

Merged
epatters merged 6 commits intomainfrom
pretty-eqns
Mar 16, 2026
Merged

Pretty-print equations in models of discrete theories#1085
epatters merged 6 commits intomainfrom
pretty-eqns

Conversation

@KevinDCarlson
Copy link
Copy Markdown
Collaborator

@KevinDCarlson KevinDCarlson commented Feb 28, 2026

This pretty-prints equations in discrete double models for the first time. An example is being tested in the snapshot test test_equality.dbltt, which exhibits output looking like so:

generate CommutativeSquare
#/ result: model generated by 4 objects and 4 morphisms
#/ NW : Entity
#/ NE : Entity
#/ SW : Entity
#/ SE : Entity
#/ t : NW -> NE : Hom Entity
#/ l : NW -> SW : Hom Entity
#/ r : NE -> SE : Hom Entity
#/ b : SW -> SE : Hom Entity
#/ t ⋅ r = l ⋅ b : Hom Entity(NW,SE)

Arguably the suffix could be any of

  • : NW -> SE
  • (Hom Entity)(NW,SE)
  • Hom Entity NW SE, or if we modify the morphism type printing, `
  • Hom(Entity)(NW,SE).

I think the last option is probably my favorite.

(EDIT: commit added to pick the last option.)

Comment thread packages/catlog/src/dbl/model.rs Outdated
@epatters epatters changed the title Pretty-printing equations for discrete models. Pretty-printing equations for discrete models Mar 2, 2026
@epatters epatters added enhancement New feature or request core Rust core for categorical logic and general computation labels Mar 2, 2026
If we're going to change this, we need to do so consistently across the
codebase and I don't that's the worth the effort right now.
@epatters epatters changed the title Pretty-printing equations for discrete models Pretty-print equations in models of discrete theories Mar 16, 2026
Copy link
Copy Markdown
Member

@epatters epatters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've cleaned this up by upgrading FgDblModel to FpDblModel and adding a method equation to that trait.

@epatters epatters merged commit 1ed1c13 into main Mar 16, 2026
16 checks passed
@epatters epatters deleted the pretty-eqns branch March 16, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Rust core for categorical logic and general computation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants