lean4-htt/src/Std/Do
Sebastian Graf 478be16fc5
feat: Implement mvcgen +jp to prevent exponential VC blowup (#9736)
This PR implements the option `mvcgen +jp` to employ a slightly lossy VC
encoding for join points that prevents exponential VC blowup incurred by
naïve splitting on control flow.

```lean
def ifs_pure (n : Nat) : Id Nat := do
  let mut x := 0
  if n > 0 then x := x + 1 else x := x + 2
  if n > 1 then x := x + 3 else x := x + 4
  if n > 2 then x := x + 1 else x := x + 2
  if n > 3 then x := x + 1 else x := x + 2
  if n > 4 then x := x + 1 else x := x + 2
  if n > 5 then x := x + 1 else x := x + 2
  return x

theorem ifs_pure_triple : ⦃⌜True⌝⦄ ifs_pure n ⦃⇓ r => ⌜r > 0⌝⦄ := by
  unfold ifs_pure
  mvcgen +jp
  /-
  ...
  h✝⁵ : if n > 0 then x✝⁵ = 0 + 1 else x✝⁵ = 0 + 2
  h✝⁴ : if n > 1 then x✝⁴ = x✝⁵ + 3 else x✝⁴ = x✝⁵ + 4
  h✝³ : if n > 2 then x✝³ = x✝⁴ + 1 else x✝³ = x✝⁴ + 2
  h✝² : if n > 3 then x✝² = x✝³ + 1 else x✝² = x✝³ + 2
  h✝¹ : if n > 4 then x✝¹ = x✝² + 1 else x✝¹ = x✝² + 2
  h✝ : if n > 5 then x✝ = x✝¹ + 1 else x✝ = x✝¹ + 2
  ⊢ x✝ > 0
  -/
  grind
```
2025-08-06 15:21:08 +00:00
..
SPred feat: Implement mvcgen +jp to prevent exponential VC blowup (#9736) 2025-08-06 15:21:08 +00:00
Triple feat: Add grind annotations for key SPred lemmas (#9757) 2025-08-06 14:36:34 +00:00
WP chore: fix spelling errors (#9175) 2025-07-24 23:35:32 +00:00
PostCond.lean feat: Make mleave apply at * and improve its simp set (#9581) (#9754) 2025-08-06 08:34:45 +00:00
PredTrans.lean chore: Remove unused definitions relating to PredTrans (#9503) 2025-07-24 06:50:57 +00:00
SPred.lean refactor: module-ize remainder of Std (#9195) 2025-07-17 11:43:57 +00:00
Triple.lean refactor: module-ize remainder of Std (#9195) 2025-07-17 11:43:57 +00:00
WP.lean refactor: module-ize remainder of Std (#9195) 2025-07-17 11:43:57 +00:00