Dynamic simulation by algorithmic generated structural models II. Prolog implementation of the model generator