Skip to main content

Module ir

Module ir 

Source
Expand description

The checked portable core: every expression carries its type and every operator its source semantics. Emitters consume it; the renaming passes give each target unique, legal local names.

The JSON form is the JavaScript runtime’s checked program, except that declarations is an array and items refer to declarations by name.

Structs§

Binder
Case
Comparison
Ctor
DataDecl
Expr
Field
FnDecl
Hints
Main
Param
PlanCase
Program
A checked portable-core program.
Proof
Scope
A per-declaration name supply: target-legal, unique, deterministic.
Split
TheoremDecl

Enums§

ByZero
What division by zero does: abort (JavaScript, Rust) or yield a total value (Lean, Rocq).
Decl
Effect
Item
A program item: a declaration, named by its full name, or a module.
LitValue
A literal’s value: numerals and strings are text, booleans are booleans.
Node
Pattern
A single-level match pattern.
Plan
Prop
Semantics
Arithmetic semantics: exact on unbounded integers, checked (aborting) machine arithmetic, truncated natural subtraction, or IEEE-754 binary64 arithmetic on JavaScript Numbers.

Functions§

contains_kind
True when any expression of the given kind occurs in the tree.
prop_contains_kind
True when any expression of the given kind occurs in the proposition.
prop_exprs
The expressions of a proposition, left to right.
rename_expr
Renames every binder in an expression; env maps source names to target names.
rename_function
A function’s parameters and body with target local names.
rename_main
The main effects with target local names.
rename_prop
rename_theorem
A theorem’s binders, proposition and proof plan with target local names.
tail_loop
Whether a function lifted from a loop calls itself only in tail position.