Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HumanEvalLean/Common/Brackets.lean
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ theorem isBalanced_eq_true_iff {openBracket closeBracket : Char} {s : String} (h
generalize hwp : isBalanced openBracket closeBracket s = w
apply Std.Do.Id.of_wp_run_eq hwp
mvcgen
case inv =>
case inv1 =>
exact Std.Do.StringInvariant.withEarlyReturn
(fun pos depth => ⌜∀ t₁ t₂, pos.Splits t₁ t₂ → minBalance (parens openBracket closeBracket t₁) = 0 ∧ depth = balance (parens openBracket closeBracket t₁)⌝)
(fun res depth => ⌜res = false ∧ ¬ IsBalanced (parens openBracket closeBracket s)⌝)
Expand Down
2 changes: 1 addition & 1 deletion HumanEvalLean/HumanEval1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ theorem goal {s : String} {hbal : IsBalanced (parens '(' ')' s)} :
generalize hwp : separateParenGroups s = w
apply Std.Do.Id.of_wp_run_eq hwp
mvcgen
case vc1.inv => exact ⇓⟨pos, ⟨curr, depth, result⟩⟩ =>
case inv1 => exact ⇓⟨pos, ⟨curr, depth, result⟩⟩ =>
⌜∀ t₁ t₂, pos.Splits t₁ t₂ →
result.toList.flatMap (parens '(' ')') ++ (parens '(' ')' curr) = parens '(' ')' t₁ ∧
result.toList.flatMap String.toList ++ curr.toList = t₁.toList.filter (fun c => c = '(' ∨ c = ')') ∧
Expand Down
2 changes: 1 addition & 1 deletion HumanEvalLean/HumanEval119.lean
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ theorem computeBalance_eq {s : String.Slice} :
generalize hwp : computeBalance s = w
apply Std.Do.Id.of_wp_run_eq hwp
mvcgen
case inv => exact (⇓(pos, ⟨bal, minBal⟩) => ⌜∀ (t₁ t₂ : String), pos.Splits t₁ t₂ →
case inv1 => exact (⇓(pos, ⟨bal, minBal⟩) => ⌜∀ (t₁ t₂ : String), pos.Splits t₁ t₂ →
bal = balance (parens '(' ')' t₁) ∧ minBal = minBalance (parens '(' ')' t₁)⌝)
next pos _ hp bal minBal h newBal newMinBal ih =>
simp only [↓Char.isValue, SPred.down_pure] at ⊢ ih
Expand Down
7 changes: 1 addition & 6 deletions HumanEvalLean/HumanEval128.lean
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ theorem List.product_eq_zero_iff {xs : List Int} :

theorem Option.of_wp {α} {prog : Option α} (P : Option α → Prop) :
(⊢ₛ wp⟦prog⟧ post⟨fun a => ⌜P (some a)⌝, fun _ => ⌜P none⌝⟩) → P prog := by
intro hspec
simp only [wp, PredTrans.apply_pushOption, PredTrans.apply_Pure_pure, SPred.entails_nil,
SPred.down_pure, forall_const] at hspec
split at hspec
case h_1 a s' heq => rw [← heq] at hspec; exact hspec
case h_2 s' heq => rw [← heq] at hspec; exact hspec
cases prog <;> simp [wp, Option.instWP._aux_1, OptionT.run]

theorem Option.of_wp_eq {α : Type} {x : Option α} {prog : Option α} (h : prog = x) (P : Option α → Prop) :
(⊢ₛ wp⟦prog⟧ post⟨fun a => ⌜P (some a)⌝, fun _ => ⌜P none⌝⟩) → P x := by
Expand Down
1 change: 1 addition & 0 deletions HumanEvalLean/HumanEval129.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module

import Std
import all Init.Data.Range.Polymorphic.RangeIterator
public meta import Std.Tactic.Do.Syntax
open Std Std.Do

set_option mvcgen.warning false
Expand Down
2 changes: 1 addition & 1 deletion HumanEvalLean/HumanEval6.lean
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ theorem computeMaxDepth_eq {s : String.Slice} :
generalize hwp : computeMaxDepth s = w
apply Std.Do.Id.of_wp_run_eq hwp
mvcgen
case inv => exact (⇓(pos, ⟨bal, maxBal⟩) => ⌜∀ (t₁ t₂ : String), pos.Splits t₁ t₂ →
case inv1 => exact (⇓(pos, ⟨bal, maxBal⟩) => ⌜∀ (t₁ t₂ : String), pos.Splits t₁ t₂ →
bal = balance (parens '(' ')' t₁) ∧ maxBal = maxBalance (parens '(' ')' t₁)⌝)
next pos _ hp bal minBal h newBal newMinBal ih =>
simp only [↓Char.isValue, SPred.down_pure] at ⊢ ih
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2026-03-09
leanprover/lean4:nightly-2026-03-22
Loading