From 3cb2bec9c8e8416e370aabf6520a0bc63c17c96c Mon Sep 17 00:00:00 2001 From: HOS Date: Wed, 9 Sep 2026 11:53:11 +0200 Subject: [PATCH 1/6] Define variability for subscripting. Closes #3932 --- chapters/operatorsandexpressions.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index b5dce3440..ef16b95a2 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -1555,6 +1555,9 @@ \section{Variability of Expressions}\label{variability-of-expressions} When determining whether an equation can contribute to solving for a variable \lstinline!v! (for instance, when applying the perfect matching rule, see \cref{synchronous-data-flow-principle-and-single-assignment-rule}), the equation can only be considered contributing if the resulting solution would be at most as variable as \lstinline!v!. \end{itemize} +The variability of \lstinline!a[I].x! is the highest variability of \lstinline!I! and \lstinline!x!, note that \lstinline!x! cannot higher variability than \lstinline!a!, due to \cref{variability-of-structured-entities}. +Slicing (see \cref{slice-operation}) is for variability interpreted as syntactic sugar for such a construct, so \lstinline!a.x! and \lstinline!a[:].x! for a vector \lstinline!a! has the same variability as \lstinline!a[1:size(a,1)].x!. + \begin{example} The (underdetermined) model \lstinline!Test! below illustrates two kinds of consequences due to variability constraints. First, it contains variability errors for declaration equations and assignments. From 1c52e7ff12441d53387ec56e1f08698311c62b6b Mon Sep 17 00:00:00 2001 From: HOS Date: Wed, 9 Sep 2026 11:57:20 +0200 Subject: [PATCH 2/6] IndexSlice --- chapters/arrays.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index d5d19943d..aec109500 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -1377,8 +1377,8 @@ \subsection{Scalar Exponentiation of Matrices}\label{scalar-exponentiation-of-sq \end{nonnormative} \subsection{Slice Operation}\label{slice-operation} - -The following holds for slice operations: +\index{Slice +The following holds for slice\index{slice} operations: \begin{itemize} \item If the component reference \lstinline!a! is an array containing scalar components and \lstinline!m! is a component of those components, the component reference \lstinline!a.m! is interpreted as a slice operation. From 15bab955a4e83fee7450fdd54896e0971628ae2b Mon Sep 17 00:00:00 2001 From: HOS Date: Wed, 9 Sep 2026 11:57:37 +0200 Subject: [PATCH 3/6] IndexSlice --- chapters/arrays.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index aec109500..65b39442e 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -1377,7 +1377,7 @@ \subsection{Scalar Exponentiation of Matrices}\label{scalar-exponentiation-of-sq \end{nonnormative} \subsection{Slice Operation}\label{slice-operation} -\index{Slice + The following holds for slice\index{slice} operations: \begin{itemize} \item From 24caa1c5c0171815bcb338e2560c351ee99d5cfb Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Wed, 9 Sep 2026 12:49:27 +0200 Subject: [PATCH 4/6] Update chapters/operatorsandexpressions.tex --- chapters/operatorsandexpressions.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index ef16b95a2..6a905060e 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -1555,7 +1555,8 @@ \section{Variability of Expressions}\label{variability-of-expressions} When determining whether an equation can contribute to solving for a variable \lstinline!v! (for instance, when applying the perfect matching rule, see \cref{synchronous-data-flow-principle-and-single-assignment-rule}), the equation can only be considered contributing if the resulting solution would be at most as variable as \lstinline!v!. \end{itemize} -The variability of \lstinline!a[I].x! is the highest variability of \lstinline!I! and \lstinline!x!, note that \lstinline!x! cannot higher variability than \lstinline!a!, due to \cref{variability-of-structured-entities}. +The variability of \lstinline!a[I].x! is the highest variability of \lstinline!I! and \lstinline!x!. +Note that \lstinline!x! cannot have higher variability than \lstinline!a!, due to \cref{variability-of-structured-entities}. Slicing (see \cref{slice-operation}) is for variability interpreted as syntactic sugar for such a construct, so \lstinline!a.x! and \lstinline!a[:].x! for a vector \lstinline!a! has the same variability as \lstinline!a[1:size(a,1)].x!. \begin{example} From 61ebd2d745b9a3cb7ba2bfc8b4e35cd22ad701ae Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Thu, 1 Oct 2026 09:43:37 +0200 Subject: [PATCH 5/6] Apply suggestion from @HansOlsson --- chapters/operatorsandexpressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 6a905060e..3a81923b1 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -1556,7 +1556,7 @@ \section{Variability of Expressions}\label{variability-of-expressions} \end{itemize} The variability of \lstinline!a[I].x! is the highest variability of \lstinline!I! and \lstinline!x!. -Note that \lstinline!x! cannot have higher variability than \lstinline!a!, due to \cref{variability-of-structured-entities}. +Note that the variability of \lstinline!x! takes the variability of \lstinline!a! in account, see \cref{variability-of-structured-entities}. Slicing (see \cref{slice-operation}) is for variability interpreted as syntactic sugar for such a construct, so \lstinline!a.x! and \lstinline!a[:].x! for a vector \lstinline!a! has the same variability as \lstinline!a[1:size(a,1)].x!. \begin{example} From e1695af5fd703330dfc188f105d3834a6232fc18 Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Thu, 1 Oct 2026 09:44:53 +0200 Subject: [PATCH 6/6] Apply suggestion from @HansOlsson --- chapters/operatorsandexpressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 3a81923b1..cfe99d7b5 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -1557,7 +1557,7 @@ \section{Variability of Expressions}\label{variability-of-expressions} The variability of \lstinline!a[I].x! is the highest variability of \lstinline!I! and \lstinline!x!. Note that the variability of \lstinline!x! takes the variability of \lstinline!a! in account, see \cref{variability-of-structured-entities}. -Slicing (see \cref{slice-operation}) is for variability interpreted as syntactic sugar for such a construct, so \lstinline!a.x! and \lstinline!a[:].x! for a vector \lstinline!a! has the same variability as \lstinline!a[1:size(a,1)].x!. +Regarding variability, slicing (see \cref{slice-operation}) is interpreted as syntactic sugar for such a construct, so \lstinline!a.x! and \lstinline!a[:].x! for a vector \lstinline!a! has the same variability as \lstinline!a[1:size(a,1)].x!. \begin{example} The (underdetermined) model \lstinline!Test! below illustrates two kinds of consequences due to variability constraints.