leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
4.59k stars 408 forks source link

kernel hangs on ac_nf expression #5699

Open tobiasgrosser opened 2 hours ago

tobiasgrosser commented 2 hours ago

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The following test case hangs in the kernel

axiom foo {p : Prop} {x : BitVec 32} (h : (!x == x + 0#32) = true) : p

theorem add_eq_sub_not_sub_one (x : BitVec 32) (h : (!x == x + (1#32 + 4294967295#32)) = true) : False := by
  simp only [BitVec.reduceAdd] at h
  exact foo h -- this works

theorem add_eq_sub_not_sub_one' (x : BitVec 32) (h : (!x == x + 1#32 + 4294967295#32) = true) : False := by
  ac_nf0 at h
  simp only [BitVec.reduceAdd] at h
  exact foo h -- this hangs here

Context

This issue arose when testing bv_decide with ac_nf enabled.

Steps to Reproduce

  1. Copy into Lean
  2. Wait for it to run
  3. Observe yellow line next to exact foo h not disappearing

Expected behavior: Proof should be confirmed by kernel

Actual behavior: Kernel is hanging

Versions

"4.12.0, commit 225e08965d644715e8961cd205ffedf1cf7d24c2"

Impact

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

nomeata commented 2 hours ago

Didn't look closely yet. This might have a similar cause as https://github.com/leanprover/lean4/issues/5384