daikon.suppress
Class NISuppressionSet

Object
  extended by NISuppressionSet
All Implemented Interfaces:
Iterable<NISuppression>

public class NISuppressionSet
extends Object
implements Iterable<NISuppression>

Class that defines a set of non-instantiating suppressions for a single invariant (suppressee).


Field Summary
static Logger debug
           
 
Constructor Summary
NISuppressionSet(NISuppression[] suppressions)
           
 
Method Summary
 void add_to_suppressor_map(Map<Class<? extends Invariant>,List<NISuppressionSet>> suppressor_map)
          Adds this set to the suppressor map.
 void clear_state()
          Clears the suppressor state in each suppression.
 void falsified(Invariant inv, List<Invariant> new_invs)
          NIS process a falsified invariant.
 NISuppressee get_suppressee()
          Returns the suppressee
 boolean is_instantiate_ok(PptSlice slice)
          Determines whether or not the suppression set is valid in the specified slice.
 boolean is_instantiate_ok(PptTopLevel ppt, VarInfo[] var_infos)
          Determines whether or not the suppressee of the suppression set should be instantiated.
 Iterator<NISuppression> iterator()
           
 void recurse_definitions(NISuppressionSet ss)
          Each suppression where a suppressor matches the suppressee in ss is augmented by additional suppression(s) where the suppressor is replaced by each of its suppressions.
 boolean suppressed(PptSlice slice)
          Determines whether or not the suppression set is valid in the specified slice.
 boolean suppressed(PptTopLevel ppt, VarInfo[] var_infos)
          Determines whether or not the suppression set is valid in the specified ppt and var_infos.
 NISuppressionSet swap()
          Swaps each suppressor and suppressee to the opposite variable order.
 String toString()
          Returns a string containing each suppression separated by commas.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public static final Logger debug
Constructor Detail

NISuppressionSet

public NISuppressionSet(NISuppression[] suppressions)
Method Detail

iterator

public Iterator<NISuppression> iterator()
Specified by:
iterator in interface Iterable<NISuppression>

add_to_suppressor_map

public void add_to_suppressor_map(Map<Class<? extends Invariant>,List<NISuppressionSet>> suppressor_map)
Adds this set to the suppressor map. The map is from the class of the suppressor to this. If the same suppressor class appears more than once, the suppression is only added once.


falsified

public void falsified(Invariant inv,
                      List<Invariant> new_invs)
NIS process a falsified invariant. This method should be called for each falsified invariant in turn. Any invariants for which inv is the last valid suppressor are added to new_invs. Note, this is no longer the preferred approach, but is kept for informational purposes. Use NIS.process_falsified_invs() instead.


suppressed

public boolean suppressed(PptSlice slice)
Determines whether or not the suppression set is valid in the specified slice. The suppression set is valid if any of its suppressions are valid. A suppression is valid if all of its suppressors are true. Also updates the debug information in each suppressor.

See Also:
for a check that considers missing

suppressed

public boolean suppressed(PptTopLevel ppt,
                          VarInfo[] var_infos)
Determines whether or not the suppression set is valid in the specified ppt and var_infos. The suppression set is valid if any of its suppressions are valid. A suppression is valid if all of its suppressors are true. Also updates the debug information in each suppressor.

See Also:
for a check that considers missing

is_instantiate_ok

public boolean is_instantiate_ok(PptSlice slice)
Determines whether or not the suppression set is valid in the specified slice. The suppression set is valid if any of its suppressions are valid. A suppression is valid if all of its non-missing suppressors are true.


is_instantiate_ok

public boolean is_instantiate_ok(PptTopLevel ppt,
                                 VarInfo[] var_infos)
Determines whether or not the suppressee of the suppression set should be instantiated. Instantiation is ok only if each suppression is invalid. A suppression is valid if all of its non-missing suppressors are true.


recurse_definitions

public void recurse_definitions(NISuppressionSet ss)
Each suppression where a suppressor matches the suppressee in ss is augmented by additional suppression(s) where the suppressor is replaced by each of its suppressions. This allows recursive suppressions. For example, consider the suppressions: (r == arg1) && (arg2 <= arg1) ==> r = max(arg1,arg2) (arg2 == arg1) ==> arg2 <= arg1 The suppressor (arg2 <= arg1) in the first suppression matches the suppressee in the second suppression. In order for the first suppression to work even when (arg2 <= arg1) is suppressed, the second suppression is added to the first: (r == arg1) && (arg2 <= arg1) ==> r = max(arg1,arg2) (r == arg1) && (arg2 == arg1) ==> r = max(arg1,arg2) When (arg2 <= arg1) is suppressed, the second suppression for max will still suppress max. If (arg2 == arg1) is falsified, the (arg2 <= arg1) invariant will be created and can continue to suppress max (as long as it is not falsified itself).


swap

public NISuppressionSet swap()
Swaps each suppressor and suppressee to the opposite variable order. Valid only on unary and binary suppressors and suppressees


get_suppressee

public NISuppressee get_suppressee()
Returns the suppressee


clear_state

public void clear_state()
Clears the suppressor state in each suppression.


toString

public String toString()
Returns a string containing each suppression separated by commas.

Overrides:
toString in class Object