Package kodkod.ast.visitor

Examples of kodkod.ast.visitor.AbstractVoidVisitor


   * @throws IllegalArgumentException - descendants !in formula.*components
   */
  public static Set<Formula> minRoots(Formula formula, Collection<? extends Node> descendants) {
   
    final Set<Node> desc = new IdentityHashSet<Node>(descendants);
    final VoidVisitor visitor = new AbstractVoidVisitor() {
      final Set<Node> visited = new IdentityHashSet<Node>();
      @Override
      protected boolean visited(Node n) {
        if (visited.add(n)) {
          desc.remove(n);
View Full Code Here


   * Returns the set of all relations at the leaves of this annotated node.
   * @return Relation & this.node.*components
   */
  public final Set<Relation> relations() {
    final Set<Relation> relations = new IdentityHashSet<Relation>();
    final AbstractVoidVisitor visitor = new AbstractVoidVisitor() {
      private final Set<Node> visited = new IdentityHashSet<Node>(sharedNodes.size());
      protected boolean visited(Node n) {
        return sharedNodes.contains(n) && !visited.add(n);
      }
      public void visit(Relation relation) {
View Full Code Here

    };
    for(Iterator<TranslationRecord> itr = log().replay(filter); itr.hasNext(); ) {
      coreNodes.add(itr.next().translated());
    }
    final Set<Formula> connected = new IdentityHashSet<Formula>();
    final AbstractVoidVisitor traverser = new AbstractVoidVisitor() {
      final Set<Node> visited = new IdentityHashSet<Node>();
      /**
       * Returns true if the given node has been visited before or if
       * it is not contained in this.nodes set.  Otherwise adds
       * the node to the connected set and returns false.
View Full Code Here

TOP

Related Classes of kodkod.ast.visitor.AbstractVoidVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.