Skip to content

Report whether a file declared a c t track - #41

Merged
guyvdbroeck merged 1 commit into
mainfrom
cnf-declared-track
Aug 29, 2026
Merged

Report whether a file declared a c t track#41
guyvdbroeck merged 1 commit into
mainfrom
cnf-declared-track

Conversation

@guyvdbroeck

Copy link
Copy Markdown
Member

CnfMeta::mode was a public field that resolved an absent c t line to
Mc, so c t mc and 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_track reports the line the file carried, and
CnfMeta::mode reports the track to read the file as, still resolving an
absent line to Mc. CnfMeta::from_parts takes the option as well, so
metadata 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 to
declared_track(). Inside the crate only mode detection in resolve_mode
read it.

`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()`.
@guyvdbroeck
guyvdbroeck merged commit 7752ea9 into main Aug 29, 2026
2 checks passed
@guyvdbroeck
guyvdbroeck deleted the cnf-declared-track branch August 29, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant