コード例 #1
0
ファイル: bst-safe.cpp プロジェクト: ahorn/benchmarks
// Unwind N+1 times
void crv_main() {
  STinit();

  for (crv::Internal<unsigned> i = 0; dfs_checker().BRANCH_CALL(i < N); i = i+1) {
    STinsert(crv::any<Item>());
  }
  STsort(sorter);

  dfs_checker().add_error(!(k == N));
  for (crv::Internal<unsigned> i = 0; dfs_checker().BRANCH_CALL(i < N - 1); i = i+1)
    dfs_checker().add_error(!(a[i] <= a[i+1]));
}
コード例 #2
0
ファイル: proj2.c プロジェクト: edujanicas/Cheques
int main(){

    int valor;
    long int refe, refb, refc, ref;
    char command[CMD_LENGTH] = "";

    STinit(&clientes);
    cheques = QUEUEinit(10);
    scanf("%s",command);

    while(strcmp(command,"sair")){

        if(!strcmp(command,"cheque")){
            scanf("%d%ld%ld%ld",&valor,&refe,&refb,&refc);
            adiciona_cheque(valor,refe,refb,refc);
        }

        else if(!strcmp(command,"processa"))
            processa_cheque();

        else if(!strcmp(command,"processaR")){
            scanf("%ld",&refc);
            processa_cheque_ref(refc);
        }

        else if(!strcmp(command,"infocheque")){
            scanf("%ld",&ref);
            info_cheque(ref);
        }

        else if(!strcmp(command,"infocliente")){
            scanf("%ld",&ref);
            info_cliente(ref);
        }

        else if(!strcmp(command,"info"))
            STsort(clientes, infoCliente);

        else
            printf("ERROR: Unknown command\n");

        scanf("%s",command);
        
    }

    clientes_activos();
    cheques_por_processar();
    STfree(&clientes);

    return 0;
}
コード例 #3
0
ファイル: bst-unsafe.cpp プロジェクト: ahorn/benchmarks
// It suffices to unwind N+1 times where N > 2
int main() {
  STinit();
  nse_make_symbolic(a);

  for (unsigned i = 0; i < N; i++) {
    STinsert(nse_symbolic_item());
  }
  STsort(sorter);

  nse_assert(k == N);
  for (unsigned i = 0; i < N - 1; i++)
    nse_assert(a[i] <= a[i+1]);

  return 0;
}