Skip to content

Fix #444: [Model] MinimumCardinalityKey#679

Merged
isPANN merged 8 commits intomainfrom
issue-444-minimum-cardinality-key
Mar 18, 2026
Merged

Fix #444: [Model] MinimumCardinalityKey#679
isPANN merged 8 commits intomainfrom
issue-444-minimum-cardinality-key

Conversation

@GiggleLiu
Copy link
Contributor

Summary

Add MinimumCardinalityKey satisfaction problem model — a classical NP-complete problem from relational database theory (Garey & Johnson A4 SR26). Given attribute names, functional dependencies, and a bound M, determines whether a candidate key of cardinality ≤ M exists.

Fixes #444

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.17%. Comparing base (08d5574) to head (8f07479).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #679      +/-   ##
==========================================
+ Coverage   97.16%   97.17%   +0.01%     
==========================================
  Files         302      304       +2     
  Lines       39923    40108     +185     
==========================================
+ Hits        38791    38976     +185     
  Misses       1132     1132              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add MinimumCardinalityKey satisfaction problem (set/ category)
- Functional dependency closure under Armstrong's axioms
- CLI create support with --num-attributes, --dependencies, --k flags
- Paper entry with problem definition and worked example
- 11 unit tests covering creation, evaluation, solver, serialization
- Regenerate example-db fixtures
@GiggleLiu
Copy link
Contributor Author

Implementation Summary

Changes

  • src/models/set/minimum_cardinality_key.rs — New MinimumCardinalityKey satisfaction problem model with functional dependency closure under Armstrong's axioms
  • src/models/set/mod.rs — Module registration and re-export
  • src/models/mod.rs — Added to set re-exports
  • src/unit_tests/models/set/minimum_cardinality_key.rs — 11 unit tests (creation, evaluation YES/NO, non-minimal rejection, bound check, solver, serialization, edge cases)
  • problemreductions-cli/src/cli.rs — Added --num-attributes and --dependencies CLI flags, help table entry
  • problemreductions-cli/src/commands/create.rs — CLI create arm with dependency parser
  • src/example_db/fixtures/examples.json — Regenerated with new model example
  • docs/paper/reductions.typ — Problem definition entry with worked example
  • docs/paper/references.bib — Added Lucchesi & Osborn (1978) citation

Deviations from Plan

  • None

Open Questions

  • None

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@isPANN isPANN self-assigned this Mar 18, 2026
isPANN and others added 2 commits March 18, 2026 16:14
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@isPANN isPANN merged commit 057025f into main Mar 18, 2026
3 checks passed
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.

[Model] MinimumCardinalityKey

3 participants