1mod builder;
4mod parser;
5mod print_trace;
6
7use std::path::Path;
8
9pub use builder::ScxmlModel;
10use log::info;
11pub use print_trace::TracePrinter;
12pub use scan_core;
13use scan_core::{CsModel, PmtlOracle, Scan};
14
15pub type ScxmlScan = Scan<CsModel, PmtlOracle>;
16
17pub fn load(
18 path: &Path,
19 properties: &[String],
20 all_properties: bool,
21) -> anyhow::Result<(ScxmlScan, ScxmlModel)> {
22 let time = std::time::Instant::now();
23 info!(target: "parser", "parse SCXML model");
24 let parser = parser::Parser::parse(path)?;
25 info!("parsing model completed in {:?}", time.elapsed());
26
27 let time = std::time::Instant::now();
28 info!(target: "build", "building SCXML model");
29 let (cs, oracle, model) = builder::ModelBuilder::build(parser, properties, all_properties)?;
30 info!("building model completed in {:?}", time.elapsed());
31 let scan = Scan::new(cs, oracle);
32 Ok((scan, model))
33}