Crates.io | btor2rs |
lib.rs | btor2rs |
version | 0.1.0 |
source | src |
created_at | 2023-10-16 21:45:23.885783 |
updated_at | 2024-01-06 16:28:37.172317 |
description | Safe-Rust Btor2 parser |
homepage | |
repository | |
max_upload_size | |
id | 1005232 |
size | 34,535 |
This crate is a lighweight alternative to Btor2Tools and their Rust wrapper btor2tools. Only safe Rust is used in this parser.
use btor2rs::Btor2;
let path = std::path::Path::new("example.btor2");
let content = std::fs::read_to_string(path).unwrap();
let btor2 = Btor2::parse(content.lines());
println!("Parsed: {:?}", btor2);
The Btor2 format is (incompletely) documented in Niemetz, A., Preiner, M., Wolf, C., Biere, A. (2018). BTOR2, BtorMC and Boolector 3.0. CAV 2018. This crate aims for compatibility with the format as parsed by Btor2Tools and used in Hardware model-checking benchmarks. Specifically, right-side nodes can be immediately bit-inverted by using a minus sign, which is not present in the original paper.
This crate is licensed under Apache 2.0 License or MIT License at your discretion.