Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate structure-s for leaf cells #4732

Closed
tothtamas28 opened this issue Jan 13, 2025 · 0 comments · Fixed by #4731
Closed

Generate structure-s for leaf cells #4732

tothtamas28 opened this issue Jan 13, 2025 · 0 comments · Fixed by #4731

Comments

@tothtamas28
Copy link
Contributor

I.e. instead of

inductive SortGasCell : Type where
  | mk (val : SortGas) : SortGasCell

generate

structure SortGasCell : Type where
  val : SortGas

Due to circular dependencies between sorts, this is not straightforward. What can be attempted:

  1. Find the SCCs in the dependency graph of sorts (where sorts that map to an abbrev are represented by their parameter sorts (see step 3).
  2. Topologically sort the SCCs.
  3. Generate a mutual for each SCC, in topological order. For each sort that depends on a sort that maps to an abbrev, inline the abbrev's definition. This is necessary because an abbrev cannot be defined in the same mutual as inductive-s / structure-s.
@tothtamas28 tothtamas28 changed the title Generate structure-s for leaf cells Generate structure-s for cell sorts Jan 16, 2025
@tothtamas28 tothtamas28 changed the title Generate structure-s for cell sorts Generate structure-s for leaf cells Jan 16, 2025
@tothtamas28 tothtamas28 linked a pull request Jan 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant