flussab-cnf

Crates.ioflussab-cnf
lib.rsflussab-cnf
version0.3.1
sourcesrc
created_at2021-03-12 12:43:33.383117
updated_at2023-11-15 19:23:45.10845
descriptionDIMACS CNF file format parser and writer
homepage
repositoryhttps://github.com/jix/flussab
max_upload_size
id367698
size74,120
Jannis Harder (jix)

documentation

README

Flussab CNF

github crates.io docs.rs

Parsing and writing of the DIMACS CNF file format, implemented using flussab. The goal of this library is to provide a very efficient streaming parser for the DIMACS CNF file format while being easy to extend to the numerous variants, extensions and related file formats. Currently plain CNF, WCNF and GCNF are supported.

Performance

I don't have any extensive benchmarks, but parsing and writing a 2.1 GiB CNF file (from and to a tmpfs) takes 9 seconds on my machine, while coreutils' wc -w takes 9.5 seconds to perform a much easier task.

Now it might seem silly to focus an parsing performance for a file format used in SAT solving, given that the runtime of SAT solvers almost always dominates any time spent parsing. Nevertheless, often enough I find myself in the situation of parsing many and/or large CNF files for some processing task which is much faster than solving itself.

License

This software is available under the Zero-Clause BSD license, see LICENSE for full licensing information.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this software by you shall be licensed as defined in LICENSE.

Commit count: 30

cargo fmt