Package daikon

Class DaikonSimple


  • public class DaikonSimple
    extends Object
    DaikonSimple reads a declaration file and trace file and outputs a list of likely invariants using the simple incremental algorithm. Its methods parallel those of Daikon but oftentimes certain checks are eliminated from DaikonSimple's methods because there is less filtering of invariants and variables.

    DaikonSimple was written to check the implementation of the optimizations in Daikon. DaikonSimple does not use any optimizations, and its processing will produce a complete set of true invariants. Daikon does have flags to "turn off" some of its optimizations but there are some optimizations are built into the way Daikon processes the samples (e.g. variable hierarchy and bottom up processing). In addition, we want to check the optimizations, so we don't want to bypass them. In Daikon, code was written to "undo" the optimizations, so we could recover the invariants that were previously filtered out or not created (see Daikon.dkconfig_undo_opts flag). By comparing the output from the two, we can find problems with the optimization implementation by tracking the cause of the differences.

    • Method Detail

      • instantiate_views_and_invariants

        public static void instantiate_views_and_invariants​(PptTopLevel ppt)
        Install views and the invariants. Duplicated from PptTopLevel's version because DaikonSimple needs to use its own version of slice checking code.

        Difference from PptTopLevel's version:

        1. canonical (leader of equality set) check of variables is turned off because every variable is in its own equality set
        2. debugging information turned off because DaikonSimple's code is more contained
        3. less constraints on the slices
        See Also:
        PptTopLevel.instantiate_views_and_invariants()
      • is_slice_ok

        @Pure
        public static boolean is_slice_ok​(VarInfo v1,
                                          VarInfo v2)
        Returns whether or not the specified binary slice should be created. The slice should not be created if the vars are not compatible.

        Since we are trying to create all of the invariants, the variables does not have to be a leader and can be a constant. Note that the always missing check is only applicable when the dynamic constants optimization is turned on (so we do not do the check here).

        See Also:
        PptTopLevel.is_slice_ok(VarInfo, VarInfo)
      • is_slice_ok

        @Pure
        public static boolean is_slice_ok​(VarInfo v1,
                                          VarInfo v2,
                                          VarInfo v3)
        Returns whether or not the specified ternary slice should be created. The slice should not be created if any of the following are true
        • Any var is an array
        • Any of the vars are not compatible with the others
        • Any var is not (integral or float)
        Since we are trying to create all of the invariants, the variables does not have to be a leader and can be a constant. Note that the always missing check is only applicable when the dynamic constants optimization is turned on (so we do not do the check here). In addition, we do want to create the reflexive ones and partially reflexive invariants.
        See Also:
        PptTopLevel.is_slice_ok(VarInfo, VarInfo, VarInfo)