I agree with your position that a withdrawl will encourage terrorists. Sadly I think the terrorists will be encouraged by any activity (leave or stay). I do agree that the path which leads to less bloodshed (here and there) lies on the "follow through" and not "cut and run". And a success will take a few years to prove and be accepted by a suspicious arab world. Costly, yet at this time it seems the best way out (long term).
If the US up and left in the middle of the night, it would embolden the terrorists who would see a formula for attacking the US anywhere and their target would be to cause the same withdrawl. They would next target bases in Kuwait, UAE and expand from there.
If they caused the US to recall all military, and close all foriegn bases (impossible to do, but for the sake of argument) they would not stop there. Those zealotous shitheads would then import their activities onto any american soil at any cost.
I don't believe we can fight them in any traditional manner, we can't use an army to fight an invisible enemy.
The best we achieve by going after harboring nations (Afghanistan, Yemen, Somalia) is to cause dispersal of them and slow their efforts, or cause them to retarget themselves.
They replenish their ranks from the disenfranchised arab youths. As long as those kids have no hope or future, there will be 10 more recruits for every nimrod who blows up a car full of C4 near an american.
Discussing the reasons the US shouldn't have -or- should have invaded are moot points now, the troops are there. A post mortum of the whole debacle may avoid a repeat in the future, but as for the current situation, it doesn't help one bit.
In order to win in the long run, they need to change how they think, and we can't help them (they will distrust the motive, even if it is good).
If you look at Iran, they are starting to change and rebel against the clerics and religious nuts. It took them 20 years to do this. They need to taste their Utopian society in order to get sick of the taste and relish what we have. Change must come from the inside for these countries, we can't export it to them.