Skip to content

fix: allowing unit conflict explanation - #82

Closed
ImkoMarijnissen wants to merge 2 commits into
mainfrom
fix/unit_conflict_explanation
Closed

ImkoMarijnissen wants to merge 2 commits into
mainfrom
fix/unit_conflict_explanation

Conversation

@ImkoMarijnissen

@ImkoMarijnissen ImkoMarijnissen commented Oct 29, 2024 •

Copy link
Copy Markdown
Contributor

Closes #81

This is a proposal, any feedback is more than welcome!

Currently, we do not handle unit conflict explanations which can interfere with the workings of the proof logging but could also inhibit the behaviour of propagators in the future.

This PR proposes to update the existing explanation_clause_manager to keep track of its own internally allocated clauses during conflict analysis such that they do not have to be allocated by the clause_allocator. This allows us to handle the cases where a conflict explanation is unit (and it could reduce the memory overhead slightly since we are not storing a ClauseBasic but a Vec<Literal>).

Additionally, to use the compact representation of a ClauseReference, a new type of this struct is used (with the 31st bit not set and the 30th bit set) which indicates an explanation clause.

@ImkoMarijnissen ImkoMarijnissen added bug Something isn't working enhancement New feature or request labels Oct 29, 2024
@EmirDe

EmirDe commented Oct 30, 2024 •

Copy link
Copy Markdown
Contributor

Two quick comments:

  1. Why do we need to have a separate concept 'explanation clause' for the clause reference, compared to simply allowing the clause allocator to allocate unit clauses?

(The solver internally already keeps track of clause references that are created as part of explanations, and deletes them after conflict analysis.)

  1. I noticed that the explanation manager is not part of the context, would it make sense to include it as part of the conflict analysis context?

If we eventually switch to the revamp, it does not matter that much, so perhaps it does not matter too much how we implement this now, as long as it works?

(p.s. I also made some comments to the issue, please have a look!)

@maartenflippo

Copy link
Copy Markdown
Contributor

After discussion, we decided to implement the complete_proof such that this issue is avoided all-together. It is a bit hacky, however, once explicit SAT literals are removed this bug would disappear anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when propagator returns unit conflict explanation

3 participants