daikon
Class PptSlice1

Object
  extended by Ppt
      extended by PptSlice
          extended by PptSlice1
All Implemented Interfaces:
Serializable

public final class PptSlice1
extends PptSlice

Contains all of the invariants over a particular set of 1 variables

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class PptSlice
PptSlice.ArityPptnameComparator, PptSlice.ArityVarnameComparator
 
Nested classes/interfaces inherited from class Ppt
Ppt.NameComparator
 
Field Summary
static Logger debugMerge
           
static Logger debugSpecific
          Debug tracer.
 
Fields inherited from class PptSlice
debug, debugFlow, debugGeneral, debugGuarding, invs, lineSep, parent
 
Fields inherited from class Ppt
emptyInvList, var_infos
 
Constructor Summary
PptSlice1(PptTopLevel parent, VarInfo[] var_infos)
          Create a new PptSlice1.
 
Method Summary
 List<Invariant> add_val_bu(Object val1, int mod1, int count)
           
 List<Invariant> add(ValueTuple full_vt, int count)
          This procedure accepts a sample (a ValueTuple), extracts the values from it, casts them to the proper types, and passes them along to the invariants proper.
 void addInvariant(Invariant invariant)
           
 int arity()
           
protected  PptSlice cloneAndPivot(VarInfo[] argNewVarInfos)
          Copy invariants from this slice to a new slice over the variables argNewVarInfos.
 void instantiate_invariants()
          Creates all of the the invariants that are appropriate for this slice.
 void instantiate_invariants(List<Invariant> proto_invs)
          Creates all of the the invariants that are appropriate for this slice based on the list of invariants passed in.
 void merge_invariants()
          Creates invariants at this ppt by merging invariants from each of its children.
 int num_samples()
          Returns the number of (non-missing) samples observed at this slice.
 int num_values()
          Returns (an approximation to) the number of distinct values observed at this slice.
 
Methods inherited from class PptSlice
allPrestate, contains_inv_exact, contains_inv, containsOnlyGuardingPredicates, copy_new_invs, find_inv_by_class, find_inv_exact, is_inv_true, log, name, processOmissions, remove_falsified, removeInvariant, removeInvariants, repCheck, toString, trimToSize, usesVar, usesVar, usesVarDerived
 
Methods inherited from class Ppt
containsVar, find_var_by_name, indexOf, varNames, varNames
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debugSpecific

public static final Logger debugSpecific
Debug tracer.


debugMerge

public static final Logger debugMerge
Constructor Detail

PptSlice1

public PptSlice1(PptTopLevel parent,
                 VarInfo[] var_infos)
Create a new PptSlice1. The var_infos must be in varinfo_index order.

Method Detail

arity

public final int arity()
Specified by:
arity in class PptSlice

instantiate_invariants

public void instantiate_invariants()
Creates all of the the invariants that are appropriate for this slice. No invariants are created unless the variables in the slice are compatible. If the variables are compatible, invariants that match the type of the slices variables are created.


instantiate_invariants

public void instantiate_invariants(List<Invariant> proto_invs)
Creates all of the the invariants that are appropriate for this slice based on the list of invariants passed in. No invariants are created unless the variables in the slice are compatible. If the variables are compatible, invariants that match the type of the slices variables are created.


num_samples

public int num_samples()
Returns the number of (non-missing) samples observed at this slice.

Specified by:
num_samples in class PptSlice

num_values

public int num_values()
Returns (an approximation to) the number of distinct values observed at this slice. This is not the number of samples observed.

Specified by:
num_values in class PptSlice

add

public List<Invariant> add(ValueTuple full_vt,
                           int count)
This procedure accepts a sample (a ValueTuple), extracts the values from it, casts them to the proper types, and passes them along to the invariants proper. (The invariants accept typed values rather than a ValueTuple that encapsulates objects of any type whatever.)

Returns:
a List of Invariants that weakened due to the processing.

add_val_bu

public List<Invariant> add_val_bu(Object val1,
                                  int mod1,
                                  int count)

addInvariant

public void addInvariant(Invariant invariant)
Specified by:
addInvariant in class PptSlice

cloneAndPivot

protected PptSlice cloneAndPivot(VarInfo[] argNewVarInfos)
Copy invariants from this slice to a new slice over the variables argNewVarInfos. The new slice should not already exist.

Parameters:
argNewVarInfos - to replace this.var_infos.
Returns:
a new PptSlice that satisfies the characteristics above.

merge_invariants

public void merge_invariants()
Creates invariants at this ppt by merging invariants from each of its children. An invariant must exist at each of the children in order for it to be created here (at the parent). Additionally, some invariants have state information that must be merged. This is done by the invariant itself. The basic steps are: 1) Find all of the child invariants. These are the invariants in the matching slice of each child. 2) For each invariant class, build a list of all of the invariants of that class. Note that some invariant classes (eg, functionBinary) contain distinct invariants, each of which must be merged separately. See Invariant.Match for more information concerning what makes an invariant the 'same' 3) Each invariant that is found at each of the children is then merged to possibly create a parent invariant.