logic casts