Skip to content

Conversation

@mezpusz
Copy link
Contributor

@mezpusz mezpusz commented Dec 10, 2025

This PR adds some type safety to IndexManager, such that the matching the index enum values and casted-to index type does not have to be done by the caller. There is still some risk, namely that we map index types to the same values, but I hope that this will be solved by some upcoming feature of C++20/23 where there are constexpr type IDs and other nice things.

The other improvement is that now IndexManager cannot be supplied from the outside to SaturationAlgorithm which allows for using the actual IndexManager instance during unit testing instead of the hacky setTestIndices.

Regression is TBD, but there shouldn't be anyting drastic.

Otter TPTP:
master unsat: 10299 (0) sat: 1020 (0)
branch unsat: 10300 (1) sat: 1020 (0)

@mezpusz
Copy link
Contributor Author

mezpusz commented Dec 10, 2025

Discount TPTP:
master unsat: 10247 (0) sat: 1030 (0)
branch unsat: 10247 (0) sat: 1030 (0)

* IMPORTANT: Keep these values distinct from each other!
*/
void IndexManager::provideIndex(IndexType t, Index* index)
INDEX_ID_IMPL(AlascaIndex<ALASCA::Demodulation::Lhs>, 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If someone has a better idea to implement this, please let me know. I looked at solution like this and the one in the comments but they don't seem to work for all compilers/linkers.

@mezpusz
Copy link
Contributor Author

mezpusz commented Dec 18, 2025

Regression over TPTP, induction&synthesis benchmarks and SMTLIB showed essentially no difference (1 lost in induction, 2 lost and 1 gained in SMTLIB). I think the PR is ready to merge.

@MichaelRawson MichaelRawson merged commit 832219c into master Dec 18, 2025
1 check passed
@MichaelRawson MichaelRawson deleted the imgr-clean branch December 18, 2025 20:39
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.

3 participants