Generally, it's very rare for a 'program' to be patented. What usually gets patented is algorithms and frameworks.
From http://www.lawtechjournal.com/notes/2003/10_030727_fagerland...
/* "You can't patent an 'algorithm'" */
Not true. An algorithm, even a mathematical algorithm, is patentable unless (1) it is not sufficiently disclosed to overcome the "abstract idea" exception, or (2) it is executed with no useful application in mind.26 This description of just what an "algorithm" is may be helpful: "Although one may devise a computer algorithm for the Pythagorean theorem, it is the step-by-step process which instructs the computer to solve the theorem which is the algorithm, rather than the theorem itself."27 Under Alappat, the algorithm might be patentable. The theorem itself, being an abstract idea, certainly would not.