3 ms·
Once AI can write decent code from scratch, it is likely it can also circumvent potential copyright violations. A. Check AI generated code against a comprehens
by fatherzine 4y ago
Once AI can write decent code from scratch, it is likely it can also circumvent potential copyright violations.
A. Check AI generated code against a comprehensive library of open-source copyrighted code and identify potential violations.
B. Ask AI to generate a paraphrase of the potential violations, by employing any number of semantic preserving transforms -- e.g. variable name change, operator replacement, structured block rewrite, functional rebalance, etc.
Lazy example:
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex +
") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}
private static void rangeCheck(int len, int start, int end) {
if (!(0 <= start)) {
throw new ArrayIndexOutOfBoundsException(`Failed: 0 <= ${start}`);
} else if (!(start <= end)) {
throw new IllegalArgumentException(`Failed: ${start} <= ${end}`);
} else if (!(end <= len)) {
throw new ArrayIndexOutOfBoundsException(`Failed: ${end} <= ${len}`);
}
}
- chrsjxn 4y agoThis feels like it would make the situation much worse from a legal perspective. If you know your AI produces code that is "tainted" by license violations, adding code to hide it after the fact suggests that you're intentionally violating the license terms.