In the paper we present a dynamic model of knowledge. The model is inspired by public announcement logic and an approach to a puzzle concerning knowledge and communication using that logic. The model, using notions of situation and epistemic state as foundations, generalizes structures usually used as a semantics for epistemic logics in static and dynamic aspects. A computer program automatically solving the considered puzzle, implementing the model, is built. Key words: knowledge representation, dynamic epistemic logic, multiagent systems, Prolog