Zulip Chat Archive

Stream: lean4

Topic: Bug in `Std.HashSet`?


Frédéric Dupuis (Dec 06 2024 at 02:48):

In the following code snippet, I get the very strange error unknown free variable: _kernel_fresh.278:

import Std.Data.HashSet.Basic

def validUpdate (upd : Array Nat) (rules : Std.HashSet (Nat × Nat)) : Bool := Id.run do
  for i in [:upd.size-1] do
    for hj : j in [i+1:upd.size] do
      if rules.contains upd[j], upd[i]!⟩ then return false
  return true

Did I just hit a bug in Std.HashSet?

If I replace Std.HashSet by Array, the error disappears.

Markus Himmel (Dec 06 2024 at 05:55):

This looks like an instance of lean4#4548, could you add your example there?

Frédéric Dupuis (Dec 06 2024 at 18:01):

Done!


Last updated: May 02 2025 at 03:31 UTC