Class NIS


  • public class NIS
    extends Object
    Main class for non-instantiating suppression. Handles setup and other overall functions.
    • Field Detail

      • debug

        public static final Logger debug
        Debug tracer.
      • debugAnt

        public static final Logger debugAnt
        Debug Tracer for antecedent method.
      • dkconfig_enabled

        public static boolean dkconfig_enabled
        Boolean. If true, enable non-instantiating suppressions.
      • dkconfig_suppression_processor

        public static NIS.SuppressionProcessor dkconfig_suppression_processor
        Specifies the algorithm that NIS uses to process suppressions. Possible selections are 'HYBRID', 'ANTECEDENT', and 'FALSIFIED'. The default is the hybrid algorithm which uses the falsified algorithm when only a small number of suppressions need to be processed and the antecedent algorithm when a large number of suppressions are processed.
      • antecedent_method

        public static boolean antecedent_method
        Boolean. If true, use antecedent method for NIS processing. If false, use falsified method for processing falsified invariants for NISuppressions. Note this flag is for internal use only and is controlled by NIS.dkconfig_suppression_processor.
      • hybrid_method

        public static boolean hybrid_method
        Boolean. If true, use a combination of the falsified method for a small number of suppressions to be processed and the antecedent method for a large number. Number is determined by NIS.dkconfig_hybrid_threshhold. Note this flag is for internal use only and is controlled by NIS.dkconfig_suppression_processor.
      • dkconfig_hybrid_threshhold

        public static int dkconfig_hybrid_threshhold
        Int. Less and equal to this number means use the falsified method in the hybrid method of processing falsified invariants, while greater than this number means use the antecedent method. Empirical data shows that number should not be more than 10000.
      • dkconfig_suppressor_list

        public static boolean dkconfig_suppressor_list
        Boolean. If true, use the specific list of suppressor related invariant prototypes when creating constant invariants in the antecedent method.
      • dkconfig_skip_hashcode_type

        public static boolean dkconfig_skip_hashcode_type
        Boolean. If true, skip variables of file rep type hashcode when creating invariants over constants in the antecedent method.
      • newly_falsified

        public static List<Invariant> newly_falsified
        List of invariants that are unsuppressed and then falsified by the current sample. This list is cleared at the beginning of apply_samples() and falsified invariants are added as the current sample is applied to invariants in new_invs. The list is only used when the falsified method is used for processing suppressions.
      • keep_stats

        public static boolean keep_stats
        Whether or not to keep statistics.
      • false_cnts

        public static int false_cnts
        Number of falsified invariants in the program point.
      • false_invs

        public static int false_invs
        Number of falsified invariants in the program point that are potential suppressors.
      • false_invs_cnt

        public static int false_invs_cnt
        Number of new_invs_cnt that are falsified by the sample.
      • created_invs_cnt

        public static int created_invs_cnt
        Number of invariants actually created.
      • duration

        public static long duration
        Total time spent in NIS processing.
    • Constructor Detail

      • NIS

        public NIS()
    • Method Detail

      • init_ni_suppression

        @EnsuresNonNull({"suppressor_map","suppressor_map_suppression_count","all_suppressions","suppressor_proto_invs"})
        public static void init_ni_suppression()
        Sets up non-instantiation suppression. Primarily this includes setting up the map from suppressor classes to all of the suppression sets associated with that suppressor invariant.
      • apply_samples

        public static void apply_samples​(ValueTuple vt,
                                         int count)
        Applies sample values to all of the newly created invariants (kept in new_invs). The sample should never falsify the invariant (since we don't create an invariant if the sample would invalidate it). The sample still needs to be applied, however, for sample-dependent invariants.

        Clears the new_invs list after processing. Currently this routine checks to insure that the newly falsified invariant is not itself a possible NI suppressor.

      • clear_stats

        public static void clear_stats()
        Clears the current NIS statistics and enables the keeping of statistics.
      • process_falsified_invs

        @RequiresNonNull({"suppressor_map","suppressor_map_suppression_count","all_suppressions","NIS.suppressor_proto_invs"})
        public static void process_falsified_invs​(PptTopLevel ppt,
                                                  ValueTuple vt)
        Creates any invariants that were previously suppressed, but are no longer suppressed. Must be called after the sample has been processed and any invariants falsified by the sample are marked as such, but before they have been removed.
      • create_suppressed_invs

        @RequiresNonNull({"all_suppressions","suppressor_map"})
        public static List<Invariantcreate_suppressed_invs​(PptTopLevel ppt)
        Creates all suppressed invariants for the specified ppt and places them in their associated slices.
        Returns:
        a list of created invariants
      • is_suppressor

        @RequiresNonNull("NIS.suppressor_map")
        @Pure
        public static boolean is_suppressor​(Class<? extends Invariant> cls)
        Returns true if the specified class is an antecedent in any NI suppression.
        Parameters:
        cls - the class for some subtype of Invariant
        Returns:
        true if the specified class is an antecedent in any NI suppression
      • dump

        @RequiresNonNull("suppressor_map")
        public static void dump​(Logger log)
        Dump out the suppressor map.