BEAN-0.1/0000775000175400017540000000000012760746433011125 5ustar tianttiantBEAN-0.1/LICENSE.txt0000664000175400017540000010543012712531174012742 0ustar tianttiant GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. “This License” refers to version 3 of the GNU General Public License. “Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. “The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. A “covered work” means either the unmodified Program or a work based on the Program. To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. “Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. “Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read < http://www.gnu.org/philosophy/why-not-lgpl.html>. BEAN-0.1/src/0000775000175400017540000000000012760746432011713 5ustar tianttiantBEAN-0.1/src/bean/0000775000175400017540000000000012760746433012621 5ustar tianttiantBEAN-0.1/src/bean/util/0000775000175400017540000000000012760746433013576 5ustar tianttiantBEAN-0.1/src/bean/util/Pair.java0000664000175400017540000000311612760710563015330 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.util; import java.util.Objects; public class Pair { private final T1 first; private final T2 second; public Pair(T1 first, T2 second) { this.first = first; this.second = second; } public T1 getFirst() { return first; } public T2 getSecond() { return second; } @Override public int hashCode() { return Objects.hash(first, second); } @Override public boolean equals(Object o) { if (o instanceof Pair) { Pair anoPair = (Pair) o; return Objects.equals(first, anoPair.first) && Objects.equals(second, anoPair.second); } return false; } @Override public String toString() { return "<" + Objects.toString(first) + ", " + Objects.toString(second) + ">"; } } BEAN-0.1/src/bean/util/ANSIColor.java0000664000175400017540000000253412760710563016171 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.util; public class ANSIColor { public static final String RESET = "\u001B[0m"; public static final String BOLD = "\u001B[1m"; public static final String BLACK = "\u001B[30m"; public static final String RED = "\u001B[31m"; public static final String GREEN = "\u001B[32m"; public static final String YELLOW = "\u001B[33m"; public static final String BLUE = "\u001B[34m"; public static final String PURPLE = "\u001B[35m"; public static final String CYAN = "\u001B[36m"; public static final String WHITE = "\u001B[37m"; } BEAN-0.1/src/bean/util/Triple.java0000664000175400017540000000346212760710563015700 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.util; import java.util.Objects; public class Triple { private final T1 first; private final T2 second; private final T3 third; public Triple(T1 first, T2 second, T3 third) { this.first = first; this.second = second; this.third = third; } public T1 getFirst() { return first; } public T2 getSecond() { return second; } public T3 getThird() { return third; } @Override public int hashCode() { return Objects.hash(first, second, third); } @Override public boolean equals(Object o) { if (o instanceof Triple) { Triple anoTriple = (Triple) o; return Objects.equals(first, anoTriple.first) && Objects.equals(second, anoTriple.second) && Objects.equals(third, anoTriple.third); } return false; } @Override public String toString() { return "<" + Objects.toString(first) + ", " + Objects.toString(second) + ", " + Objects.toString(third) + ">"; } } BEAN-0.1/src/bean/main/0000775000175400017540000000000012760746432013544 5ustar tianttiantBEAN-0.1/src/bean/main/DoopMain.java0000664000175400017540000000706412761144677016130 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.main; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Set; import bean.oag.OAG; import bean.oag.context.Context; import bean.oag.context.ContextSelector; import bean.oag.context.RepresentativeContextSelector; import bean.pta.Heap; import bean.pta.PointsToAnalysis; import bean.pta.doop.DoopPointsToAnalysis; import bean.util.ANSIColor; import bean.util.Pair; public class DoopMain { private static final char SEP = '\t'; private static final char EOL = '\n'; public static void main(String[] args) throws Exception { String db = args[0]; File contextFile = new File(args[1]); File dbDir = new File(db); System.out.println("Reading the points-to set from Doop ..."); PointsToAnalysis pta = new DoopPointsToAnalysis(dbDir); System.out.println("Constructing object allocation graph (OAG) ..."); long start = System.currentTimeMillis(); OAG oag = new OAG(pta); long end = System.currentTimeMillis(); System.out.printf(ANSIColor.BOLD + "OAG construction: " + ANSIColor.GREEN + String.format("%.2fs", (end - start) / 1000F) + ANSIColor.RESET + "\n"); System.out.println("Computing contexts..."); start = System.currentTimeMillis(); // The depth indicates the depth of heap context. // The method context has 1 more level than heap context. // Here depth is 1 which corresponds to 2-object-sensitive analysis // with 1 heap context. ContextSelector cs = new RepresentativeContextSelector(oag, 1); end = System.currentTimeMillis(); System.out.printf(ANSIColor.BOLD + "Context computation: " + ANSIColor.GREEN + String.format("%.2fs", (end - start) / 1000F) + ANSIColor.RESET + "\n"); writeContext(cs, oag, contextFile); } private static void writeContext(ContextSelector cs, OAG oag, File contextFile) throws FileNotFoundException { // BeanHeapAllocation[allocHctx, allocator, heap] = newHctx PrintWriter writer = new PrintWriter(contextFile); oag.allNodes().forEach(node -> { Heap allocator = node.getHeap(); Set ctxs = cs.contextsOf(allocator); for (Context ctx : ctxs) { Heap allocHctx = ctx.get(0); Set> csheaps = cs.allocatedBy(ctx, allocator); if (csheaps != null) { csheaps.forEach(csheap -> { Heap newHctx = csheap.getFirst().get(0); Heap heap = csheap.getSecond(); writer.write(allocHctx.toString()); writer.write(SEP); writer.write(allocator.toString()); writer.write(SEP); writer.write(heap.toString()); writer.write(SEP); writer.write(newHctx.toString()); writer.write(EOL); }); } } }); writer.close(); } } BEAN-0.1/src/bean/oag/0000775000175400017540000000000012760746432013366 5ustar tianttiantBEAN-0.1/src/bean/oag/Node.java0000664000175400017540000000442212760710563015114 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.oag; import java.util.HashSet; import java.util.Set; import bean.pta.Heap; public class Node { /** The heap that this node represents. */ private final Heap heap; private Set preds = new HashSet<>(); private Set succs = new HashSet<>(); private int indegree = 0; private int outdegree = 0; private Set reachableNodes = null; public Node(Heap heap) { this.heap = heap; } public Heap getHeap() { return heap; } @Override public int hashCode() { return heap.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Node)) { return false; } Node anoNode = (Node) obj; return heap.equals(anoNode.heap); } @Override public String toString() { return heap.toString(); } Set getPreds() { return preds; } Set getSuccs() { return succs; } int getInDegree() { return indegree; } int getOutDegree() { return outdegree; } void addSucc(Node succNode) { if (succs.add(succNode)) { incOutDegree(); } if (succNode.getPreds().add(this)) { succNode.incInDegree(); } } Set getReachableNodes() { return reachableNodes; } void setReachableNodes(Set reachableNodes) { this.reachableNodes = reachableNodes; } private void incInDegree() { ++indegree; } private void incOutDegree() { ++outdegree; } } BEAN-0.1/src/bean/oag/context/0000775000175400017540000000000012760746432015052 5ustar tianttiantBEAN-0.1/src/bean/oag/context/Context.java0000664000175400017540000000537212760710563017344 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.oag.context; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.ArrayList; import bean.pta.Heap; /** * In BEAN, a context is a sequence of heaps. * */ public class Context { private final List context; private int hashCode = 0; private Context(List context) { this.context = context; } public boolean contains(Heap heap) { return context.contains(heap); } /** * * @param i * @return the i-th heap of this context */ public Heap get(int i) { return context.get(i); } public int depth() { return context.size(); } public boolean isEmpty() { return context.isEmpty(); } public Iterator iterator() { return context.iterator(); } @Override public int hashCode() { if (hashCode == 0) { hashCode = context.hashCode(); } return hashCode; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Context)) { return false; } Context anoCtx = (Context) o; return context.equals(anoCtx.context); } @Override public String toString() { return "Context: " + context.toString(); } private static final Context EMPTY_CONTEXT = new Context(Collections.emptyList()); /** * Return an empty context. * */ public static Context emptyContext() { return EMPTY_CONTEXT; } /** * Compose a new context by a given context and a heap. * The depth of new context is also required. */ public static Context newContext(Context c, Heap heap, int depth) { List context; if (c.depth() < depth) { context = new ArrayList<>(c.depth() + 1); context.addAll(c.context); } else { context = new ArrayList<>(depth); for (int i = c.depth() - depth + 1; i < c.depth(); ++i) { context.add(c.context.get(i)); } } context.add(heap); return new Context(context); } } BEAN-0.1/src/bean/oag/context/RepresentativeContextSelector.java0000664000175400017540000001026712760710563023765 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.oag.context; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.stream.Collectors; import bean.oag.OAG; import bean.oag.Node; import bean.pta.Heap; import bean.util.Triple; /** * Context selector of BEAN. This selector aims to avoid redundant * context elements while selecting contexts. * */ public class RepresentativeContextSelector extends ContextSelector { public RepresentativeContextSelector(OAG oag) { super(oag); } public RepresentativeContextSelector(OAG oag, int depth) { super(oag, depth); } @Override protected void selectContext(OAG oag) { contextMap = new HashMap<>(); oag.tailNodes().forEach(node -> { mergeContextMap(selectContext(oag, node)); }); oag.allNodes().forEach(node -> { if (!contextMap.containsKey(node.getHeap())) { mergeContextMap(selectContext(oag, node)); } }); } private Map> selectContext(OAG oag, Node dest) { Map> tempContextMap = new HashMap<>(); Queue> worklist = new LinkedList<>(); initialWorkList(worklist, oag, dest); while (!worklist.isEmpty()) { Triple triple = worklist.poll(); Node node = triple.getFirst(); Context ctx = triple.getSecond(); boolean split = triple.getThird(); Heap heap = node.getHeap(); if (!tempContextMap.containsKey(heap)) { tempContextMap.put(heap, new HashSet<>()); } if (tempContextMap.get(heap).add(ctx)) { Set reachSuccs = selectReachNodes(oag.getSuccsOf(node), dest, oag); final boolean isFork = reachSuccs.size() > 1; reachSuccs.forEach(succ -> { final boolean isJoinSucc = oag.getInDegreeOf(succ) > 1; Context newCtx; boolean succSplit = split; if (split && isJoinSucc && !ctx.contains(heap)) { newCtx = Context.newContext(ctx, heap, depth); succSplit = false; } else { newCtx = ctx; } if (isFork) { succSplit = true; } Set ctxs = tempContextMap.get(succ); if (ctxs == null || !ctxs.contains(newCtx)) { addAllocation(ctx, heap, newCtx, succ.getHeap()); worklist.add(new Triple<>(succ, newCtx, succSplit)); } }); } } return tempContextMap; } private void mergeContextMap(Map> anoContextMap) { anoContextMap.forEach((heap, ctxs) -> { if (contextMap.containsKey(heap)) { contextMap.get(heap).addAll(ctxs); } else { contextMap.put(heap, ctxs); } }); } /** * Select the nodes from a node set which can reach the destination node * @param nodes * @param dest * @param oag * @return */ private Set selectReachNodes(Set nodes, Node dest, OAG oag) { return nodes.stream() .filter(node -> oag.reaches(node, dest)) .collect(Collectors.toSet()); } private void initialWorkList(Queue> worklist, OAG oag, Node node) { Set reachRoots = selectReachNodes(oag.rootNodes(), node, oag); boolean split = reachRoots.size() > 1; Context emptyCtx = Context.emptyContext(); reachRoots.forEach(root -> worklist.add(new Triple<>(root, Context.newContext(emptyCtx, root.getHeap(), depth), split))); } } BEAN-0.1/src/bean/oag/context/ContextSelector.java0000664000175400017540000000415012760710563021036 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.oag.context; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import bean.oag.OAG; import bean.pta.Heap; import bean.util.Pair; /** * Compute the contexts of each heap object via OAG. * */ public abstract class ContextSelector { protected int depth; // the depth of context protected Map> contextMap; protected Map, Set>> allocation = new HashMap<>(); protected ContextSelector(OAG oag) { this(oag, Integer.MAX_VALUE); } protected ContextSelector(OAG oag, int depth) { this.depth = depth; selectContext(oag); } public int depth() { return depth; } public Set contextsOf(Heap heap) { return contextMap.get(heap); } public Set> allocatedBy(Context ctx, Heap heap) { return allocation.get(new Pair<>(ctx, heap)); } protected abstract void selectContext(OAG oag); protected void addAllocation(Context ctx, Heap heap, Context newCtx, Heap succ) { Pair csheap = new Pair<>(ctx, heap); Set> heaps = allocation.get(csheap); if (heaps == null) { allocation.put(csheap, new HashSet<>()); } allocation.get(csheap).add(new Pair<>(newCtx, succ)); } } BEAN-0.1/src/bean/oag/context/TraditionalContextSelector.java0000664000175400017540000000455512760710563023242 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.oag.context; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Queue; import java.util.Set; import bean.oag.OAG; import bean.oag.Node; import bean.pta.Heap; import bean.util.Pair; /** * Traditional k-obj analysis. * */ public class TraditionalContextSelector extends ContextSelector { public TraditionalContextSelector(OAG oag) { super(oag); } public TraditionalContextSelector(OAG oag, int depth) { super(oag, depth); } @Override protected void selectContext(OAG oag) { contextMap = new HashMap<>(); Queue> worklist = new LinkedList<>(); Context emptyCtx = Context.emptyContext(); // 1. initial work-list: oag.rootNodes().forEach( root -> worklist.add(new Pair<>(root, Context.newContext(emptyCtx, root.getHeap(), depth)))); // 2. propagate contexts while (!worklist.isEmpty()) { Pair pair = worklist.poll(); Node node = pair.getFirst(); Context ctx = pair.getSecond(); Heap heap = node.getHeap(); if (!contextMap.containsKey(heap)) { contextMap.put(heap, new HashSet<>()); } if (contextMap.get(heap).add(ctx)) { oag.getSuccsOf(node).forEach(succ -> { Context newCtx = Context.newContext(ctx, heap, depth); Set ctxs = contextMap.get(succ); if (ctxs == null || !ctxs.contains(newCtx)) { addAllocation(ctx, heap, newCtx, succ.getHeap()); worklist.add(new Pair<>(succ, newCtx)); } }); } } } } BEAN-0.1/src/bean/oag/OAG.java0000664000175400017540000001463112760710563014640 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.oag; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.Stack; import java.util.stream.Collectors; import bean.pta.CallGraph; import bean.pta.Heap; import bean.pta.Method; import bean.pta.PointsToAnalysis; import bean.pta.PointsToSet; import bean.pta.Variable; import bean.util.Pair; /** * Implementation of Object Allocation Graph (OAG). * */ public class OAG { private Set nodes = new HashSet<>(); private Set rootNodes; private Set tailNodes; /** map a heap to its corresponding node in the OAG */ private Map heap2node = new HashMap<>(); public OAG(PointsToAnalysis pta) { buildOAG(pta); computeRootNodes(); computeTailNodes(); } public Set allNodes() { return nodes; } public Set rootNodes() { return rootNodes; } public Set tailNodes() { return tailNodes; } /** * The nodes are computed on-the-fly and thus inefficient. * @return The nodes whose number of in-degree is larger than 1. */ public Set junctionNodes() { return nodes.stream() .filter(n -> n.getInDegree() > 1) .collect(Collectors.toSet()); } public Set getPredsOf(Node n) { return n.getPreds(); } public Set getSuccsOf(Node n) { return n.getSuccs(); } public int getInDegreeOf(Node n) { return n.getInDegree(); } public int getOutDegreeOf(Node n) { return n.getOutDegree(); } /** * * @param source * @param dest * @return whether there is a path from source to target in the OAG */ public boolean reaches(Node source, Node dest) { Set reachableNodes = source.getReachableNodes(); if (reachableNodes == null) { reachableNodes = computeReachableNodes(source); source.setReachableNodes(reachableNodes); } return reachableNodes.contains(dest); } /** * @param source * @return the nodes in OAG which can be reached from source */ private Set computeReachableNodes(Node source) { Set reachableNodes = new HashSet<>(); Stack stack = new Stack<>(); stack.push(source); while (!stack.isEmpty()) { Node node = stack.pop(); if (reachableNodes.add(node)) { node.getSuccs().forEach(stack::add); } } return reachableNodes; } private void buildOAG(PointsToAnalysis pta) { PointsToSet p2set = pta.getPointsToSet(); CallGraph cg = pta.getCallGraph(); Map> allocatorHeapsOfMethods = computeAllocatorsOfMethods(p2set, cg); p2set.allHeaps().forEach(heap -> { Node tgt = addNode(heap); Method inMethod = heap.inMethod(); // Some special heap objects, e.g., string constants and class constants, // do not be allocated in any method. if (inMethod != null && allocatorHeapsOfMethods.containsKey(inMethod)) { Set allocatorHeaps = allocatorHeapsOfMethods .get(inMethod); allocatorHeaps.forEach(allocatorHeap -> { Node src = addNode(allocatorHeap); addEdge(src, tgt); }); } }); addInitialAllocation(pta); } private void addInitialAllocation(PointsToAnalysis pta) { pta.getInitialAllocation().forEach(pair -> { Heap allocator = pair.getFirst(); Heap heap = pair.getSecond(); addEdge(addNode(allocator), addNode(heap)); }); } private Map> computeAllocatorsOfMethods( PointsToSet p2set, CallGraph cg) { Map> result = new HashMap<>(); Queue> workList = new LinkedList<>(); initWorkList(workList, p2set, cg); while (!workList.isEmpty()) { Pair pair = workList.poll(); Method m = pair.getFirst(); Heap h = pair.getSecond(); if (!result.containsKey(m)) { result.put(m, new HashSet<>()); } result.get(m).add(h); cg.getCalleesOf(m).stream().filter(callee -> callee.isStatic()) .forEach(callee -> { Set cacheHeaps = result.get(callee); if (cacheHeaps == null || !cacheHeaps.contains(h)) { workList.add(new Pair<>(callee, h)); } }); } return result; } /** * Initialize every instance method * * @param workList */ private void initWorkList(Queue> workList, PointsToSet p2set, CallGraph cg) { cg.allMethods() .stream() .filter(m -> m.isInstance()) .forEach(m -> { Variable thisVar = m.getThis(); p2set.getPointsToSetOf(thisVar).forEach( heap -> workList.add(new Pair<>(m, heap))); }); } /** * Add a node which represents the given heap object to the OAG. If the * corresponding node already exists, then return the existing node. * * @param heap * the one represented by the added node in the graph * @return the new added node */ private Node addNode(Heap heap) { Node node = heap2node.get(heap); if (node == null) { node = new Node(heap); heap2node.put(heap, node); nodes.add(node); } return node; } /** * Add a directed object allocation edge to the OAG. * * @param src * source of the edge * @param tgt * target of the edge */ private void addEdge(Node src, Node tgt) { src.addSucc(tgt); } private void computeRootNodes() { rootNodes = nodes.stream() .filter(node -> node.getInDegree() == 0) .collect(Collectors.toSet()); } private void computeTailNodes() { tailNodes = nodes.stream() .filter(node -> node.getOutDegree() == 0) .collect(Collectors.toSet()); } } BEAN-0.1/src/bean/pta/0000775000175400017540000000000012760746433013405 5ustar tianttiantBEAN-0.1/src/bean/pta/PointsToAnalysis.java0000664000175400017540000000205412760710563017527 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta; import java.util.Set; import bean.util.Pair; public interface PointsToAnalysis { public PointsToSet getPointsToSet(); public CallGraph getCallGraph(); public Set> getInitialAllocation(); } BEAN-0.1/src/bean/pta/doop/0000775000175400017540000000000012760746433014346 5ustar tianttiantBEAN-0.1/src/bean/pta/doop/DoopCallGraph.java0000664000175400017540000001013212760710563017660 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import bean.pta.CallGraph; import bean.pta.Method; class DoopCallGraph implements CallGraph { // Query predicates. private static final String REGULARCALL= "Stats:Simple:InsensCallGraphEdge"; private static final String REFCALL = "_(from,to)<-ReflectiveCallGraphEdge(_,from,_,to)."; private static final String NATIVECALL = "_(from,to)<-NativeCallGraphEdge(_,from,_,to)."; private static final String MAINMETHOD = "MainMethodDeclaration"; private static final String REACHABLE = "Reachable"; private static final String IMPLICITREACHABLE = "ImplicitReachable"; private Set methods = new HashSet<>(); private Set implictEntries = new HashSet<>(); private Method mainMethod; private Map> meth2callers = new HashMap<>(); private Map> meth2callees = new HashMap<>(); DoopCallGraph(DataBase db, MethodManager methManager) throws IOException { addReachable(db, methManager); List> cg = db.query(REGULARCALL); cg.addAll(db.query(REFCALL)); cg.addAll(db.query(NATIVECALL)); cg.forEach(list -> { String callsite = list.get(0); String targetSig = list.get(1); Method caller = methManager.getMethodOf(callsite); Method callee = methManager.getMethod(targetSig); methods.add(caller); methods.add(callee); addCallGraphEdge(caller, callee); }); setMainMethod(db, methManager); computeImplicitEntries(db, methManager); } @Override public Set allMethods() { return methods; } @Override public Set implictEntryMethods() { return implictEntries; } @Override public Method mainMethod() { return mainMethod; } @Override public Set getCallersOf(Method m) { Set callers = this.meth2callers.get(m); return callers == null ? Collections.emptySet() : callers; } @Override public Set getCalleesOf(Method m) { Set callees = this.meth2callees.get(m); return callees == null ? Collections.emptySet() : callees; } private void addCallGraphEdge(Method caller, Method callee) { if (!meth2callers.containsKey(callee)) { meth2callers.put(callee, new HashSet<>()); } meth2callers.get(callee).add(caller); if (!meth2callees.containsKey(caller)) { meth2callees.put(caller, new HashSet<>()); } meth2callees.get(caller).add(callee); } private void addReachable(DataBase db, MethodManager methManager) throws IOException { db.query(REACHABLE) .stream() .map(list -> list.get(0)) .map(methManager::getMethod) .forEach(methods::add); } private void setMainMethod(DataBase db, MethodManager methManager) throws IOException { String sig = db.query(MAINMETHOD).get(0).get(0); mainMethod = methManager.getMethod(sig); } private void computeImplicitEntries(DataBase db, MethodManager methManager) throws IOException { implictEntries = db.query(IMPLICITREACHABLE) .stream() .map(list -> list.get(0)) .map(sig -> methManager.getMethod(sig)) .collect(Collectors.toSet()); } } BEAN-0.1/src/bean/pta/doop/DoopMethod.java0000664000175400017540000000446312760710563017255 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.util.regex.Matcher; import java.util.regex.Pattern; import bean.pta.Method; import bean.pta.Variable; /** * In Doop, a method is represented by its full signature: a string. */ class DoopMethod extends Method { private final String method; private final String name; private final Variable thisVar; private final boolean isStatic; DoopMethod(String methodSig, Variable thisVar, boolean isStatic) { this.method = methodSig; this.name = extractMethodName(methodSig); this.thisVar = thisVar; this.isStatic = isStatic; } @Override public int hashCode() { return method.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DoopMethod)) { return false; } DoopMethod anoMeth = (DoopMethod) obj; return method.equals(anoMeth.method); } @Override public String toString() { return method; } @Override public Variable getThis() { return thisVar; } @Override public String getName() { return name; } @Override public boolean isStatic() { return isStatic; } private static final Pattern mtdNamePattern = Pattern.compile(".+\\s.+\\s(.+)\\(.*"); private static String extractMethodName(String methSig) { Matcher matcher = mtdNamePattern.matcher(methSig); if (matcher.matches()) { return matcher.group(1); } else { throw new RuntimeException("extractMethodName error"); } } } BEAN-0.1/src/bean/pta/doop/DoopVariable.java0000664000175400017540000000266212760710563017561 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import bean.pta.Variable; /** * In Doop, a variable is distinguished by its name: a string */ class DoopVariable extends Variable { private final String var; DoopVariable(String varName) { this.var = varName; } @Override public int hashCode() { return var.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DoopVariable)) { return false; } DoopVariable anoVar = (DoopVariable) obj; return var.equals(anoVar.var); } @Override public String toString() { return var; } } BEAN-0.1/src/bean/pta/doop/HeapManager.java0000664000175400017540000001152712760710563017362 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import bean.pta.Heap; import bean.pta.Method; class HeapManager { // Query predicates. private static final String SPECIAL_HEAP = "HeapAllocation:Special"; private static final String MERGE_HEAP = "HeapAllocation:Merge"; private static final String STRING_CONSTANTS = "StringConstant"; private static final String REF_STRING_CONSTANTS = "ReflectionStringConstant"; private static final String HEAP_IN = "_(heap,inmethod)<-" + "AssignHeapAllocation(heap,_,inmethod)."; private static final String REF_HEAP = "_(heap,callsite)<-" + "ReflectiveHeapAllocation[callsite,_]=heap."; private static final String STRING_CONSTANT = "<>"; private static boolean MERGE_NON_REFLECTION_STRINGS = true; private Map heap2sig = new HashMap<>(); private Map heapName2heap = new HashMap<>(); private Map heap2callsite = new HashMap<>(); private Map heap2mergedheap = new HashMap<>(); private Set heapsToBeMerged = new HashSet<>(); private MethodManager methManager; HeapManager(DataBase db, MethodManager methManager) throws IOException { Set specialHeaps = db.query(SPECIAL_HEAP) .stream() .map(list -> list.get(0)) .collect(Collectors.toSet()); db.query(MERGE_HEAP) .forEach(list -> { String heap = list.get(0); String mergedHeap = list.get(1); heap2mergedheap.put(heap, mergedHeap); specialHeaps.add(mergedHeap); if (!heap.equals(mergedHeap)) { heapsToBeMerged.add(heap); } }); if (MERGE_NON_REFLECTION_STRINGS) { mergeReflectionIrrelevantStrings(db, specialHeaps); } List> heapIn = db.query(HEAP_IN); heapIn.forEach(list -> { String heapName = list.get(0); String methSig = list.get(1); // Filter out the containing methods of insensitive heaps and class constants // as their contexts are handled separately. if (!specialHeaps.contains(heapName) && !isClassConstant(heapName)) { heap2sig.put(heapName, methSig); } }); List> refHeap = db.query(REF_HEAP); refHeap.forEach(list -> heap2callsite.put(list.get(0), list.get(1))); this.methManager = methManager; } Heap getHeap(String heapName) { if (heapsToBeMerged.contains(heapName)) { return getHeap(heap2mergedheap.get(heapName)); } Heap heap = heapName2heap.get(heapName); if (heap == null) { if (heap2sig.containsKey(heapName)) { String methSig = heap2sig.get(heapName); Method inMethod = methManager.getMethod(methSig); heap = new DoopHeap(heapName, inMethod); } else if (heap2callsite.containsKey(heapName)) { // In this case, the heap is created by a newInstance() call, // so the allocation site is the call site to newInstance(). String callsite = heap2callsite.get(heapName); Method inMethod = methManager.getMethodOf(callsite); heap = new DoopHeap(heapName, inMethod); } else { heap = new DoopHeap(heapName, null); } heapName2heap.put(heapName, heap); } return heap; } /** * Merge reflection-irrelevant string constants * @param db * @param specialHeaps * @throws IOException */ private void mergeReflectionIrrelevantStrings(DataBase db, Set specialHeaps) throws IOException { Set refstrings = db.query(REF_STRING_CONSTANTS) .stream() .map(list -> list.get(0)) .collect(Collectors.toSet()); db.query(STRING_CONSTANTS) .stream() .map(list -> list.get(0)) .filter(str -> !refstrings.contains(str)) .forEach(str -> { heap2mergedheap.put(str, STRING_CONSTANT); specialHeaps.add(str); heapsToBeMerged.add(str); }); } private boolean isClassConstant(String heapName) { return heapName.startsWith(". */ package bean.pta.doop; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import bean.pta.Heap; import bean.pta.PointsToSet; import bean.pta.Variable; class DoopPointsToSet implements PointsToSet { // Query predicates. private static final String VARPOINTSTO = "Stats:Simple:InsensVarPointsTo"; private Set vars = new HashSet<>(); private Set heaps = new HashSet<>(); private Map> p2set = new HashMap<>(); DoopPointsToSet(DataBase db, VariableManager varManager, HeapManager heapManager) throws IOException { List> varpt = db.query(VARPOINTSTO); varpt.forEach(list -> { String heapName = list.get(0); String varName = list.get(1); Variable var = varManager.getVariable(varName); Heap heap = heapManager.getHeap(heapName); vars.add(var); heaps.add(heap); addPointsTo(var, heap); }); } @Override public Set allVariables() { return vars; } @Override public Set allHeaps() { return heaps; } @Override public Set getPointsToSetOf(Variable var) { Set heaps = p2set.get(var); return heaps == null ? Collections.emptySet() : heaps; } private void addPointsTo(Variable var, Heap heap) { if (!p2set.containsKey(var)) { p2set.put(var, new HashSet<>()); } p2set.get(var).add(heap); } } BEAN-0.1/src/bean/pta/doop/MethodManager.java0000664000175400017540000000656712760710563017735 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import bean.pta.Method; class MethodManager { // Query predicates. private static final String THISVAR = "ThisVar"; private static final String CALLSITEIN = "_(callsite,inmethod)<-" + "SpecialMethodInvocation:In(callsite,inmethod);" + "VirtualMethodInvocation:In(callsite,inmethod);" + "StaticMethodInvocation:In(callsite,inmethod)."; private static final String OBJFINAL = "ObjectSupportsFinalize"; private static final String THREADSTART0 = ""; private Map sig2this = new HashMap<>(); private Map sig2meth = new HashMap<>(); private Map callsite2sig = new HashMap<>(); private Map callsite2meth = new HashMap<>(); private Map objfinal2sig = new HashMap<>(); private VariableManager varManager; MethodManager(DataBase db, VariableManager varManager) throws IOException { List> thisVar = db.query(THISVAR); thisVar.forEach(list -> sig2this.put(list.get(0), list.get(1))); List> callsiteIn = db.query(CALLSITEIN); callsiteIn.forEach(list -> callsite2sig.put(list.get(0), list.get(1))); List> objfinal = db.query(OBJFINAL); objfinal.forEach(list -> objfinal2sig.put(list.get(0), list.get(1))); this.varManager = varManager; callsite2meth.put(THREADSTART0, getMethod(THREADSTART0)); } Method getMethod(String sig) { Method method = sig2meth.get(sig); if (method == null) { String varName = sig2this.get(sig); if (varName == null) { // sig represents a static method method = new DoopMethod(sig, null, true); } else { // sig represents an instance method method = new DoopMethod(sig, varManager.getVariable(varName), false); } sig2meth.put(sig, method); } return method; } Method getMethodOf(String callsite) { if (!callsite2meth.containsKey(callsite)) { String sig = callsite2sig.get(callsite); if (sig == null) { // sig == null means that the given callsite is not a real callsite, // and it should be an allocation site which represents to an object // that supports finalization. Doop does this for modeling implicit // calls to java.lang.ref.Finalizer.register(). // Refer to /logic/library/finalization.logic in Doop for details. sig = objfinal2sig.get(callsite); } callsite2meth.put(callsite, getMethod(sig)); } return callsite2meth.get(callsite); } } BEAN-0.1/src/bean/pta/doop/DoopHeap.java0000664000175400017540000000306412760710563016706 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import bean.pta.Heap; import bean.pta.Method; /** * In Doop, a heap is represented by a String. */ class DoopHeap extends Heap { private final String heap; private final Method inMethod; DoopHeap(String heap, Method inMethod) { this.heap = heap; this.inMethod = inMethod; } @Override public int hashCode() { return heap.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DoopHeap)) { return false; } DoopHeap anoHeap = (DoopHeap) obj; return heap.equals(anoHeap.heap); } @Override public String toString() { return heap; } @Override public Method inMethod() { return inMethod; } } BEAN-0.1/src/bean/pta/doop/DoopPointsToAnalysis.java0000664000175400017540000001244112760710563021313 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.Stack; import java.util.stream.Collectors; import bean.pta.CallGraph; import bean.pta.Heap; import bean.pta.Method; import bean.pta.PointsToAnalysis; import bean.pta.PointsToSet; import bean.util.Pair; public class DoopPointsToAnalysis implements PointsToAnalysis { private PointsToSet p2set; private CallGraph cg; private Set specialHeaps; private Set> initialAlloc; public DoopPointsToAnalysis(File dbDir) throws IOException { DataBase db = new DataBase(dbDir); VariableManager varManager = new VariableManager(); MethodManager methManager = new MethodManager(db, varManager); HeapManager heapManager = new HeapManager(db, methManager); p2set = new DoopPointsToSet(db, varManager, heapManager); cg = new DoopCallGraph(db, methManager); initialSpecialHeaps(heapManager); computeInitialAllocation(heapManager); } @Override public PointsToSet getPointsToSet() { return p2set; } @Override public CallGraph getCallGraph() { return cg; } @Override public Set> getInitialAllocation() { return initialAlloc; } private void initialSpecialHeaps(HeapManager heapManager) { specialHeaps = Arrays.asList( "<>", "<>", "<>", "<>", "<>", "<>", "<>" ) .stream() .map(heapManager::getHeap) .collect(Collectors.toSet()); } private void computeInitialAllocation(HeapManager heapManager) { initialAlloc = new HashSet<>(); Heap immutableHeap = heapManager.getHeap("<>"); Set immutableHeaps = computeImmutableHeaps(); immutableHeaps .forEach(heap -> initialAlloc.add(new Pair<>(immutableHeap, heap))); Heap clinitHeap = heapManager.getHeap("<>"); computeClassInitializationHeaps() .stream() .filter(heap -> !immutableHeaps.contains(heap)) .forEach(heap -> initialAlloc.add(new Pair<>(clinitHeap, heap))); Heap initHeap = heapManager.getHeap("<>"); computeInitContextHeaps() .stream() .filter(heap -> !immutableHeaps.contains(heap)) .forEach(heap -> initialAlloc.add(new Pair<>(initHeap, heap))); Heap jvmstartup = heapManager.getHeap("<>"); computeImplicitReachableHeaps() .stream() .filter(heap -> !immutableHeaps.contains(heap)) .forEach(heap -> initialAlloc.add(new Pair<>(jvmstartup, heap))); initialAlloc.add(new Pair<>(jvmstartup, heapManager.getHeap("<>"))); initialAlloc.add(new Pair<>(jvmstartup, heapManager.getHeap("<>"))); initialAlloc.add(new Pair<>(jvmstartup, heapManager.getHeap("<>"))); } private Set computeImmutableHeaps() { return p2set.allHeaps() .stream() .filter(heap -> !specialHeaps.contains(heap)) .filter(heap -> heap.inMethod() == null) .collect(Collectors.toSet()); } private Set computeClassInitializationHeaps() { Set clinits = cg.allMethods() .stream() .filter(m -> m.getName().equals("")) .collect(Collectors.toSet()); return computeReachableHeaps(clinits); } private Set computeInitContextHeaps() { return computeReachableHeaps(Collections.singleton(cg.mainMethod())); } private Set computeImplicitReachableHeaps() { return computeReachableHeaps(cg.implictEntryMethods()); } private Set computeReachableHeaps(Set methods) { Set reachMethods = methods .stream() .map(this::computeReachableStaticMethods) .reduce(new HashSet<>(), (s1, s2) -> { s1.addAll(s2); return s1; }); return p2set.allHeaps() .stream() .filter(h -> reachMethods.contains(h.inMethod())) .collect(Collectors.toSet()); } private Set computeReachableStaticMethods(Method method) { Set reachableMethods = new HashSet<>(); Stack stack = new Stack<>(); stack.push(method); while (!stack.isEmpty()) { Method m = stack.pop(); if (reachableMethods.add(m)) { cg.getCalleesOf(m).stream() .filter(meth -> meth.isStatic()) .forEach(stack::add); } } return reachableMethods; } } BEAN-0.1/src/bean/pta/doop/VariableManager.java0000664000175400017540000000230612760710563020225 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.util.HashMap; import java.util.Map; import bean.pta.Variable; class VariableManager { private Map varName2var = new HashMap<>(); Variable getVariable(String varName) { Variable var = varName2var.get(varName); if (var == null) { var = new DoopVariable(varName); varName2var.put(varName, var); } return var; } } BEAN-0.1/src/bean/pta/doop/DataBase.java0000664000175400017540000000416012760710563016651 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta.doop; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.LinkedList; import java.util.List; /** * A class that represents the database of Doop. * */ class DataBase { private static final String CMD = "bloxbatch -db %s -query %s"; private static final String SEP = ", "; /** The directory of Doop database */ private final File dbDir; DataBase(File dbDir) { this.dbDir = dbDir; } /** Return the results of the give query. */ List> query(String query) throws IOException { String cmd = String.format(CMD, dbDir.getAbsolutePath(), query); Runtime rt = Runtime.getRuntime(); Process proc = rt.exec(cmd); BufferedReader reader = new BufferedReader( new InputStreamReader(proc.getInputStream())); List> result = new LinkedList<>(); String line = null; while ((line = reader.readLine()) != null) { result.add(line2list(line)); } try { proc.waitFor(); } catch (InterruptedException e) { throw new RuntimeException("Exception during query: " + query); } reader.close(); return result; } private List line2list(String line) { return Arrays.asList(line.trim().split(SEP)); } } BEAN-0.1/src/bean/pta/Heap.java0000664000175400017540000000232512760710563015122 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta; /** * The abstraction of heap object in bean. The concrete type of this class must implements * hashCode() and equals() methods. */ public abstract class Heap { @Override public abstract int hashCode(); @Override public abstract boolean equals(Object obj); /** Return the method which contains the allocation site of this heap */ public abstract Method inMethod(); } BEAN-0.1/src/bean/pta/Variable.java0000664000175400017540000000214212760710563015767 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta; /** * The abstraction of variable in bean. The concrete type of this class must implements * hashCode() and equals() methods. */ public abstract class Variable { @Override public abstract int hashCode(); @Override public abstract boolean equals(Object obj); } BEAN-0.1/src/bean/pta/CallGraph.java0000664000175400017540000000221412760710563016077 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta; import java.util.Set; /** * The abstraction of call graph in bean. */ public interface CallGraph { public Set allMethods(); public Set implictEntryMethods(); public Method mainMethod(); public Set getCallersOf(Method m); public Set getCalleesOf(Method m); } BEAN-0.1/src/bean/pta/Method.java0000664000175400017540000000254612760710563015472 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta; /** * The abstraction of method in bean. The concrete type of this class must implements * hashCode() and equals() methods. */ public abstract class Method { @Override public abstract int hashCode(); @Override public abstract boolean equals(Object obj); /** Return `this` variable of this method, only useful for instance method. */ public abstract Variable getThis(); public abstract String getName(); public boolean isInstance() { return !isStatic(); } public abstract boolean isStatic(); } BEAN-0.1/src/bean/pta/PointsToSet.java0000664000175400017540000000207512760710563016502 0ustar tianttiant/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting * * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package bean.pta; import java.util.Set; /** * The abstraction of points-to set in bean. */ public interface PointsToSet { public Set allVariables(); public Set allHeaps(); public Set getPointsToSetOf(Variable var); } BEAN-0.1/doop-bean.patch0000664000175400017540000011177712760742052014021 0ustar tianttiantBinary files doop-r160113-bin/bean.jar and doop-bean/bean.jar differ diff -urN doop-r160113-bin/logic/bean-2-object-sensitive+heap/analysis.logic doop-bean/logic/bean-2-object-sensitive+heap/analysis.logic --- doop-r160113-bin/logic/bean-2-object-sensitive+heap/analysis.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-2-object-sensitive+heap/analysis.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,146 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * Context-sensitive pointer analysis with context of 1 object and a + * context-sensitive heap abstraction. The heap contexts are computed + * by BEAN. + * + */ + +#include "macros.logic" +#include "../context-sensitive.logic" +#include "../library.logic" + +// In this analysis, the real context is a pair of HeapAllocationRefs +// and the real heap context a single HeapAllocationRef. Keeping mapping +// functions is the way to handle analyses where HContext = Context +// (since the language considers them different types). +ContextFromRealContext[?heap1, ?heap2] = ?ctx -> + Context(?ctx), HeapAllocationRef(?heap1), HeapAllocationRef(?heap2). +lang:skolem(`ContextFromRealContext). +RealContext1FromContext[?ctx] = ?heap -> + Context(?ctx), HeapAllocationRef(?heap). +RealContext2FromContext[?ctx] = ?heap -> + Context(?ctx), HeapAllocationRef(?heap). + +RealContext1FromContext[?ctx] = ?heap1, +RealContext2FromContext[?ctx] = ?heap2 <- + ContextFromRealContext[?heap1, ?heap2] = ?ctx. + +HeapInContext(?heap, ?ctx) -> + HeapAllocationRef(?heap), Context(?ctx). + +HeapInContext(?heap, ?ctx) <- + AssignNormalHeapAllocationSkolemOpt(?heap, ?ctx, _). + +#ifndef DISABLE_REFLECTION +HeapInContext(?heap, ?ctx) <- + ReflectiveAssignHeapAllocation(?instruction, ?type, ?ctx, _), + ReflectiveHeapAllocation[?instruction, ?type] = ?heap. +#endif + + +BeanHContext[?ctx, ?heap] = ?heapctx -> + Context(?ctx), HeapAllocationRef(?heap), HeapAllocationRef(?heapctx). + +BeanHContext[?ctx, ?heap] = ?heapctx <- + HeapInContext(?heap, ?ctx), + ContextFromRealContext[?heap1, ?heap2] = ?ctx, + BeanHeapContext[?heap1, ?heap2, ?heap] = ?heapctx. + +// Due to some special context handling of Doop, some contexts would be +// missed by BEAN. In this case, we make Doop regress to traditional +// object-sensitivity. +BeanHContext[?ctx, ?heap] = ?heap2 <- + HeapInContext(?heap, ?ctx), + ContextFromRealContext[?heap1, ?heap2] = ?ctx, + !BeanHeapContext[?heap1, ?heap2, ?heap] = _. + + +HContextFromRealHContext[?heap] = ?hctx -> + HContext(?hctx), HeapAllocationRef(?heap). +lang:skolem(`HContextFromRealHContext). +RealHContextFromHContext[?hctx] = ?heap -> + HContext(?hctx), HeapAllocationRef(?heap). + +RealHContextFromHContext[?hctx] = ?heap <- + HContextFromRealHContext[?heap] = ?hctx. + +// Creating special immutable heap allocation constant +ImmutableHeapValue[] = ?immHeap <- + HeapAllocationValue(?immHeap, "<>"). + + +// Create initial objects with their heapcontexts. +HContextFromRealHContext[?heap] = ?hctx, +HContext(?hctx), +SystemThreadGroup(?hctx, ?alloc) <- + MySystemThreadGroup(?heap, ?alloc). + +HContextFromRealHContext[?heap] = ?hctx, +HContext(?hctx), +MainThreadGroup(?hctx, ?alloc) <- + MyMainThreadGroup(?heap, ?alloc). + +HContextFromRealHContext[?heap] = ?hctx, +HContext(?hctx), +MainThread(?hctx, ?alloc) <- + MyMainThread(?heap, ?alloc). + +/** + * Merge optimization hack + */ + +// For this analysis, we only need two of the parameters that may +// influence the new context object. +MyMergeBasis(?hctx, ?heap) <- + MergeBasis(_, _, ?hctx, ?heap). + +// We create new context objects sparingly, because of the high cost. +// We also cache them, so they can be looked up without a join. +Context(?calleeCtx), +ContextFromRealContext[RealHContextFromHContext[?hctx],?heap] = ?calleeCtx, +OptimizeMerge[?hctx, ?heap] = ?calleeCtx <- + MyMergeBasis(?hctx, ?heap). + + +/** + * Reachable + */ +ReachableContext(?ctx, ?method), +ContextFromRealContext[?initheap,?initheap] = ?ctx, +Context(?ctx) + <- + MainMethodDeclaration(?method), + HeapAllocationValue(?initheap, "<>"). + +ReachableContext(?ctx, ?method), +ContextFromRealContext[?startupheap,?startupheap] = ?ctx, +Context(?ctx) + <- + ImplicitReachable(?method), + HeapAllocationValue(?startupheap, "<>"). + +ReachableContext(?ctx, ?clinit), +ContextFromRealContext[?clinitheap,?clinitheap] = ?ctx, +Context(?ctx) + <- + InitializedClass(?class), + ClassInitializer[?class] = ?clinit, + HeapAllocationValue(?clinitheap, "<>"). diff -urN doop-r160113-bin/logic/bean-2-object-sensitive+heap/declarations.logic doop-bean/logic/bean-2-object-sensitive+heap/declarations.logic --- doop-r160113-bin/logic/bean-2-object-sensitive+heap/declarations.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-2-object-sensitive+heap/declarations.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,31 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "macros.logic" +#include "../context-sensitive-declarations.logic" + +// For this analysis, contexts are heap objects, so this is +// what the initial system objects should have. +MySystemThreadGroup(?heap, ?alloc) -> + HeapAllocationRef(?heap), HeapAllocationRef(?alloc). + +MyMainThreadGroup(?heap, ?alloc) -> + HeapAllocationRef(?heap), HeapAllocationRef(?alloc). + +MyMainThread(?heap, ?alloc) -> + HeapAllocationRef(?heap), HeapAllocationRef(?alloc). diff -urN doop-r160113-bin/logic/bean-2-object-sensitive+heap/delta.logic doop-bean/logic/bean-2-object-sensitive+heap/delta.logic --- doop-r160113-bin/logic/bean-2-object-sensitive+heap/delta.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-2-object-sensitive+heap/delta.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,47 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "macros.logic" +#include "../library/common-delta.logic" + +/** + * Special calling contexts + * + * Note: the type is necessary (java.lang.String), but never used. It + * could be anything. It also needs to be an existing type, otherwise + * the sanity checks will barf. + */ +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). + +/** + * Special objects + */ ++MySystemThreadGroup(?heap, ?alloc), + PlusHeapAllocationRef(?heap, "<>", "java.lang.String"), + PlusHeapAllocationRef(?alloc, "<>", "java.lang.ThreadGroup"). + ++MyMainThreadGroup(?heap, ?alloc), + PlusHeapAllocationRef(?heap, "<>", "java.lang.String"), + PlusHeapAllocationRef(?alloc, "<>", "java.lang.ThreadGroup"). + ++MyMainThread(?heap, ?alloc), + PlusHeapAllocationRef(?heap, "<>", "java.lang.String"), + PlusHeapAllocationRef(?alloc, "<>", "java.lang.Thread"). diff -urN doop-r160113-bin/logic/bean-2-object-sensitive+heap/macros.logic doop-bean/logic/bean-2-object-sensitive+heap/macros.logic --- doop-r160113-bin/logic/bean-2-object-sensitive+heap/macros.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-2-object-sensitive+heap/macros.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,75 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "../library/fact-macros.logic" + +// For this analysis, every heap context recorded on allocation +// corresponds to the most significant element of the calling +// context of the allocator method. +#define RecordMacro(ctx, heap, hctx) \ + HContext(hctx), \ + HContextFromRealHContext[BeanHContext[ctx, heap]] = hctx + +#define RecordImmutableMacro(ctx, heap, immCtx) \ + HContext(immCtx), \ + HContextFromRealHContext[ImmutableHeapValue[]] = immCtx + + +// For this analysis the context of a method call corresponds to the +// identity of the receiver object and the receiver object of the caller. +// Again, this may trigger creation of a new object. +#define MergeMacro(callerCtx, invocation, hctx, heap, calleeCtx) \ + Context(calleeCtx), \ + ContextFromRealContext[RealHContextFromHContext[hctx], heap] = calleeCtx + +#define MergeBasisMacro(callerCtx, invocation, hctx, heap) \ + MergeBasis(callerCtx, invocation, hctx, heap) + +#define OptimizeMergeMacro(callerCtx, invocation, hctx, heap, calleeCtx) \ + OptimizeMerge[hctx, heap] = calleeCtx + +// For this analysis, static calls just keep the same context as the +// caller. *Not* creating a new one, but pretending to, nonetheless, +// so the engine doesn't barf. +#define MergeStaticMacro(callerCtx, invocation, calleeCtx) \ + Context(calleeCtx), \ + ContextFromRealContext[RealContext1FromContext[callerCtx], \ + RealContext2FromContext[callerCtx]] = calleeCtx + +// MergeThreadStart, MergeStartup, and MergeFinalizerRegisterContext +// have the same logic as plain Merge for this analysis. +#define MergeThreadStartMacro(hctx, heap, callerCtx, newCtx) \ + Context(newCtx), \ + ContextFromRealContext[RealHContextFromHContext[hctx], heap] = newCtx + +#define MergeStartupMacro(hctx, heap, calleeCtx) \ + Context(calleeCtx), \ + ContextFromRealContext[RealHContextFromHContext[hctx], heap] = calleeCtx + +// This is exactly equivalent to the regular merge logic, but written +// differently. At finalization, we create a new hctx, based on the +// callerCtx, and then use this new hctx as we would in regular Merge. +// The macro below does this, without referring to the new hctx (i.e., +// using knowledge of how it is created). This is necessary because since +// the new hctx is created in the same rule, it will not yet have values +// for its inverse functions (RealHContextFromHContext), so the rule will never +// fire if done naively. The signature of the macro (which does not accept a +// hctx) is a hint for avoiding this problem. +#define MergeFinalizerRegisterContextMacro(callerCtx, inmethod, heap, newCtx) \ + Context(newCtx), \ + ContextFromRealContext[RealContext2FromContext[callerCtx], heap] = newCtx diff -urN doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/analysis.logic doop-bean/logic/bean-selective-2-object-sensitive+heap/analysis.logic --- doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/analysis.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-selective-2-object-sensitive+heap/analysis.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,190 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * Context-sensitive pointer analysis with context of 2 objects + * (AND for static calls 1 call-site). + * The object-sensitive contexts are computed by BEAN. + */ + +#include "macros.logic" +#include "../context-sensitive.logic" +#include "../library.logic" + +// In this analysis, the real context is a pair of HeapAllocationRef AND +// a MethodInvocationRef (for static calls) sometimes. +// The real heap context is a single HeapAllocationRef. Keeping mapping +// functions is the way to handle analyses where HContext = Context +// (since the language considers them different types). +// NOTE: Changed from HeapAllocationRef to CallGraphEdgeSourceRef +// in order to use the invocation site for static calls. +ContextFromRealContext[?heap1, ?heap2] = ?ctx -> + Context(?ctx), CallGraphEdgeSourceRef(?heap1), CallGraphEdgeSourceRef(?heap2). + +lang:skolem(`ContextFromRealContext). + +// NOTE: Use the following when using both the normal (caller's) context +// and the invocation site for static calls. +SpecialContextFromRealContext[?heap1, ?invocation, ?heap2] = ?ctx -> + CallGraphEdgeSourceRef(?heap1), CallGraphEdgeSourceRef(?heap2), + CallGraphEdgeSourceRef(?invocation), Context(?ctx). + +lang:skolem(`SpecialContextFromRealContext). + +RealContext1FromContext[?ctx] = ?heap -> + Context(?ctx), CallGraphEdgeSourceRef(?heap). + +RealContext2FromContext[?ctx] = ?heap -> + Context(?ctx), CallGraphEdgeSourceRef(?heap). + +RealContext1FromContext[?ctx] = ?heap1, +RealContext2FromContext[?ctx] = ?heap2 <- + ContextFromRealContext[?heap1, ?heap2] = ?ctx. + +// NOTE: Use the following when using both the normal (caller's) context +// and the invocation site for static calls. +RealContext1FromContext[?ctx] = ?invocation, +RealContext2FromContext[?ctx] = ?heap2 <- + SpecialContextFromRealContext[_, ?invocation, ?heap2] = ?ctx. + + +HeapInContext(?heap, ?ctx) -> + HeapAllocationRef(?heap), Context(?ctx). + +HeapInContext(?heap, ?ctx) <- + AssignNormalHeapAllocationSkolemOpt(?heap, ?ctx, _). + +#ifndef DISABLE_REFLECTION +HeapInContext(?heap, ?ctx) <- + ReflectiveAssignHeapAllocation(?instruction, ?type, ?ctx, _), + ReflectiveHeapAllocation[?instruction, ?type] = ?heap. +#endif + +// ?heap1 is the real heap context of ?heap2. +TwoHeapsFromContext(?ctx, ?heap1, ?heap2) -> + Context(?ctx), + HeapAllocationRef(?heap1), + HeapAllocationRef(?heap2). + +TwoHeapsFromContext(?ctx, ?heap1, ?heap2) <- + ( + ContextFromRealContext[?heap1, ?heap2] = ?ctx; + SpecialContextFromRealContext[?heap1, _, ?heap2] = ?ctx + ), + HeapAllocationRef(?heap1), + HeapAllocationRef(?heap2). + +BeanHContext[?ctx, ?heap] = ?heapctx -> + Context(?ctx), HeapAllocationRef(?heap), CallGraphEdgeSourceRef(?heapctx). + +BeanHContext[?ctx, ?heap] = ?heapctx <- + HeapInContext(?heap, ?ctx), + TwoHeapsFromContext(?ctx, ?heap1, ?heap2), + BeanHeapContext[?heap1, ?heap2, ?heap] = ?heapctx. + +// Due to some special context handling of Doop, some contexts would be +// missed by BEAN. In this case, we make Doop regress to traditional +// object-sensitivity. +BeanHContext[?ctx, ?heap] = ?heap2 <- + HeapInContext(?heap, ?ctx), + TwoHeapsFromContext(?ctx, ?heap1, ?heap2), + !BeanHeapContext[?heap1, ?heap2, ?heap] = _. + +// In selective 2 object-sensitivity, some contexts consist of 1 heap and +// 2 call sites. In this case, we make Doop regress to traditional +// object-sensitivity. +BeanHContext[?ctx, ?heap] = ?heap2 <- + HeapInContext(?heap, ?ctx), + SpecialContextFromRealContext[?realCtx1, _, ?heap2] = ?ctx, + !HeapAllocationRef(?realCtx1). + + + +HContextFromRealHContext[?heap] = ?hctx -> + HContext(?hctx), CallGraphEdgeSourceRef(?heap). + +lang:skolem(`HContextFromRealHContext). + +RealHContextFromHContext[?hctx] = ?heap -> + HContext(?hctx), CallGraphEdgeSourceRef(?heap). + +RealHContextFromHContext[?hctx] = ?heap <- + HContextFromRealHContext[?heap] = ?hctx. + +// Creating special immutable heap allocation constant +ImmutableHeapValue[] = ?immHeap <- + HeapAllocationValue(?immHeap, "<>"). + + +// Create initial objects with their heapcontexts. +HContextFromRealHContext[?heap] = ?hctx, +HContext(?hctx), +SystemThreadGroup(?hctx, ?alloc) <- + MySystemThreadGroup(?heap, ?alloc). + +HContextFromRealHContext[?heap] = ?hctx, +HContext(?hctx), +MainThreadGroup(?hctx, ?alloc) <- + MyMainThreadGroup(?heap, ?alloc). + +HContextFromRealHContext[?heap] = ?hctx, +HContext(?hctx), +MainThread(?hctx, ?alloc) <- + MyMainThread(?heap, ?alloc). + +/** + * Merge optimization hack + */ + +// For this analysis, we only need two of the parameters that may +// influence the new context object. +MyMergeBasis(?hctx, ?heap) <- + MergeBasis(_, _, ?hctx, ?heap). + +// We create new context objects sparingly, because of the high cost. +// We also cache them, so they can be looked up without a join. +Context(?calleeCtx), +ContextFromRealContext[RealHContextFromHContext[?hctx],?heap] = ?calleeCtx, +OptimizeMerge[?hctx, ?heap] = ?calleeCtx <- + MyMergeBasis(?hctx, ?heap). + + +/** + * Reachable + */ +ReachableContext(?ctx, ?method), +ContextFromRealContext[?initheap,?initheap] = ?ctx, +Context(?ctx) + <- + MainMethodDeclaration(?method), + HeapAllocationValue(?initheap, "<>"). + +ReachableContext(?ctx, ?method), +ContextFromRealContext[?startupheap,?startupheap] = ?ctx, +Context(?ctx) + <- + ImplicitReachable(?method), + HeapAllocationValue(?startupheap, "<>"). + +ReachableContext(?ctx, ?clinit), +ContextFromRealContext[?clinitheap,?clinitheap] = ?ctx, +Context(?ctx) + <- + InitializedClass(?class), + ClassInitializer[?class] = ?clinit, + HeapAllocationValue(?clinitheap, "<>"). diff -urN doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/declarations.logic doop-bean/logic/bean-selective-2-object-sensitive+heap/declarations.logic --- doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/declarations.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-selective-2-object-sensitive+heap/declarations.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,31 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "macros.logic" +#include "../context-sensitive-declarations.logic" + +// For this analysis, contexts are heap objects, so this is +// what the initial system objects should have. +MySystemThreadGroup(?heap, ?alloc) -> + HeapAllocationRef(?heap), HeapAllocationRef(?alloc). + +MyMainThreadGroup(?heap, ?alloc) -> + HeapAllocationRef(?heap), HeapAllocationRef(?alloc). + +MyMainThread(?heap, ?alloc) -> + HeapAllocationRef(?heap), HeapAllocationRef(?alloc). diff -urN doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/delta.logic doop-bean/logic/bean-selective-2-object-sensitive+heap/delta.logic --- doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/delta.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-selective-2-object-sensitive+heap/delta.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,47 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "macros.logic" +#include "../library/common-delta.logic" + +/** + * Special calling contexts + * + * Note: the type is necessary (java.lang.String), but never used. It + * could be anything. It also needs to be an existing type, otherwise + * the sanity checks will barf. + */ +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). +PlusHeapAllocationRef(?heap, "<>", "java.lang.String"). + +/** + * Special objects + */ ++MySystemThreadGroup(?heap, ?alloc), + PlusHeapAllocationRef(?heap, "<>", "java.lang.String"), + PlusHeapAllocationRef(?alloc, "<>", "java.lang.ThreadGroup"). + ++MyMainThreadGroup(?heap, ?alloc), + PlusHeapAllocationRef(?heap, "<>", "java.lang.String"), + PlusHeapAllocationRef(?alloc, "<>", "java.lang.ThreadGroup"). + ++MyMainThread(?heap, ?alloc), + PlusHeapAllocationRef(?heap, "<>", "java.lang.String"), + PlusHeapAllocationRef(?alloc, "<>", "java.lang.Thread"). diff -urN doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/macros.logic doop-bean/logic/bean-selective-2-object-sensitive+heap/macros.logic --- doop-r160113-bin/logic/bean-selective-2-object-sensitive+heap/macros.logic 1970-01-01 10:00:00.000000000 +1000 +++ doop-bean/logic/bean-selective-2-object-sensitive+heap/macros.logic 2016-08-29 11:38:28.000000000 +1000 @@ -0,0 +1,73 @@ +/* Bean - Making k-Object-Sensitive Pointer Analysis More Precise with Still k-Limiting + * + * Copyright (C) 2016 Tian Tan, Yue Li, Jingling Xue + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "../library/fact-macros.logic" + +// For this analysis, every heap context recorded on allocation +// corresponds to the most significant element of the calling +// context of the allocator method. +#define RecordMacro(ctx, heap, hctx) \ + HContext(hctx), \ + HContextFromRealHContext[BeanHContext[ctx, heap]] = hctx + +#define RecordImmutableMacro(ctx, heap, immCtx) \ + HContext(immCtx), \ + HContextFromRealHContext[ImmutableHeapValue[]] = immCtx + + +// For this analysis the context of a method call corresponds to the +// identity of the receiver object and the receiver object of the caller. +// Again, this may trigger creation of a new object. +#define MergeMacro(callerCtx, invocation, hctx, heap, calleeCtx) \ + Context(calleeCtx), \ + ContextFromRealContext[RealHContextFromHContext[hctx], heap] = calleeCtx + +#define MergeBasisMacro(callerCtx, invocation, hctx, heap) \ + MergeBasis(callerCtx, invocation, hctx, heap) + +#define OptimizeMergeMacro(callerCtx, invocation, hctx, heap, calleeCtx) \ + OptimizeMerge[hctx, heap] = calleeCtx + +// For this analysis, static calls use additionally the invocation site as a context. +#define MergeStaticMacro(callerCtx, invocation, calleeCtx) \ + Context(calleeCtx), \ + SpecialContextFromRealContext[RealContext1FromContext[callerCtx], invocation, \ + RealContext2FromContext[callerCtx]] = calleeCtx + +// MergeThreadStart, MergeStartup, and MergeFinalizerRegisterContext +// have the same logic as plain Merge for this analysis. +#define MergeThreadStartMacro(hctx, heap, callerCtx, newCtx) \ + Context(newCtx), \ + ContextFromRealContext[RealHContextFromHContext[hctx], heap] = newCtx + +#define MergeStartupMacro(hctx, heap, calleeCtx) \ + Context(calleeCtx), \ + ContextFromRealContext[RealHContextFromHContext[hctx], heap] = calleeCtx + +// This is exactly equivalent to the regular merge logic, but written +// differently. At finalization, we create a new hctx, based on the +// callerCtx, and then use this new hctx as we would in regular Merge. +// The macro below does this, without referring to the new hctx (i.e., +// using knowledge of how it is created). This is necessary because since +// the new hctx is created in the same rule, it will not yet have values +// for its inverse functions (RealHContextFromHContext), so the rule will never +// fire if done naively. The signature of the macro (which does not accept a +// hctx) is a hint for avoiding this problem. +#define MergeFinalizerRegisterContextMacro(callerCtx, inmethod, heap, newCtx) \ + Context(newCtx), \ + ContextFromRealContext[RealContext2FromContext[callerCtx], heap] = newCtx diff -urN doop-r160113-bin/logic/library/common-delta.logic doop-bean/logic/library/common-delta.logic --- doop-r160113-bin/logic/library/common-delta.logic 2013-01-16 07:31:46.000000000 +1100 +++ doop-bean/logic/library/common-delta.logic 2016-08-29 09:40:57.000000000 +1000 @@ -1,6 +1,7 @@ #include "native-delta.logic" PlusHeapAllocationRef(?alloc, "<>", "java.lang.String"). +PlusHeapAllocationRef(?alloc, "<>", "java.lang.String"). PlusHeapAllocationRef(?alloc, "<>", "java.lang.StringBuffer"). #if defined(JRE15) || defined(JRE16) diff -urN doop-r160113-bin/logic/library/fact-declarations.logic doop-bean/logic/library/fact-declarations.logic --- doop-r160113-bin/logic/library/fact-declarations.logic 2013-01-16 07:31:46.000000000 +1100 +++ doop-bean/logic/library/fact-declarations.logic 2016-08-29 10:19:21.000000000 +1000 @@ -489,3 +489,21 @@ MethodInvocationRef(?invocation), VarRef(?to), VarRef(?field). + + +/** + * The string constants that would be distinguished. + */ +DistinctStringConstant(?heap) -> HeapAllocationRef(?heap). + + +/** + * Heap contexts computed by BEAN. + */ + +BeanHeapContext[?allocHctx, ?allocator, ?heap] = ?newHctx -> + HeapAllocationRef(?allocHctx), + HeapAllocationRef(?allocator), + HeapAllocationRef(?heap), + HeapAllocationRef(?newHctx). + \ No newline at end of file diff -urN doop-r160113-bin/logic/library/reflection.logic doop-bean/logic/library/reflection.logic --- doop-r160113-bin/logic/library/reflection.logic 2013-01-16 07:31:46.000000000 +1100 +++ doop-bean/logic/library/reflection.logic 2016-08-29 10:08:22.000000000 +1000 @@ -118,6 +118,7 @@ //YANNIS (REVIEW): needs optimization. Create opt predicate computed //from first three below, but reordering the ?param, ?invocation //so that VarPointsTo can also index it efficiently. +ReflectionStringConstant(?constant), ReflectiveAssignClassConstant(?ctx, ?invocation, ?type) <- java:lang:Class:forName(?invocation, ?inmethod), ReachableContext(?ctx, ?inmethod), // recursive diff -urN doop-r160113-bin/logic/library/string-constants.logic doop-bean/logic/library/string-constants.logic --- doop-r160113-bin/logic/library/string-constants.logic 2013-01-16 07:31:46.000000000 +1100 +++ doop-bean/logic/library/string-constants.logic 2016-08-29 10:07:54.000000000 +1000 @@ -67,6 +67,18 @@ HeapAllocationValue(?constant, "<>"). #endif +ReflectionStringConstant(?heap) -> HeapAllocationRef(?heap). + +#ifdef DISTINGUISH_SPECIFIED_STRING_CONSTANTS +HeapAllocation:Merge[?heap] = ?constant <- + StringConstant(?heap), + ! DistinctStringConstant(?heap), + HeapAllocationValue(?constant, "<>"). + +HeapAllocation:ContextInsensitive(?heap) <- + DistinctStringConstant(?heap). +#endif + #ifdef DISTINGUISH_CLASS_STRING_CONSTANTS HeapAllocation:Merge[?heap] = ?constant <- StringConstant(?heap), @@ -114,7 +126,12 @@ * String buffers and builders *************************************************************/ -#ifdef MERGE_STRING_BUFFERS +HeapAllocation:Merge[?heap] = ?mergeHeap <- + HeapAllocation:Type[?heap] = ?type, + Type:Value(?type:"java.lang.String"), + ! StringConstant(?heap), + HeapAllocationValue(?mergeHeap, "<>"). + HeapAllocation:Merge[?heap] = ?mergeHeap <- HeapAllocation:Type[?heap] = ?type, Type:Value(?type:"java.lang.StringBuffer"), @@ -124,7 +141,7 @@ HeapAllocation:Type[?heap] = ?type, Type:Value(?type:"java.lang.StringBuilder"), HeapAllocationValue(?mergeHeap, "<>"). -#endif + /************************************************************* * Throwable diff -urN doop-r160113-bin/run doop-bean/run --- doop-r160113-bin/run 2013-01-16 07:38:09.000000000 +1100 +++ doop-bean/run 2016-08-29 14:24:46.000000000 +1000 @@ -157,6 +157,8 @@ mainclass="" os="unix" dynamics="" +beanctx="" +distStrConst="" logicProfile="" logLevel="" refine="false" @@ -235,6 +237,12 @@ CPPFLAGS_STRING_CONSTANTS="-DDISTINGUISH_NO_STRING_CONSTANTS" shift 1 ;; + "-distinguish-specified-string-constants") + CPPFLAGS_STRING_CONSTANTS="-DDISTINGUISH_SPECIFIED_STRING_CONSTANTS" + shift 1 + distStrConst="$1" + shift 1 + ;; "-merge-string-buffers") CPPFLAGS_STRING_BUFFERS="-DMERGE_STRING_BUFFERS" shift 1 @@ -295,6 +303,11 @@ dynamics="${dynamics} $1" shift 1 ;; + "-bean-context") + shift 1 + beanctx="$1" + shift 1 + ;; "-logicProfile") shift 1 logicProfile="-logicProfile $1" @@ -668,6 +681,33 @@ # timing $bloxbatch -db $database -addBlock -file tmp/spanning.logic # fi + + # Read contexts computed by BEAN + if [ ! "x$beanctx" = "x" ]; then + echo "loading BEAN heap context ... $beanctx" + cat > tmp/beanctx.import < tmp/distStrConst.import <,,Y>/OA 3RG9'5z [x?4R}aX/j.1bRKM$oa;Ԇ4FUa7HNN <6zߙRY6}th&l1rWXf.TY ׻*Nޝmx;P|AUs^*)7^ _֙Jf[Bdt>۞X_ESKf%r¸Zp#92pU'+r&pՍöHe8jN՘'8)Uo'WΕ0p:Gs8uq,꒟KoGc)gVr׺~s9vs8B՗/rG]үnMA[:S?;3Ja`rX*D=ECgx#h%M1uXf[h3r3 K:dĵ_FJ܂6]|U')\"lac#f0xi\MqrPcQj-FV^M asn݂kbf# S&1;0u׏uZ(/C4j[z+-Ȍ`1u9[/irWUo[STqzG]Oe^Q;[~8;.YxP(xOu?y^wWi<#y厣7|4B[IAN ЀL.&Aaە ,p?vzui>rw w|na=µ(;L* )UM UxTx*F-ۿl+v4j+*CaNѠ9{r ߩSu E#x, =95彛hu9^I_ 2RQ"fGgw!~įӌ1\v,rEJR]: ~o9{ _'9PK8;"l PK 'uI bean/oag/PK 'uIbean/oag/context/PK]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+NlTQ/mmKܬTYj>K rFIjCϏjʥuiO1Kܞ@PΖon 8)U!RGz&еdGkF% f].eb8}֦Yf G),e7 kV[ҩM(4$,QpSnr0.b8K'%,jCU\JpUPpW5H== ﱬ @@/YMc-:r^xPv ZU1KtY\7*A\0<27Q0YV-􆂛ErdK1/Iqhf.ʵJX0Y3(L~|M0?™u0DKb"| H+Hvv(=;q~v@ob-"Jk>ZOtpg {kGQa_'5 I"/O|S5x `]Ͱ ;D{JY/sͭ;w McQ~wF35!WI{Nq1z I01LBo&8Z(=U FkGI|6Fq -K*K7ݡe_0rkG62G&IK6-X7( HS =Kr3KK8<'EgPKq>PK]Ibean/util/Triple.classU]oE=o;[&kIS臽qb@8Ɛ M"[\6Βl1Y J>D +? !Ĺ[zE{ι瞙Iϒ(\8v9Ru-;'7VeKMO!]THל][!V/Jf}qqpU+N 0Y~!$93b9L)D4.#!MHfi_n:ldi,ב8c'k4ʮ krov}sq&4Sk\ }s5&Nމxb 5 ,b6|wImݷZҘ+< +JXUy#-7]NvS+ܓG 8 նu(wx1OrVCPn3)Χp2¸/"62Nmڻx0[$< J}X_aWLs%QQ)8xb(6 }<.=g1~h.rRWVyxd͟0@_d )mv6FC7BQioRt 'k_mDłZ#&k ]g#ĕʔ^Pw[VY)ڗbES\:Ҍr:ǞE1bN;` shu~-7E⬾@F D:orΠEʿܘ@]l=O908<6CQril#m{"L.L.#xLJ%yPK{-ЙPKRuI META-INF/PKRuI'kCD=META-INF/MANIFEST.MFPK  uIbean/PK  uI bean/main/PKsI8;"l  bean/main/DoopMain.classPK 'uI bean/oag/PK 'uI bean/oag/context/PK]Ik/ N  bean/oag/context/Context.classPK]I9e &nbean/oag/context/ContextSelector.classPK]Iw 4bean/oag/context/RepresentativeContextSelector.classPK]IA$B;1!bean/oag/context/TraditionalContextSelector.classPK]IF(bean/oag/Node.classPK]IX+%,bean/oag/OAG.classPKSI'GA  <bean/oag/OAGDirectedGraph.classPKSI@<"Abean/oag/OAGDumper.classPK  uI #Cbean/pta/PK]I( JCbean/pta/CallGraph.classPK 4uIDbean/pta/doop/PK]I.bCDbean/pta/doop/CSHeap.classPK]IM=װ- Gbean/pta/doop/DataBase.classPK]I8I !#Mbean/pta/doop/DoopCallGraph.classPK]Ip$# BWbean/pta/doop/DoopHeap.classPK]ISYbean/pta/doop/DoopMethod.classPK]I͐wh$]bean/pta/doop/DoopPointedBySet.classPK]I8GU$(ebean/pta/doop/DoopPointsToAnalysis.classPK]Iɘ DG#tbean/pta/doop/DoopPointsToSet.classPK]IfB H{bean/pta/doop/DoopVariable.classPK]IՄv x}bean/pta/doop/HeapManager.classPK]Ilj+!;bean/pta/doop/MethodManager.classPK]Iu8k#dbean/pta/doop/VariableManager.classPK]ImFnjȒbean/pta/Heap.classPK]I7oh* bean/pta/Method.classPK]IZTkbean/pta/PointsToAnalysis.classPK]I(mbean/pta/PointsToSet.classPK]IXM bean/pta/Variable.classPK 'uI =bean/util/PK]Ikaebean/util/ANSIColor.classPK]Iq>7bean/util/Pair.classPK]I{-Йbean/util/Triple.classPK'' BEAN-0.1/tutorial.txt0000664000175400017540000000414312760760612013526 0ustar tianttiantBEAN 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.