#NEWLINE# def visit_fn( self , fn ) : #NEWLINE# #INDENT# assert isinstance ( fn , syntax . TypedFn ) , ( 'Expected typed function, got %s' % fn ) #NEWLINE# self . fn = fn #NEWLINE# self . value_env = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . equivalence_classes = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . known_offsets = OffsetAnalysis ( ) . visit_fn ( fn ) #NEWLINE# arg_types = [ fn . type_env [ name ] for name in fn . arg_names ] #NEWLINE# input_values = shape_from_type . Converter ( ) . from_types ( arg_types ) #NEWLINE# for ( n , v ) in zip ( fn . arg_names , input_values ) : #NEWLINE# #INDENT# self . value_env [ n ] = v #NEWLINE# #UNINDENT# self . visit_block ( fn . body )