A Model for Artificial Intelligence