Skip to content

Simplify SAT equivalence formula#177

Merged
kellyma2 merged 1 commit into
rmohr:mainfrom
aszady:collapse.eq
Jan 27, 2026
Merged

Simplify SAT equivalence formula#177
kellyma2 merged 1 commit into
rmohr:mainfrom
aszady:collapse.eq

Conversation

@aszady
Copy link
Copy Markdown
Contributor

@aszady aszady commented Jan 22, 2026

[ A small extract from a larger change #153 ]


For each package we had this set of implication over all provided: one provided is on ⇒ all provided are on as well.

This is effectively the equivalence between all these variables, and therefore can be represented by bf.Eq instead.

Such formulation is easier for the used SAT solver, as example runs show:

before:
//pkg/sat:sat_determinsitic_test PASSED in 20.3s
//pkg/sat:sat_test PASSED in 118.7s

after:
//pkg/sat:sat_determinsitic_test PASSED in 8.9s
//pkg/sat:sat_test PASSED in 6.8s

Note that tests under sat/loader_test.go guarantee that we're still solving the same problem.

This change focuses on improving the performance.
Follow-up changes are recommended to cleanup the code from these redundant variables.

@aszady aszady marked this pull request as ready for review January 22, 2026 12:53
For each package we had this set of implication over all `provided`:
one `provided` is on ⇒  all `provided` are on as well.

This is effectively the equivalence between all these variables,
and therefore can be represented by `bf.Eq` instead.

Such formulation is easier for the used SAT solver, as example runs show:

before:
//pkg/sat:sat_determinsitic_test                                         PASSED in 20.3s
//pkg/sat:sat_test                                                       PASSED in 118.7s

after:
//pkg/sat:sat_determinsitic_test                                         PASSED in 8.9s
//pkg/sat:sat_test                                                       PASSED in 6.8s

Note that tests under `sat/loader_test.go` guarantee that we're still solving the same problem.

This change focuses on improving the performance.
Follow-up changes are recommended to cleanup the code from these redundant variables.
@github-actions
Copy link
Copy Markdown

⚠️ Optional job e2e-bzlmod-toolchain-circular-dependencies failed ⚠️

  • exit status: 1

@kellyma2 kellyma2 merged commit 98899ae into rmohr:main Jan 27, 2026
14 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.

2 participants