Skip to content

Conversation

@strub
Copy link
Member

@strub strub commented Jan 14, 2025

Syntax this: theory T = Path.To.Theory

Theory aliases allow giving alternate names to theories - mainly
for readability issues. They are purely syntactic sugar and are
fully resolved (desugared) during typing.

The pretty-printer uses them when printing path, using a
longest-then-lastly-introduced strategy.

@strub strub self-assigned this Jan 14, 2025
@strub strub changed the title Theory aliases New vernacular command: theory aliases Jan 15, 2025
@strub strub requested review from bgregoir and fdupress January 15, 2025 21:11
@strub
Copy link
Member Author

strub commented Jan 15, 2025

FYI, this is part of the "resolving the cloning-hell" process. Currently, this mechanism is simulated using cloning + theory renaming, which can lead to scenarios where it is no more possible to use the with theory T <- U' idioms some theories in Uas been renamed and are thus missing for fully instantiatingT`.

@oskgo
Copy link
Contributor

oskgo commented Jan 21, 2025

This also closes #125.

@strub
Copy link
Member Author

strub commented Jan 21, 2025

This also closes #125.

This partially fixes. I still want a import ... as ... in the end.

@fdupress
Copy link
Member

This also closes #125.

This partially fixes. I still want a import ... as ... in the end.

Based on current struggles with namespacing in Formosa proofs, I think a require ... as ... mechanism would also be useful. In particular, the following sequence might become used a lot if we keep lacking creativity in theory names.

from X require Y as YX.
from A require Y as YA.

Syntax this: `theory T = Path.To.Theory`

Theory aliases allow giving alternate names to theories - mainly
for readability issues. They are purely syntactic sugar and are
fully resolved (desugared) during typing.

The pretty-printer uses them when printing path, using a
longest-then-lastly-introduced strategy.
@strub strub enabled auto-merge (rebase) March 25, 2025 08:54
@strub strub merged commit 20b28e0 into main Mar 25, 2025
15 checks passed
@strub strub deleted the theory-alias branch March 25, 2025 08:57
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.

4 participants