Skip to content

feat: add --ignore-missing flag to skip missing declarations#36

Merged
hargoniX merged 3 commits into
leanprover:masterfrom
augustepoiroux:ignore-missing
Jun 5, 2026
Merged

feat: add --ignore-missing flag to skip missing declarations#36
hargoniX merged 3 commits into
leanprover:masterfrom
augustepoiroux:ignore-missing

Conversation

@augustepoiroux
Copy link
Copy Markdown
Contributor

This PR adds a new command-line option, --ignore-missing, to allow the exporter to skip missing constant lookups and proceed gracefully, rather than panicking.

By default, lean4export strictly panics when a constant requested for export is not present in the environment. In some systems, it is useful to query multiple declarations without knowing in advance if they are present in the environment.

The main motivation for this option is the development of a disproof feature for comparator where a potential target.disproof declaration might be present or not in the submitted solution.

Comment thread Main.lean Outdated
modify (fun st => { st with noMDataExprs := {} })
dumpConstant c
if (← get).ignoreMissing then
try dumpConstant c catch _ => pure ()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why should ignoreMissing allow us to ignore any error that is thrown during constant dumping? Furthermore, which error that is not already handled by your changes in Export is handled by this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, thank you, I removed this change

@hargoniX hargoniX merged commit fb2594d into leanprover:master Jun 5, 2026
1 check passed
@augustepoiroux augustepoiroux deleted the ignore-missing branch June 5, 2026 15:47
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