leanprover / leanprover/subverso

Highlight data should distinguish bindings even in case of state rollback

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
8
Forks
14
Avg merge
14h 54m
Merged PRs (30d)
5

Description

Currently, when an example contains an error or when the user asks for it, we roll back the elaborator state after an example.

This is generally the right thing, but it has one downside: the unique variable counter gets reset, and later elaborator runs might re-use internal IDs. This can lead to mistaken extra highlights:

Screenshot 2024-03-21 at 11 05 12

There should be some way of preventing this, e.g. by postprocessing the elaborated example to extract the highest ID, then bumping the counter.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how elaborator state rollback resets the unique variable counter after an example, then reproduce the mistaken extra highlights shown in the issue. The work is done when later elaborator runs cannot reuse internal IDs after rollback and the extra highlights no longer appear.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.