Last active
November 17, 2015 04:11
-
-
Save jon-whit/280297ef577a37ae5bec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get a pointer to the literal that needs assignment, if one exists | |
if ((lp = is_unitclause(form->clauses[i], assigned, vals)) != NULL) { | |
// COPY THE LITERAL POINTER | |
lp1 = (literal*) malloc(sizeof(literal)); | |
memcpy(lp1, lp, sizeof(literal)); | |
assert_literal(lp1, vals, assigned); | |
stack_item si = {lp1, i, 0}; | |
// COPY THE STACK ITEM | |
sip = (stack_item*) malloc(sizeof(stack_item)); | |
memcpy(sip, &si, sizeof(stack_item)); | |
push_stack(&s, sip); | |
} | |
void push_stack(stack *sp, stack_item *item) | |
{ | |
if (DEBUG) | |
printf("push (ID) %d (S) %d (G) %d (CI) %d\n", item->lp->id, item->lp->sign, item->guess, item->ci); | |
sp->top++; | |
sp->items[sp->top] = item; | |
sp->size++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment