From 9f0e4605e1c8816dbf5ed3e9e893b25e9a2be4a3 Mon Sep 17 00:00:00 2001
From: Son Ho
Date: Fri, 26 Jan 2024 00:17:59 +0100
Subject: Improve the Lean backend

---
 backends/lean/Base/Arith/Scalar.lean | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'backends/lean/Base/Arith/Scalar.lean')

diff --git a/backends/lean/Base/Arith/Scalar.lean b/backends/lean/Base/Arith/Scalar.lean
index 2342cce6..43fd2766 100644
--- a/backends/lean/Base/Arith/Scalar.lean
+++ b/backends/lean/Base/Arith/Scalar.lean
@@ -17,13 +17,20 @@ def scalarTacExtraPreprocess : Tactic.TacticM Unit := do
    add (← mkAppM ``Scalar.cMax_bound #[.const ``ScalarTy.Usize []])
    add (← mkAppM ``Scalar.cMax_bound #[.const ``ScalarTy.Isize []])
    -- Reveal the concrete bounds, simplify calls to [ofInt]
-   Utils.simpAt true [``Scalar.min, ``Scalar.max, ``Scalar.cMin, ``Scalar.cMax,
+   Utils.simpAt true
+                -- Unfoldings
+                [``Scalar.min, ``Scalar.max, ``Scalar.cMin, ``Scalar.cMax,
                  ``I8.min, ``I16.min, ``I32.min, ``I64.min, ``I128.min,
                  ``I8.max, ``I16.max, ``I32.max, ``I64.max, ``I128.max,
                  ``U8.min, ``U16.min, ``U32.min, ``U64.min, ``U128.min,
                  ``U8.max, ``U16.max, ``U32.max, ``U64.max, ``U128.max,
                  ``Usize.min
-                 ] [``Scalar.ofInt_val_eq, ``Scalar.neq_to_neq_val] [] .wildcard
+                 ]
+                 -- Simp lemmas
+                 [``Scalar.ofInt_val_eq, ``Scalar.neq_to_neq_val,
+                  ``Scalar.lt_equiv, ``Scalar.le_equiv, ``Scalar.eq_equiv]
+                 -- Hypotheses
+                 [] .wildcard
    
 
 elab "scalar_tac_preprocess" : tactic =>
-- 
cgit v1.2.3

