Example #1
0
 @Override
 public Void visit(Bag b, Void _) {
     boolean allCells = true;
     for (Term t : b.getContents()) {
         if (t instanceof Cell
             || t instanceof TermComment) {
             continue;
         } else if (t instanceof Variable) {
             Variable v = (Variable)t;
             if (v.getSort().equals("Bag")) {
                 continue;
             }
         } else if (t instanceof Bracket) {
             Bracket r = (Bracket)t;
             if (r.getContent() instanceof Rewrite
                 && r.getContent().getSort().equals("Bag")) {
                 continue;
             }
         }
         allCells = false;
         break;
     }
     if (allCells) {
         for (Term t : b.getContents()) {
             this.visitNode(t);
         }
     } else {
         assert false;
     }
     return null;
 }
Example #2
0
 public void visitNodeOrKList(Term t) {
     if (t instanceof Bracket) {
         Bracket b = (Bracket)t;
         visitNodeOrKList(b.getContent());
     } else if (t instanceof KList) {
         builder.append("`#klist`(");
         visitNestedKLists((KList)t);
         builder.append(')');
     } else {
         visitNode(t);
     }
 }
Example #3
0
 public Void visit(Bracket b, Void _) {
     // builder.append('(');
     this.visitNode(b.getContent());
     // builder.append(')');
     return null;
 }