Aug 042010
 
No Gravatar

Lawyers have successfully managed to argue that computer programs are not mathematics and thus should not be covered by the exclusion of mathematics from patentable material. This comes from a deep misunderstanding of how computers really work – particularly as implementations of a universal turing machine. Some great papers on this have been written – including this one at groklaw. That explains in detail how computers really work and why all computer programs are simply mathematical functions – and even why all mathematical functions are really just numbers.

A great quote from it is this one: “Programming a computer is, essentially, just discovering a number that suits the programmers wishes”.

The thing is – for somebody whose only understanding of computation theory is even that paper- this will seem like a bit of a leap. After all the process of writing code is creative, involves design and innovative thinking – surely this wonderful process cannot just be “discovering a number” – after all – you can do that just by counting – this is WHY it’s unpatentable…

What I want to do with this post is to – very simply – explain why that really is true. I’m going to give you a very simple computer program. I’ll write it in pseudocode so non-programmers can read it, but it can be implemented easily in any programming language and run – and in most of them will take less than about 10 lines of code to do:


Make the vairable X equal to 0;
Start a loop here:
Write the binary representation of X into a new file.
increase X by 1
continue the above loop until the program is interrupted by deliberately killing it (an infinite loop);

With this simple program – I can create an exact copy of every single program ever written and – this is important – every single program that CAN ever be written.
This is because any compiled program becomes a file filled with zeros and ones – to a computer, that’s just a big number (the whole computation theory and lambda calculus etc. that explains how a number can BE an algorithm is needed to know how this happens – but the important thing is – it’s a number). This program will store every number that can exist into a file – by just counting.

The process is very ineffective for a few reasons: firstly almost every program it produces won’t run, the vast majority of numbers do not correspond to useful programs – in fact only an incredibly small subset of them do – but they are still numbers you can count to, and they are still numbers my program WILL produce. Secondly there is no real way to determine the useful programs from the ones that aren’t- you have to manually try to run all of them – and see for yourself what happens. More-over for every program in there, you’ll produce thousands of copies – some that will only run on other computers than yours. But somewhere in there will be a full version of Microsoft OutLook that can run on your computer… if you run it long enough at least.
Another inefficiency is that it creates every program as one self-sustained entity – as it ends up in memory, but programs aren’t sold like that. Programs have many parts that are identical between them (just like the number 105 and the number 316 both contain the number 1 – just one a much bigger scale) – it’s smart to store these in separate files so multiple programs can use them – it saves disk space, but it doesn’t change the number that actually goes into memory when it is run, it merely stores it more efficiently by avoiding replication.

The process is fully doable however, it would take a massive amount of time to discover just the subset of numbers that correspond to a runnable program – let alone the ones inside that do anything useful – and of course since you’ll also be generating every virus program ever – the process is likely to be rather harmful to your computer.

So indeed, you CAN discover every computer program ever written, and every computer program that WILL ever be written just by counting – just like you can do any multiplication sum by adding up numbers repeatedly. But it’s a very crude an ineffective way of doing it, learning multiplication saves a lot of time and effort for the same result, but even though it’s a faster process- ultimately it is STILL just adding up repeatedly.
Programming in the end is a technique whereby we can very efficiently narrow down onto the numbers that are truly useful, we use principles of engineering and mathematics to skip the addition and multiply directly as it were – going straight to the number we are looking for. In fact it’s not a perfect process – that’s why all programs have bugs – we don’t get to exactly the perfect number for the program we want – we get to a number that’s so close however as to make no difference. Somewhere in there is the number that will be the perfect bug-free version of the program. The counting way could find it (but will be hardpressed proving it did) but the programming methods won’t – the closer you get the harder it gets to narrow down, the very same things that make programming a much more efficient way than counting to find useful software, also makes it’s results slightly less perfect. It’s sort of like calculating the value of Pi, the longer you go on – the more accurate your answer becomes but you never quite get there and the cost of one more digit of accuracy must eventually be higher than the value of having it.

So there you have it – not only is every program a number – they are all simple integer numbers that can be counted, and all the great skill and artifice of the programmer is really just a much more efficient way of finding the number we want – rather than counting through them all and checking if it is the one we want (which could take centuries to be honest).

