Memory, experience and adaptation in logical agents