“While a few like Avicenna and Averroes seem to have held that a God who lacks certain types of knowledge would be more perfect, most have claimed that God knows everything. This is sometimes refined, for example, to the claim that God knows everything that is logically possible to know.
“An area of concern going back to Aristotle (On Interpretation 9) is the claim that propositions about future contingent events (that is, those whose causes are not determined by past events) have no truth value. If so they are unknowable, even by an omniscient being (a view held in modern times by so called Open Theism). Some have claimed that even if future events have a truth value, they are logically unknowable. Of special concern is the relationship between omniscience and human free will: if yesterday God knew infallibly that I would do x today, it seems I have no alternative but to do x today–a conclusion that seems to violate free will.
“To solve this, Boethius and Aquinas appealed to the concept of God’s timelessness, which entails that none of God’s knowledge is past or future. Aquinas also said that God determines all events and determines that they will be done freely. De Molina objected that this amounts to removing free will. He constructed his own view, which said that God’s knowledge is logically prior to his decree of what will be. God knows what an individual will do in all possible circumstances (a capacity called middle knowledge), and he decrees those circumstances in which a person freely cooperates with the divine plan. Thus foreknowledge is compatible with free will.
“Others have conceded that foreknowledge is incompatible with free will but claim that God voluntarily limits his knowledge of future events so that there can still be freedom. This makes omniscience a matter of having an ability to know rather than having specific knowledge. Another solution to the problem of omniscience and freedom challenges the idea that God’s knowledge limits future free actions in any way. While God knows necessarily that I will do x tomorrow that does not entail that it is necessary I do x. What God knows is what I will freely choose to do. So God knows today that I will do x tomorrow because tomorrow I will freely choose to do x. But if tomorrow I choose to do y, then today God knows that tomorrow I will do y. This view is consistent with what we know about less than infallible knowledge of future events. I may know that a person will choose steak over bologna though I in no way influenced their choice.” (go to article)
— Brian Morley, “Western Concepts of God,” The Internet Encyclopedia of Philosophy