Test "bugs/loose-bvar-value"
Expected: ✋ reject · Size: 2.7 KB · Lines: 48 · lean4export: 3.1.0 · Lean: 4.34.1 · 📄 Declaration
A definition whose value is a loose bound variable, met before it is checked.
The export is that of
def f.{u} (α : Sort u) : Sort u := α
inductive T (γ : f Type) : Type
| mk : γ → T γ
with the value of f replaced by the bound variable #0, which no binder
binds. The official kernel rejects f: its type checker does not support
loose bound variables.
A checker that checks an inductive declaration as soon as it meets it, but
defers definitions, reaches f first through T.mk: the type of its field
must be a sort, so f Type is reduced, and unfolding f gives #0 Type.
Pestka looked the variable up in an empty environment, found #0 again,
and hung until it was
fixed.
Found by a differential run of Pestka against other checkers, which also showed that a loose bound variable in a value stops sokonanoda with an internal error, and makes nanoda, nanoclo and nanobruijn panic (their runners here report any failure as a rejection).
| Checker | Result | ⏱️ | 🧠 | |||
|---|---|---|---|---|---|---|
| nano-lean | ✋ | 0.484 ms | 13.8 MB | |||
| logos-kernel | ✋ | 0.397 ms | 4.3 MB | |||
| gruszka | ✋ | 1.75 ms | 29.6 MB | |||
| sokonanoda | 💥 | 0.640 ms | 18.0 MB | |||
| pestka | ✋ | 1.93 ms | 13.3 MB | |||
| kefir | ✋ | 0.395 ms | 5.1 MB | |||
| palladium | ✋ | 0.539 ms | 18.8 MB | |||
| kefir-wasm | ✋ | 90.5 ms | 81.0 MB | |||
| con-ron | ✋ | 29.6 ms | 43.1 MB | |||
| con-agua | ✋ | 20.5 ms | 11.7 MB | |||
| nanobruijn | ✋ | 0.608 ms | 5.5 MB | |||
| nanoda | ✋ | 0.596 ms | 3.1 MB | |||
| con-leche | ✋ | 3.94 ms | 21.8 MB | |||
| pestka-wasm | ✋ | 84.2 ms | 104.9 MB | |||
| tenet-jvm | ✋ | 93.8 ms | 63.6 MB | |||
| official-nightly | ✋ | 33.2 ms | 107.9 MB | |||
| eink0rn | ✋ | 1.29 ms | 11.2 MB | |||
| official | ✋ | 32.0 ms | 101.7 MB | |||
| ind-models | ✋ | 99.8 ms | 102.2 MB | |||
| lean4lean | ✋ | 27.8 ms | 98.1 MB | |||
| tenet | ✋ | 122 ms | 44.7 MB | |||
| tenet-hs | ✋ | 1.12 ms | 8.0 MB | |||
| ocaml4lean | ✋ | 13.3 ms | 22.6 MB | |||
| lean4cobol | ✋ | 2.00 ms | 13.3 MB | |||
| evmlean | ✋ | 1.01 s | 246.7 MB | |||
| mini | ✋ | 34.0 ms | 75.0 MB | |||
| overfull | ✋ | 4.66 s | 45.7 MB | |||
| kiota | 💥 | 0.551 ms | 9.1 MB | |||
| canonical-min | 🚫 | 550 ms | 1.1 GB | |||
| nanoclo | ✋ | 0.717 ms | 41.8 MB | |||
| vow-lean-kernel | ✋ | 110 ms | 14.5 MB | |||
| lazylean | ✋ | 1.07 ms | 21.2 MB | |||
| metalean-slow | ✋ | 29.7 ms | 71.5 MB | |||
| metalean-fast | ✋ | 29.7 ms | 69.7 MB | |||
| nanoclo-fortran | ✋ | 0.792 ms | 4.4 MB | |||
| mathgraph | ✋ | 0.626 ms | 29.7 MB | |||
| rpylean | ✋ | 0.443 ms | 4.0 MB |