Package daikon.diff

Class ConsequentExtractorVisitor

  • All Implemented Interfaces:
    Visitor

    public class ConsequentExtractorVisitor
    extends DepthFirstVisitor
    ConsequentExtractorVisitor is a visitor that takes in RootNode tree used by the other visitors in Diff and only modifies the first inv tree out of the pair of two inv trees (the second tree is never read or modified).

    The goal is to take the right hand side of any implication and extract it for later use. The implementation completely replaces the previous inv tree with the a new inv tree. The new inv tree contains only the extracted consequents of the original inv tree.

    • Method Detail

      • visit

        public void visit​(InvNode node)
        The idea is to check if the node is an Implication Invariant. If not, immediately remove the invariant. Otherwise, extract the Consequent, remove the Implication, and then add the consequent to the list.
        Specified by:
        visit in interface Visitor
        Overrides:
        visit in class DepthFirstVisitor
      • shouldPrint

        protected boolean shouldPrint​(@Nullable Invariant inv1,
                                      @Nullable Invariant inv2)
        Returns true if the pair of invariants should be printed, depending on their type, relationship, and printability.