def assign(self, var, val, assignment):
oldval = assignment.get(var, None)<EOL>if val != oldval:<EOL><INDENT>if oldval is not None: <EOL><INDENT>self.record_conflict(assignment, var, oldval, -<NUM_LIT:1>)<EOL><DEDENT>self.record_conflict(assignment, var, val, +<NUM_LIT:1>)<EOL>CSP.assign(self, var, val, assignment)<EOL><DEDENT>
Assign var, and keep track of conflicts.