daikon.suppress
Class NIS

Object
  extended by NIS

public class NIS
extends Object

Main class for non-instantiating suppression. Handles setup and other overall functions.


Nested Class Summary
static class NIS.SuppressionProcessor
          Enum.
 
Field Summary
static boolean antecedent_method
          Boolean.
static int created_invs_cnt
          Number of invariants actually created
static Logger debug
          Debug tracer.
static Logger debugAnt
          Debug Tracer for antecedent method
static boolean dkconfig_enabled
          Boolean.
static int dkconfig_hybrid_threshhold
          Int.
static boolean dkconfig_skip_hashcode_type
          Boolean.
static NIS.SuppressionProcessor dkconfig_suppression_processor
          Specifies the algorithm that NIS uses to process suppressions.
static boolean dkconfig_suppressor_list
          Boolean.
static int false_cnts
          Number of falsified invariants in the program point
static int false_invs
          Number of falsified invariants in the program point that are potential suppressors
static int false_invs_cnt
          Number of new_invs_cnt that are falsified by the sample
static boolean hybrid_method
          Boolean.
static boolean keep_stats
          Whether or not to keep statistics
static List<Invariant> new_invs
          List of invariants that are unsuppressed by the current sample.
static List<Invariant> newly_falsified
          List of invariants that are unsuppressed and then falsified by the current sample.
static int suppressions_processed
          Number of suppressions processed
static int suppressions_processed_falsified
          Number of suppressions processed by the falsified method
static Map<Class<? extends Invariant>,List<NISuppressionSet>> suppressor_map
          Map from invariant class to a list of all of the suppression sets that contain a suppressor of that class.
static Map<Class<? extends Invariant>,Integer> suppressor_map_suppression_count
          Map from invariant class to the number of suppressions that contain a suppressor of that class.
static List<Invariant> suppressor_proto_invs
          List of suppressor invariant prototypes
static Stopwatch watch
          Total time spent in NIS processing
 
Constructor Summary
NIS()
           
 
Method Summary
static void apply_samples(ValueTuple vt, int count)
          Applies sample values to all of the newly created invariants (kept in new_invs).
static void clear_sample_stats()
           
static void clear_stats()
          Clears the current NIS statistics and enables the keeping of statistics
static List<Invariant> create_suppressed_invs(PptTopLevel ppt)
          Creates all suppressed invariants for the specified ppt and places them in their associated slices.
static void dump_stats(Logger log, PptTopLevel ppt)
          dump statistics on NIS to the specified logger
static void dump(Logger log)
          Dump out the suppressor map.
static void falsified(Invariant inv)
          Instantiates any invariants that are no longer suppressed because inv has been falsified.
static void init_ni_suppression()
          Sets up non-instantiation suppression.
static boolean is_suppressor(Class<? extends Invariant> cls)
          Returns true if the specified class is an antecedent in any NI suppression
static void process_falsified_invs(PptTopLevel ppt, ValueTuple vt)
          Creates any invariants that were previously suppressed, but are no longer suppressed.
static void remove_suppressed_invs(PptTopLevel ppt)
          Removes any invariants in the specified ppt that are suppressed
static void stats_header(Logger log)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


suppressor_map

public static Map<Class<? extends Invariant>,List<NISuppressionSet>> suppressor_map
Map from invariant class to a list of all of the suppression sets that contain a suppressor of that class.


suppressor_map_suppression_count

public static Map<Class<? extends Invariant>,Integer> suppressor_map_suppression_count
Map from invariant class to the number of suppressions that contain a suppressor of that class.


suppressor_proto_invs

public static List<Invariant> suppressor_proto_invs
List of suppressor invariant prototypes


new_invs

public static List<Invariant> new_invs
List of invariants that are unsuppressed by the current sample. The falsified() and process_falsified_invs() methods add created invariants to this list. This list is cleared by apply_samples()


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


suppressions_processed

public static int suppressions_processed
Number of suppressions processed


suppressions_processed_falsified

public static int suppressions_processed_falsified
Number of suppressions processed by the falsified method


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


watch

public static Stopwatch watch
Total time spent in NIS processing

Constructor Detail

NIS

public NIS()
Method Detail

init_ni_suppression

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


falsified

public static void falsified(Invariant inv)
Instantiates any invariants that are no longer suppressed because inv has been falsified. Note: this method is should NOT be used with the antecedent approach. See NIS.process_falsified_invs()


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


clear_sample_stats

public static void clear_sample_stats()

stats_header

public static void stats_header(Logger log)

dump_stats

public static void dump_stats(Logger log,
                              PptTopLevel ppt)
dump statistics on NIS to the specified logger


process_falsified_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

public static List<Invariant> create_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.

remove_suppressed_invs

public static void remove_suppressed_invs(PptTopLevel ppt)
Removes any invariants in the specified ppt that are suppressed


is_suppressor

public static boolean is_suppressor(Class<? extends Invariant> cls)
Returns true if the specified class is an antecedent in any NI suppression


dump

public static void dump(Logger log)
Dump out the suppressor map.