/** * Initializes the circular sequence parameters and data structures required to create a user-specified replacement policy */ void readCseq3(int vNRU) { int i,j; NRU = vNRU; prob_init(); mAssoc = nassoc * 3; poly_coefficient = malloc((mAssoc+1)*sizeof(double)); stat_poly_coefficient = malloc((mAssoc+1)*sizeof(double)); for (i=0;i<mAssoc+1;i++) poly_coefficient[i]= malloc(MAX_NX * sizeof(double)); for (i=0;i<mAssoc+1;i++) stat_poly_coefficient[i]=malloc(MAX_NX * sizeof(double)); for (i=0;i<mAssoc+1;i++) for (j=0;j<MAX_NX;j++) poly_coefficient[i][j]=0; }
void start_ltsmin(void) { prob_client_t pc = prob_client_create(); ProBInitialResponse initial_resp = prob_init(pc, 0); // Some Demo code /* Get the successors of the initial state. DA$init_state is the transition group representing the initialization. The prototype does initializing and constant setup in one step. I don't know how LTSmin handles this, but DA$init_state is always the only transition group that is possible in the initial state and it is never possible to execute DA$init_state in any other state. ProB automatically adds it as the first transition group. */ int nr_successors; ProBState *successors = prob_next_state(pc, initial_resp.initial_state, "DA$init_state", &nr_successors); prob_destroy_initial_response(&initial_resp); // Send a get label request using the last state of the previous request ProBState foo = successors[nr_successors - 1]; // DAinvariant is hard wired because I am too lazy to store it in the init code. // However, ProB does send the state label. int val = prob_get_state_label(pc, foo, "DAinvariant"); printf("Result: %d\n", val); prob_terminate(pc); // Cleanup int i; for (i = 0; i < nr_successors; i++) { prob_destroy_state(&(successors[i])); } RTfree(successors); prob_client_destroy(pc); }