#solver #smt #smt-lib #smt-solver

bin+lib smt2parser

Generic parser library for the SMT-LIB-2 format

11 releases (6 breaking)

0.6.1 Sep 8, 2021
0.6.0 Jul 9, 2021
0.5.2 Jul 8, 2021
0.1.0 Jan 28, 2021

#9 in #smt-lib

Download history 2488/week @ 2024-07-21 2429/week @ 2024-07-28 2203/week @ 2024-08-04 2873/week @ 2024-08-11 4081/week @ 2024-08-18 3789/week @ 2024-08-25 3438/week @ 2024-09-01 4125/week @ 2024-09-08 4139/week @ 2024-09-15 3963/week @ 2024-09-22 5037/week @ 2024-09-29 4751/week @ 2024-10-06 3864/week @ 2024-10-13 4633/week @ 2024-10-20 3822/week @ 2024-10-27 4171/week @ 2024-11-03

16,706 downloads per month
Used in 5 crates (4 directly)

MIT/Apache

190KB
5K SLoC

smt2parser

smt2parser on crates.io Documentation License License

This crate provides a generic parser for SMT2 commands, as specified by the SMT-LIB-2 standard.

Commands are parsed and immediately visited by a user-provided implementation of the trait visitors::Smt2Visitor.

To obtain concrete syntax values, use concrete::SyntaxBuilder as a visitor:

let input = b"(echo \"Hello world!\")(exit)";
let stream = CommandStream::new(
    &input[..],
    concrete::SyntaxBuilder,
    Some("optional/path/to/file".to_string()),
);
let commands = stream.collect::<Result<Vec<_>, _>>().unwrap();
assert!(matches!(commands[..], [
    concrete::Command::Echo {..},
    concrete::Command::Exit,
]));
assert_eq!(commands[0].to_string(), "(echo \"Hello world!\")");

Contributing

See the CONTRIBUTING file for how to help out.

License

This project is available under the terms of either the Apache 2.0 license or the MIT license.

Dependencies

~7.5MB
~108K SLoC