Skip to content

Conversation

ThomasHaas
Copy link
Collaborator

I added a new class EncodingUtils that can encode cardinality constraints and symmetry constraints (moved the existing SymmetryEncoder.encodeLexLeader into EncodingUtils). Simplified existing code to use the new class.

This PR is almost a pure refactor with one exception: the encoding of rf has slightly changed.
We used to encode the at-most-one constraint unconditionally for rf-edges, and only conditioned the at-least-one constraint on the execution of a read, i.e., at-most-one(SetOfRfEdges) /\ (exec(r) => at-least-one(SetOfRfEdges).
Now both parts are conditioned: exec(r) => (at-most-one(...) /\ at-least-one(...)).
I don't know if this impacts performance in any measurable way (over our unit tests nothing really changes I think).

Moved existing LexLeader encoding to EncodingUtils.
Add Cardinality constraint encodings to EncodingUtils.
Simplified encoding of rf.
Copy link
Collaborator

@xeren xeren left a comment

Choose a reason for hiding this comment

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

This refactor makes WmmEncoder.RelationEncoder.visitReadFrom(ReadFrom) more readable.

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