Bisimilarity with assert in presets

This commit is contained in:
elvis
2025-08-15 00:32:58 +02:00
parent d48f352bfa
commit a4da8aec8d
6 changed files with 77 additions and 41 deletions

View File

@ -1,27 +1,10 @@
fn main() {
let now = std::time::Instant::now();
// use reactionsystems::rsprocess::presets;
// match presets::run("testing/first.system".into()) {
// Ok(_) => {},
// Err(e) => {println!("{e}")}
// }
use reactionsystems::grammar::AssertParser;
use reactionsystems::rsprocess::translator::Translator;
let contents = r#"label { if (substr("e", ('e').tostr)) then {return 'e'} else {return (("e").toel)} }"#;
let mut translator = Translator::new();
let tree = AssertParser::new().parse(&mut translator, contents).unwrap();
println!("{tree}");
match tree.typecheck() {
Ok(_) => println!("ok"),
Err(e) => println!("error: {e}")
}
match tree.execute(&reactionsystems::rsprocess::structure::RSlabel::new(), &mut translator) {
Ok(val) => println!("ok: {val}"),
Err(e) => println!("error: {e}")
use reactionsystems::rsprocess::presets;
match presets::run("testing/first.system".into()) {
Ok(_) => {},
Err(e) => {println!("{e}")}
}
println!("{} milliseconds elapsed", now.elapsed().as_millis());