Suppose an original piece of software contains an AI algorithm (that is NOT patented) that tries to optimise the solutions the software produces.
Out of the box the software does not infringe any patents, but after learning from user input and goals it starts homing in on a behaviour which has been patented.
It 'learns' that the patented solution is a optimum solution.
Would that be an infringement?