Made the mygcd function visible so that I can use it in building tests

This commit is contained in:
Neil Brown 2007-12-13 15:32:04 +00:00
parent 9082e5c887
commit e56d02b727

View File

@ -87,10 +87,6 @@ solveConstraints p ineq
| ((e ! 0) `mod` g) /= 0 = Nothing
| otherwise = Just $ amap (\x -> x `div` g) e
where g = foldl1 mygcd (map abs $ tail $ elems e) -- g is the GCD of a_1 .. a_n (not a_0)
mygcd :: Integer -> Integer -> Integer
mygcd 0 0 = 0
mygcd x y = gcd x y
-- | Solves all equality problems in the given list.
-- Will either succeed (Just () in the Error/Maybe monad) or fail (Nothing)
@ -205,3 +201,7 @@ solveConstraints p ineq
checkFalsifiable' :: EqualityConstraintEquation -> Bool
checkFalsifiable' e = (e ! 0 /= 0) && (all (== 0) . tail . elems) e
mygcd :: Integer -> Integer -> Integer
mygcd 0 0 = 0
mygcd x y = gcd x y