Package kodkod.ast.visitor

Examples of kodkod.ast.visitor.AbstractReplacer


   * @return an annotated formula f such that f.node is equivalent to annotated.node
   * with its <tt>truePreds</tt> replaced with the constant formula TRUE and the remaining
   * predicates replaced with equivalent constraints.
   */
  private AnnotatedNode<Formula> inlinePredicates(final AnnotatedNode<Formula> annotated, final Set<RelationPredicate> truePreds) {
    final AbstractReplacer inliner = new AbstractReplacer(annotated.sharedNodes()) {
      public Formula visit(RelationPredicate pred) {
        Formula ret = lookup(pred);
        if (ret!=null) return ret;
        return truePreds.contains(pred) ? cache(pred, Formula.TRUE) : cache(pred, pred.toConstraints());
      }
View Full Code Here


   * with its <tt>simplified</tt> predicates replaced with their corresponding Formulas and the remaining
   * predicates replaced with equivalent constraints.
   */
  private AnnotatedNode<Formula> inlinePredicates(final AnnotatedNode<Formula> annotated, final Map<RelationPredicate,Formula> simplified) {
    final Map<Node,Node> sources = new IdentityHashMap<Node,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);
View Full Code Here

TOP

Related Classes of kodkod.ast.visitor.AbstractReplacer

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.