This PR adds the np.where function and the np.convolve function with the "valid" option to the library. It adds some benchmarking cases for testing these functions, and also includes some extra changes for making synthesis work with these functions. These are:
Partial evaluation rules to convert calls of the form np.ones(n) @ i -> 1, and similarly for np.zeros
Equality saturation rewrite rules to add a rewrite between x @ i = 1 -> x @ i = ones(len(x)) @ i
An intermediate value replacement step which will serve to make sure that no expressions containing intermediate values make it into the final synthesized expression. These are the buildExprMap and postprocess functions in the np_synthesis.ml file, and currently they find assignment statements and add a mapping between the length of the variable being assigned to and the length passed into the np.zeros function, if the np.zeros function is used in the assingment statement.
Equality saturation is run on the pattern as well as the target now.
This PR adds the np.where function and the np.convolve function with the "valid" option to the library. It adds some benchmarking cases for testing these functions, and also includes some extra changes for making synthesis work with these functions. These are:
buildExprMap
andpostprocess
functions in thenp_synthesis.ml
file, and currently they find assignment statements and add a mapping between the length of the variable being assigned to and the length passed into the np.zeros function, if the np.zeros function is used in the assingment statement.