Skip to content
Open
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
12 changes: 7 additions & 5 deletions Export.lean
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,13 @@ where
theorems and definitions/opaques are still dumped in a singleton array for simplicity. -/
dumpThmDefOpaque (base : ConstantInfo) : M Unit := do
let mut all := #[]
for declarName in base.all do
let declar := (← read).env.find? declarName |>.get!
assert!((!declar.isUnsafe) || (← get).exportUnsafe)
all := all.push declar
modify fun st => { st with visitedConstants:= st.visitedConstants.insert declarName }
for declarName in (if base.all.contains base.name then base.all else base.name :: base.all) do
if declarName == base.name || !(← get).visitedConstants.contains declarName
then
let declar := (← read).env.find? declarName |>.get!
assert!((!declar.isUnsafe) || (← get).exportUnsafe)
all := all.push declar
modify fun st => { st with visitedConstants:= st.visitedConstants.insert declarName }
for declar in all do
dumpDeps declar.type
dumpDeps (declar.value! (allowOpaque := true))
Expand Down
2 changes: 1 addition & 1 deletion Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def exportMetadata : Json :=
]
let exporterMeta := Json.mkObj [
("name", "lean4export"),
("version", "3.0.0")
("version", "3.1.0")
]
let formatMeta := Json.mkObj [
("version", "3.0.0")
Expand Down
2 changes: 1 addition & 1 deletion examples/Nat.add_succ.ndjson
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"meta":{"exporter":{"name":"lean4export","version":"3.0.0"},"format":{"version":"3.0.0"},"lean":{"githash":"2fcce7258eeb6e324366bc25f9058293b04b7547","version":"4.27.0-rc1"}}}
{"meta":{"exporter":{"name":"lean4export","version":"3.0.0"},"format":{"version":"3.0.0"},"lean":{"githash":"db93fe1608548721853390a10cd40580fe7d22ae","version":"4.27.0"}}}
{"in":1,"str":{"pre":0,"str":"Nat"}}
{"il":1,"succ":0}
{"ie":0,"sort":1}
Expand Down