A Formal Model for Simulations