leanprover / lean4

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

perf: bv_decide inline all lets once at the beginning of preprocessing #6198

Closed hargoniX closed 2 days ago

hargoniX commented 5 days ago

This PR changes bv_decide's preprocessing to inline all let at the beginning of the pipeline once. This makes sure that when we actually start to rewrite in the fixed point pipeline, no let are there anymore. As DiscrTree matching in the rewriting steps involves traversing and instantiating the lets over and over again this can bring some drastic speedups:

baseline:
lake exe leanwuzla --maxRecDepth=8000 --maxHeartbeats=2000000 --disableEmbeddedConstraintSubst ../../smt/non-incremental/QF_BV/fft/Sz256_6616.smt2   30.02s

after this:
lake exe leanwuzla --maxRecDepth=8000 --maxHeartbeats=2000000 --disableEmbeddedConstraintSubst ../../smt/non-incremental/QF_BV/fft/Sz256_6616.smt2   4.15s
leanprover-community-bot commented 5 days ago

Mathlib CI status (docs):

hargoniX commented 2 days ago

Obsoleted by the proper fix https://github.com/leanprover/lean4/pull/6220/