-
Notifications
You must be signed in to change notification settings - Fork 5
Setting up the Environment
This guide describes how to set up the AProVE development environment in Eclipse or in IntelliJ. Please follow the steps carefully to ensure a working configuration.
-
Clone or fork the repository
Contributors should work on a fork of the repository and stage a pull request after implementing new features.
Clone the fork into a folder
aprove-open-source.
mkdir aprove_project/
cd aprove_project/
git clone git@github.com:<fork-name>/aprove-open-source.git
cd aprove-open-source/
-
Install Required Dependencies
Depending on what you want to work on in AProVE you need different additional tools installed. In the following, you can find a list of all external tools that AProVE might call. If you start working on AProVE and have no idea what you need to install: Just install the satisfiability checkers and ignore the rest.
For (non)termination proofs you also need the satisfiability checkers Z3, Yices, and MiniSat:
-
Z3: Please visit https://github.com/Z3Prover/z3/releases to download Z3 (version >= 4.4.0). For Linux please download the source code, then compile and install it as described in the README file. In addition, you have to pass the option --java to scripts/mk_make.py to build Z3's java bindings. Alternatively, you can download pre-compiled binaries from https://github.com/Z3Prover/z3/releases. To do so, you have to select ''Planned'' in the section ''OTHER DOWNLOADS'' on the right. Afterwards, please make sure to add the Z3 sub-directory containing the executable z3 to your path environment as described below. Furthermore, the folder containing the file libz3java.so has to be added to the environment variable LD_LIBRARY_PATH. This works similar to setting the path environment (see below).
-
Yices 1: AProVE still runs only with Yices 1 (e.g., Yices 1.0.40 released December 4, 2013), but not Yices 2. Please download Yices 1 from https://yices.csl.sri.com/old/download-yices1.html. After extracting the files, please make sure to add the yices bin sub-directory (/home/username/yices-1.0.40/bin/) to your path environment as described below. Moreover, please make sure that this sub-directory appears before any other directory (e.g., /usr/local/bin) that would contain another Yices binary.
-
MiniSat To run AProVE, you need to install MiniSat version 2 or higher: Linux On Debian and Ubuntu it suffices to install the minisat2 package. For other systems: Make sure that make and the developer version of zlib are installed on your sytem. Download http://minisat.se/downloads/minisat2-070721.zip and unzip it. Inside the minisat/simp directory, run
make rs(this depends on glibc-static, install if not present on your system). Rename the resulting file minisat_static to minisat and add its directory to your path environment as described below.
If you need to visualize graphs, please also download and install the Graphviz tools (containing dot) from http://www.graphviz.org/. For Debian and Ubuntu it suffices to install the graphviz package.
In order to invoke CeTA from the GUI one needs to install CeTA (version >= 2.22). It is available at http://cl-informatik.uibk.ac.at/software/ceta/, where both precompiled binaries and the sources are available. To compile CeTA you additionally need to install the Glasgow Haskell Compiler, which is included in the Haskell Platform. After installing CeTA, please make sure that ceta is accessible, by adjusting your path environment as described below.
To be able to prove upper bounds on the complexity of Integer Term Rewrite Systems from the GUI, one needs to install the tool KoAT. Moreover, KoAT is used by some complexity analysis techniques for classical Term Rewriting. Please checkout KoAT from github. Install KoAT according to the supplied instructions. Rename the resulting executable to koat and add its directory to your path environment as described below.
To be able to prove lower bounds on the complexity of Integer Term Rewrite Systems from the GUI, one needs to install the tool LoAT. The recommended way to install LoAT is to download the pre-compiled binary for Linux/x64. Alternatively, checkout LoAT from github. Install LoAT according to the supplied instructions. In any case, rename the resulting executable to loat and add its directory to your path environment as described below.
Some complexity analysis techniques for Term Rewriting require CoFloCo. Please follow the installation instructions from the CoFloCo website.
To be able to analyze C Programs, one needs to install Clang 2.9. To do so, please download and install the suitable precompiled binary of Clang 2.9, which is available here. Newer version of Clang up to and including Clang 3.5 should also work, but we cannot guarantee this.
-
-
Download and Install the newest version of Eclipse here
-
Import the Eclipse Project and set the correct Java Version
-
Navigate to:
File → Import → General → Existing Projects into Workspace -
Select the
aprove_project/directory -
Import all detected projects
AProVE is currently developed with Java 25. You can set the Java version in the preferences of each Project. Right-click the project then
Properties > Java Compiler > Compiler Compliance Leveland set it to 25. -
-
Import the Eclipse Preferences
-
Navigate to:
File → Import → General → Preferences -
Select the file:
aprove_project/aprove-open-source/eclipsePreferences/preferences.epf
This file contains settings for the Java Code Formatter as well as custom compiler errors and warnings.
-
-
Run ant target
initialSetupMake sure you have the right ant version installed for your JDK.
cd aprove_project/aprove-open-source/ ant -f build-aprove.xml initialSetupYou can also do this from eclipse by setting up the correct Ant-file. To do this, go to the properties for the aprove project, choose the tab "Builders" and create an "Ant Builder", for which you configure the possible targets.
-
Wait for Eclipse to build the Workspace
You might need to refresh the project.
Eclipse can build your workspace automatically. For this, make sure to check the menu entry
Project > Build Automatically. However, since AProVE is a big project, you might want to disable this. In this case, you have to trigger the Eclipse build manually viaProject > Build All. Using the automatic build is more convenient (better IDE support) as long as you can tolerate being interrupted by the automatic build occasionally. -
Using the Automatic Build without being interrupted by it very frequently
If the box in
Menu > Project > Build Automaticallyis checked, the Eclipse provides a much better editing support. However, if not configured correctly, then the automatic build can really get in the way, because it frequently interrupts the user for several minutes to rebuild the whole project. This might have several reasons, but is not the intended way how it should work.For me, the available RAM for Eclipse was set too low, so Eclipse could not keep the whole project into memory at once. The problem was solved by increasing the available RAM. This can be configured in the
eclipse.inifile. I set-Xms1024mfor the minimum size and-Xmx4096mfor the maximum size.Another helpful option is to enable
Window > Preferences > General > Startup and Shutdown > Refresh workspace on startup. This causes Eclipse to refresh its workspace when it is started, which often causes a rebuild of the project. If this option is disabled you might run into the situation that you start Eclipse and do something else while it start. But then, when you actually start working with Eclipse and make the first changes it notices that it needs to refresh its workspace and causes a rebuild, effectively interrupting you again from starting to work with the code. I strongly suggest checking this box, so that Eclipse is ready to go when you are. -
Configure run
You need to configure how aprove should be run. A list of all command line flags can be found here in the 'AProVE Command-Line Version' section. For configuration go to 'Run --> Open Run Dialog... --> Java Application --> New and use aprove.Main as main class.
An example of a run configuration that gives the WST output, a plain proof output, and uses a timer of 60 seconds on an examples named #4.16.ari located in the examples/TRS_Standard folder would be:
-m wst -p plain -t 60 examples/TRS_Standard/#4.16.ari
-
Download and install the newest version of Eclipse
This is needed because the build process depends on some Eclipse libraries.
-
Install the Ant plugin from the marketplace in IntelliJ
-
Start IntelliJ and open the
approve-open-sourcedirectory -
If necessary, locate the Eclipse's installation directory upon prompt (e.g. /usr/lib/eclipse)
-
Import the Ant build script
Navigate to
View -> Tool Windows -> Antand press the+-button and select the fileapprove-open-source/build-aprove.xml. -
Configure the SDKs
Navigate to
File -> Project Structureand furtherPlatform Settings -> SDKs, press the+-button and add both the SDK 25 as well as SDK 8. Then navigate toProject Settings -> Projectand select 25 as your SDK and your language level. Make sure your language level is lower or equal to your SDK version. Do the same underProject Settings -> Modules. -
Increase the maximum heap size of the build process
Navigate to
Settings -> Build, Execution, Deployment -> Compilerand set the shared heap size to e.g. 4069. -
Run ant target
initialSetupOpen the Ant tool window and double-click the respective item.
-
Configure run
In toolbar on the top, select the configurations dropdown menu and press
Edit configurations.... Then, add a newApplicationconfiguration and setaprove.Mainas the Main class. Then configure the program arguments as required, for example-m wst -p plain -t 60 examples/TRS_Standard/#4.16.ari.
- Disable automatic build in: Menu > Project > Build Automatically
- Clean all projects: Menu > Project > Clean (enable Clean all projects, disable Start a build immediately) > Clean
- Run ant scripts:
- In the
aprove_project/aprove-open-source/directory: runant -f build-aprove.xml cleanAll initialSetup
- In the
- Refresh all projects: In the Project Explorer right click each project > select Refresh
- Enable automatic build in: Menu > Project > Build Automatically
- Wait for the build to finish (see bottom right corner in the status bar, this might take a few minutes)
-
Try to to the steps above again and read everything very carefully!
-
Try compiling in the console:
$ cd ~/workspace/aprove $ ant -
Eclipse sometimes messes up its builds (rarely happens). Then, e.g. some perfectly valid imports are not resolved by Eclipse any more. In such a case, it can be helpful to
- refresh the project (click on the project root in the package explorer and press F5)
- clean the project via Menu Project -> Clean...
-
If you see an error like "declared package does not match expected package", then you may need to set the source folder in your project properties:
Project properties -> Java Build Path -> Source -> set to aprove-open-source/src -
Another issue that may come up is Eclipse crashing with an OutOfMemoryException. To prevent this, invoke Eclipse as follows:
eclipse -vmargs -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -
Using Eclipse on 32 bit machines?
Memory options to be passed to eclipse:
-Xmx<number>mwhere is a suitably high number, bigger than 128 (recommended: 256 or more, you had better have enough RAM). This is necessary for Eclipse to be able to compile the continuously growing AProVE project (more than 4000 classes surely lead to one heck of a dependency graph). -
Final Option: Ask a fellow AProVE developer like Jan-Christoph Kassing (Kassing@cs.rwth-aachen.de)