leventerkok / lineareqsolver Goto Github PK
View Code? Open in Web Editor NEWSolve systems of linear equations, using SMT solvers.
License: Other
Solve systems of linear equations, using SMT solvers.
License: Other
I get the following error when trying to solve a system of equations using Z3 and linearEqSolver v2.3:
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude> import Math.LinearEquationSolver
Prelude Math.LinearEquationSolver> solveIntegerLinearEqs Z3 [[1,-1],[3,-2]] [0,-1]
*** Exception: Unable to locate executable for Z3
Executable specified: "z3"
CallStack (from HasCallStack):
error, called at ./Data/SBV/SMT/SMT.hs:573:23 in sbv-8.6-4QEWrfdds2bERRyL3UyeG:Data.SBV.SMT.SMT
When installing v2.0 of linearEqSolver from Cabal, the build fails with the following error:
Math/LinearEquationSolver.hs:143:29: error: Not in scope: type constructor or class ‘SymWord’ Perhaps you meant ‘SWord’ (imported from Data.SBV) | 143 | buildConstraints :: (Num a, SymWord a) => String -> [[a]] -> [a] -> Symbolic SBool |
As mentioned in the title: building fails for me with sbv-3.1 and with ghc-7.8.3.
[1 of 1] Compiling Math.LinearEquationSolver ( Math/LinearEquationSolver.hs, dist/build/Math/LinearEquationSolver.o )
Math/LinearEquationSolver.hs:36:7:
Ambiguous occurrence ‘Solver’
It could refer to either ‘Math.LinearEquationSolver.Solver’,
defined at Math/LinearEquationSolver.hs:33:1
or ‘Data.SBV.Solver’,
imported from ‘Data.SBV’ at Math/LinearEquationSolver.hs:27:1-43
(and originally defined in ‘sbv-3.1:Data.SBV.BitVectors.Data’)
[...]
Making this change re-enables compilation:
--- LinearEquationSolver.hs.old 2014-08-27 19:59:24.000000000 +0200
+++ LinearEquationSolver.hs 2014-08-27 19:27:14.000000000 +0200
@@ -24,7 +24,7 @@
, solveRationalLinearEqsAll
) where
-import Data.SBV hiding (z3, cvc4)
+import Data.SBV hiding (z3, cvc4, Solver)
import qualified Data.SBV as SBV (z3, cvc4)
-- | Interface to the SMT solver, via the SBV library. Unless you need to create
Hello Levent!
I may be misunderstanding something, but when I run this example code from the documentation:
>>> take 3 `fmap` solveRationalLinearEqsAll Z3 [[2.4, 3.6]] [12]
[[0 % 1,10 % 3],[(-3) % 2,13 % 3],[(-3) % 4,23 % 6]]
I see no results (in both interpreted and compiled code). Any idea what the problem might be? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.