Suppose you have an arbitrary code base, C, possibly composed of multiple programs, none of which fall under a copyleft license.

Suppose this code, taken together, does the same job as a nice integrated program, A licensed under some copyleft license like the GPL, but that for whatever reason the GPL code is superior (faster, cleaner, less buggy, whatever).

Now suppose that for each feature in C, you find the equivalent feature in A and, through careful step-by-step refactoring, create two chains of patches that converge on a third program, B.

In other words, you can show step by step, via patches, how to derive any of the three programs from any of the others:

A <--> B <--> C

It seems that through this procedure, you have extracted value from A and even created a derived work, but the new work doesn't necessarily resemble A, and there is a clear chain of evidence showing that B was derived from a different code base entirely.

My question is:

Would a "dialectic" implementation like this provide the same legal effect as a traditional "clean room" implementation?

Note: feel free to replace the licenses of A and C with your most and least favorite options, respectively. The question is about the process in general.

  • 4
    By "Escaping the GPL" you mean can I take someone else code and claim it as my own and then sell it. Why not just rephrase the question "How can I get away with stealing code." – James Anderson Aug 8 '13 at 4:32
  • 8
    @JamesAnderson: Because that is not what I'm asking. Please actually read the question. :) If you prefer, imagine I'm asking about improving a GPL project with knowledge gleaned from closed-source code. The FSF had to consider the same questions when creating GNU, unless you believe they stole intellectual property from Bell Labs. – tangentstorm Aug 8 '13 at 4:42


Copyright doesn't work by "if you could". It works by "if you did". If you took C and modified it to get B, you are bound by C's license regardless of how close B is to A. In theory, if you took a 10,000 line GPL file, deleted all but the first line, and wrote arbitrary code after it, you'd still be bound by the GPL. In your initial example, if you create any chain of patches from C to B, you are bound by C's license regardless of what you do with A. What you do with A is completely and utterly irrelevant to the matter.

Note that if you read source to C, walk into another room and type it from memory, you are still creating a derivative work. A "clean room" implementation rests on the people doing the implementing having no direct knowledge of the original. That is, someone reads C, figures out the interfaces, creates a basic design document describing those interfaces and gives it to someone else to implement.

Of course if it ever gets to trial, it becomes a matter of whether lawyers can prove based on a preponderance of that evidence that this is what you did and in practice the bulk of this evidence will center around whether you had access to the original and how similar your work is to the original. Lawyers are going to lay out your work B and work C in front of either a judge or a jury and say "@tangentstorm had access to C and B is very similar, therefore he likely copied the work and is bound by C's license".

A would enter into it is if you claimed that your B derived from A and that similarity to C is pure coincidence. The more knowledge of C you can be shown to have, and the more similar B is to C, the harder this will be. You can certainly claim that you derived B from A and use patches/etc. as a defense, but if you actually used the process you describe, this would be perjury.

(Also note that this is civil law, where questions are of "preponderance of evidence", not "beyond reasonable doubt" like criminal cases. In other words, 51% likelihood not 99.99% likelihood.)

In the situation like you describe, your best options are either to ignore C completely and derive from A alone or derive from C and abide by the GPL. Trying to "get around" is both unethical and opens you up to legal risk.

NOTE: I should state that I am NOT a lawyer, and if you are planning on anything like the original question, you should see a real one. The general takeaway from this answer should really be that you are metaphorically asking if you've found a good way of poking a stick into a hornets nest.

  • If you're bound by A's license, you're surely also bound by C's license. B is derived directly from both, along different paths, possibly at different times or by different people. If I'm following your argument correctly, then one copy of B is under license A and the other under license C, even though the two versions of B are bit-for-bit identical? – tangentstorm Aug 8 '13 at 3:44
  • If two people somehow independently came to B from different sources, then those two copies of B would be under different licenses. (In practice, this is a statistical impossibility for anything of meaningful size.) – Gort the Robot Aug 8 '13 at 4:02
  • To clarify, they're not working independently and doing this by chance. Rather, they're deliberately converging on some point which will become B, but one worker only has knowledge of program A, and the other only has knowledge of program C, and they're careful to come up with new names and function signatures independent of both, and only communicate using the new shared vocabulary. But I don't think this point affects your answer: the two identical code bases are under different licences... And therefore the one you like least can be discarded? – tangentstorm Aug 8 '13 at 4:49
  • @tangentstorm Steven has explained very carefully that this is deep legal water. I was required to testify in such a case once. If you start making money the owners of whatever you copy can take it all and more. The existence of your post here will show that any similarity was not an accident. – andy256 Aug 8 '13 at 11:39
  • 1
    The statement "In theory, if you took a 10,000 line GPL file, deleted all but the first line, and wrote arbitrary code after it, you'd still be bound by the GPL." is not correct. There is a de minimus exception in copyright law, and a requirement for some sort of creativity. If the first line is "/*" then it meets neither criteria. Best real-world example is BSD Unix, derived from AT&T Unix, but (eventually) changed enough that it was no longer under the AT&T copyright. However, be prepared for a lawsuit should that happen. This is why it's generally safer to do a cleanroom implementation. – Andrew Dalke Aug 8 '13 at 11:41

Your explanation ends up proving the following:

A <-----> C

That is to say, B is derived from both A and C. Your rights are given in the intersection both both licenses, your obligations by their union.



As I understand your proposal, you would be creating a copy of A by artifice.

You don't need to use a computer to copy a work, reading one work and re-producing it is still violating copyright. Copyright law does vary by jurisdiction, but AFAIK is fairly consistent in meaning. Basically, if you copy a work, whether it be computer software, a book, music, or whatever, a copy is a copy, and violates copyright.


The GPL doesn't speak at all about clean rooms or reverse-engineering.

If you study source code from a GPL'd program, and use the knowledge you gain to write your own code yourself, you have not necessarily run afoul of the GPL. An infringement occurs when you use and distribute someone else's code, not when you write your own.

Of course, it must be apparent that it is your code, and not merely a parroting or mechanical transliteration of the original code. IANAL, TANSTAAFL, YMMV.

  • 1
    It would be good if there was a lawyer around here. Or maybe there is, but they don't give free advice. No there's a thought: open source legal advice! – andy256 Aug 9 '13 at 2:35

This A <--> B <--> C makes a nice logical thought experiment, but I can't understand the practical application.

I only see two possibilities:

1) A --> B <-- C

If B truly is derived from both (as you suggested), in other words, met-in-the-middle, then it is derived from C, as a means of linking A and C (and vice versa, though that doesn't seem to matter).

There would be no way to arrive at a middle, B, without direct knowledge and work from A, aside from a statistical impossibility as Steven Burnap says.


Or if B is not derived from both, then it is derived from one, and the path to the other is reverse engineered using that source.

In this case, you either went A --> B --> C in which case you are bound by the license. Or you went
C --> B --> A in which case you could argue you aren't bound by the license, but why would you have created the B --> A link at all? In this case, if you'd stopped at C --> B, you'd be fine.

So either...

  • You are bound by the license.
  • or you did something you didn't need to do.
  • Yes, I'm asking mostly as a thought experiment, just to try and understand intellectual property a little better. As for (potentially?) practical applications, if you assume the patches really are refactorings (i.e., specific, repeatable, almost mechanical transformations that preserve semantics, in contrast to arbitrary changes) then the chain of patches serve as a proof that the two programs behave identically. – tangentstorm Aug 8 '13 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.