Copying code

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Rebel
Posts: 7475
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Copying code

Post by Rebel »

hgm wrote: Does that make it clear?
No :wink: see my former answer.

Forget the Rybka case, it's not about that although certainly inspired. The only good thing about that drama is that it created awareness (at least by me) how we have underestimated the impact of the open sources on our hobby especially when they took over the established names in strength.

I am looking for a programmer code for the example I listed.
jdart
Posts: 4420
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Copying code

Post by jdart »

I am not sure what Ed means by "allowed." Allowed according to law? If so copyright is a legal concept and degree of copying/amount of originality is something that not infrequently winds up in court when two parties have a different point of view about what is allowed.

But also: usage according to license is allowed, and when a license exists the question is often whether usage was granted according to the license, not whether copying occurred or whether copyright was violated.

If you want to see how complex this can get, look at the recent Oracle lawsuit against Google. Google did not want to acquire a license to Java (which is complex and expensive), but released Android software that uses the Java language but with their own runtime engine. Google says Android is based on Apache Harmony, a Java implementation with a liberal (Apache) license, but not sanctioned by Oracle, which now owns Java. Oracle alleges both copyright and patent infringement.

All this though does not answer the question whether copying was morally right or allowed according to other than legal rules (such as ICGA rules).
User avatar
Rebel
Posts: 7475
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: No gray area here

Post by Rebel »

sje wrote:If a chess program is produced from the source of another program and the production involves no more skill than that of a first semester coder with little knowledge of the chess domain, then there is no gray area. The result is a copy and is not an original work.
Absolutely.

And the answer to my initial question ?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: No gray area here

Post by sje »

Rebel wrote:
sje wrote:If a chess program is produced from the source of another program and the production involves no more skill than that of a first semester coder with little knowledge of the chess domain, then there is no gray area. The result is a copy and is not an original work.
Absolutely.

And the answer to my initial question ?
Just changing variable names? Then it's just a copy. not an original.

Changing data structures? Also just a copy unless some significant value or novelty was added.

Note that nether of the above will produce a different computational result, and that's another damning testimony.
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Copying code

Post by zamar »

Rebel wrote: Here is the deal, provided a programmer already has an engine and he wants to copy code from another engine:
Why would anyone want to copy code from another engine? Copyright laws in most Western countries prohibit copying anything without author's permission.

Reading another person's engine and writing your engine by using similar ideas is of course okay. But resulting functions, semantics, arrays are going to very different.

But there are people trying to stretch the limit. "How much can I copy code without getting caught? Maybe I'm able to raise enough reasonable doubts, so that the original author cannot proof with 100% certaintity that I copied his code.". This is where the grey area comes from.
Joona Kiiski
User avatar
hgm
Posts: 28443
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Copying code

Post by hgm »

Rebel wrote:
hgm wrote: Does that make it clear?
No :wink: see my former answer.
That is bcause your former answer was to my later posting. And you fail to address th most important point of it, which blew the question itself out of the water:
hgm wrote:Allowed by what?
If you cannot even phrase an unambiguous question, you should not expect an answer...
User avatar
Rebel
Posts: 7475
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Copying code

Post by Rebel »

zamar wrote:
Rebel wrote: Here is the deal, provided a programmer already has an engine and he wants to copy code from another engine:
Why would anyone want to copy code from another engine? Copyright laws in most Western countries prohibit copying anything without author's permission.
IPPO is freeware.
Reading another person's engine and writing your engine by using similar ideas is of course okay. But resulting functions, semantics, arrays are going to very different.
Here is an example that proofs you wrong, at least if you think I did nothing wrong, which I think you do :wink:

2-3 years ago I went through the Fruit source code because of the raging Rybka debate and I found something I did not have, penalizing a trapped bishop on the 6th rank. So I took it and it resulted in the following code.

Code: Select all

	if (board[A6]==WB && board[B5]==BP) score=score-64;
	if (board[H6]==WB && board[G5]==BP) score=score-64;
	if (board[A3]==BB && board[B4]==WP) score=score+64;
	if (board[H3]==BB && board[G4]==WP) score=score+64;
My own code, I copied nothing from Fruit. However, compare this with the Fruit source code, 100% identical, not only semantically equal, even code wise equal.

Did I plagiarize Fruit ?
User avatar
Rebel
Posts: 7475
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: No gray area here

Post by Rebel »

sje wrote:
Rebel wrote:
sje wrote:If a chess program is produced from the source of another program and the production involves no more skill than that of a first semester coder with little knowledge of the chess domain, then there is no gray area. The result is a copy and is not an original work.
Absolutely.

And the answer to my initial question ?
Just changing variable names? Then it's just a copy. not an original.

Changing data structures? Also just a copy unless some significant value or novelty was added.
First opinion is in, thank you.
Note that nether of the above will produce a different computational result, and that's another damning testimony.
Not necessarily, see my Fruit example.
jdart
Posts: 4420
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Copying code

Post by jdart »

Copying usually has to be a significant amount to get you into trouble (again, from a legal point of view).

And it is well known, ideas are not subject to copyright.

Nobody is going to sue you over 4 lines of code.

So, the answer here is no.
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Copying code

Post by zamar »

Rebel wrote:
zamar wrote:
Rebel wrote: Here is the deal, provided a programmer already has an engine and he wants to copy code from another engine:
Why would anyone want to copy code from another engine? Copyright laws in most Western countries prohibit copying anything without author's permission.
IPPO is freeware.
I said without author's permission. If the writer of the program has explicitly given permission to copy code then it's of course okay (assuming he didn't copy the code from another source).
Reading another person's engine and writing your engine by using similar ideas is of course okay. But resulting functions, semantics, arrays are going to very different.
Here is an example that proofs you wrong, at least if you think I did nothing wrong, which I think you do :wink:

2-3 years ago I went through the Fruit source code because of the raging Rybka debate and I found something I did not have, penalizing a trapped bishop on the 6th rank. So I took it and it resulted in the following code.

Code: Select all

	if (board[A6]==WB && board[B5]==BP) score=score-64;
	if (board[H6]==WB && board[G5]==BP) score=score-64;
	if (board[A3]==BB && board[B4]==WP) score=score+64;
	if (board[H3]==BB && board[G4]==WP) score=score+64;
My own code, I copied nothing from Fruit. However, compare this with the Fruit source code, 100% identical, not only semantically equal, even code wise equal.

Did I plagiarize Fruit ?
You need to use some common sense: four lines in context of chess program is meaningless amount of code. It might happen just by accident.

Some examples:
- If two books on the same subject have a same sentence or even multiple sentences in a row, it's not yet considered copying.
- If one page is exactly similar, it's already considered copying.
- Rewriting the book by slightly modifying each sentence is considered copying.
- Writing a similar book, but bringing in your own ideas and expressing old ideas in your own way is fully legal. But in that case you won't find 30 identical sentences in row. That's statistically impossible.

The law is very clear that copying other person's work without his permission is illegal. Why do you want to create confusion?
Joona Kiiski