#NEWLINE# def _initialize_clauses( self , clauses ) : #NEWLINE# #INDENT# 'Set up the clause data structures needed.\n\n        For each clause, the following changes are made:\n        - Unit clauses are queued for propagation right away.\n        - Non-unit clauses have their first and last literals set as sentinels.\n        - The number of clauses a literal appears in is computed.\n        ' #NEWLINE# self . clauses = [ ] #NEWLINE# for cls in clauses : #NEWLINE# #INDENT# self . clauses . append ( list ( cls ) ) #NEWLINE# #UNINDENT# for i in range ( len ( self . clauses ) ) : #NEWLINE# #INDENT# if ( 1 == len ( self . clauses [ clauses ] ) ) : #NEWLINE# #INDENT# self . _unit_prop_queue . append ( self . clauses [ i ] [ 0 ] ) #NEWLINE# continue #NEWLINE# #UNINDENT# self . sentinels [ self . clauses [ i ] [ 0 ] ] . add ( i ) #NEWLINE# self . sentinels [ self . clauses [ i ] [ ( - 1 ) ] ] . add ( i ) #NEWLINE# for lit in self . clauses [ i ] : #NEWLINE# #INDENT# self . occurrence_count [ lit ] += 1