As a bit-part expert witness for the other side of the SCO case, I saw
hundreds of pages of evidence in the form of side-by-side code
comparison. As I recall, the vast majority of highlighted
correspondences were small snippets, often rearranged. I didn't
interact with the lawyers enough to form a solid opinion about where
this stood on the spectrum of coincidence to fair use to plagiarism.
It certainly wasn't wholesale copying. I do not recall being asked to
opine on whether trade secrets had been stolen.
Apropos of rearranged snippets, one of the diff algorithms I
experimented with in the mid-70s identified rearrangements. I
abandoned it because real life code contains lots of similar lines, so
many in PDP-11 assembler programs as to suggest that these programs
are largely permutations of each other. The phenomenon is much less
common in C, but still present; witness the prevalence of code like
int i, n;
for(i=0; i<n; i++) {
The phenomenon may have been afoot in the SCO evidence.
In regard to trade secrets, I was surprised when I moved from Unix at
Bell Labs to Linux at Dartmouth and found calendar(1) to be completely
rewritten, but with logic absolutely identical to the original version
I wrote at the Labs. That was so idiosyncratic that the identity of
the two could not have been an accident.
Doug