Skip to content

Commit

Permalink
Number of features is optional (comments) in dimacs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhorcas authored Mar 11, 2024
1 parent fd0a0da commit ab3ca22
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def transform(self) -> PySATModel:
else:
clauses_lines.append(line)
if problem is None:
raise FlamaException(f'Incorrect Dimacs format of {self.path}')
raise FlamaException(f'Incorrect Dimacs format of {self.path}. No problem statement.')

problem_list = problem.split()
n_features = int(problem_list[2])
n_clauses = int(problem_list[3])
if n_features != len(features_lines) or n_clauses != len(clauses_lines):
raise FlamaException(f'Incorrect Dimacs format of {self.path}')
if n_clauses != len(clauses_lines):
raise FlamaException(f'Incorrect Dimacs format of {self.path}. Inconsistent number of clauses.')
features, variables = self._parse_features_variables(features_lines)
sat_model = PySATModel()
sat_model.features = features
Expand Down

0 comments on commit ab3ca22

Please sign in to comment.