In paper [10], we have given a detailed discussion on how to describe, synthesize and simulate a digital system using functional hardware description language. In this paper a further study of the algebraic properties of the language will be presented and the digital system will be optimized by program transformation. In this way, we can get a correct and optimized logic structure which has no redundancy and reuses each common component to the great extent. Some rules and algorithms of transformation and some examples are given to illustrate this new method.