5 unstable releases

0.3.1 Nov 15, 2023
0.3.0 Mar 6, 2022
0.2.0 Mar 18, 2021
0.1.1 Mar 13, 2021
0.1.0 Mar 12, 2021

#1467 in Parser implementations

41 downloads per month
Used in cnfpack

0BSD license

2.5K SLoC

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.


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.


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


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


~22K SLoC