BEAN is implemented as standalone tool for performing context selection.
To demonstrate the usefulness of BEAN to pointer analysis, we have integrated
BEAN with DOOP (version r160113), a state-of-the-art context-sensitive pointer analysis
framework for Java.

This tutorial introduces how to install and use BEAN together with DOOP.


----------------
| Requirements |
----------------

To use BEAN, you need to get JDK 1.8 (or later) and Python 2.x installed on your system.


----------------------------------------------
| Instructions of Integrating BEAN with DOOP |
----------------------------------------------

1. Download DOOP (r160113) from http://doop.program-analysis.org/download.html.

2. Unzip DOOP, then set environment variable DOOP_HOME to the directory where you unpack DOOP by:
   $ export DOOP_HOME=unpack_directory/doop-r160113-bin/

3. Put doop-bean.patch in $DOOP_HOME and then apply it to DOOP by:
   $ cd $DOOP_HOME
   $ patch -p1 < doop-bean.patch

4. Put bean.jar in $DOOP_HOME.

Now, BEAN has been integrated with DOOP.

In addition, to run DOOP, users should follow the instructions in $DOOP_HOME/README
to setup the applications and library (to be analyzed) and configure the corresponding paths.


----------
| Usages |
----------

After integration, there are two BEAN-directed object-sensitive pointer analyses 
now available in DOOP (and the usages of DOOP remain the same):

1. bean-2-object-sensitive+heap
2. bean-selective-2-object-sensitive+heap

These two analyses improves the precision of the two state-of-the-art pointer analyses
(2-object-sensitive+heap and selective-2-object-sensitive+heap) provided by DOOP.

For example, let us analyze luindex benchmark of DaCapo using the contexts selected by BEAN:

$ ./run -jre1.6 bean-2-object-sensitive+heap jars/dacapo/luindex.jar

Then BEAN is run and will automatically select the useful contexts (by avoiding redundant context elements
for precision improvement), which will be used by the later object-sensitive pointer analysis.

Please feel free to contact the authors if you have any concerns.
