#include "basis.h" //preprocess void unit_propagation() { lit uc_lit; int uc_clause; int uc_var; bool uc_sense; int c,v; int i,j; lit cur, cur_c; //while (unitclause_queue_beg_pointer < unitclause_queue_end_pointer) for(unitclause_queue_beg_pointer=0; unitclause_queue_beg_pointer < unitclause_queue_end_pointer; unitclause_queue_beg_pointer++) { uc_lit = unitclause_queue[unitclause_queue_beg_pointer]; uc_var = uc_lit.var_num; uc_sense = uc_lit.sense; if(fix[uc_var]==1) {if(uc_sense!=cur_soln[uc_var])cout<<"c wants to fix a variable twice, forbid."< max_clause_len) max_clause_len = clause_lit_count[c]; else if(clause_lit_count[c] < min_clause_len) min_clause_len = clause_lit_count[c]; } avg_clause_len = (double)formula_len/num_clauses; for (v=1; v<=num_vars; ++v) { if(fix[v]==1) { fix_var_count++; } var_lit[v][var_lit_count[v]].clause_num=-1;//new var_lit boundary } cout<<"c unit propagation fixes "<