Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active August 26, 2017 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/bf2ed182afc45a23430c0a7deabb13f1 to your computer and use it in GitHub Desktop.
Save deque-blog/bf2ed182afc45a23430c0a7deabb13f1 to your computer and use it in GitHub Desktop.
sat :: SAT -> Bool
sat pb = or $ do
assignment <- forM (allVars pb) $ \var -> do
val <- [True, False]
pure (var, val)
pure (evalSat assignment pb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment