leanprover / leanprover/comparator

Comparator generates different instance names for problem and solution files

Open
#58 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
203
Forks
36
Avg merge
1h 40m
Merged PRs (30d)
7

Description

With this challenge in challenge.lean:

instance : Inhabited Nat := ⟨37⟩

theorem target : default = 37 := sorry

and this solution.lean

instance : Inhabited Nat := ⟨37⟩

theorem target : default = 37 := rfl

comparator fails with

Exporting #[target, propext, Quot.sound, Classical.choice, Nat.add, Nat.sub, Nat.mul, Nat.pow, Nat.gcd, Nat.div, Nat.mod, Nat.beq, Nat.ble, Nat.land, Nat.lor, Nat.xor, Nat.shiftLeft, Nat.shiftRight, String.ofList] from Challenge
Building Solution
Build completed successfully (3 jobs).
Exporting #[target, propext, Quot.sound, Classical.choice, Nat.add, Nat.sub, Nat.mul, Nat.pow, Nat.gcd, Nat.div, Nat.mod, Nat.beq, Nat.ble, Nat.land, Nat.lor, Nat.xor, Nat.shiftLeft, Nat.shiftRight, String.ofList] from Solution
uncaught exception: Challenge and solution theorem statement do not match: 'target'

presumably because one has type

@default _ instInhabitedNat_challenge = 37

and the other has type

@default _ instInhabitedNat_solution = 37

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

Reproduce the mismatch using the challenge.lean and solution.lean snippets from the report, then trace the comparator's theorem-statement comparison after the Challenge and Solution builds. The fix is done when equivalent local Inhabited Nat instances no longer make the target statements differ.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.