Forty years ago this week, in the case of Parker v. Flook, the US Supreme Court came close to banning software patents. "The court said, 'Well, software is just math; you can't patent math,'" said Stanford legal scholar Mark Lemley. As a result, "It was close to impossible in the 1970s to get software patents."

If the courts had faithfully applied the principles behind the Flook ruling over the last 40 years, there would be far fewer software patents on the books today. But that's not how things turned out. By 2000, other US courts had dismantled meaningful limits on patenting software—a situation exemplified by Amazon's infamous 1999 patent on the concept of shopping with one click. Software patents proliferated, and patent trolls became a serious problem.

But the pendulum eventually swung the other way. A landmark 2014 Supreme Court decision called CLS Bank v. Alice—which also marks its anniversary this week—set off an earthquake in the software patent world. In the first three years after Alice, the Federal Circuit Court, which hears all patent law appeals, rejected 92.3 percent of the patents challenged under the Alice precedent.

The shifting rules about software patentability reflect a long-running tug of war between the Supreme Court and the Federal Circuit. The Federal Circuit loves software patents; the Supreme Court is more skeptical.

That fight continues today. While the Federal Circuit has invalidated many software patents in the four years since the Alice ruling, it also seems to be looking for legal theories that could justify more software patents. Only continued vigilance from the Supreme Court is likely to ensure things don't get out of hand again.

The 40-year-old Flook ruling remains a key weapon in the Supreme Court's arsenal. It's the court's strongest statement against patenting software. And, while software patent supporters aren't happy about it, it's still the law of the land.

The banhammer?

In the mid-1970s, Dale Flook applied for a patent on the concept of using a computer to monitor a process of catalytic conversion of hydrocarbons. Software would trigger an alarm if the temperature, pressure, or other variables got out of control.

"Fixed alarm limits may be appropriate for a steady operation, but during transient operating situations, such as startup, it may be necessary to update the alarm limits periodically," the Supreme Court explained in its 1978 ruling. Flook's patent provided a specific formula for updating the "alarm limit" that determined when an alarm would sound.

But the Supreme Court concluded that Flook's invention was not eligible for a patent. "The patent application does not purport to explain how to select the appropriate margin of safety, the weighting factor, or any of the other variables," the court wrote. "All that it provides is a formula for computing an updated alarm limit."

And that was a problem because the Supreme Court had previously ruled that mathematical formulas couldn't be patented. In the 1972 case of Gottschalk v. Benson, the high court rejected a patent on a method for converting numbers from conventional binary format to a binary-coded decimal format.

"Reasoning that an algorithm, or mathematical formula, is like a law of nature, Benson applied the established rule that a law of nature cannot be the subject of a patent," the court wrote in the Flook decision.

Dale Flook argued that his patent was different because he had combined a computer program with a real-world industrial application. But the Supreme Court found this reasoning unpersuasive.

"The notion that post-solution activity, no matter how conventional and obvious in itself, can transform an unpatentable principle into a patentable process exalts form over substance," the court wrote. "The Pythagorean theorem would not have been patentable, or partially patentable, because a patent application contained a final step indicating that the formula, when solved, could be usefully applied to existing surveying techniques."

There's an important ambiguity in the Benson and Flook decisions. They talk about algorithms and mathematical formulas, not about software or computer programs. If you treat "algorithm" and "computer program" as synonymous, then these two decisions amount to a flat ban on patenting software.

It's not clear if this is what the Supreme Court had in mind. Later rulings from lower courts tried to draw a distinction between mathematical algorithms on the one hand and algorithms that manipulate more "concrete" types of data, like audio or video, on the other. Other rulings have suggested that software techniques for improving computer performance are patentable.

Yet in both the Benson and Flook cases, the Supreme Court suggested that it was up to Congress, not the courts, to extend patent protection to software. And Berkeley legal scholar Pam Samuelson points out that the Supreme Court's Benson ruling cited a 1966 report by a presidential commission recommending that software not be eligible for patent protection.

In 1981, the Supreme Court decided a third case on software patentability: Diamond v. Diehr. The high court approved a patent on the idea of using a computer to manage a rubber-curing process, dynamically calculating the optimal time to open the press in order to produce perfectly cured rubber parts.

This ruling is often described as the Supreme Court overruling its prior decisions and opening the door to software patents. But it might be better understood as representing the other side of the Flook coin. Flook's patent was rejected because it merely claimed a mathematical algorithm. The Diehr patent, by contrast, was allowed because it claimed a lot more than just an algorithm.

"The respondents here do not seek to patent a mathematical formula. Instead, they seek patent protection for a process of curing synthetic rubber," the court wrote. "Their process admittedly employs a well-known mathematical equation, but they do not seek to pre-empt the use of that equation."

In other words, rather than reading the Diehr decision as saying that software is patentable, it makes more sense to read it as allowing the patent because it wasn't a software patent.

Still, the Diehr decision did help to crack open the door to more software patents. But it's notable that this 1981 decision was not followed by an avalanche of software patents. Software patenting continued to be a relatively rare phenomenon throughout the 1980s. That would change in the 1990s, however.