Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiyu Yang committed Feb 26, 2024
1 parent 4fa80e5 commit f7c3791
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lean_dojo/interaction/Lean4Repl.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Lean.Elab.Frontend

open Lean Lean.Meta Lean.Elab Lean.Elab.Command Lean.Elab.Tactic

set_option autoImplicit false

namespace LeanDojo


Expand Down Expand Up @@ -50,18 +52,18 @@ structure ReplState (σ : Type _) where


/-- Get the saved tactic state with the given ID. --/
private def getSavedState? (m : TypeType) [Monad m] [MonadState (ReplState σ) m] (sid : Nat) : m (Option σ) := do
private def getSavedState? (m : TypeType) [Monad m] {σ : Type _} [MonadState (ReplState σ) m] (sid : Nat) : m (Option σ) := do
return (← get).savedStates[sid]?


/-- Get the initial tactic state. --/
private def getInitialState! (m : TypeType) [Monad m] [MonadState (ReplState σ) m] [MonadError m] : m σ := do
private def getInitialState! (m : TypeType) [Monad m] {σ : Type _} [MonadState (ReplState σ) m] [MonadError m] : m σ := do
let some ts ← getSavedState? m 0 | throwError "[fatal] no initial state"
return ts


/-- Get the next state ID. --/
private def getNextSid (m : TypeType) [Monad m] [MonadState (ReplState σ) m] : m Nat := do
private def getNextSid (m : TypeType) [Monad m] {σ : Type _} [MonadState (ReplState σ) m] : m Nat := do
return (← get).savedStates.size


Expand Down

0 comments on commit f7c3791

Please sign in to comment.