You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a script which is supposed to be able to process both DIMACS and another input format (list of graph6 representations of formulas). The method I use to distinguish between the formats is I first try to load from the file with CNF(from_file='filename'), and I rely on it to throw an exception when the file is not valid DIMACS (which I believe is the intended behavior). Turns out that doesn't always happen. I linked a file from which CNF(from_file='filename') loads without raising an exception and returns a CNF with all empty clauses, as many as there were lines in the file. Confirmed with versions 0.1.6.dev9 and 0.1.7.dev15.
No, there was no intention to detect errors while parsing. Parsing of formulas is already a bottleneck, and making it more clever would only slow this functionality down. So right now we basically rely on exceptions thrown by Python itself, if any.
I agree that checking the format could (and probably should) be done but this would require some sophisticated refactoring to make it scale better while being clever. I will label it as "enhancement".
I have a script which is supposed to be able to process both DIMACS and another input format (list of graph6 representations of formulas). The method I use to distinguish between the formats is I first try to load from the file with
CNF(from_file='filename')
, and I rely on it to throw an exception when the file is not valid DIMACS (which I believe is the intended behavior). Turns out that doesn't always happen. I linked a file from whichCNF(from_file='filename')
loads without raising an exception and returns a CNF with all empty clauses, as many as there were lines in the file. Confirmed with versions 0.1.6.dev9 and 0.1.7.dev15.graph6_not_dimacs.txt
The text was updated successfully, but these errors were encountered: