feat: add initial proof logging infrastructure#369
Conversation
cf21727 to
64d0995
Compare
64d0995 to
f125fcd
Compare
f125fcd to
fd331b9
Compare
|
This is looking great! I don't know exactly what the status of the DRCP checker is, but from the VeriPB side, the proofs can now be checked with the latest version from https://gitlab.com/MIAOresearch/software/VeriPB.
I have tested this locally and almost all of the proofs produced from crates/huub-cli/corpus pass the checker already. There's only a couple of further fixes needed, which I made a quick PR for Dekker1#5 .
With these two fixes, all but two of the corpus proofs pass. The two that fail are due to the proofs being essentially empty, because Huub was able to detect contradiction without any search at all. This is related to the problem we discussed last year of needing to log root-level propagations in addition to the clauses traced by the SAT engine. I think it's in a state where it could be merged (with some disclaimers in the docs) and then it can be built on top of. There are various suggestions I would have for later versions that wouldn't necessary need to be included in an "initial proof logging infrastructure". I'll note these shortly. |
|
In terms of questions you asked:
Yes, but this isn't strictly necessary for a bare assertion proof to pass. For the (in progress) justifier tool, I do need some kind of literal -> atomic constraint mapping. The .lits file produced for DRCP would work, or I think I had a lits.json being produced before? Alternatively, for the Glasgow solver we have standardised a VeriPB-CP-literal naming convention, which we could use instead directly in the proof. This would eliminate the need for literal mapping names entirely as the justifier could parse the meanings directly from the names.
For now, from the latest VeriPB version, (after cargo install veripb) should work (with an
This was the plan. I think I have two alternative way to deal with unification however. Might need to progress further with the Justifier implementation before I can say what I'd recommend. But potentially we do either/both of:
Both of these have the advantage of supporting derivable views as well as unifications, and avoids adding antecedent dependencies to every constrant that contains unified variables. |
fd331b9 to
3abd6f0
Compare
|
Thanks for the fixes. I've included them in the branch.
Okay, I think that is okay for now. In my understanding, the justifier would in the end be a surrounding (leading) executable would make this unnecessary.
This seems like it would be nice to resolve before we merge the branch. Writing out a literal mapping seems very straightforward, so we could do that, but if the "VeriPB-CP-literal naming convention" would make things work better, then I would be happy to implement that. (You just have to let me know where I can find the specification). I've been thinking about changing the DRCP proofs to do the inline atomic constraints as well. It seems it would make things much more readable, but currently there is still a slight issue with the order in which some information gets to the tracer.
Yes, this would certainly be something to tackle. I think the code infrastructure is now much better able to potentially handle this, but I think it might be wise to leave this for a next stage.
I think the alternatives sound much closer to what I was hoping for when we initially talked about this issue. They certainly seem to take some burden away from the logger. For now, I might just leave this in your (more capable) hands for now, and we can ship a solution in a next version. |
|
In terms of naming conventions, we have gone for the following in the Glasgow Solver:
The "i" is for "integer variable". The square bracketed names maybe seem a bit verbose, but we found it was what worked best for validating/parsing names in the formally verified PB encoding. On the subject of args: these are more just taste things so feel free to ignore, but may as well note:
|
3abd6f0 to
841601e
Compare
|
I've also updated the design to output an If there was something more specific that you were thinking, then let me know. I couldn't find the previous JSON literal output that you mentioned. For the flags, I did find that there was a big problem with the output path when using the default path, at least when using Huub through MiniZinc. Normally, MiniZinc will place the FlatZinc file in some temporary directory, which then also hides the proof created. I didn't really like placing it in the current directory automatically, so I went towards the design I think Glasgow CP uses, where you have to provide the path. Now You are now allowed to give just a directory as the As suggested, I changed From my side, the only remaining things on my list are seeing whether we can have an option to use the inline literal names/definitions, and if the DRCP team gets back to me to do some testing using their toolchain. |
841601e to
ae709d5
Compare
Co-authored-by: Matthew J McIlree <matthew.j.mcilree@gmail.com>
ae709d5 to
481580d
Compare
An attempted update of #216, with support for outputting proofs in DRCP format.