A novel approach for automating the functional design of digital systems is presented. Given a set of behavioral specifications, the objective is to produce an optimal functional design which minimizes certain design criteria. One distinct feature of this approach is adding the step of function minimization: i. e. , the abstraction of the primitive operations into a set of functions that generates the desired behavior attempts to minimize the cost of that set according to the design criteria. For this purpose, it is important to have a powerful search strategy which will lead to a near-optimal solution in a reasonable time. The authors have adopted best-first search as the general framework, and developed several domain-specific heuristic functions which control the search process. Preliminary experimental results are reported.