#NEWLINE# def visit_Prim( self , node ) : #NEWLINE# #INDENT# if ( node . fn == 'shape#' ) : #NEWLINE# #INDENT# return array ( int32 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( node . fn == 'mult#' ) : #NEWLINE# #INDENT# tya = self . visit ( node . args [ 0 ] ) #NEWLINE# tyb = self . visit ( node . args [ 1 ] ) #NEWLINE# self . constraints += [ ( tya , tyb ) ] #NEWLINE# return tyb #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( node . fn == 'add#' ) : #NEWLINE# #INDENT# tya = self . visit ( node . args [ 0 ] ) #NEWLINE# tyb = self . visit ( node . args [ 1 ] ) #NEWLINE# self . constraints += [ ( tya , tyb ) ] #NEWLINE# return tyb #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise NotImplementedError