-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternate clause layouts #12
Comments
Hmm I don't see what problem would be solved by using A better clause/clause db layout is something I would like to experiment with. I have not fully decided on the overall clause database organisation, so I do to some degree want to do that first. Now all clauses are in one formula, and separated on That being said, alternative clause representations can be experimented with separately of the overall clause db representations. Also I think proof-wise "deep-model" would help in this, as it would allow to write specs on Also some other Rust clause/clause db implementations: |
It will store the data inline under a certain size rather than performing a seperate allocation.
Eh, its no worse than using |
Yes, I know. I don't see when that is useful? I think the good design is to have the clause db be a 1d vec with manual handling of clauses as a header and lits. I dunno, might be useful when operating with temporary clauses, i.e. in clause learning, but I don't think the good solution will have many temporary clauses.
Well if so it is fine. |
This is the part i don't know how to properly do in Rust, that would require defining an unsized type since clauses wouldn't have fixed size. It will also 100% require unsafe code somewhere as a result, and not the kind Creusot can handle. On the other hand |
Well the clause db would become either a
Will |
Right now things look something like this
simply adding small vec may store entire clauses inline in the formula which can potentially speed things up by removing the need to follow pointers (loading contiguous memory is much faster than seperate loads). If we just add a ClauseDB but keep the same layout then we get soemthing like this instead:
Which seems like a loss unless we can store clauses flat with their literals (which will not be easy in rust i believe). |
It seems like we might be talking past each other. ClauseDB = formula, and does thus not add another level of indirection.
Starlit, Varisat and Minisat-rust do this (links above). See for instance this comment in Starlit
I use the tests (yeah, I should move to using |
I was using ClauseDB to refer specifically to an arena allocated setup but you're right that we wouldn't need a seperate formula vector then.
I would like to avoid doing this: I would much, much perfer to compose safe abstractions than have to write so much unsafe code. You were worried about using dependencies, this is what worries me. Finding some way to express this using existing tools and techniques would be ideal. |
I feel like it might be a good idea to experiment with using
smallvec
in the definition ofClause
.Alternately, I wonder if it is possible define a custom unsized type in Rust so that we can layout the clause literals inline with a header.
The text was updated successfully, but these errors were encountered: