A Model for Learning Systems