feat: add --help and --all-theorems command line options#33
Open
robsimmons wants to merge 9 commits intomasterfrom
Open
feat: add --help and --all-theorems command line options#33robsimmons wants to merge 9 commits intomasterfrom
robsimmons wants to merge 9 commits intomasterfrom
Conversation
nomeata
reviewed
Apr 30, 2026
Contributor
nomeata
left a comment
There was a problem hiding this comment.
Seems unnecessarily restrictive. Why not allow the user to specify any set of module names and/or constants to export? Maybe I need an export of module A and B and additionally foo.
Author
|
@nomeata I think you're right — I've changed the behavior quite a bit so that "export all (theorems) from a module" and "export these constants specifically" are compatible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we'd like to export and replay the contents of a module, it's desirable to be able to export just the constants in that module and their transitive dependencies.
This PR, in addition adds an
--all-theorems MODULE_NAMEcommand line option that adds all the theorems in the specified module to the root set of constants for exporting. It can be used in conjunction with naming individual constants with the--option.Additional changes:
Refactor: consolidates parsing of command line arguments
Feature: adds usage information,
-hargumentFeature: turns several panics into controlled error (invalid constant, constant not present in environment)
Backwards incompatible (or bugfix, depending on your perspective): Move the filtering of unsafe constants from the "dump constant" phase to the "figure out what 'everything' is when we export everything".
Currently, if Foo contains an unsafe definition
x, thenlean4export Foo -- xjust silently dropsx. It should either throw an error ("--export-unsaferequired") or print outxand its dependencies, and this resolves to do the latter:--export-unsafeonly affects the "export everything" behavior.