A library for runtime checking of protocols