Intelligence - what is it?

Another try, I guess it’s on-topic here. I happen to believe that definition of intelligence is essential to design a clean AGI, vs. the mess we have between the ears. But this definition must be functional, else it’s just idle word games people have been playing for millenia. So, here is mine:

Intelligence is the ability to predict and plan (self-predict), which can only be done by discovering and projecting patterns. This perspective is well established: pattern recognition is a core of any IQ test.
But there is no general and constructive definition of either pattern or recognition (quantified similarity).
So, I came up with my own definitions, which directly translate into algorithm proposed below.
Continued on http://www.cognitivealgorithm.info