MPS Language and Concept Inheritance
Two layers of inheritance matter in MPS: module-level (one language extends another) and concept-level (concepts inherit superconcepts and implement interface concepts).
Critical Directives
- Concept-level inheritance is realized through module-level extension — different
languageReferenceon a concept and itssuperConceptindicates a cross-language specialization, which usually requires the consumer's language to extend the parent. GET_ALL_SUPERCONCEPTSgives the full transitive closure in a single call — prefer it over recursive walking ofsuperConcept/superInterfaces.IS_SUBCONCEPT_OFis the fastest way to verify a single assignability question; do not enumerateGET_SUB_CONCEPTSand search by hand.
Module-Level Inheritance (Language Extension)
One language can inherit the structure and functionality of another via an "extends" relationship.
- Tool:
mps_mcp_get_project_structure(withincludeDependencies: true). - Workflow: check the
extendedLanguagesfield in the response for the target language. This lists direct parent languages. - Hierarchy tracing: recursively call this tool for each parent to build the full inheritance tree.
Concept-Level Inheritance
Upward Hierarchy (Ancestors)
- Direct ancestors: use
mps_mcp_get_concept_details. The response includes:superConcept: immediate parent concept.superInterfaces: immediate implemented interface concepts.superConceptContainingProjectandsuperInterfaceDetails[*].containingProjectwhen an ancestor comes from another open MPS project and is read-only from the selected project.
- Full closure: use
mps_mcp_query_structurewithGET_ALL_SUPERCONCEPTSto get the complete chain of ancestors and interfaces in one call.
Downward Hierarchy (Descendants)
- Specializations: use
mps_mcp_query_structurewithGET_SUB_CONCEPTSto find all concepts (direct and indirect) inheriting from a base. - Implementations: use
GET_ASSIGNABLE_CONCEPTSto retrieve only non-abstract subconcepts that can be instantiated.
Strategic Analysis
- Verification: use
mps_mcp_query_structurewithIS_SUBCONCEPT_OFto check if concept A inherits from concept B. - Cross-language extension: compare the
languageReferenceof a concept with that of itssuperConcept. Different references indicate a language boundary specialization; foreign-project ancestors are marked explicitly with the containing-project fields. - Discovery: use
mps_mcp_search_conceptsto find base concepts (e.g. "Statement") for extension. - Implicit dependencies: if a model uses a language without an explicit import, check if its used languages extend the missing language via
mps_mcp_get_project_structure.
Best Practice
Identify extension points by first checking high-level extendedLanguages via mps_mcp_get_project_structure, then use mps_mcp_get_concept_details to pinpoint cross-language concept specializations.
Related Skills
mps-language-analysis— start here when you need general language inspection, not just inheritance.mps-aspect-structure-concepts— when you intend to define new concepts (with their own super/interface lists).mps-aspect-accessories— forextendedLanguagesvsusedLanguagessemantics at module level.