Skip to main content

scan_scxml/
lib.rs

1//! Parser and model builder for SCAN's SCXML specification format.
2//!
3//! This crate is part of the [SCAN statistical model checker](https://convince-project.github.io/scan/)
4
5#![forbid(unsafe_code)]
6
7mod builder;
8mod parser;
9mod tracer;
10
11use std::path::Path;
12
13pub use builder::ScxmlModel;
14use log::info;
15pub use scan_core;
16use scan_core::Scan;
17use scan_pmtl::PmtlOracle;
18pub use tracer::TracePrinter;
19
20pub fn load(
21    path: &Path,
22    properties: &[String],
23    all_properties: bool,
24) -> anyhow::Result<(Scan<PmtlOracle>, ScxmlModel)> {
25    let time = std::time::Instant::now();
26    info!(target: "parser", "parse SCXML model");
27    let parser = parser::Parser::parse(path)?;
28    info!("parsing model completed in {:?}", time.elapsed());
29
30    let time = std::time::Instant::now();
31    info!(target: "build", "building SCXML model");
32    let (cs, oracle, model) = builder::ModelBuilder::build(parser, properties, all_properties)?;
33    info!("building model completed in {:?}", time.elapsed());
34    let scan = Scan::new(cs, oracle);
35    Ok((scan, model))
36}