Compact internal representation of dynamic situations: neural network implementing the causality principle