Package daikon.split
Class PptSplitter
- Object
-
- PptSplitter
-
- All Implemented Interfaces:
Serializable
@UsesObjectEquals public class PptSplitter extends Object implements Serializable
PptSplitter contains the splitter and its associated PptConditional ppts. Currently all splitters are binary (have exactly two PptConditional ppts) and this is presumed in the implementation. However, this could be extended by extending this class with specific other implementations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Logger
debug
General debug tracer.static boolean
dkconfig_disable_splitting
Boolean.static int
dkconfig_dummy_invariant_level
Integer.static boolean
dkconfig_split_bi_implications
Split bi-implications ("a <==> b
") into two separate implications ("a ==> b
" and "b ==> a
").static boolean
dkconfig_suppressSplitterErrors
When true, compilation errors during splitter file generation will not be reported to the user.PptTopLevel[]
ppts
One PptConditional for each splitter result. ppts[0] is used when the splitter is true, ppts[1] when the splitter is false.@Nullable Splitter
splitter
Splitter that chooses which PptConditional a sample is applied to.
-
Constructor Summary
Constructors Constructor Description PptSplitter(PptTopLevel parent, PptTopLevel exit1, PptTopLevel exit2)
Creates a PptSplitter over two exit points.PptSplitter(PptTopLevel parent, Splitter splitter)
Create a binary PptSplitter with the specied splitter for the specified PptTopLevel parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add_bottom_up(ValueTuple vt, int count)
Adds the sample to one of the conditional ppts in the split.void
add_implication(PptTopLevel ppt, Invariant predicate, Invariant consequent, boolean iff, Map<Invariant,Invariant> orig_invs)
If the implication specified by predicate and consequent is a valid implication, adds it to the joiner view of parent.void
add_implications()
Adds implication invariants based on the invariants found on each side of the split.void
add_relation(PptRelation rel, PptSplitter ppt_split)
Adds the specified relation from each conditional ppt in this to the corresponding conditional ppt in ppt_split.@Nullable PptConditional
choose_conditional(ValueTuple vt)
Chooses the correct conditional point based on the values in this sample.boolean
splitter_valid()
Returns true if the splitter is valid at this point, false otherwise.String
toString()
-
-
-
Field Detail
-
dkconfig_disable_splitting
public static boolean dkconfig_disable_splitting
Boolean. If true, the built-in splitting rules are disabled. The built-in rules look for implications based on boolean return values and also when there are exactly two exit points from a method.
-
dkconfig_dummy_invariant_level
public static int dkconfig_dummy_invariant_level
Integer. A value of zero indicates that DummyInvariant objects should not be created. A value of one indicates that dummy invariants should be created only when no suitable condition was found in the regular output. A value of two indicates that dummy invariants should be created for each splitting condition.
-
dkconfig_split_bi_implications
public static boolean dkconfig_split_bi_implications
Split bi-implications ("a <==> b
") into two separate implications ("a ==> b
" and "b ==> a
").
-
dkconfig_suppressSplitterErrors
public static boolean dkconfig_suppressSplitterErrors
When true, compilation errors during splitter file generation will not be reported to the user.
-
splitter
public transient @Nullable Splitter splitter
Splitter that chooses which PptConditional a sample is applied to. May be null if no computation is required (e.g., splitting over exit points).
-
ppts
public PptTopLevel[] ppts
One PptConditional for each splitter result. ppts[0] is used when the splitter is true, ppts[1] when the splitter is false. The contents are PptConditional objects if the splitter is valid, but are PptTopLevel if the PptSplitter represents two exit points (for which no splitter is required).
-
-
Constructor Detail
-
PptSplitter
public PptSplitter(PptTopLevel parent, Splitter splitter)
Create a binary PptSplitter with the specied splitter for the specified PptTopLevel parent. The parent should be a leaf (i.e., a numbered exit point).
-
PptSplitter
public PptSplitter(PptTopLevel parent, PptTopLevel exit1, PptTopLevel exit2)
Creates a PptSplitter over two exit points. No splitter is required.
-
-
Method Detail
-
splitter_valid
public boolean splitter_valid()
Returns true if the splitter is valid at this point, false otherwise.
-
add_bottom_up
@RequiresNonNull({"daikon.suppress.NIS.suppressor_map","daikon.suppress.NIS.suppressor_map_suppression_count","daikon.suppress.NIS.all_suppressions","daikon.suppress.NIS.suppressor_proto_invs"}) public void add_bottom_up(ValueTuple vt, int count)
Adds the sample to one of the conditional ppts in the split.
-
choose_conditional
public @Nullable PptConditional choose_conditional(ValueTuple vt)
Chooses the correct conditional point based on the values in this sample. Returns null if none is applicable.
-
add_implications
@RequiresNonNull({"parent.equality_view","daikon.suppress.NIS.all_suppressions","daikon.suppress.NIS.suppressor_map"}) public void add_implications()
Adds implication invariants based on the invariants found on each side of the split.
-
add_implication
public void add_implication(PptTopLevel ppt, Invariant predicate, Invariant consequent, boolean iff, Map<Invariant,Invariant> orig_invs)
If the implication specified by predicate and consequent is a valid implication, adds it to the joiner view of parent.- Parameters:
orig_invs
- maps permuted invariants to their original invariants
-
add_relation
public void add_relation(PptRelation rel, PptSplitter ppt_split)
Adds the specified relation from each conditional ppt in this to the corresponding conditional ppt in ppt_split. The relation specified should be a relation from this.parent to ppt_split.parent.- Parameters:
rel
- the relation to addppt_split
- the target of the relation; that is, the relation goes fromthis
toppt_split
-
-