An evolutionary Lyapunov function