示例#1
0
  /**
   * Builds a scopeless structure definition.
   *
   * @param declaration Definition's declaration
   */
  public StructDefinition(StructDeclaration declaration) {
    super((ScopeNode) null);
    this.declaration = declaration;

    for (String fName : declaration.getFieldsList()) {
      IDeclaration fieldDecl = declaration.getFields().get(fName);
      assert (fieldDecl != null);

      Definition def = fieldDecl.createDefinition();
      this.definitions.put(fName, def);
    }
  }
示例#2
0
 @Override
 public String visit(IExists e) throws IVisitor.VisitorException {
   if (!isFormula) {
     throw new VisitorException(
         "Use of exists in a term position is not yet implemented in the Simplify adapter",
         e.pos()); // FIXME - booleans as terms
   }
   StringBuilder sb = new StringBuilder();
   sb.append("(EXISTS (");
   for (IDeclaration d : e.parameters()) {
     if (d.sort().isBool()) {
       throw new VisitorException(
           "Boolean quantifiers are not implemented in the Simplify adapter",
           e.pos()); // FIXME - booleans as terms
     }
     sb.append(d.accept(this));
     sb.append(" ");
   }
   sb.append(") ");
   sb.append(e.expr().accept(this));
   sb.append(")");
   return sb.toString();
 }
示例#3
0
 @Override
 public String visit(IDeclaration e) throws IVisitor.VisitorException {
   StringBuilder sb = new StringBuilder();
   sb.append(e.parameter().accept(this));
   return sb.toString();
 }