Exemple #1
0
decision_proceduret::resultt dplib_dect::read_dplib_result()
{
  std::ifstream in(temp_result_filename.c_str());

  std::string line;

  while(std::getline(in, line))
  {
    if(has_prefix(line, "Invalid."))
    {
      dplib_prop.reset_assignment();

      while(std::getline(in, line))
      {
        if(has_prefix(line, "ASSERT "))
          read_assert(in, line);
      }

      return D_SATISFIABLE;
    }
    else if(has_prefix(line, "Valid."))
      return D_UNSATISFIABLE;
  }

  error("Unexpected result from CVC-Lite");

  return D_ERROR;
}
Exemple #2
0
decision_proceduret::resultt cvc_dect::read_cvcl_result()
{
  std::ifstream in(temp_result_filename.c_str());
  
  std::string line;
  
  while(std::getline(in, line))
  {
    if(has_prefix(line, "Invalid."))
    {
      boolean_assignment.clear();
      boolean_assignment.resize(no_boolean_variables);
    
      while(std::getline(in, line))
      {
        if(has_prefix(line, "ASSERT "))
          read_assert(in, line);
      }
      
      return D_SATISFIABLE;
    }
    else if(has_prefix(line, "Valid."))
      return D_UNSATISFIABLE;
  }
  
  error() << "Unexpected result from CVC-Lite" << eom;
  
  return D_ERROR;
}
Exemple #3
0
AST_stmt* readASTStmt(BufferedReader* reader) {
    uint8_t type = reader->readByte();
    if (VERBOSITY("parsing") >= 2)
        printf("type = %d\n", type);
    if (type == 0)
        return NULL;

    uint8_t checkbyte = reader->readByte();
    assert(checkbyte == 0xae);

    switch (type) {
        case AST_TYPE::Assert:
            return read_assert(reader);
        case AST_TYPE::Assign:
            return read_assign(reader);
        case AST_TYPE::AugAssign:
            return read_augassign(reader);
        case AST_TYPE::Break:
            return read_break(reader);
        case AST_TYPE::ClassDef:
            return read_classdef(reader);
        case AST_TYPE::Continue:
            return read_continue(reader);
        case AST_TYPE::Delete:
            return read_delete(reader);
        case AST_TYPE::Expr:
            return read_expr(reader);
        case AST_TYPE::For:
            return read_for(reader);
        case AST_TYPE::FunctionDef:
            return read_functiondef(reader);
        case AST_TYPE::Global:
            return read_global(reader);
        case AST_TYPE::If:
            return read_if(reader);
        case AST_TYPE::Import:
            return read_import(reader);
        case AST_TYPE::ImportFrom:
            return read_importfrom(reader);
        case AST_TYPE::Pass:
            return read_pass(reader);
        case AST_TYPE::Print:
            return read_print(reader);
        case AST_TYPE::Raise:
            return read_raise(reader);
        case AST_TYPE::Return:
            return read_return(reader);
        case AST_TYPE::TryExcept:
            return read_tryexcept(reader);
        case AST_TYPE::TryFinally:
            return read_tryfinally(reader);
        case AST_TYPE::While:
            return read_while(reader);
        case AST_TYPE::With:
            return read_with(reader);
        default:
            fprintf(stderr, "Unknown stmt node type (parser.cpp:" STRINGIFY(__LINE__) "): %d\n", type);
            exit(1);
            break;
    }
}