Skip to main content

validate_ir

Function validate_ir 

Source
pub fn validate_ir(ir: &Arc<Ir>) -> Result<(), ContextError>
Expand description

Admits a public IR arena without creating an evaluator, interning literals, evaluating expressions or invoking caller code. Uses the same structural authority as evaluator construction with empty constant/override bindings.

ยงErrors

A typed malformed arena or bounded structural admission refusal. Numeric IDs remain relative to this arena; this does not certify their foreign provenance.

use std::sync::Arc;
let analysis = dive_sema::analyze_source("M.tla",
    "---- MODULE M ----\nVARIABLE x\nInit == x = TRUE\n====\n", &Default::default());
let ir = Arc::new(dive_ir::lower(&analysis).expect("IR"));
dive_eval::validate_ir(&ir).expect("well-formed arena");