Package daikon.diff

Class Diff


  • public final class Diff
    extends Object
    Diff is the main class for the invariant diff program. The invariant diff program outputs the differences between two sets of invariants.

    The following is a high-level description of the program. Each input file contains a serialized PptMap or InvMap. PptMap and InvMap are similar structures, in that they both map program points to invariants. However, PptMaps are much more complicated than InvMaps. PptMaps are output by Daikon, and InvMaps are output by this program.

    First, if either input is a PptMap, it is converted to an InvMap. Next, the two InvMaps are combined to form a tree. The tree is exactly three levels deep. The first level contains the root, which holds no data. Each node in the second level is a pair of Ppts, and each node in the third level is a pair of Invariants. The tree is constructed by pairing the corresponding Ppts and Invariants in the two PptMaps. Finally, the tree is traversed via the Visitor pattern to produce output. The Visitor pattern makes it easy to extend the program, simply by writing a new Visitor.