#NEWLINE# def const_additive_cancellation( self , x_name , y_value , output_type ) : #NEWLINE# #INDENT# '\n    Return a single variable in situations like \n      x = prev_var + const \n      y = x + (- const) \n    ' #NEWLINE# if ( x_name in self . known_offsets ) : #NEWLINE# #INDENT# for ( prev_var_name , offset ) in self . known_offsets [ x_name ] : #NEWLINE# #INDENT# if ( prev_var_name in self . seen_binding ) : #NEWLINE# #INDENT# if ( offset == ( - y_value ) ) : #NEWLINE# #INDENT# prev_type = self . fn . type_env [ prev_var_name ] #NEWLINE# prev_var = Var ( name = prev_var_name , type = prev_type ) #NEWLINE# return self . cast ( prev_var , output_type )