Verification IR Lowering #
Public entry points for lowering TorchLean programs to the shared verifier IR and querying IBP and
CROWN bounds. Graph construction lives in Lowering.Builder; this module contains the stable
result type and the operations available on a lowered graph.
The broad lowerForwardToIR entry point runs a TorchLean.Program with the IR-building
interpreter, then checks the graph's structure and shapes. A successful result is executable and
ready for verifier passes, but does not by itself prove equality with the source program. The
theorem-backed source fragment lives under NN.Verification.Builtin.Proved.
Public lowering entry points #
Result of lowering a TorchLean forward model to verifier IR.
This bundles:
- the produced IR graph (
NN.IR.Graph), - a CROWN/LiRPA-style
ParamStorecontaining constants and layer parameters, and - the distinguished input/output node ids (used by bound propagation and certificate checkers).
- graph : IR.Graph
Lowered IR graph.
Parameters/constants for verifier algorithms (IBP, CROWN, etc.).
- inputId : ℕ
Distinguished input node id (kept stable as
0). - outputId : ℕ
Output node id.
Instances For
Seed the distinguished verifier input with an explicit flat input box.
Instances For
Flatten a shaped center/radius pair into the verifier input-box representation.
Instances For
Uniform $\ell^\infty$ box around a shaped TorchLean input tensor.
Instances For
Flattening an $\ell^\infty$ ball preserves the number of tensor entries as its dimension.
Seed the distinguished verifier input with a uniform $\ell^\infty$ ball.
Instances For
Shape of the distinguished verifier input node.
Instances For
Flattened dimension of the distinguished verifier input node.
Instances For
Affine/CROWN context for the distinguished verifier input.
Instances For
Run IBP on a lowered verifier graph.
Instances For
Read the verifier output box from an IBP result array.
Instances For
Read the lowered verifier output box, throwing an IO.userError if it is missing.
Instances For
Read the verifier output affine form from a forward affine result array.
Instances For
Run forward CROWN and evaluate the lowered verifier output on a selected input box.
Instances For
Run forward CROWN for a lowered verifier graph, throwing an IO.userError on failure.
Instances For
Run objective-dependent backward CROWN and evaluate the scalar objective on the input box.
Instances For
Convert a parameter TorchLean.TensorPack into constant references for IR lowering.
Instances For
Lower a TorchLean forward model with one distinguished input, supplied as its last argument.
Success means that every encountered operation was supported and that the produced IR passed structural and shape validation. It does not attach a source-to-IR semantic theorem.