Description
FunctionExtensions.ComputeIsModelLevelEvaluable(this IFunction) in
SysML2.NET/Extend/FunctionExtensions.cs:69 is a NotSupportedException stub. It has no OCL
derivation — per KerML 1.0 §8.3.4.7.4 (normative) it is a Kernel Functions Library membership
test:
Certain Functions from the Kernel Functions Library are considered to have
isModelLevelEvaluable = true. For all other Functions it is false.
The set is KerML 1.0 Table 5 (§8.2.5.8.1) + Table 7 (§8.2.5.8.2) — 39 operator symbols, 3 of them
marked No. Do not hardcode the names: 36 of the 39 rows are derivable from sources the code
generator already reads.
Derivation
- Operator symbols from the grammar —
Resources/KerML-textual-bnf.kebnf, token rules
ConditionalBinaryOperator, BinaryOperator, UnaryOperator, ClassificationTestOperator,
CastOperator, MetaclassificationTestOperator, MetaCastOperator, plus the inline
operator = 'if' | 'all' | '[' | ',' assignments. → 35 symbols.
- The 4 remaining operators from the XMI —
IndexExpression, FeatureChainExpression,
CollectExpression and SelectExpression do not assign operator in the grammar; it is an OCL
constraint body in Resources/KerML_only_xmi.uml: operator = '#' (:5937), '.' (:5761),
'collect' (:5692), 'select' (:5633). → 39 total.
- Symbol → library function — from
Resources/sysml.library.kpar/Kernel_Function_Library-1.0.0.kpar: the first package declaring a
Function with that declaredName, probed in the order BaseFunctions, DataFunctions,
ControlFunctions. That order is not invented — it is the OCL at
Resources/KerML_only_xmi.uml:5671, already implemented at
SysML2.NET/Extend/OperatorExpressionExtensions.cs:63. It resolves the == / === collision
(both are declared in BaseFunctions and DataFunctions) to BaseFunctions, matching
Table 5.
- Subtract the 3 curated exclusions — the only No rows:
BaseFunctions::'all' (type extent),
BaseFunctions::'[' and DataFunctions::'~' (abstract, no default definition in the library; see
the notes at Resources/KerML-textual-bnf.kebnf:1178 and :1064). isAbstract does not
discriminate — BaseFunctions::'==' is abstract and is evaluable — so these three must be an
explicit list with a spec citation each.
This derivation is deliberately narrower than "every Function in the three packages": max, min,
reduce, forAll, selectOne, minimize etc. are declared there but are not operator terminals,
and fall out automatically.
Generator must validate (fail generation on mismatch)
- Every derived qualified name resolves to a
Function in the Kernel Function Library.
- Steps 1–3 yield exactly 39 symbols — any other count means spec or library drift.
- The exclusion list has 3 entries and every entry is present in the derived set.
'^' and '**' are separate Function declarations in DataFunctions even though Table 5
collapses them into one row; both belong in the emitted set.
Output
A frozen set of qualified names in an AutoGen file (alongside
SysML2.NET/LexicalRules/AutoGenLexicalRules/), consumed by ComputeIsModelLevelEvaluable via
functionSubject.qualifiedName. Scope is the evaluable set only — the full operator → function map
is #365's concern.
Notes
SysML2.NET.CodeGenerator/Grammar/ already carries the KEBNF object model (TerminalElement,
Alternatives, TextualNotationRule) and GrammarLoader, and UmlCoreLexicalRulesGenerator
already emits from this rule shape. Reading .kermlx is the one new capability —
SysML2.NET.CodeGenerator references uml4net.xmi only, not SysML2.NET.Serializer.Xmi.
Impact
Completes the runtime behaviour of
InvocationExpressionExtensions.ComputeRedefinedModelLevelEvaluableOperation
(SysML2.NET/Extend/InvocationExpressionExtensions.cs:57), which compiles today but throws through
function.isModelLevelEvaluable.
Checklist
System Configuration
- SysML2.NET version: 0.19.0
- Source files:
SysML2.NET/Extend/FunctionExtensions.cs
SysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/
Description
FunctionExtensions.ComputeIsModelLevelEvaluable(this IFunction)inSysML2.NET/Extend/FunctionExtensions.cs:69is aNotSupportedExceptionstub. It has no OCLderivation — per KerML 1.0 §8.3.4.7.4 (normative) it is a Kernel Functions Library membership
test:
The set is KerML 1.0 Table 5 (§8.2.5.8.1) + Table 7 (§8.2.5.8.2) — 39 operator symbols, 3 of them
marked No. Do not hardcode the names: 36 of the 39 rows are derivable from sources the code
generator already reads.
Derivation
Resources/KerML-textual-bnf.kebnf, token rulesConditionalBinaryOperator,BinaryOperator,UnaryOperator,ClassificationTestOperator,CastOperator,MetaclassificationTestOperator,MetaCastOperator, plus the inlineoperator = 'if' | 'all' | '[' | ','assignments. → 35 symbols.IndexExpression,FeatureChainExpression,CollectExpressionandSelectExpressiondo not assignoperatorin the grammar; it is an OCLconstraint body in
Resources/KerML_only_xmi.uml:operator = '#'(:5937),'.'(:5761),'collect'(:5692),'select'(:5633). → 39 total.Resources/sysml.library.kpar/Kernel_Function_Library-1.0.0.kpar: the first package declaring aFunctionwith thatdeclaredName, probed in the orderBaseFunctions,DataFunctions,ControlFunctions. That order is not invented — it is the OCL atResources/KerML_only_xmi.uml:5671, already implemented atSysML2.NET/Extend/OperatorExpressionExtensions.cs:63. It resolves the==/===collision(both are declared in
BaseFunctionsandDataFunctions) toBaseFunctions, matchingTable 5.
BaseFunctions::'all'(type extent),BaseFunctions::'['andDataFunctions::'~'(abstract, no default definition in the library; seethe notes at
Resources/KerML-textual-bnf.kebnf:1178and:1064).isAbstractdoes notdiscriminate —
BaseFunctions::'=='is abstract and is evaluable — so these three must be anexplicit list with a spec citation each.
This derivation is deliberately narrower than "every
Functionin the three packages":max,min,reduce,forAll,selectOne,minimizeetc. are declared there but are not operator terminals,and fall out automatically.
Generator must validate (fail generation on mismatch)
Functionin the Kernel Function Library.'^'and'**'are separateFunctiondeclarations inDataFunctionseven though Table 5collapses them into one row; both belong in the emitted set.
Output
A frozen set of qualified names in an
AutoGenfile (alongsideSysML2.NET/LexicalRules/AutoGenLexicalRules/), consumed byComputeIsModelLevelEvaluableviafunctionSubject.qualifiedName. Scope is the evaluable set only — the full operator → function mapis #365's concern.
Notes
SysML2.NET.CodeGenerator/Grammar/already carries the KEBNF object model (TerminalElement,Alternatives,TextualNotationRule) andGrammarLoader, andUmlCoreLexicalRulesGeneratoralready emits from this rule shape. Reading
.kermlxis the one new capability —SysML2.NET.CodeGeneratorreferencesuml4net.xmionly, notSysML2.NET.Serializer.Xmi.Impact
Completes the runtime behaviour of
InvocationExpressionExtensions.ComputeRedefinedModelLevelEvaluableOperation(
SysML2.NET/Extend/InvocationExpressionExtensions.cs:57), which compiles today but throws throughfunction.isModelLevelEvaluable.Checklist
operator = '…'constraint operatorsKernel_Function_Library-1.0.0.kpar, map symbol → qualified name via the OCL probe orderAutoGenfilebool ComputeIsModelLevelEvaluable(this IFunction)SysML2.NET.Tests/Extend/FunctionExtensionsTestFixture.csSystem Configuration
SysML2.NET/Extend/FunctionExtensions.csSysML2.NET.CodeGenerator/Generators/UmlHandleBarsGenerators/