Tractables / LogicCircuits.jl

Logic Circuits from the Juice library
https://tractables.github.io/LogicCircuits.jl/dev/
Apache License 2.0
48 stars 4 forks source link

Allow empty lines in CNF files #97

Closed RenatoGeh closed 3 years ago

RenatoGeh commented 3 years ago

Hi,

This patch allows empty lines in CNF files. Previously, LogicCircuits would complain when a CNF had empty lines, even trailing ones like the one in the example below:

p cnf 4 3
1 -2 0
3 -4 0
1 -4 0

Since file format specifications for .cnf (and .dnf) don't specify that empty lines are disallowed, this patch removes such a requirement.

I considered having this patch as part of #96, but I didn't know whether this PR in particular would be accepted, so sending this out as separate. Sorry for the spam :)

Thanks!

codecov[bot] commented 3 years ago

Codecov Report

Merging #97 (49730de) into master (bd48e34) will decrease coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   88.11%   88.08%   -0.04%     
==========================================
  Files          31       31              
  Lines        3198     3198              
==========================================
- Hits         2818     2817       -1     
- Misses        380      381       +1     
Impacted Files Coverage Δ
src/LoadSave/circuit_loaders.jl 99.44% <100.00%> (ø)
src/transformations.jl 95.81% <0.00%> (-0.33%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bd48e34...49730de. Read the comment docs.

khosravipasha commented 3 years ago

Thanks, this should be good.