Report whether a file declared a c t track - #41
Merged
Conversation
`CnfMeta::mode` resolved an absent `c t` line to `Mc`, which left `c t mc` and a bare DIMACS file indistinguishable. A consumer that varies its own defaults between a competition instance and a plain CNF has nothing to key on, and the show set and the weights already answer the same question with `Option`. `CnfMeta` now stores the track as `Option<Mode>` behind two accessors: `declared_track` reports the line, `mode` reports the track to read the file as. `from_parts` takes the option too, so metadata built in process states absence the same way a parsed file does. The field was public, so this replaces it. Callers reading a track move to `mode()`; callers that need to know whether the file said so move to `declared_track()`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CnfMeta::modewas a public field that resolved an absentc tline toMc, soc t mcand a file with no header at all read back identically.A consumer that varies its own defaults between a competition instance and a
plain CNF had nothing to key on — and the show set and the weights already
answer the same question with an
Option.The track is now stored as
Option<Mode>behind two accessors:CnfMeta::declared_trackreports the line the file carried, andCnfMeta::modereports the track to read the file as, still resolving anabsent line to
Mc.CnfMeta::from_partstakes the option as well, sometadata assembled in process can state absence the way a parsed file does.
This replaces the public field, so a caller reading a track moves to
mode(), and one that needs to know whether the file said so moves todeclared_track(). Inside the crate only mode detection inresolve_moderead it.