Skip to content

Commit

Permalink
fix: mTrans at grind offset
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Jan 12, 2025
1 parent 912327c commit 222cb56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Lean/Meta/Tactic/Grind/Arith/ProofUtil.lean
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def mkTrans (nodes : PArray Expr) (pi₁ : ProofInfo) (pi₂ : ProofInfo) (v : N
else if k₂ > 0 then
let ke₂ := toExpr k₂.toNat
if k₂ > k₁ then
mkApp7 (mkConst ``Nat.ro_lo_1) u w v ke₁ ke₂ p₁ p₂
else
mkApp8 (mkConst ``Nat.ro_lo_2) u w v ke₁ ke₂ rfl_true p₁ p₂
else
mkApp7 (mkConst ``Nat.ro_lo_1) u w v ke₁ ke₂ p₁ p₂
else
let ke₂ := toExpr (-k₂).toNat
mkApp7 (mkConst ``Nat.ro_ro) u w v ke₁ ke₂ p₁ p₂
Expand Down
15 changes: 15 additions & 0 deletions tests/lean/run/grind_offset_cnstr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,18 @@ example (a1 a2 a3 : Nat) :
a1 ≤ a2 + 5 → a2 ≤ a3 + 2 → False := by
fail_if_success grind
sorry

/--
info: [grind.offset.internalize.term] a1 ↦ #0
[grind.offset.internalize.term] a2 ↦ #1
[grind.offset.dist] #0 ≤ #1 + 2
[grind.offset.internalize.term] a3 ↦ #2
[grind.offset.dist] #1 + 3 ≤ #2
[grind.offset.dist] #0 + 1 ≤ #2
-/
#guard_msgs (info) in
set_option trace.grind.offset.internalize.term true in
set_option trace.grind.offset.dist true in
example (a1 a2 a3 : Nat) : a1 ≤ a2 + 2 → a2 + 3 ≤ a3 → False := by
fail_if_success grind
sorry

0 comments on commit 222cb56

Please sign in to comment.