You cannot ask for a more simple piece of proof that a program is in fact a number – that software is discovered rather than invented. The fact that we have very effective methods of discovering them does not change this and doesn’t change that you should not be able to patent numbers.

I still highly recommend reading the article I linked – especially if you are a lawyer or activist involved in the software patent field as it explains the underlying theories very clearly. Effectively it tells you how it came to BE that these numbers are useful, and how we derive their particular useful meaning from them. That process of derivation is what computer hardware does, and a better tool to do that with is patentable (which is why you should indeed be able to get patents on computer hardware), but go in with this basic understanding. That every computer program really is just a number, that those numbers can be reached by simple counting – I’ve proven this to you here, and all of computer programming – as wonderful and delicious and artistic a field of endeavor as it is – is really in the end – just a faster way to count to a number that we like.
This does not reduce from programming any of it’s artifice, if anything it adds to the merit of the field because the processes by which we count are complex and fantastic and beautiful and we are always looking at ways to count even more effectively so we invent new programming languages and ideas like agile programming to help us do it even better – but in the end, the results is just a number that anybody could have counted to – and that is NOT an invention you can patent.

UPDATE: Something I didn’t make clear above but which is important – is that you will generate not only every program that can exist but every FILE that can exist. This includes for example if you read them all as .jpg – every digital photograph – photoshop’d or not that can be taken. A digital camera is just a very efficient way to get to the number that represents a picture – it’s still art. Photoshop is a way to manipulate that same number with small algebraic changes to get to one very near it, but slightly different – it’s still art. This is why I say that this reality doesn’t reduce programming’s artistic and creative status. If you read them all – every text file that can exist is in there too, from the bible to Shakespeare’s Macbeth. But it also includes about a million numbers right NEXT to the one with Shakespeare’s Macbeth which differ only in that an A on line 6000 has been replaced by a Z for example. Again – authors seem to be real artists for finding the “magic number” without counting and checking every possible variation – indeed for doing so long before we had the mathematical knowhow to turn something like MacBeth into a number and back again. The PDF versions are in there too. Every music file, the mp3 compressed ones and otherwise. Every news report and every youtube video will get generated.
It will also be damn near impossible to find anything in there by looking manually – you’d have to study each number just to figure out if you should run it, try to boot it or open it in a video player ! What’s worse there’s real CPU specific stuff in this approach – the 64-bit version of outlook will be a very different (literally – an order of magnitude different) number from the 32-bit version of the same program.
The nice thing is that if you find the right source* file number, you can generate all the possible binary file numbers from it. You’d need to wade through a few thousand ones just like with MacBeth that are almost but not quite right – except for one altered or missing character somewhere.
So programmers focus on finding the the magic number for the file with the source code – because find that one, and you can jump straight to any of the executables magic numbers with a single calculation which we call “compiling” . See what I mean by “a much more efficient way to count to a useful number” ?

