Package kodkod.ast

Examples of kodkod.ast.Node


    final AbstractReplacer inliner = new AbstractReplacer(annotated.sharedNodes()) {
      private RelationPredicate source =  null;     
      protected <N extends Node> N cache(N node, N replacement) {
        if (replacement instanceof Formula) {
          if (source==null) {
            final Node nsource = annotated.sourceOf(node);
            if (replacement!=nsource)
              sources.put(replacement, nsource);
          } else {
            sources.put(replacement, source);
          }
View Full Code Here


   * Returns the source of the the given descendant of this.node.
   * @requires n in this.node.*components
   * @return this.source[n]
   */
  public final Node sourceOf(Node n) {
    final Node d = source.get(n);
    return d==null ? n : d;
  }
View Full Code Here

    if (options.logTranslation()>0) {
      final Map<Node,Node> source = new IdentityHashMap<Node,Node>();
      final Skolemizer r = new Skolemizer(annotated, bounds, options) {
        protected Formula source(Formula f, Node n) {
          //System.out.println("logging " + f + " <-- " + n);
          final Node nsource = annotated.sourceOf(n);
          if (f!=nsource) source.put(f, nsource);
          return f;
        }
      };
      final Formula f = annotated.node().accept(r);
View Full Code Here

    annotated.node().accept(flat);
    final List<Formula> roots = new ArrayList<Formula>(flat.conjuncts.size());
    roots.addAll(flat.conjuncts.keySet());
    for(Iterator<Map.Entry<Formula,Node>> itr = flat.conjuncts.entrySet().iterator(); itr.hasNext(); ) {
      final Map.Entry<Formula, Node> entry = itr.next();
      final Node source = annotated.sourceOf(entry.getValue());
      if (entry.getKey()==source)   { itr.remove(); }
      else               { entry.setValue(source); }
    }
    return AnnotatedNode.annotate(Formula.and(roots), flat.conjuncts);
  }
View Full Code Here

    annotated.node().accept(this);
    final List<Formula> roots = new ArrayList<Formula>(conjuncts.size());
    roots.addAll(conjuncts.keySet());
    for(Iterator<Map.Entry<Formula,Node>> itr = conjuncts.entrySet().iterator(); itr.hasNext(); ) {
      final Map.Entry<Formula, Node> entry = itr.next();
      final Node source = annotated.sourceOf(entry.getValue());
      if (entry.getKey()==source)   { itr.remove(); }
      else               { entry.setValue(source); }
    }
    return AnnotatedNode.annotate(Formula.and(roots), conjuncts);
  }
View Full Code Here

TOP

Related Classes of kodkod.ast.Node

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.