Compare commits
No commits in common. "549be79cbf3f051271b6deaf956ec15a2cc9ab51" and "59935e386bfdb7e2863a1a6d7a068db51a718465" have entirely different histories.
549be79cbf
...
59935e386b
|
@ -59,12 +59,6 @@ and then add the new constants.
|
||||||
def environmentPickle (env : Environment) (path : System.FilePath) : IO Unit :=
|
def environmentPickle (env : Environment) (path : System.FilePath) : IO Unit :=
|
||||||
Pantograph.pickle path (env.header.imports, env.constants.map₂)
|
Pantograph.pickle path (env.header.imports, env.constants.map₂)
|
||||||
|
|
||||||
def resurrectEnvironment
|
|
||||||
(imports : Array Import)
|
|
||||||
(map₂ : PHashMap Name ConstantInfo)
|
|
||||||
: IO Environment := do
|
|
||||||
let env ← importModules imports {} 0
|
|
||||||
env.replay (Std.HashMap.ofList map₂.toList)
|
|
||||||
/--
|
/--
|
||||||
Unpickle an `Environment` from disk.
|
Unpickle an `Environment` from disk.
|
||||||
|
|
||||||
|
@ -74,7 +68,8 @@ and then replace the new constants.
|
||||||
@[export pantograph_env_unpickle_m]
|
@[export pantograph_env_unpickle_m]
|
||||||
def environmentUnpickle (path : System.FilePath) : IO (Environment × CompactedRegion) := unsafe do
|
def environmentUnpickle (path : System.FilePath) : IO (Environment × CompactedRegion) := unsafe do
|
||||||
let ((imports, map₂), region) ← Pantograph.unpickle (Array Import × PHashMap Name ConstantInfo) path
|
let ((imports, map₂), region) ← Pantograph.unpickle (Array Import × PHashMap Name ConstantInfo) path
|
||||||
return (← resurrectEnvironment imports map₂, region)
|
let env ← importModules imports {} 0
|
||||||
|
return (← env.replay (Std.HashMap.ofList map₂.toList), region)
|
||||||
|
|
||||||
|
|
||||||
open Lean.Core in
|
open Lean.Core in
|
||||||
|
@ -93,9 +88,7 @@ def goalStatePickle (goalState : GoalState) (path : System.FilePath) : IO Unit :
|
||||||
savedState := {
|
savedState := {
|
||||||
term := {
|
term := {
|
||||||
meta := {
|
meta := {
|
||||||
core := {
|
core,
|
||||||
env, nextMacroScope, ngen, ..
|
|
||||||
},
|
|
||||||
meta,
|
meta,
|
||||||
}
|
}
|
||||||
«elab»,
|
«elab»,
|
||||||
|
@ -107,10 +100,9 @@ def goalStatePickle (goalState : GoalState) (path : System.FilePath) : IO Unit :
|
||||||
convMVar?,
|
convMVar?,
|
||||||
calcPrevRhs?,
|
calcPrevRhs?,
|
||||||
} := goalState
|
} := goalState
|
||||||
|
--let env := core.env
|
||||||
Pantograph.pickle path (
|
Pantograph.pickle path (
|
||||||
env.constants.map₂,
|
({ core with } : CompactCoreState),
|
||||||
|
|
||||||
({ nextMacroScope, ngen } : CompactCoreState),
|
|
||||||
meta,
|
meta,
|
||||||
«elab»,
|
«elab»,
|
||||||
tactic,
|
tactic,
|
||||||
|
@ -125,8 +117,6 @@ def goalStatePickle (goalState : GoalState) (path : System.FilePath) : IO Unit :
|
||||||
def goalStateUnpickle (path : System.FilePath) (env : Environment)
|
def goalStateUnpickle (path : System.FilePath) (env : Environment)
|
||||||
: IO (GoalState × CompactedRegion) := unsafe do
|
: IO (GoalState × CompactedRegion) := unsafe do
|
||||||
let ((
|
let ((
|
||||||
map₂,
|
|
||||||
|
|
||||||
compactCore,
|
compactCore,
|
||||||
meta,
|
meta,
|
||||||
«elab»,
|
«elab»,
|
||||||
|
@ -137,8 +127,6 @@ def goalStateUnpickle (path : System.FilePath) (env : Environment)
|
||||||
convMVar?,
|
convMVar?,
|
||||||
calcPrevRhs?,
|
calcPrevRhs?,
|
||||||
), region) ← Pantograph.unpickle (
|
), region) ← Pantograph.unpickle (
|
||||||
PHashMap Name ConstantInfo ×
|
|
||||||
|
|
||||||
CompactCoreState ×
|
CompactCoreState ×
|
||||||
Meta.State ×
|
Meta.State ×
|
||||||
Elab.Term.State ×
|
Elab.Term.State ×
|
||||||
|
@ -149,7 +137,6 @@ def goalStateUnpickle (path : System.FilePath) (env : Environment)
|
||||||
Option (MVarId × MVarId × List MVarId) ×
|
Option (MVarId × MVarId × List MVarId) ×
|
||||||
Option (MVarId × Expr)
|
Option (MVarId × Expr)
|
||||||
) path
|
) path
|
||||||
let env ← env.replay (Std.HashMap.ofList map₂.toList)
|
|
||||||
let goalState := {
|
let goalState := {
|
||||||
savedState := {
|
savedState := {
|
||||||
term := {
|
term := {
|
||||||
|
|
Loading…
Reference in New Issue