In The Foreknowledge of God, and Cognate Themes in Theology and Philosophy, L. D. McCabe writes:
It is remarkable how constantly it is implied, or assumed, in the Scriptures, that God does not foreknow the choices of free beings while acting under the law of liberty. As for example, the words of Jehovah to Moses, “I am sure the King of Egypt will not let you go.” The angel of the Lord called to Abraham out of the heavens, and said, “Lay not thou a hand on the lad, neither do thou any thing to him; for now I know that thou fearest God seeing thou hast not withheld thy son, thine only son, from me.” These words imply that up to that point God did not absolutely know what the final decision of Abraham would be. If he did foreknow it, a seeming falsity, or pretense, is assumed, and a deception practiced upon the reader. “Now I know that thou fearest God.” Of Solomon God promised, saying, “I will be his father, and he shall be my son. But if he commit, iniquity, I will chasten him with the rod of iron.” “He led thee these forty years in the wilderness, to humble thee, to prove thee, to know what was in thine heart whether thou wouldst keep his commandments or no.” And the Lord said, “It repenteth me that I have made man.” Moses said, “It repented the Lord that he had made man, and it grieved him at his heart.” These words seem to imply a heart-felt regret on the part of God, and that he had not foreknown with certainty the fall of man. For, if he had foreknown the wickedness of man, why did he grieve after its occurrence more, than before? And if he grieved equally before he made Adam, at the sight of his future sinfulness, why did he not decline his creation? If he foreknew the fall, not merely as a contingent possibility, but as an inevitable fact, then this mournful declaration makes him appear inconsistent. And then who can sympathize with him in his grief for having created man? Evidently, in this passage, God implicitly, but clearly, assumes his non-foreknowledge of the certain future wickedness of man. And that assumption is necessary to give consistency to the divine conduct and statements, and to establish any claim on, the sympathy of an intelligent universe in his great disappointment. But when the whole transaction is considered in view of that assumption a light, luminous with the most interesting suggestions, emanates from this troublesome text.