Smooth animation of algorithms in a declarative framework