Design by contract style assertion function.