*Text files, executable, source code, pdf’s all files in fact are saved as just one gigantic number on a computer. The computer just follows a set of rules to make sense of them. The exact rules differ between architectures – on an 8-bit computer if you tell it that the file is “text” it will read every 8 digits, take that as a number by itself and find a corresponding letter from a chart (known as the ascii set), on 32-bit and higher computers it reads more – and can refer to longer and more complete charts like unicode – but ultimately – what gets saved on the disk is still just one big number. Here-in lies the secret to what lets the “universal Turing machine” actually work – software is data.

  • hartz

    Your argument is technically correct but irrelevant for 2 reasons, and a honorable mention 3rd reason.

    1. You ignore the fact that no method of “discovering a number that equates to a usefull program” will ever be able to solve a specific problem. The problem is that computers will NEVER be fast enough to itterate through the infinite number space that equates usefull programs to be able to find out which one equates the one you need to solve a problem. This is even ignoring the fact that the vast majority of all existing numbers do not represent working programs on any computer. So even if you could effectively eliminate all the useless numbers, you are still left with an infinite number of numbers, of which you need to find one which equates the solution to a specific problem.

    You have limited time in which a specific problem is solvable, after which it becomes obsolete. You also have limited time during which to investigate this, absolutely governed by your biologicall body deteriorating as it gets older. If ever we ascend this would become a moot point.

    Thus the only way to produce a usefull program remains to write a program as a sequence of instructions and to then translate this into computer code.

    2. My time, as is yours, is worth something to me. I need to exchange my time for currency so that I can eat, feed my family, build a legacy for my children, pay for goods and services, etc. I want to protect my efforts. If I spend any amount of time writing a program, then it is my right to protect my effort, otherwise I will not be able to sell my product and at the end my time will become worthless.

    If you do not allow organizations or persons to sell their effort then you remove their motivation to put the effort in, which in turn will effect that people will stop producing programs/goods/art.

    3. Interpreting an artwork as a number because it is possible to do so does not make it valuable. The same can be said for everything ever produced by man, merely by looking at its composition and then interpreting it “as a number”. Thus either you have to argue that nothing ever is patentable, or that the argument is invalid that being able to represent something as a number makes it unpatentable. Point nr 2 appies to all things made by man, not just computer programs. A Photo remains a photo, the art in it remains art, even though it can be deconstructed and represented as a number. A formula (computer program) remains a formula, no matter that you can represent it as a number.

    Patents are there specifically to protect investment. This encourages more investment (time, money, effort, etc), which affects progress. In conclusion, while you could argue that a program (or the formula to build a car, or your DNA, or …. ) is just a number, you have to conclude that the law that state that a number is not patentable must be flawed, or that the argument is irrelevant, possibly due to the sparseness of usefull computer program numbers among the spread of all numbers.

    The only other possible argument have to be that all computer programmers are altruistic benefactors who have no need to sell their efforts to be able to make a living, and this is clearly not true!

  • http://silentcoder.co.za silentcoder

    >1. You ignore the fact that no method of “discovering a number that equates to a usefull program” will ever be able to solve a specific problem. The problem is that computers will NEVER be fast enough to itterate through the infinite number space that equates usefull programs to be able to find out which one equates the one you need to solve a problem. This is even ignoring the fact that the vast majority of all existing numbers do not represent working programs on any computer. So even if you could effectively eliminate all the useless numbers, you are still left with an infinite number of numbers, of which you need to find one which equates the solution to a specific problem.

    I did not ignore this – I specifically stated that doing so via iteration would be a stupidly impractical way of doing it – and that programming is, instead, a practical solution driven way of doing it – but what you are doing has the exact same end result – with the advantage that you can actually finish the job.

    Let’s take another example of a useful number. Say – my height. I could go and cut lengths of wood of every length in milimeters up to about 10 meters and stick each next to me one after the other until I find one that’s the same – counting through each number in that series until I find the useful one that equates to “my height”.
    But that would be a stupid way to do it. Instead I can use my knowledge of what constitutes this useful number – to go there via a much shorter route, by taking a measuring tape with the possibilities and pulling it out until it’s the same height as me and reading the number there.
    The first is an iterative approach, the latter is a sollution driven approach – but both give the exact same number. Programming is merely a solution driven approach to finding a number that can do a useful task on a computer – like I said, a much more effective way of discovering that number than by counting.

    >2. My time, as is yours, is worth something to me. I need to exchange my time for currency so that I can eat, feed my family, build a legacy for my children, pay for goods and services, etc. I want to protect my efforts. If I spend any amount of time writing a program, then it is my right to protect my effort, otherwise I will not be able to sell my product and at the end my time will become worthless.

    Nothing I said had anything to do with THIS debate. I spoke about patent law, not reimbursement for labour. As it is software falls under copyright. Nothing else is covered by BOTH copyright and patents- why should software be the exception to this rule ? It makes no sense.
    As it is – you live in a country where software patents ARE illegal – this information is written for people trying to keep it that way. I don’t see the lack of legal software patents harming either our incomes – nor doing any harm to either the local or the international software companies doing business here.
    That said – there are right now creative industries with NEITHER copyright nor patent protection that are making fortunes. Fashion design is one. Under international law fashion designs cannot be patented and receive no copyright protection. Fashion designers get rich anyway. They just had to convince people that buying an ORIGINAL Louis Vitton is better than buying a cheaper reproduction. It’s clearly POSSIBLE.
    This may not be the ideal way for software – but to claim it’s impossible is to ignore the fact that industries are doing so successfully and have been for hundreds of years.

    >3. Interpreting an artwork as a number because it is possible to do so does not make it valuable. The same can be said for everything ever produced by man, merely by looking at its composition and then interpreting it “as a number”. Thus either you have to argue that nothing ever is patentable, or that the argument is invalid that being able to represent something as a number makes it unpatentable. Point nr 2 appies to all things made by man, not just computer programs. A Photo remains a photo, the art in it remains art, even though it can be deconstructed and represented as a number. A formula (computer program) remains a formula, no matter that you can represent it as a number.

    I am making neither of those arguments. Artwork isn’t patentable ANYWAY. Only inventions are. The ability to represent an invention as a number does not make it unpatentable – but patents are supposed to only apply to physical and real things. You can use a number to represent information about such a thing, but not the thing iself. Either way software is not represented BY a number – it IS the number.
    All the other things are ways to represent the number – the number does not represent the source code, it’s the other way around. Having a way to come up with a number does not make the number itself patentable. By that logic the first cassio calculator that could do a sum not done by a human before would be able to patent the answers !

    >Patents are there specifically to protect investment. This encourages more investment (time, money, effort, etc), which affects progress. In conclusion, while you could argue that a program (or the formula to build a car, or your DNA, or …. ) is just a number, you have to conclude that the law that state that a number is not patentable must be flawed, or that the argument is irrelevant, possibly due to the sparseness of usefull computer program numbers among the spread of all numbers.

    Patents are not encouraging investment – they are massively failing. It’s also not an ARGUMENT that numbers are unpatentable – it’s international law. And for damn good reason. You also cannot patent a natural law, even if you ARE the first to discover it. Build a new machine that works with it – and you can patent that machine. Software patents is a net drain on the entire software industry – free (beer), free (speech), commercial (free speech) and commercial (proprietory) all lose because of it. It turns development into a lottery – and the only way to WIN the lottery is to have millions of tickets. The companies that HAVE thousands and thousands of patents – they win and even they have public stated (IBM – the largest patent holder in the world said this in an official press release) that they make NO money out of patents – all it does is give them protection against patent lawsuits by OTHER companies who ALSO make no money. Every piece of software ever written violates patents, no exceptions – the very nature of software makes it mathematically impossible to write anything beyond “hello world” without violating patents.
    So what happens – microsoft says to IBM “you are violating this patent with AIX” – IBM says “well you’re violating THESE patents with windows – let’s cross-license and save ourselves the costs of 5000 lawsuits”.
    That’s the totality of value the BIG boys get out of it, the little guys ? They only ever lose.

    >The only other possible argument have to be that all computer programmers are altruistic benefactors who have no need to sell their efforts to be able to make a living, and this is clearly not true!

    Nope – I am in favor of a profitable software industry – I’m opposed to patents because they reduce the possibility of programmers to earn a living. By a huge margin – and it’s the worst for those programmers not working for one of the 10 or so major corporations – that is 90% of them, who work in small companies or for themselves. The only people who earn a living out of software patents are lawyers, programmers just pay that living and never share it.
    Copyright and patents are not the same thing, and are not related. There is copyright protection on software as works of art and craft, just as there is on movies. You can represent a movie with a number but that doesn’t take away it’s copyright, nor does it on software.
    I do believe copyright on software does not give users enough rights and my feelings on this is well known – but that is irellevent to THIS post. This post is about patents. Nobody makes their living out of software patents. Even then – I did write software for a living for a long time – as my own boss, and I did it all under the GPL, I charged for my time when adding features. This made me quite enough to live on – I chose a salaried job for security, not because that model didn’t work wonderfully.
    Copyright can be useful thought it needs reform to be ideal. But it’s another matter altogether – it has a completely different legal history and is completely unrelated to patent law- the two literally have almost nothing in common (copyrights are automatic, patents have to be applied for and can be denied. Copyright has fair-use exceptions, patents do not – you get the idea) and this is purely about patents, not copyrights.
    We may not agree on what copyright reforms are needed, but there is no reason we cannot agree that patents should be abholished for software- because NO programmers actually benefit from it.

  • hartz

    OK, this I agree with, and yes I mistakenly ignored the distinction between copyright and patents.

    Your response to my post reads much more sensibly than the blog post do.

  • http://silentcoder.co.za silentcoder

    Well that’s one benefit of a comment system – be debating points I can determine things I was unclear about and clarify those points – leading to a better collective piece of information than I could have done by myself.

  • pygorex1

    This argument – that all computer programs are just very long numbers and therefore should remain un-patentable – is silly.

    The counting program hypothesized would not only generate every possible computer program, work of art, book, etc. written. It would also generate every patentable idea that currently exists or might possibly exist. Let’s say I create radically new and advanced silicon chip design. This design will be enumerated by the counting program. Should this enumeration invalidate any patent I might seek for my design?

  • lous39

    You say that a program is a number and numbers are not patentable (both true) but in fact you can;t copyright a number either, but I assume you would like to copyright software, if only to be able to use GPL. So your analysis is not complete. Why should you be able to copyright a program if it is a number?

  • http://silentcoder.co.za silentcoder

    @pygorex – I addressed your question in both the article AND the comments. There is a crucial difference – I can enumerate a photo as a number, but the real image still exists. A computer program is not an enumerated idea. It IS the number itself. There is nothing else.
    Quite frankly Donald Knuth knows a LOT more about programs than you do – and this argument is directly derived from HIS arguments as he stated them as an expert witness for the U.S. Supreme Court.
    Even if you claim that the “number” is just a representation and a program is a computational function – well computational functions are mathematics too. You can’t patent Phytagoras’ law, even if you discovered a new law like that – it would be unpatentable – that same goes for software.

    @Lous39 – I would prefer it if they weren’t copyrightable in fact. If software never had copyright – then frankly we wouldn’t have ever NEEDED the GPL and shipping as anything BUT source would be stupid. Having said that – in fact you can copyright a number to a limited extent. That is because unlike patents, copyright does not deal with what things really are – but with what they MEAN. Numbers can have specific meanings in specific contents – and people can and do sometimes copyright new such meanings when they come up with them. But then it’s copyright only on the meaning of the number in that context – you can still use the number as a number in any other way you want.
    When I discover that a certain number has a specific meaning on a computer that equates to a useful program, I get copyright on that meaning – not on any other uses the number may have. Since we’re not dealing here with how copyright law should be but with how it is- the fact is that there is no legal problem with copyrighting software.
    There is a major legal issue with patenting it – not lease because absolutely nothing else can be both copyrighted AND patented. That just shows how confusing legal experts find software as they don’t understand what it really is. Is it an invention or a creative work ? I say it’s certainly the latter, and never the former.
    You still forget that in the MAJORITY of the world’s countries software is specifically excluded from patentable material and their software industries are doing just fine. In fact they have a major edge because of it. I can register a software patent in the USA, and then sue IBM for violating it, and unlike US companies they could never say “but your code violates OUR patents let’s cross-license” – because my patent is valid in their country, but theirs is not valid in mine.
    This is why the US is putting pressure on other countries to follow in their folly with allowing software patents – because the U.S. companies hate the idea of giving foreign competitors an edge, and the lawyers who have power within them cannot countenance the much smarter idea of lobying for having it abolished locally rather (which solves the same problem – but means they give up their vast portfolio’s – those portfolio’s may be worthless to the company even now, but they sure do make the lawyers rich).
    There have been several studies btw. that proved that in any given economy – barring international trade pressure – the abolition of the ENTIRE patent system would be a nett economic benefit to the country. I’d settle for at least limiting patents to it’s rightful domain – which software is decidedly outside of.
    The fact is that there are creative industries that have neither patent nor copyright protection and never will because international law states it would be a violation of human rights to give them either – and those industries are nevertheless making fortunes and have been for a very long time. I even gave you an example in the article.

    Copyright and patents are two possible forms of rewarding the creation of new products (I am in favor of that as I believe it’s good for society to do so) but they are by no means the ONLY ways of doing so, there are other ways- and they are probably better when it comes to software.
    In the end though – the crucial point here is the one that shouldn’t be contentious. Software patents are a nett drain on the incomes of every software author. It is provable FACT that it is impossible in the USA today to write ANY non-trivial program without violating multiple patents. A law it is impossible not to break while going about a lawful occupation is ipso-facto a bad law.

    I like living in a country where software patents are illegal, working for a software company – I WANT to continue to live in a country which does not subject my employers to this legal minefield and it’s massive related overhead costs, the money we don’t spend on lawyers = more profit = higher increases = more money in my pocket.
    I will continue to advocate – using solid, verifiable, provable facts – that this happy state of affairs continue in my country, and that other countries which have lost it work towards it’s restoration.