deque *state_queue = create();
trans_t *t = NULL;
state_t *tmp_state = (state_t *)malloc(sizeof(state_t));
+ lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
+ //state_t *new_state = (state_t *)malloc(sizeof(state_t));
BDD visited = init->bdd;
BDD new;
tmp_state->bdd = init->bdd;
tmp_state->vars = init->vars;
- tmp_state->lrd = NULL;
+ tmp_state->lrd = lrd;
state_queue = enq(tmp_state, state_queue);
while (isEmpty(state_queue) == 0){
if (check_visited(new, visited, init->vars.varset) == 0){
if (check_goal(new, g->bdd, init->vars.varset) == 0){
lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
- lrd = tmp_state->lrd;
state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ printf("here1\n");
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
+ printf("here2\n");
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'l');
}
else {
printf("GOAL\n");
- lurd_t *lrd = tmp_state->lrd;
- state_t *new_state = NULL;
- new_state = (state_t*)malloc(sizeof(state_t));
+ lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
+ state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'l');
if (check_visited(new, visited, init->vars.varset) == 0){
if (check_goal(new, g->bdd, init->vars.varset) == 0){
lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
- lrd = tmp_state->lrd;
state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'u');
}
else {
printf("GOAL\n");
- lurd_t *lrd = tmp_state->lrd;
- state_t *new_state = NULL;
- new_state = (state_t*)malloc(sizeof(state_t));
+ lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
+ state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'u');
if (new != sylvan_false && new != tmp_state->bdd){
if (check_visited(new, visited, init->vars.varset) == 0){
if (check_goal(new, g->bdd, init->vars.varset) == 0){
+ printf("Here1\n");
lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
- lrd = tmp_state->lrd;
state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
+ printf("Here2\n");
+
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'r');
}
else {
printf("GOAL\n");
- lurd_t *lrd = tmp_state->lrd;
- state_t *new_state = NULL;
- new_state = (state_t*)malloc(sizeof(state_t));
+ lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
+ state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
+
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'r');
if (new != sylvan_false && new != tmp_state->bdd){
if (check_visited(new, visited, init->vars.varset) == 0){
if (check_goal(new, g->bdd, init->vars.varset) == 0){
+
lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
- lrd = tmp_state->lrd;
state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
+
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'd');
}
else {
printf("GOAL\n");
- lurd_t *lrd = tmp_state->lrd;
- state_t *new_state = NULL;
- new_state = (state_t*)malloc(sizeof(state_t));
+ lurd_t *lrd = (lurd_t *)malloc(sizeof(lurd_t));
+ state_t *new_state = (state_t *)malloc(sizeof(state_t));
+ memcpy(lrd, tmp_state->lrd, sizeof(lurd_t));
+
new_state->bdd = new;
new_state->vars = init->vars;
lrd = lappend(lrd, 'd');