forked from leanprover/LNSym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework step theorem generation to be faster and cache intermediate re…
…sults to the environment (leanprover#92) ### Description: Forewarning: the diff of this one is rather large. I've implemented a new version of step theorem generation, culminating in the `genStepEqTheorem` function. In particular: - We get rid of the different fetch/decode/exec intermediate lemma, instead opting to generate the final step theorem in one go. The bottleneck seems to be kernel checking, so by reducing the number of theorems sent to the kernel we achieve a good speedup (SHA512 used to take about 55 seconds for the three generation commands combined, now it's about 35 seconds). - In the process, we build a `ProgramInfo` struct, which holds a bunch of interesting expressions that further proof automation could exploit. This programInfo is stored in a persistent environment extension, so that it is persisted in the olean files (hence, making it available to downstream files). - While building the previous, I've moved some definitions around and did other refactors: happy to split those off into their own PR if that makes reviewing easier. EDIT: split off leanprover#93 for the `#time` command ### Testing: `make all` succeeded ### License: By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Siddharth <siddu.druid@gmail.com> Co-authored-by: Shilpi Goel <shigoel@gmail.com>
- Loading branch information
1 parent
16b87e6
commit 93f6a71
Showing
13 changed files
with
596 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import Proofs.SHA512.Sha512FetchLemmas | ||
import Proofs.SHA512.Sha512DecodeExecLemmas | ||
import Proofs.SHA512.Sha512Program | ||
-- import Tests.SHA2.SHA512ProgramTest | ||
import Tactics.StepThms | ||
|
||
-- set_option trace.gen_step.debug.heartBeats true in | ||
-- set_option trace.gen_step.print_names true in | ||
set_option maxHeartbeats 2000000 in | ||
#genStepTheorems sha512_program thmType:="step" `state_simp_rules | ||
#genStepEqTheorems sha512_program | ||
|
||
/-- | ||
info: sha512_program.stepi_0x126c90 (s sn : ArmState) (h_program : s.program = sha512_program) | ||
info: sha512_program.stepi_eq_0x126c90 {s : ArmState} (h_program : s.program = sha512_program) | ||
(h_pc : r StateField.PC s = 1207440#64) (h_err : r StateField.ERR s = StateError.None) : | ||
(sn = stepi s) = (sn = w StateField.PC (if ¬r (StateField.GPR 2#5) s = 0#64 then 1205504#64 else 1207444#64) s) | ||
stepi s = w StateField.PC (if ¬r (StateField.GPR 2#5) s = 0#64 then 1205504#64 else 1207444#64) s | ||
-/ | ||
#guard_msgs in | ||
#check sha512_program.stepi_0x126c90 | ||
#check sha512_program.stepi_eq_0x126c90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.