Last active
August 10, 2017 17:37
-
-
Save Garciat/3bf24dc94abe1f842f343ecf0dc95f1d 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
import Data.SBV | |
fruits :: SInteger -> SInteger -> SInteger -> SBool | |
fruits a b c = equation &&& positive | |
where | |
x = sFromIntegral a :: SReal | |
y = sFromIntegral b :: SReal | |
z = sFromIntegral c :: SReal | |
equation = x / (y + z) + y / (x + z) + z / (x + y) .== 4 | |
positive = a .> 0 &&& b .> 0 &&& c .> 0 | |
main :: IO () | |
main = sat fruits >>= print |
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
$ ghci Fruits.hs | |
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help | |
[1 of 1] Compiling Main ( Fruits.hs, interpreted ) | |
Ok, 1 module loaded. | |
*Main> sat fruits | |
Unknown. | |
Reason: smt tactic failed to show goal to be sat/unsat (incomplete (theory arithmetic)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment