[Haskell-cafe] Solving integer equations in Haskell

Levent Erkok erkokl at gmail.com
Mon Oct 22 05:31:41 CEST 2012


On Oct 17, 2012, at 3:35 AM, Justin Paston-Cooper <paston.cooper at gmail.com> wrote:
> Thanks for all the informative replies. SBV seems the simplest solution right now, and speed isn't too much of an issue here. Anything under 20 seconds per solution should be bearable.

I'm happy to announce the SMT based linear equation solver library: http://hackage.haskell.org/package/linearEqSolver

You can use it get solutions over Integers only, or over Rationals if so needed. Functions are provided to extract one solution, or all possible solutions (as a lazy list). The latter variant is useful for underspecified systems. 

Regarding performance: SMT solvers are very good at solving such equations, so aside from the overhead of calling out to an external program, it should be fairly fast. I'd expect no practical instance to come to anywhere near the 20 second limit you've mentioned. For most practical instances, the process switch overhead would dominate computation time, which should be negligible. Let me know if you find otherwise. 

-Levent. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121021/ff9f71dc/attachment.htm>


More information about the Haskell-Cafe mailing list