Skip to content

RFC: maxHeartbeats option is not respected during equation theorem generation #11546

@NicolasRouquette

Description

@NicolasRouquette

Proposal

Clear and detailed description of the proposal. Consider the following questions:

  • User Experience: How does this feature improve the user experience?

    I tried adding support for specifying maxHeartbeats in doc-gen4 to address this seemingly simple issue: Add support for specifying maxHeartbeats doc-gen4#335

    The PR I developed turned out to be anything but simple: Added support for specifying max heartbeats via an env. variable or a CLI argument doc-gen4#336

    doc-gen4 calculates equations here using Lean.Meta.getEqnsFor?:

    def getEqnsFor? (declName : Name) : MetaM (Option (Array Name)) := withLCtx {} {} do
      -- This is the entry point for lazy equation generation. Ignore the current value
      -- of the options, and revert to the default.
      withOptions (eqnAffectingOptions.foldl fun os o => o.set os o.defValue) do
        getEqnsFor?Core declName
    • getEqnsFor? resets certain options to defaults via eqnAffectingOptions
    • maxHeartbeats is not in that list, so it gets whatever default is in the fresh context (200000)
    • Therefore, tools like cannot override maxHeartbeats.
  • Suggestion:

    Add maxHeartbeats to eqnAffectingOptions

  • Beneficiaries: Which Lean users and projects benefit most from this feature/change?

    This should help solving this issue [doc-gen4#335] and simplify the WIP PR doc-gen#336

  • Maintainability: Will this change streamline code maintenance or simplify its structure?

Community Feedback

Ideas should be discussed on the Lean Zulip prior to submitting a proposal. Summarize all prior discussions and link them here.

Impact

Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRequest for comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions