open intervals and type derivation