summaryrefslogtreecommitdiff
path: root/src/bindings
AgeCommit message (Collapse)Author
2019-12-17Generate code for options with modes. (#3561)Mathias Preiner
This commit adds support for code generation of options with modes (enums). From now on option enums can be specified in the corresponding *.toml files without the need of extra code. All option enums are now in the options namespace.
2019-09-25Use separate CMake project for CVC4 examples. (#3196)Mathias Preiner
2019-07-29Model blocker feature (#3112)Andrew Reynolds
2019-07-29Support get-abduct smt2 command (#3122)Andrew Reynolds
2019-06-21Add floating-point support in the Java API (#3063)Andres Noetzli
This commit adds support for the theory of floating-point numbers in the Java API. Previously, floating-point related classes were missing in the JAR. The commit also provides an example that showcases how to work with the theory of floating-point numbers through the API.
2019-06-11Fix compilation issue for Java bindings + CLN (#3045)Andres Noetzli
Fixes #3044. When using CLN instead of GMP, SWIG produces different Java files for the CLN classes. The bindings expected the GMP files even when building with CLN, so compilation failed. This commit fixes the issue by changing the list of files depending on whether we build with CLN or GMP.
2019-06-05Add support for SWIG 4 (#3041)Andres Noetzli
SWIG 4 seems to change the name for `std::map<CVC4::Expr, CVC4::Expr>` to include the implicit template argument for comparisons. To make the code compatible with both SWIG 4.0.0 and older versions, this commit creates an explicit instance of the template.
2019-05-15Fix iterators in Java API (#3000)Andres Noetzli
Fixes #2989. SWIG 3 seems to have an issue properly resolving `T::const_iterator::value_type` if that type itself is a `typedef`. This is for example the case in the `UnsatCore` class, which `typedef`s `const_iterator` to `std::vector<Expr>::const_iterator`. As a workaround, this commit changes the `JavaIteratorAdapter` class to take two template parameters, one of which is the `value_type`. The commit also adds a compile-time assertion that `T::const_iterator::value_type` can be converted to `value_type` to avoid nasty surprises. A nice side-effect of this solution is that explicit `typemap`s are not necessary anymore, so they are removed. Additionally, the commit adds a `toString()` method for the Java API of `UnsatCore` and adds examples that show and test the iteration over the unsat core and the statistics. Iterating over `Statistics` now returns instances of `Statistic` instead of `Object[]`, which is a bit cleaner and requires less glue code.
2019-05-15cmake: Install JAR and JNI files for Java bindings. (#3002)Mathias Preiner
Default install paths are: - libcvc4jni.so in /usr/lib/ - CVC4.jar in /usr/share/java/cvc4 Fixes #2990.
2019-04-24Do not use __ prefix for header guards. (#2974)Mathias Preiner
Fixes 2887.
2019-03-26Update copyright headers.Aina Niemetz
2018-10-22Fail for SWIG 3.0.8 (#2656)makaimann
Ran into this bug when compiling with python3 bindings: https://github.com/swig/swig/issues/588 Instantiating any object crashes python. Since swig3.0.8 is currently the apt-get install for Ubuntu 16.04, I thought it'd be good to have a check for that. If python3 is preferred and the swig version is 3.0.8, it errors out and asks users to downgrade or upgrade SWIG.
2018-10-19Remove autotools build system. (#2639)Mathias Preiner
2018-10-18Introducing internal commands for SyGuS commands (#2627)Haniel Barbosa
2018-09-22cmake: Add python3 option.Mathias Preiner
2018-09-22cmake: Add make install rule.Mathias Preiner
2018-09-22cmake: Rebase with current master, add new tests/source files.Mathias Preiner
2018-09-22cmake: Add SWIG support + Python and Java bindings.Mathias Preiner
2018-09-22cmake: Added initial build infrastructure.Aina Niemetz
2018-09-04Remove CVC3 compatibility layer (#2418)Andres Noetzli
2018-08-07Require Swig 3 (#2283)Andres Noetzli
Removes some hacks due to Swig 2's incomplete C++11 support and adds checks for version 3 at configuration time as well as in swig.h
2018-06-25Updated copyright headers.Aina Niemetz
2018-03-26Make Java bindings work with newer build envs (#1709)Andres Noetzli
Our current build scripts did not work with Automake 1.16. At configure time, the .swig_deps target in src/bindings/Makefile.am was executed due to the `@mk_include@ .swig_deps` (which is not the case with older versions of Automake). This ultimately caused configure to fail because SWIG was complaining about missing files (generated source files, such as src/expr/expr.h). This commit fixes the issue by adding `-ignoremissing` to the call to SWIG. With that option, SWIG is not complaining about the missing files and the dependency generation completes successfully. Currently, the src/bindings/compat/java/create_impl.py script is not compatible with Python 3, which leads to errors when building on systems where `python` links to Python 3 (e.g. on Arch Linux). This commit makes the script compatible with both Python 2 and 3. Our build scripts were using old -source/-target versions when calling `javac`. Those are not supported by newer Java versions (e.g. Java 9). This commit updates the version to 1.6, which is still fairly old, so should be broadly supported. Finally, some systems (e.g. Arch Linux' AUR package for SWIG 2) refer to SWIG 2 as `swig-2`. This commit adds support for detecting this at configure time.
2017-10-27Modify LDFLAGS to support shared libraries for Win (#1280)Andres Noetzli
* Use uintptr_t for pointer casts in Swig files CVC4's Swig interface files were casting pointers to longs in multiple instances. The problem with that is that on certain platforms *cough* Windows/MinGW *cough* long is only 32-bit even when compiling a 64-bit executable (they use the LLP64 data model). This made the compilation of language bindings fail with MinGW. This commit changes the types to uintptr_t defined in Swig's stdint.i. * Modify LDFLAGS to support shared libraries for Win This commit adds "-no-undefined" to the LDFLAGS of CVC4's library, which is required for building DLLs (shared libraries on Windows). It also adds "--export-all-symbols" to the linker flags of the parser to ensure that there are no unresolved symbols when linking against it (see comment in the Makefile.am for details). * Fix for non-Windows builds * add no-undefined to libcvc4compatjni
2017-09-19Fixing a null pointer dereference in the cvc3 compatibility layer. (#1089)Tim King
2017-09-13Remove unused RecordSelect and TupleSelect (#1087)Andres Noetzli
Commit 62b673a6b8444c14c169a984dd6e3fc8f685851e remove most of the record/tuple infrastructure but did not remove the classes RecordSelect and TupleSelect which lead to issues with Java bindings (the references to the corresponding mkConst implementations could not be resolved). This commit removes the remaining traces of those classes.
2017-08-30Use thread_local instead of compiler extensions (#210)Andres Noetzli
C++11 introduced the thread_local keyword, so we don't need to use non-standard extensions or our custom pthread extension anymore. The behavior was previously introduced as a workaround in commit 753a072c542c1c254d7c6adbf10e091ba585ede5. This commit introduces the macro CVC4_THREAD_LOCAL that can be used to declare variables as thread local. For Swig, this macro is defined to be empty.
2017-07-07Update copyright headers.Mathias Preiner
2016-04-20update from the masterPaulMeng
2015-12-24Miscellaneous fixesTim King
- Splitting the two instances of CheckArgument. The template version is now always defined in base/exception.h and is available in a cvc4_public header. This version has lost its variadic version (due to swig not supporting va_list's). The CPP macro version has been renamed PrettyCheckArgument. (Taking suggestions for a better name.) This is now only defined in base/cvc4_assert.h. Only use this in cvc4_private headers and in .cpp files that can use cvc4_private headers. To use a variadic version of CheckArguments, outside of this scope, you need to duplicate this macro locally. See cvc3_compat.cpp for an example. - Making fitsSignedInt() and fitsUnsignedInt() work more robustly for CLN on 32 bit systems. - Refactoring ArrayStoreAll to avoid potential problems with circular header inclusions. - Changing some headers to use iosfwd when possible.
2015-12-14Refactoring Options Handler & Library Cycle BreakingTim King
What to Know As a User: A number of files have moved. Users that include files in the public API in more refined ways than using #include <cvc4.h> should consult which files have moved. Note though that some files may move again after being cleaned up. A number of small tweaks have been made to the swig interfaces that may cause issues. Please file bug reports for any problems. The Problem: The build order of CVC4 used to be [roughly] specified as: options < expr < util < libcvc4 < parsers < main Each of these had their own directories and their own Makefile.am files. With the exception of the util/ directory, each of the subdirectories built exactly one convenience library. The util/ directory additionally built a statistics library. While the order above was partially correct, the build order was more complicated as options/Makefile.am executed building the sources for expr/Makefile.am as part of its BUILT_SOURCES phase. This options/Makefile.am also build the options/h and options.cpp files in other directories. There were cyclical library dependencies between the first four above libraries. All of these aspects combined to make options extremely brittle and hard to develop. Maintaining these between clang versus gcc, and bazel versus autotools has become increasing unpredictable. The Solution: To address these cyclic build problems, I am simplifying the build process. Here are the main things that have to happen: 1. util/ will be split into 3 separate directories: base, util, and smt_util. Each will have their own library and Makefile.am file. 2. Dependencies for options/ will be moved into options/. If a type appears as an option, this file will be moved into options. 3. All of the old options_handlers.h files have been refactored. 4. Some files have moved from util into expr/ to resolve cycles. Some of these moves are temporary. 5. I am removing the libstatistics library. The constraints that the CVC4 build system will eventually satisfy are: - The include order for both the .h and .cpp files for a directory must respect the order libraries are built. For example, a file in options/ cannot include from the expr/ directory. This includes built source files such as those coming from */kinds files and */options files. - The types definitions must also respect the build order. Forward type declarations will be allowed in exceptional, justified cases. - The Makefile.am for a directory cannot generate a file outside of the directory it controls. (Or call another Makefile.am except through subdirectory calls.) - One library per Makefile.am. - No extra copies of libraries will be built for the purpose of distinguishing between external and internal visibility in libraries for building parser/ or main/ libraries and binaries. Any function used by parser/ and main/ will be labeled with CVC4_PUBLIC and be in a public API. (AFAICT, libstatistics was being built exactly to skirt this.) The build order of CVC4 can now be [roughly] specified as base < options < util < expr < smt_util < libcvc4 < parsers < main The distinction between "base < options < util < expr" are currently clean. The relationship between expr and the subsequent directories/libraries are not yet clean. More details about the directories: base/ The new directory base/ contains the shared utilities that are absolutely crucial to starting cvc4. The list currently includes just: cvc4_assert.{h,cpp}, output.{h,cpp}, exception.{h,cpp}, and tls.{h, h.in, cpp}. These are things that are required everywhere. options/ The options/ directory is self contained. - It contains all of the enums that appear as options. This includes things like theory/bv/bitblast_mode.h . - There are exactly 4 classes that handled currently using forward declarations currently to this: LogicInfo, LemmaInputChannel, LemmaOutputChannel, and CommandSequence. These will all be removed from options. - Functionality of the options_handlers.h files has been moved into smt/smt_options_handler.h. The options library itself only uses an interface class defined in options/options_handler_interface.h. We are now using virtual dispatch to avoid using inlined functions as was previously done. - The */options_handlers.h files have been removed. - The generated smt/smt_options.cpp file has been be replaced by pushing the functionality that was generated into: options/options_handler_{get,set}_option_template.cpp . The non-generated functionality was moved into smt_engine.cpp. - All of the options files have been moved from their directories into options/. This means includes like theory/arith/options.h have changed to change to options/arith_options.h . util/ The util/ directory continues to contain core utility classes that may be used [almost] everywhere. The exception is that these are not used by options/ or base/. This includes things like rational and integer. These may not use anything in expr/ or libcvc4. A number of files have been moved out of this directory as they have cyclic dependencies graph with exprs and types. The build process up to this directory is currently clean. expr/ The expr/ directory continues to be the home of expressions. The major change is files moving from util/ moving into expr/. The reason for this is that these files form a cycle with files in expr/. - An example is datatype.h. This includes "expr/expr.h", "expr/type.h" while "expr/command.h" includes datatype.h. - Another example is predicate.h. This uses expr.h and is also declared in a kinds file and thus appears in kinds.h. - The rule of thumb is if expr/ pulls it in it needs to be independent of expr/, in which case it is in util/, or it is not, in which case it is pulled into expr/. - Some files do not have a strong justification currently. Result, ResourceManager and SExpr can be moved back into util/ once the iostream manipulation routines are refactored out of the Node and Expr classes. - Note the kinds files are expected to remain in the theory/ directories. These are only read in order to build sources. - This directory is not yet clean. It contains forward references into libcvc4 such as the printer. It also makes some classes used by main/ and parser CVC4_PUBLIC. smt_util/ The smt_util/ directory contains those utility classes which require exprs, but expr/ does not require them. These are mostly utilities for working with expressions and nodes. Examples include ite_removal.h, LemmaInputChannel and LemmaOutputChannel. What is up next: - A number of new #warning "TODO: ..." items have been scattered throughout the code as reminders to myself. Help with these issues is welcomed. - The expr/ directory needs to be cleaned up in a similar to options/. Before this happens statistics needs to be cleaned up.
2014-08-06First crack at fixing double-linking issues in build system.Morgan Deters
2014-07-01Update copyrights.Morgan Deters
2014-06-21Fix compat-Java layer, should fix build.Morgan Deters
2014-06-21Lower the Java JRE version requirement.Morgan Deters
2014-06-21Adjust library dependencies to be more correct (fixes lintian warnings).Morgan Deters
2013-12-03Work around a swig segfault issue when building on Mac OSMorgan Deters
2013-11-26Fix Java output stream adapter.Morgan Deters
2013-11-13Some patches to CVC3 compatibility layer; Thanks to Adam Buchbinder @ Google ↵Morgan Deters
for the report and patch!
2013-11-10Fix compat-java library naming on Mac OS; thanks to Zheng Manchun for ↵Morgan Deters
reporting this issue
2013-07-30Minor fixes to build system.Morgan Deters
2013-07-29Fix numerous compiler warnings on various platformsMorgan Deters
2013-04-29Some fixes for GCC 4.2, and for Java on MacMorgan Deters
2013-04-02Regenerated copyrights: canonicalized names, no emailsMorgan Deters
2013-04-01update copyrightsMorgan Deters
2013-03-26Fixes for warnings from clang++, from -std=gnu++0x, from swig, and from javacMorgan Deters
2013-03-25java input stream adapters workingMorgan Deters
2013-03-15fix up build system for swig (d242c30 introduced a subtle error)1.0.xMorgan Deters
2013-03-14fix to build system: #include the proper file when they are in both builds ↵Morgan Deters
and src
2012-11-17* enable previously-failing (now succeeding) datatype example that uses recordsMorgan Deters
* some bindings cleanup (this commit was certified error- and warning-free by the test-and-commit script.)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback