Hi everyone,
I’ve got some questions regarding the semantics of Range-Constrained (Section 7.4). Specifically, when a type usage is qualified with a BMM_VALUE_SET_SPEC (e.g., CodedText <<iso::iso_639-2>>), I’d like to clarify how this affects the computational behavior of the system.
1. Type Conformance & Identity **: **How does the value_constraint affect conformance? If we have a base type CodedText and a constrained version CodedText <<iso::iso_639-2>>, my assumption is:
-
CodedText <<iso::iso_639-2>>conforms toCodedText(The constrained type is a specialized version of the base). -
Does
CodedTextconform toCodedText <<iso::iso_639-2>>? I assume not, right ? at least without a runtime check like usingis_instance_of(CodedText <<iso::iso_639-2>>)in other languages. -
Does
CodedText <<iso::iso_639-2>>conform toCodedText <<iso::languages>>, like if they have different resource/value_set IDs?
2. Output of type_name() or type_signature() : When calling type_name() on a BMM_MODEL_TYPE that has a value_constraint, what is the expected output?
-
Should it return the “notional syntax” (e.g.,
"CodedText <<iso::639-1>>")? -
Or should it return the base name (
"CodedText") while the constraint remains a separate metadata property?This is particularly important for error messages , runtime reflection and types interning.
3. Scope of Constraint: Variable vs. Instance: pardon me if the question sound naïve,but does the value_constraint constraint the declaration (the variable/attribute) or the instance (the object itself)? To illustrate with an example:
// Variable 'language1' is constrained
CodedText <<iso::languages>> language1 = CodedText <<iso::languages>>(...);
// Variable 'language2' is unconstrained
CodedText language2 = language1;
// If I mutate language2, I am technically mutating the object
// referenced by language1.
language2.set_code("non_iso_code");
If the constraint is only on the declaration of language1, the underlying object might become invalid relative to language1’s constraint via a reference from language2. Does the BMM intend for these constraints to be enforced only at the point of assignment/validation, or should the instance itself “carry” the knowledge of its constraint? this would have two different different approaches (static vs dynamic value validation)
I’m curious if these behaviors are already implicitly decided or if they are left to the implementation of the Expression Language runtime
Note: BTW, the same questions also apply regarding Enumerations.