If it's patented they can't use it...
If it's a copy left license I would say that at that point anything made by the ai should be copy left as well.
Just because you think a machine should have the right to use open source code doesn't mean the author or the license agree.