Invokes the Lean runner and Lake.
Summary
Functions
Runs Lake and returns {exit_status, stdout}. Stderr is inherited.
Runs a protocol request and collects its JSON updates in order.
Verifies assembled files and returns their timings and diagnostics.
Functions
@spec lake(String.t(), [String.t()], binary()) :: {non_neg_integer(), binary()}
Runs Lake and returns {exit_status, stdout}. Stderr is inherited.
Uses the caller's active toolchain and selects project_dir with Lake's --dir option.
Arguments are passed directly to the executable.
Commands reading stdin must use framing (such as a terminating newline), since ports cannot close stdin alone.
Runs a protocol request and collects its JSON updates in order.
Each update includes elapsed milliseconds and diagnostics. Returns verification errors and skipped files as updates. Raises on failure responses, invalid JSON output, or unexpected exit statuses. The caller supplies the complete request, including its command and version. Updates retain the JSON protocol's string keys and values.
@spec verify!(String.t(), [map()], keyword()) :: [Lynx.Laws.report()]
Verifies assembled files and returns their timings and diagnostics.
Verification errors and skipped files are returned as updates. Runner failures raise.
Reports and diagnostics have atom keys; statuses and severities are atoms.
Module names, declarations, paths, and messages remain strings.
Uses the current Mix build directory for cached artifacts, falling back to _build/dev.
Options
:options- a keyword list of Lean options, such as[maxRecDepth: 10_000], set at the top of every translated module. Values are integers, booleans, or strings. They are part of every cache key.:debug_dir- a directory where the rendered Lean source of every module is written by module path, such asErlang/json.lean, when a module does not verify.:debug- set to:leanto write the sources to:debug_direven when every module verifies. Set to:oleanto also write the compiled files of every verified module next to its source, such asErlang/json.olean.:check_source- whentrue, parses each module's rendered source and reports an error where it differs from the elaborated commands. Used by Lynx's own tests.:export- a path where the declarations of the verified modules and their dependencies are written in Lean's export format, forlake check --from-export. It is written only when every module verifies.