Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
jniz3-scala-examples [2010/12/03 18:04] philippe.suter |
jniz3-scala-examples [2011/07/29 16:40] philippe.suter |
||
---|---|---|---|
Line 5: | Line 5: | ||
===== Testing your setup ===== | ===== Testing your setup ===== | ||
+ | |||
===== *nix Systems ===== | ===== *nix Systems ===== | ||
Once you have the required files, try our your setup with the Scala interpreter. Note that you have to make sure that ''libz3.so'' is in the dynamically-loaded library path (''LD_LIBRARY_PATH'' in Unix-like systems). You can run ''scala'' as follows: | Once you have the required files, try our your setup with the Scala interpreter. Note that you have to make sure that ''libz3.so'' is in the dynamically-loaded library path (''LD_LIBRARY_PATH'' in Unix-like systems). You can run ''scala'' as follows: | ||
- | LD_LIBRARY_PATH=${Z3_LIB_PATH} scala -classpath z3.jar | + | LD_LIBRARY_PATH=${Z3_LIB_PATH} scala -classpath scalaz3.jar |
where ''${Z3_LIB_PATH}'' is the directory where you keep ''libz3.so''. (Alternatively, export ''LD_LIBRARY_PATH'' once and for all.) Then, try the following: | where ''${Z3_LIB_PATH}'' is the directory where you keep ''libz3.so''. (Alternatively, export ''LD_LIBRARY_PATH'' once and for all.) Then, try the following: | ||
Line 15: | Line 16: | ||
it should print something like: | it should print something like: | ||
- | Z3 2.16 (build 0, rev. 0) | + | res0: String = Z3 2.19 (build 0, rev. 0), ScalaZ3 2.19 |
- | jniZ3 1.1 (2010-12-03) | + | |
- | z3.scala 1.1 (2010-12-03) | + | If you have an older version of Z3, go get the latest. |
- | (Note that Z3 2.15 for Linux reports 2.16 as the version number...) If you have an older version of Z3, go get the latest. | ||
===== Windows ===== | ===== Windows ===== | ||
- | Make sure you have all required files installed and available in the path, including the [[http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84|Microsoft Visual C++ 2010 Redistributable Package]]. The instructions are otherwise similar as above. (Z3 correctly reports 2.15 under Windows.) | + | Make sure you have all required files installed and available in the path, including the [[http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84|Microsoft Visual C++ 2010 Redistributable Package]]. The instructions are otherwise similar as above. |
===== Solving integer constraints ===== | ===== Solving integer constraints ===== | ||
Line 85: | Line 86: | ||
You can compile it simply by running | You can compile it simply by running | ||
- | scalac -cp z3.jar SecondsToTime.scala | + | scalac -cp scalaz3.jar SecondsToTime.scala |
and run it with | and run it with | ||
- | LD_LIBRARY_PATH=${Z3_LIB_PATH} scala -cp z3.jar SecondsToTime 12345 | + | LD_LIBRARY_PATH=${Z3_LIB_PATH} scala -cp scalaz3.jar SecondsToTime 12345 |
for instance. | for instance. | ||