Skip to content

Avoid speaking of 'instance hierarchy'#3916

Open
henrikt-ma wants to merge 1 commit into
modelica:masterfrom
henrikt-ma:cleanup/instance-hierarchy
Open

Avoid speaking of 'instance hierarchy'#3916
henrikt-ma wants to merge 1 commit into
modelica:masterfrom
henrikt-ma:cleanup/instance-hierarchy

Conversation

@henrikt-ma

Copy link
Copy Markdown
Collaborator

Fixing a few places where the term instance hierarchy was used, and where I believe the correct term to use is instance tree.

@henrikt-ma henrikt-ma requested review from HansOlsson and perost June 8, 2026 09:24
@henrikt-ma henrikt-ma force-pushed the cleanup/instance-hierarchy branch from 104d263 to acef07f Compare June 8, 2026 09:25
@perost

perost commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Maybe it would be a good idea to update the labels too, such as instance-hierarchy-name-lookup-of-inner-declarations.

@HansOlsson

Copy link
Copy Markdown
Collaborator

Maybe it would be a good idea to update the labels too, such as instance-hierarchy-name-lookup-of-inner-declarations.

Yes, they should be consistent.

Comment thread chapters/scoping.tex
\section{Inner Declarations - Instance Tree Name Lookup}\label{instance-hierarchy-name-lookup-of-inner-declarations}\label{inner-declarations-instance-hierarchy-name-lookup}

An element declared with the prefix \lstinline!outer!\indexinline{outer} references an element instance with the same name but using the prefix \lstinline!inner!\indexinline{inner} which is nearest in the enclosing instance hierarchy of the \lstinline!outer! element declaration.
An element declared with the prefix \lstinline!outer!\indexinline{outer} references an element instance with the same name but using the prefix \lstinline!inner!\indexinline{inner} which is nearest in the enclosing instance tree of the \lstinline!outer! element declaration.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was problematic before, but the new change adds issues.

A model has only one "instance tree", so "nearest in the enclosing instance tree" seems to roughly mean "nearest enclosing in the instance tree". However, roughly is doing quite a lot of work, and something like "nearest enclosing" is needed (but not explained) as it isn't "nearest" in the instance graph (as trees are graphs).

The intent (as we all know) is that you go up the tree (or hierarchy) step-by-step stop as soon as you find a "sibling" that is an inner element with the same name, so using "instance sub-tree" might fix some issues - but it really should be explained in more detail.

@HansOlsson HansOlsson Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So something like:

Suggested change
An element declared with the prefix \lstinline!outer!\indexinline{outer} references an element instance with the same name but using the prefix \lstinline!inner!\indexinline{inner} which is nearest in the enclosing instance tree of the \lstinline!outer! element declaration.
An element declared with the prefix \lstinline!outer!\indexinline{outer} references an element instance with the same name but using the prefix \lstinline!inner!\indexinline{inner} whose parent in the instance tree is the closest ancestor of the \lstinline!outer! element declaration, having a matching \indexinline{inner} element.

Comment thread chapters/scoping.tex
\begin{nonnormative}
\lstinline!inner!/\lstinline!outer! components may be used to model simple fields, where some physical quantities, such as gravity vector, environment temperature or environment pressure, are accessible from all components in a specific model hierarchy.
Inner components are accessible throughout the model, if they are not ``shadowed'' by a corresponding \lstinline!inner! declaration in a more deeply nested level of the model hierarchy.
\lstinline!inner!/\lstinline!outer! components may be used to model simple fields, where some physical quantities, such as gravity vector, environment temperature or environment pressure, are accessible from all components in a specific instance tree.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"specific instance tree" make it sound as if a model may have multiple instance trees, but during translation the model only has one - so I would more say that it is accessible in a sub-tree or part of the tree, and "instance sub-tree" would be a new term, so prefer the latter:

Suggested change
\lstinline!inner!/\lstinline!outer! components may be used to model simple fields, where some physical quantities, such as gravity vector, environment temperature or environment pressure, are accessible from all components in a specific instance tree.
\lstinline!inner!/\lstinline!outer! components may be used to model simple fields, where some physical quantities, such as gravity vector, environment temperature or environment pressure, are accessible from all components in a part of the instance tree.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or possibly something like "in the instance tree, or part of it".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants