Index: /reasoner/reasoner.tex
===================================================================
--- /reasoner/reasoner.tex	(revision 67)
+++ /reasoner/reasoner.tex	(revision 68)
@@ -120,5 +120,5 @@
 $value(v)$ denotes the actual value of $v$, with $type(value(v))$ compliant with $type(v)$. Please note, that $type(value(v))$ can be a subtype of $type(v)$ (cf. \cite{IVML-LS} for details on the IVML type compliance rules and the IVML type hierarchy).
 
-As types like container or compound require a nesting of configuration variables, we generically define $nested(v)$ as the set of all variables nested in $v$. Of course, $nested(v)=\setEmpty$ if no nested variables are defined on $v$, $type(v)$ or $type(value(v))$. We define $parent(v)$ as the object $v$ is nested within, which is either the containing configuration if $v$ is a top-level variable or the parent variable, i.e., $\forall_{n\in nested(v)}:parent(n)=v$. For convenience, we also define
+As types like container or compound require a nesting of configuration variables, we generically define $nested(v)$ as the set of all variables nested in $v$ and $nested(v, n)$ the nested variable with name $n$ in $v$ ($nested(v, n)$ may be undefined). Of course, $nested(v)=\setEmpty$ if no nested variables are defined on $v$, $type(v)$ or $type(value(v))$. We define $parent(v)$ as the object $v$ is nested within, which is either the containing configuration if $v$ is a top-level variable or the parent variable, i.e., $\forall_{n\in nested(v)}:parent(n)=v$. For convenience, we also define
 
 \begin{multline}
