Cost-sensitive programming, verification, and semantics