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 | ⏱️ | 🧠 | |||
|---|---|---|---|---|---|---|
| logos-kernel | ✋ | 0.397 ms | 4.3 MB | |||
| nano-lean | ✋ | 0.484 ms | 13.9 MB | |||
| sokonanoda | 💥 | 0.636 ms | 17.7 MB | |||
| pestka | ✋ | 0.711 ms | 10.6 MB | |||
| kefir | ✋ | 0.395 ms | 5.0 MB | |||
| nanoclo | ✋ | 0.716 ms | 41.6 MB | |||
| kefir-wasm | ✋ | 90.1 ms | 81.1 MB | |||
| con-ron | ✋ | 22.0 ms | 37.7 MB | |||
| con-agua | ✋ | 17.6 ms | 8.5 MB | |||
| nanoda | ✋ | 0.596 ms | 3.3 MB | |||
| lazylean | ✋ | 1.07 ms | 21.3 MB | |||
| con-leche | ✋ | 3.81 ms | 20.8 MB | |||
| pestka-wasm | ✋ | 78.0 ms | 91.6 MB | |||
| tenet-jvm | ✋ | 95.4 ms | 63.7 MB | |||
| eink0rn | ✋ | 1.29 ms | 11.3 MB | |||
| official | ✋ | 27.7 ms | 67.0 MB | |||
| ind-models | ✋ | 99.8 ms | 106.3 MB | |||
| lean4lean | ✋ | 27.8 ms | 97.4 MB | |||
| tenet | ✋ | 122 ms | 44.4 MB | |||
| tenet-hs | ✋ | 1.12 ms | 7.9 MB | |||
| ocaml4lean | ✋ | 13.2 ms | 22.5 MB | |||
| lean4cobol | ✋ | 1.99 ms | 13.2 MB | |||
| evmlean | ✋ | 1.01 s | 268.4 MB | |||
| overfull | ✋ | 4.66 s | 45.7 MB | |||
| vow-lean-kernel | ✋ | 110 ms | 14.5 MB | |||
| mini | ✋ | 34.0 ms | 73.9 MB | |||
| canonical-min | 🚫 | 550 ms | 1.1 GB | |||
| kiota | 💥 | 0.547 ms | 9.1 MB | |||
| metalean-slow | ✋ | 29.7 ms | 71.5 MB | |||
| nanobruijn | ✋ | 0.607 ms | 5.4 MB | |||
| metalean-fast | ✋ | 29.7 ms | 69.5 MB | |||
| nanoclo-fortran | ✋ | 0.729 ms | 4.5 MB | |||
| rpylean | ✋ | 0.440 ms | 3.8 MB | |||
| mathgraph | ✋ | 0.623 ms | 29.8 MB | |||
| parse-only | 👍 | 27.5 ms | 65.3 MB |