Skip to content
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

Add unit tests for Tseitin CNF conversion and implement missing equals method for Sym. #4222

Merged
merged 2 commits into from Jan 2, 2015

Conversation

gbasler
Copy link
Contributor

@gbasler gbasler commented Dec 26, 2014

As promised in #4078.

The tests already paid off: figured out that I forgot to add equals (shame on me)...

Review by @adriaanm

@scala-jenkins scala-jenkins added this to the 2.11.6 milestone Dec 26, 2014
@gbasler gbasler force-pushed the topic/patmat-unit-tests-rebased branch 2 times, most recently from 52fba08 to f84d3ea Compare December 26, 2014 18:22
@adriaanm
Copy link
Contributor

Thanks! Could you split up the commit into the bugfix for the earlier PR (equals method) and the test? Why is the solver code duplicated in the test? Can we refactor the actual solver to make it testable directly?

@adriaanm adriaanm modified the milestones: 2.11.5, 2.11.6 Dec 29, 2014
We compare the results using the Tseitin transformation with the results of a
conversion via expansion of the formula (using distributive laws), e.g.,

```
             +-------+
             |Formula|
             +---+---+
                 |
     +-----------+-----------+
     |                       |
     v                       v
+---------+              +-------+
|Expansion|              |Tseitin|
+----+----+              +---+---+
     |        +-----+        |
     +------->| =?= |<-------+
              +-----+
```

both methods should deliver the same results (i.e., models).
@gbasler
Copy link
Contributor Author

gbasler commented Dec 29, 2014

I've split the commit into two parts.

The current solver implementation is coupled with it's usage, I used a suggestion by @retronym to decouple the code. I don't see a better way right now since the traits are otherwise not accessible.
Actually there should not be any duplicated code, the two functions that I added are not needed anymore by the solver that is used in the pattern matcher.

@adriaanm
Copy link
Contributor

adriaanm commented Jan 2, 2015

LGTM, thanks for splitting them up. I'm going to merge this so we can get the improvement into 2.11.5

adriaanm added a commit that referenced this pull request Jan 2, 2015
Add unit tests for Tseitin CNF conversion and implement missing `equals` method for `Sym`.
@adriaanm adriaanm merged commit 3fafbc2 into scala:2.11.x Jan 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants