Created
January 21, 2016 06:22
-
-
Save cheecheeo/80fe6150ff06ea3ca95a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package sbv | |
import Data.SBV | |
main = | |
print =<< | |
(sat $ | |
\lo m2 m1 hi -> | |
((lo :: SInt8) + m2 + m1 + hi .== 31) | |
&&& (lo `sMod` 2 + m2 `sMod` 2 + m1 `sMod` 2 + hi `sMod` 2 .== 1) | |
&&& allDifferent [lo, m2, m1, hi] | |
&&& lo .< m2 | |
&&& m2 .< m1 | |
&&& m1 .< hi | |
&&& (hi - lo .== 7) | |
&&& (m1 - m2 .== 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment