``sym => cbv`` produces a kernel-rejected term on a goal with metavariables left by error recovery

Aperta
#16,828 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Ambito
compilers

Direzione di ricerca

The failure involves the sym tactic and the cbv tactic run on a goal that error recovery left with metavariables after a failed have. Start by reproducing the snippet and checking whether the kernel error appears once the f error is removed. Done means the only reported error is the unknown-identifier one for f, with no kernel application mismatch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Prerequisites
Description

If we fail inside of a have statement, the error recovery leaves metavariables. sym => cbv applies these metavariables to the wrong argument, leading to a kernel-rejection.

Context

Discovered whilst random testing (initial input was fuzzer generated and then manually reduced).

Steps to Reproduce
example :
  have v := (5 : BitVec 64);
  have w := v + 0 ^ (f 1).length;
  v ≠ w := by
  sym =>
    cbv
    intro hyp

Expected behavior: Only the error related to undefined function f

Actual behavior:

bug.lean:3:21: error: Function expected at
  f
but this term has type
  ?m.1

Note: Expected a function because this term is being applied to the argument
  1

Hint: The identifier `f` is unknown, and Lean's `autoImplicit` option causes an unknown identifier to be treated as an implicitly bound variable with an unknown type. However, the unknown type cannot be a function, and a function is what Lean expects here. This is often the result of a typo or a missing `import` or `open` statement.
bug.lean:5:2: error: `sym` has failed, use `+verbose` to obtain diagnostic information
bug.lean:7:4: error: (kernel) application type mismatch
  _x_3
argument has type
  x✝
but function has type
  {f : _x_1} → (v : BitVec 64) → HPow (BitVec 64) (_x_2 v) (BitVec 64)
Versions

4.38.0-nightly-2026-11-26

Additional Information

This looks related to https://github.com/leanprover/lean4/issues/15627 but its reproducer does not trigger for me anymore on the newest nightly, so it seems to have been fixed whereas this is still an open issue.

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Lingua principale
Lean
Stelle
10.3k
Fork
1.1k
Merge medio
16h 45m
PR unite (30g)
361

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di leanprover/lean4

Tutte le issue di leanprover/lean4

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.