If he didn’t then Trump isn’t as smart as I think he is. I’m not worried in the least. Trump is not stupid. I don’t think for a minute that he went into this decision without taking the prisoners into account. Trump is the most competent President in my life time. I wouldn’t bet on his stupidity.
Erdogan has shown little fear of Trump or any other U.S. president, witness the purchase of Russian arms and equipment. Trump's response to that was to bemoan the cancelling of the F-35 sales to Turkey.
Besides, right now the Kurds and our Syrian allies have the ISIS prisoners. If we're throwing them to the wolves then what incentive do they have to hang on to them?