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

Help: satisfy_all on CNF significantly slower than DNF #161

Open
Cerebus opened this issue Sep 3, 2020 · 0 comments
Open

Help: satisfy_all on CNF significantly slower than DNF #161

Cerebus opened this issue Sep 3, 2020 · 0 comments

Comments

@Cerebus
Copy link

Cerebus commented Sep 3, 2020

I know I'm probably missing something simple and stupid, but here's the stage:

  • Expression is an alternating nest:
Or(
  And(
    Or(
      And(var, var, ...),
      And(var, var, ...),
      ...
    ),
    Or(And(...),...),
    ...
  ),
  And(Or(And(...),...), ...),
  ...
)
  • list(x.satisfy_all()) on the un-normalized expression as the baseline
  • list(x.to_dnf().satisfy_all()) runs ~20x faster
  • list(x.to_cnf().satisfy_all()) runs >100x slower

The times for to_cnf() and to_dnf() are fine, in that this isn't the source of the time difference.

The CNF expression should be foisted off on PicoSAT, and since that's in C I expected that to be a lot faster. What am I missing?

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

No branches or pull requests

1 participant