@@ -327,5 +327,5 @@
      $add(\topLevelConstraints, constraints(p), true)$\; \label{algTranslateConstraintsAdd} \label{algTranslateConstraintsTopLevelConstraints}
      \ForAll{a \iterAssng assignments(p)}{
-        $translateAnnotationAssignments(a, \undef, \undef)$\; \label{algTranslateConstraintsTopLevelAnnotationAssignments}
+        $translateAnnotationAssignments(a, \undef, \undef, \undef)$\; \label{algTranslateConstraintsTopLevelAnnotationAssignments}
      } \label{algTranslateConstraintsTranslationEnd}
      $add(\topLevelConstraints,\seqWith{constraints(e)}{e\in evals(p)}\TBD{Priority?}$\;\label{algTranslateConstraintsTopLevelEvals}
@@ -542,8 +542,8 @@
   \KwData{constraints $\otherConstraints$, variable mapping $\variableMapping$}
 
-  \ForAll{s \iterAssng slots(v)} { %actual slots
+  \ForAll{s \iterAssng slots(v)} { \label{algTranslateCompoundDeclarationVarMappingStart} %actual slots
       $x \assng \createExpression{\closedCases{\IVMLMeta{acc}(d,s), & \text{if } ca = \undef \\ \IVMLMeta{acc}(\IVML{asType}(ca, type(value(v))), s), &\text{else}}}$\;
       $\variableMapping \assng \variableMapping \addMap \set{\mapEntry{s}{x}}$\;
-  }
+  }\label{algTranslateCompoundDeclarationVarMappingEnd}
   \ForAll{s \iterAssng slots(v)  \TBD{hint: contains vars from assignment block defs!}} { %actual slots
       $translateDeclaration(s, decision(v, s), c)$\; \label{algTranslateCompoundDeclarationTranslateSlots}
@@ -559,5 +559,5 @@
   \If{$\neg inc$} {
       \ForAll{$a \iterAssng assignments(t)$}{
-          $translateAnnotationAssignments(a, \undef, ca)$\; \label{algTranslateCompoundDeclarationCompoundAssignments}
+          $translateAnnotationAssignments(a, v, \undef, ca)$\; \label{algTranslateCompoundDeclarationCompoundAssignments}
       }
   }
@@ -659,11 +659,14 @@
 \end{algorithm}
 
-We turn now to the translation of annotation assignment blocks. In IVML, an assignment block is used on top-level or within compounds to declare compound slots with an implicit assignment of a value to each delcared annotation. Further, assignment blocks can be nested and the assignments defined for the outer blocks must be applied also to the inner blocks. 
-
-The translation of assignment blocks on top-level is triggered by Algorithm \ref{algTranslateConstraints} in line \ref{algTranslateConstraintsTopLevelAnnotationAssignments}. the translation of assignment blocks within compounds by Algorithm \ref{algTranslateCompoundDeclaration} in line \ref{algTranslateCompoundDeclarationCompoundAssignments} (there mapping all variable declarations in assignment blocks to $\variableMapping$ in line \ref{algTranslateCompoundDeclarationTranslateSlots}). In both cases, Algorithm \ref{algTranslateAnnotationAssignments} is called. Algorithm \ref{algTranslateAnnotationAssignments} first builds up (incrementally) the set of effective assignments data $ea$ that is relevant for the actual assignment block $a$ (initially $ea=\emptySet$ for a top-level assignment block). Then, for all assignment data and all declared slots, the algorithm creates the variable mapping entries for all assignments, in particular considering whether we are in a compound $ca \neq \undef$ or on top-level. When the mapping is created, the algorithm performs the transformation of each individual assignment and collects the created constraints in $\otherConstraints$. If the type \TBD{this is the static type} of the slot is a compound, it performs the same transformation on all compound slots with respective accessors (either using the slot variable $d$ or the compound accessor $ca$ if given). 
-
-\begin{algorithm}[H]
-  \SetAlgoLined
-  \KwIn{assignment block $a$, effective assignment data $ea$, compound access $ca$}
+We turn now to the translation of annotation assignment blocks. In IVML, an assignment block is used on top-level or within compounds to declare compound slots with an implicit assignment of a value to each declared annotation. Further, assignment blocks can be nested and the assignments defined for the outer blocks must be applied also to the inner blocks. 
+
+The translation of assignment blocks on top-level is triggered by Algorithm \ref{algTranslateConstraints} in line \ref{algTranslateConstraintsTopLevelAnnotationAssignments}. The translation of assignment blocks within compounds is caused by Algorithm \ref{algTranslateCompoundDeclaration} in line \ref{algTranslateCompoundDeclarationCompoundAssignments} (variable mapping in lines \ref{algTranslateCompoundDeclarationVarMappingStart}-\ref{algTranslateCompoundDeclarationVarMappingEnd} and slot translation in line \ref{algTranslateCompoundDeclarationTranslateSlots} along with the decision variables of the compound value). In both cases, Algorithm \ref{algTranslateAnnotationAssignments} is called. 
+
+Algorithm \ref{algTranslateAnnotationAssignments} first builds up (incrementally) the set of effective assignments data $ea$ that is relevant for the actual assignment block $a$ (initially $ea=\emptySet$ for a top-level assignment block). 
+For a given assignment block $a$, the algorithm performs then the transformation of each individual assignment and collects the created constraints in $\otherConstraints$. If the type of the slot (if available the dynamic type of the value)  is a compound, the algorithm performs the same transformation on all compound slots with respective accessors (either using the slot variable $d$ or the compound accessor $ca$ if given). Finally, the algorithm recursively processes contained assignment blocks.
+
+\begin{algorithm}[H]
+  \SetAlgoLined
+  \KwIn{assignment block $a$, variable $v$ effective assignment data $ea$, compound access $ca$}
   \KwData{constraints $\otherConstraints$}
   
@@ -672,11 +675,14 @@
       \ForAll{$d \iterAssng slots(a)$} {
           $add(\otherConstraints, \set{translateAnnotationAssignment(e, d, ca)}, false)$\;
-          \If{$isCompound(type(d))$} {
-              \ForAll{$s \iterAssng slots(d)$} {
-                  $c \assng \IVMLMeta{acc}(\closedCases{d, & \text{if } ca = \undef\\ ca, &\text{else}}, s)$\;
-                  $\variableMapping \assng \variableMapping \addMap \mapEntry{s}{c}$\;
-               }
-              \ForAll{$s \iterAssng slots(d)$} {
-                  $add(\otherConstraints, translateAnnotationAssignment(e, s, \variableMapping[s]))$\;
+          $t \assng type(d)$\;
+          \If{$v \neq \undef$}{
+              $w \assng nested(v, name(d))$\;
+              \uIf{$n \neq \undef \wedge\text{ } value(w) \neq \undef$} {
+                  $t \assng type(value(w))$\;
+              }
+          }
+          \If{$isCompound(t)$} {
+              \ForAll{$s \iterAssng slots(t)$} {
+                  $add(\otherConstraints, translateAnnotationAssignment(e, s, v, \variableMapping[s]))$\;
               }
           }
@@ -691,5 +697,5 @@
 \end{algorithm}
 
-Algorithm \ref{algTranslateAnnotationAssignments} uses the translation of an individual assignment data. The translation of a single assignment from an assignment data $a$ leads to the creation of an assignment constraint as shown below. If a compound accessor $ca$ is given, the annotation is accessed through $ca$ and the respective annotation defined for the given variable declaration $d$ through ($annotation(d, name(a))$. If no accessor is given and the declaration $d$ is not in the variable mapping $\variableMapping$, $d$ is taken as accessor, else the actual accessor in $\variableMapping$. The accessor is used as the left side of an IVML assignment, the right side (value) is made up of the default value expression given by the assignment data $a$.
+Algorithm \ref{algTranslateAnnotationAssignments} relies on the translation of an individual assignment data object. The translation of a single assignment from an assignment data $a$ leads to the creation of an assignment constraint as shown below. If a compound accessor $ca$ is given, the annotation is accessed through $ca$ and the respective annotation defined for the given variable declaration $d$ through ($annotation(d, name(a))$. If no accessor is given and the declaration $d$ is not in the variable mapping $\variableMapping$, $d$ is taken as accessor, else the actual accessor in $\variableMapping$. The accessor is used as the left side of an IVML assignment, the right side (value) is made up of the default value expression given by the assignment data $a$.
 
 \begin{align*}
