Fundamentals of model-based reasoning