summaryrefslogtreecommitdiff
path: root/backends/lean (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-06-25Bump Lean to v4.9.0rc3 (#261)Son HO3-4/+2
2024-06-22Do some cleanup in the Lean backend (#257)Son HO7-22/+69
2024-06-22Improve `scalar_tac` and `scalar_decr_tac` (#256)Son HO7-50/+155
* Fix an issue in a proof of the hashmap * Improve scalar_decr_tac * Improve the error message of scalar_tac and add the missing Termination.lean
2024-06-21Add some proofs for the Lean backend (#255)Son HO9-40/+125
* Make progress on the proofs of the hashmap * Make a minor modification to the hashmap * Make progress on the hashmap * Make progress on the proofs * Make progress on the proofs * Make progress on the proof of the hashmap * Progress on the proofs of the hashmap * Update a proof * Update the Charon pin * Make minor modifications to the hashmap * Regenerate the tests * Regenerate the hashmap * Add lemmas to the Lean backend * Make progress on the proofs of the hashmap * Make a minor fix * Finish the proof about the hashmap * Update scalar_tac * Make a minor modification in the hashmap * Update the proofs of the hashmap --------- Co-authored-by: Son Ho <sonho@Sons-MacBook-Pro.local> Co-authored-by: Son Ho <sonho@Sons-MBP.lan>
2024-06-17Make a minor cleanupSon Ho1-9/+11
2024-06-17Update the Lean dependenciesSon Ho1-4/+4
2024-06-14Start updating Lean to 4.9.0-rc2Son Ho2-4/+4
2024-06-13Update the testsSon Ho1-5/+0
2024-06-13Update Lean to v4.9.0-rc1Son Ho15-139/+172
2024-06-13Fix more issues with the scalar notationsSon Ho1-15/+29
2024-06-13Fix more issuesSon Ho3-16/+22
2024-06-13Fix a proofSon Ho1-1/+1
2024-06-12Add an exampleSon Ho1-0/+3
2024-06-12Update the scalar notations in LeanSon Ho3-102/+109
2024-06-12Revert "Update the scalar notation for the Lean backend"Son Ho1-25/+25
This reverts commit c8272aeea205ca9cb36e22757473ca2a931a4933.
2024-06-12Revert "Update CoreConvertNum.lean"Son Ho1-22/+22
This reverts commit fe59d3afe131e9f83cbdf73b1c8089ad090d92fb.
2024-06-12Update CoreConvertNum.leanSon Ho1-22/+22
2024-06-12Update the scalar notation for the Lean backendSon Ho1-25/+25
2024-06-12Deactivate the coercion from Nat to ScalarSon Ho2-0/+17
2024-06-12Slightly simplify the progress tacticSon Ho1-8/+4
2024-06-12Add wrappers around the rewriterSon Ho1-0/+61
2024-06-12Add the Simp.Config to the simp wrappersSon Ho4-37/+36
2024-06-12backends/lean: introduce `HasIntPred` automationRyan Lahfa2-8/+38
`HasIntPred` enable generation of facts based on specific terms in the context rather than their types, e.g. if the "length of a list" occurs in the context, generate the fact 0 ≤ length of that list, which can be further used for `scalar_tac` automation to discharge bounds goals. The aim is to use it to simplify various height related computations, e.g. whenever "height of a (left ; right) tree" is encountered, generate "height left < height of a (left ; right) tree", etc. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-06-11feat: `PropHasImp` can have `Sort u` as premissesRyan Lahfa1-1/+1
This makes it possible to have `InBounds ... : Type 1` for example as `x`. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-05-24feat: add small pieces of max theoryRyan Lahfa1-0/+39
`0#ty` is neutral for `max` for unsigned integers. Without the `Fact` instances, those theorems are not as automatic as they could be. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-05-24Update scalar_tac to use omega instead of linarithSon Ho4-104/+82
2024-05-21Fix an issue in the progress tacticSon Ho1-0/+13
2024-05-21feat(backends/lean): make `max`-related coercions nicerRyan Lahfa1-0/+12
Situations where you have `coe (max a b) = max (coe a) (coe b)` are often stuck during verification because of the lack of this theorem. With this theorem, `push_cast` works as intended and normalizes even further. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-05-13backends/lean: repair definition of `core.mem.replace`Ryan Lahfa1-1/+4
Oops, it is supposed to do something with the second argument! Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-04-30feat(backend/lean): Raw Lean literals can be parsed into scalars automaticallyRyan Lahfa1-0/+5
We can use coercion to go to integers, build a scalar out of an int via unification and let the user clear up bounds or let Lean decide them. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-04-25Update the backend and ExtractBuiltin.mlSon Ho1-1/+1
2024-04-24Add core::option::unwrap builtinZyad Hassan3-5/+13
2024-04-24compiler: map `core::mem::swap` to the pure swapRyan Lahfa1-0/+2
In the pure functional model, `swap` is mostly about borrow checking and should simplify to the pure swap in our backends. Other backends than Lean are not done in this commit. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-04-23feat(backends/lean): scalars form a linear orderRyan Lahfa1-0/+15
More than c1c33de8, actually, scalars form a linear order with a decidable ≤ operation which is induced by the integer (Z) model. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-04-17compiler: map `core::option::Option::take` to identity functionRyan Lahfa1-0/+2
`take` in a pure functional model is the identity function and everything related to borrow checking is handled by the forward/backward mechanism. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-04-12lean: scalars form a preorderRyan Lahfa1-0/+10
Via the canonical injection, we can easily define an induced preorder on scalars and inherit all nice properties. It's useful to reason on specific scalar preorders w.r.t. Ordering, see the binary search tree verification example. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-04-12Add more definitions to the Lean librarySon Ho4-0/+127
2024-04-12Reorganize the files in the Lean backend a bitSon Ho5-241/+266
2024-04-12Start adding integer functions to the Lean librarySon Ho3-3/+266
2024-04-12Fix a proofSon Ho1-1/+0
2024-04-12Update the core.num.checked_* definitionsSon Ho1-31/+233
2024-04-05Update the lean toolchain and fix the proofsSon Ho9-20/+12
2024-04-04Rename Result.ret as Result.ok in the backendsSon Ho8-217/+215
2024-04-04Fix the coerce notation for scalars and update some lemmasSon Ho1-4/+15
2024-04-03Add builtins for some checked ops such as checked_addZyad Hassan1-0/+29
2024-03-25backend(/tests)/lean: 4.6.0-rc1 → 4.6.1Ryan Lahfa1-1/+1
4.6.0 has been released in https://github.com/leanprover/lean4/releases/tag/v4.6.0 Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
2024-03-18Fix a minor issueSon Ho1-1/+3
2024-03-18Regenerate the constants tests and update Primitives/Base.leanSon Ho1-1/+1
2024-03-09Fix an issue with the divergent encodingSon Ho1-3/+27
2024-03-08Fix tuple indexing for Lean backendZyad Hassan1-1/+1