Exemplo n.º 1
0
 @Override
 public IResponse execute(ISolver solver) {
   SMT.Configuration smtConfig = solver.smt();
   if (!(solver instanceof Solver_test)) {
     return smtConfig.responseFactory.error(
         "This kind of solver (" + solver.getClass() + ") is not able to execute a what command",
         null);
   }
   IPrinter printer = smtConfig.defaultPrinter;
   SymbolTable symTable = ((Solver_test) solver).symTable;
   Iterator<IIdentifier> iter = ids().iterator();
   if (!iter.hasNext()) {
     // No arguments - print everything in the symbol table
     SymbolTable.Iterator symiter = symTable.iterator();
     while (symiter.hasNext()) {
       SymbolTable.Entry n = symiter.next();
       smtConfig.log.logOut(printer.toString(n.name) + " : " + printer.toString(n.sort));
     }
   } else {
     while (iter.hasNext()) {
       IIdentifier s = iter.next();
       ISort.IDefinition sortDef = symTable.lookupSort(s);
       if (sortDef != null)
         smtConfig.log.logOut(printer.toString(s) + " : " + printer.toString(sortDef));
       else {
         Map<Integer, List<SymbolTable.Entry>> map = symTable.lookup(s);
         if (map != null && map.size() != 0) {
           for (List<SymbolTable.Entry> entrylist : map.values()) {
             for (SymbolTable.Entry entry : entrylist) {
               smtConfig.log.logOut(printer.toString(s) + " : " + printer.toString(entry.sort));
             }
           }
         } else {
           smtConfig.log.logOut(printer.toString(s) + " : -no entry- ");
         }
       }
     }
   }
   return smtConfig.responseFactory.success();
 }
Exemplo n.º 2
0
 @Override
 public IResponse execute(ISolver solver) {
   return solver.declare_fun(this);
 }
Exemplo n.º 3
0
 @Override
 public IResponse execute(ISolver solver) {
   return solver.assertExpr(formula);
 }