Skip to main content

Crate olean_export

Crate olean_export 

Source
Expand description

Read Lean 4 .olean files directly and emit the lean4export stream, as NDJSON or in a compact binary form (blean), without starting Lean.

Re-exports§

pub use compare::compare;
pub use compare::Diff;
pub use info::Info;
pub use record::Counts;
pub use record::Record;
pub use record::Sink;

Modules§

accepted
Accepted stores: the declaration keys each checker has accepted, one section per checker, so several checkers share one file.
blean
blean, the binary export format.
compare
Compare two exports up to id numbering, record order and binders.
info
Facts about each expression that kernels otherwise compute on import.
join
Per-module exports and joining them back into one.
key
Declaration keys, shared by external checkers.
ndjson
The lean4export 3.1.0 NDJSON format.
record
One line of the export stream with every reference resolved to an output id. The traversal in crate::Exporter produces these and every output format consumes them.
statement
What a theorem’s statement rests on, printed as raw terms for a person to review.

Structs§

Body
The value of an opaque constant.
Const
A declaration the kernel would accept. Unsafe and partial ones are dropped at load time.
Ctor
Decl
A constant as the olean lists it, without its terms.
Defn
Env
Every constant reachable from a set of root modules, in import order.
Exporter
Streams an Env in lean4export 3.1.0 order to a Sink, NDJSON by default. Ids are assigned on first use and every record only refers to records already written.
Exprs
Expressions by id. Ids come in chunks, each filled by one decoding thread, with gaps.
Header
Fields of the fixed-size header that precedes every compacted region.
Id
The id of a T in its table.
Import
One entry of a module’s import list: import all, public import and meta import.
Inductive
LetNode
The fields of a let, boxed to keep Expr at 16 bytes.
Mark
Where an export stopped, so that a later one on the same Env, reloaded or not, continues its ids and writes only records the earlier one did not.
Rec
Reload
What Env::reload changed.
Rule
Section
A slice of the module’s data and the bytes only it reaches. Shared objects count toward the first section that reaches them, in the order constants, extra names, imports, then environment extensions.
Summary
What one module’s olean holds, read straight from its header and ModuleData without decoding any terms.
Table
A hash-consing arena: structurally equal nodes get the same id. Ids are interleaved across shards, so they are nearly but not exactly dense.
Theorem
A theorem. Its value is None when [Env::load_cone] did not need it.
Univs
The universe levels of a constant, interned so that a Const node holds only an id.

Enums§

Binder
Error
Everything that can go wrong loading oleans or writing an export.
Expr
Equality and hashing ignore binder names and annotations, matching Lean’s BEq Expr, so terms that differ only there share one id, as they do in lean4export.
Hints
Kind
Level
Name
QuotKind

Constants§

ANON
SUPPORTED
The Lean releases whose object layouts this reader has been checked against.
ZERO

Functions§

resolve
The .olean for a dotted module name such as Init.Prelude, from the first directory of search that has it.
search_path

Type Aliases§

ExprId
LevelId
NameId
Result
UnivsId