# liberty-db [![pipeline](https://github.com/zao111222333/liberty-db/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/zao111222333/liberty-db/actions/workflows/build.yml) [![pipeline](https://github.com/zao111222333/liberty-db/actions/workflows/bench_deploy.yml/badge.svg?branch=master)](https://github.com/zao111222333/liberty-db/actions/workflows/bench_deploy.yml) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![liberty-db](https://shields.io/crates/v/liberty-db.svg?style=flat-square&label=liberty-db)](https://crates.io/crates/liberty-db) [![Docs](https://docs.rs/liberty-db/badge.svg)](https://docs.rs/liberty-db) [![Benchmark](https://img.shields.io/badge/Benchmark-8A2BE2)](https://zao111222333.github.io/liberty-db/bench) [![codecov](https://codecov.io/github/zao111222333/liberty-db/graph/badge.svg?token=AI2BVDIFOI)](https://codecov.io/github/zao111222333/liberty-db) ## Highlight Features + Support all `liberty` attributes with typed datastructure, rather than syntax tree (AST) only, in the definition of [Liberty Version R-2020.09, September 2020](https://zao111222333.github.io/liberty-db/2020.09/reference_manual.pdf) + Support [`liberty` boolean expression syntax](https://zao111222333.github.io/liberty-db/2020.09/reference_manual.html?field=test&bgn=132.36+132.41&end=132.38+133.13), employ [binary decesion diagram (BDD)](https://github.com/sybila/biodivine-lib-bdd) to [identify (hashing)](https://docs.rs/liberty-db/latest/liberty_db/expression/struct.IdBooleanExpression.html) + Parser & formatter are implemented by static macros, providing a decent preformance and tiny ~3MB `parser & formatter` binary. See [benchmark summary](https://zao111222333.github.io/liberty-db/bench) + Support `define define_group` user-defined attributes + Verified with library-complier, well defined [document](https://docs.rs/liberty-db/latest/liberty_db/library/struct.Library.html), and [examples](examples) provided ## Usage This library is implemented in [Rust](https://doc.rust-lang.org/book/ch01-00-getting-started.html), with [document](https://docs.rs/liberty-db). ```toml [dependencies] liberty_db = "0.7" ``` You can run [examples](examples) with commands: ``` shell # example0 cargo run --example 0_parse_fmt # example1 cargo run --example 1_parse_fmt_file -- dev/tech/cases/ocv.lib # example2 cargo run --example 2_prune_lib -- dev/tech/cases/ocv.lib ``` ## Benchmark Basic information as follow, see latest [benchmark summary](https://zao111222333.github.io/liberty-db/bench). ### Project Comparison
Project | Lang | Version | Type Support | Boolean Expression | Comment | ||
---|---|---|---|---|---|---|---|
All | Partly | AST only | |||||
liberty-db | rust | latest | ✓ | ✓ | current version | ||
si2dr_liberty | C | 1.0 | ✓ | ✓ | Synopsys's version at 2005, many attributes are not supported | ||
OpenTimer | C++17 | 2 | ✓ | ✓ | STA tool's liberty component | ||
liberty-io | rust | 0.0.4 | ✓ | ||||
libertyparse | rust | 0.3.0 | ✓ | ✓ | |||
liberty2json | rust | 0.1.0 | ✓ |
Project | Lang | Version | Type Support | Boolean Expression | Comment | ||
---|---|---|---|---|---|---|---|
All | Partly | AST only | |||||
liberty-db | rust | latest | ✓ | ✓ | current version | ||
liberty-db | rust | 0.6.3 | ✓ | ✓ | published at 2024-09-07 | ||
liberty-db | rust | 0.5.9 | ✓ | ✓ | published at 2024-08-27 | ||
liberty-db | rust | 0.4.13 | ✓ | ✓ | published at 2024-08-13 | ||
liberty-db | rust | 0.3.1 | ✓ | published at 2023-08-03 |