1. A method for computer program optimization, comprising the steps of: representing machine instructions as respective expression trees having nodes and leaves, said nodes representing operators and said leaves representing machine resources and operations; generating transformed code by converting an input sequence of said machine instructions in a computer program into an input set of said respective expression trees; optimizing said transformed code to define optimized transformed code comprising a modified set of said expression trees; and converting said modified set of said expression trees in said optimized transformed code into an optimized sequence of said machine instructions.