Package daikon

Class PptSliceEquality

    • Field Detail

      • dkconfig_set_per_var

        public static boolean dkconfig_set_per_var
        If true, create one equality set for each variable. This has the effect of turning the equality optimization off, without actually removing the sets themselves (which are presumed to exist in many parts of the code).
    • Method Detail

      • num_samples

        public int num_samples​(@UnknownInitialization @GuardSatisfied PptSliceEquality this)
        Description copied from class: PptSlice
        Return an approximation of the number of samples seen on this slice.
        Specified by:
        num_samples in class PptSlice
      • num_values

        public int num_values()
        Description copied from class: PptSlice
        Return an approximation of the number of distinct values seen on this slice.
        Specified by:
        num_values in class PptSlice
      • instantiate_from_pairs

        public void instantiate_from_pairs​(Set<VarInfo.Pair> eset)
        Instantiate the full equality sets from a set of variable pairs where each member of a pair is equal to the other.
      • add

        public List<Invariantadd​(ValueTuple vt,
                                   int count)
        Returns a List of Invariants that have been weakened/destroyed. However, this handles the creation of new Equality invariants and the instantiation of other invariants.
        Returns:
        a List of invariants that have been weakened
      • createEqualityInvs

        public List<EqualitycreateEqualityInvs​(List<VarInfo> vis,
                                                 Equality leader)
        Create a List of Equality invariants based on the VarInfos in vis. Assumes that the VarInfos in vis are not missing. The method is used exclusively for reversing optimizations in Daikon.

        Requires: vis.size() > 0

        Ensures: result.size() > 0

        Parameters:
        vis - the VarInfos that were different from leader
        leader - the original leader of VarInfos
        Returns:
        a List of Equality invariants bundling together same values from vis
      • copyInvsFromLeader

        public List<InvariantcopyInvsFromLeader​(VarInfo leader,
                                                  List<VarInfo> newVis)
        Instantiate invariants from each inv's leader. This is like instantiate_invariants at the start of reading the trace file, where we create new PptSliceNs. This is called when newVis have just split off from leader, and we want the leaders of newVis to have the same invariants as leader.

        post: Adds the newly instantiated invariants and slices to this.parent.

        Parameters:
        leader - the old leader
        newVis - a List of new VarInfos that used to be equal to leader. Actually, it's the list of canonical that were equal to leader, representing their own newly-created equality sets.
      • repCheck

        public void repCheck()
        Description copied from class: PptSlice
        Check the internals of this slice. Each invariant in the slice is checked for consistency and each inv.ppt must equal this.
        Overrides:
        repCheck in class PptSlice
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied PptSliceEquality this)
        Description copied from class: PptSlice
        For debugging only.
        Overrides:
        toString in class PptSlice
      • get_leaders_sorted

        public VarInfo[] get_leaders_sorted()
        Returns an array of all of the leaders sorted by varinfo_index for this equality view.