The ‘theory theory’ of an ‘infantile scientific impulse’ and Rosen’s concept of anticipatory systems were both anticipated by Peirce. In a 1901 article, he used ‘a little diagrammatic psychology’ to sketch the origins of the scientific quest for truth:
No man can recall the time when he had not yet begun a theory of the universe, when any particular course of things was so little expected that nothing could surprise him, even though it startled him. The first surprise would naturally be the first thing that would offer sufficient handle for memory to draw it forth from the general background. It was something new. Of course, nothing can appear as definitely new without being contrasted with a background of the old. At this, the infantile scientific impulse,— what becomes developed later into various kinds of intelligence, but we will call it the scientific impulse because it is science that we are now endeavoring to get a general notion of,— this infantile scientific impulse must strive to reconcile the new to the old. The first new feature of this first surprise is, for example, that it is a surprise; and the only way of accounting for that is that there had been before an expectation. Thus it is that all knowledge begins by the discovery that there has been an erroneous expectation of which we had before hardly been conscious. Each branch of science begins with a new phenomenon which violates a sort of negative subconscious expectation, like the frog’s legs of Signore Galvani.
— EP2:87-8
Later on the same page, Peirce integrated emotion into this cognitive picture by observing that ‘the emotion of surprise’ which triggers inquiry ‘is merely the instinctive indication of the logical situation. It is evolution (φύσις) that has provided us with the emotion. The situation is what we have to study.’