Index: /reasoner/reasoner.tex
===================================================================
--- /reasoner/reasoner.tex	(revision 65)
+++ /reasoner/reasoner.tex	(revision 66)
@@ -273,5 +273,6 @@
 
 \begin{figure}[ht]
-\includegraphics[scale=0.6]{figures/structure.eps}
+\center
+\includegraphics[scale=0.41]{figures/structure.eps}
 \caption{Structuring blocks, algorithms and sections.}
 \label{figStructure}
@@ -430,7 +431,7 @@
 In more detail, Algorithm \ref{algTranslateDeclaration} first declares some local variables in line \ref{algTranslateDeclarationDecl}, including the actual type $t$ (to be overridden by the type of the default value expression if needed), the default value expression $dflt$, the actual set of default constraints ($\defaultConstraints$ or $\deferredDefaultConstraints$) to be utilized for adding the final constraint and the actual value of self $s$ (for compound types only). Then, if $t$ is a derived data type, constraints are translated and collected through Algorithm \ref{algTranslateDerivedDatatypeConstraints}. In non-incremental mode, i.e., we translate default value expressions to assignment constraints as well as the default constraints for annotations can then be translated using \ref{algTranslateAnnotationDefaults}. Due to potential type interferences with derived types, we determine then the actual type through the type of the default value expression if defined. If $t$ is a compound type, we set the value of self $v$ to the actual variable declaration $d$ and execute the specific translations for compound types using Algorithm \ref{algTranslateCompoundDeclaration}. If $t$ is a container type, we call \ref{algTranslateContainerDeclaration} instead. Otherwise, if there is a default value expression and reasoning is not in incremental mode, i.e., we shall translate default value expressions to assignment constraints, and if there is a compound accessor, we just have to schedule a replacement of \IVML{self} by the compound accessor. Remaining default constraints are taken over as defined as long as the reasoner is not operating incremental mode as there no default value assignments are needed.
 
-If there is finally a default value expression to be recorded in the constraint base, we have to distinguish whether the actual variable is a constraint variable or an usual variable. In the first case, we apply Algorithm \ref{algCreateConstraintVariableConstraint} (cf. Section \ref{sectConstraintVariables}). In the second case, we turn the default value expression into an assignment expression, through the compound accessor if it currently represents \IVML{self}, or the variable. Then, we substitute \IVML{self} and the actual variable mapping on the complete constraint expression and turn the result into a default constraint. We either either it to $\deferredDefaultConstraints$ if the constraint may override a complete value assignment (\IVML{self} is used referring to another variable in the same compound or $d$ is an overridden slot that may accidentally be overriden by a complex compound value) or in all other cases to the usual default constraints set $\defaultConstraints$.
-
-Adding constraints or sets of constraints to the constraint base involves constraint filtering. We will discuss these operations in Section \ref{sectContainerBase}.
+If there is finally a default value expression to be recorded in the constraint base, we have to distinguish whether the actual variable is a constraint variable or an usual variable. In the first case, we apply Algorithm \ref{algCreateConstraintVariableConstraint} (cf. Section \ref{sectConstraintVariables}). In the second case, we turn the default value expression into an assignment expression. However, the accessor creation depends on whether $d$ is an annotation or an usual variable. Then, we substitute \IVML{self} and the actual variable mapping on the complete constraint expression and turn the result into a default constraint. We either either it to $\deferredDefaultConstraints$ if the constraint may override a complete value assignment (\IVML{self} is used referring to another variable in the same compound or $d$ is an overridden slot that may accidentally be overriden by a complex compound value) or in all other cases to the usual default constraints set $\defaultConstraints$.
+
+Adding constraints or sets of constraints to the constraint base involves constraint filtering in order to respect the incremental reasoning mode and in some cases collection of constraints that initialize compounds and containers \TBD{unclear}. We will discuss these operations in Section \ref{sectContainerBase} and just use the function $addConstraint(s, c, b)$, adding constraint $c$ to constraint set $s$, considering copound and container initialization if $b = true$.
 
 \begin{algorithm}[H]
@@ -454,16 +455,17 @@
       }\lElseIf{$inc$}{$ dflt \assng \undef $}
       \If{$ deflt \neq \undef $}{ 
-          \uIf{$\neg isConstraint(type(d))$}{
-              $dflt \assng \createExpression{\IVML{assign}(\closedCases{ca, & \text{if } s = ca \\ d, &\text{else}}, dflt)}$\; \label{algTranslateDeclarationTranslateDefault}
-          }
-          $dflt \assng \varSubstitutionSelfVarMapping{dflt}{s}$\;
           \uIf{$isConstraint(type(d))$}{
               $createConstraintVariableConstraint(dflt, s, v)$\; \label{algTranslateDeclarationConstraintVariableConstraint}
           }\Else{ 
+              \uIf{$isAnnotation(v)$}{
+                  $ac\assng \closedCases{\IVMLMeta{acc}(d,a), & \text{if } ca = \undef \\ \IVMLMeta{acc}(ca,a), &\text{else}}$\;
+              }\uElse{
+                  $ac \assng \closedCases{ca, & \text{if } s = ca \\ d, &\text{else}}$\; 
+              }
              \lIf{$\IVMLself{} \in dflt \vee isOverridenSlot(d)$}{$dfltS \assng \deferredDefaultConstraints$}\lElse{$dfltS \assng \defaultConstraints$}
-              $add(dfltS, \createDefaultConstraint{dflt})$\; 
+              $add(dfltS, \createDefaultConstraint{\varSubstitutionSelfVarMapping{\IVML{assign}(ac, dflt)}{s}})$\; \label{algTranslateDeclarationTranslateDefault}
           }
       }
- \caption{Translating declaration constraints (\IVML{translateDeclaration}).}\label{algTranslateDeclaration}
+ \caption{Translating declarations (\IVML{translateDeclaration}).}\label{algTranslateDeclaration}
 \end{algorithm}
 
@@ -491,13 +493,23 @@
 \subsection{Annotation default expressions}\label{sectAnnotationDefaults}
 
-In IVML, annotations are orthogonal typed variables that can be attached to a variable. For all those ortogonal variables, the reasoner must create constraints to perform the evaluation and assignment of the default values before all other constraints are considered for reasoning.  Algorithm \ref{algTranslateAnnotationDefaults} receives the configuration to operate on, the declaration of the actual variable and a potential compound access expression $ca$ to $d$ if the algorithm is recursively called within a compound structure. For all annotations of $d$ (technically only available from the actual decision variable of the configuration $cfg$), the algorithm creates constraints that assign the annotation $r$ (on $d$ or via $ca$) the value of the default value expression of $r$.
+In IVML, annotations are orthogonal typed variables that can be attached to a variable. For all those ortogonal variables, the reasoner must create constraints to perform the evaluation and assignment of the default values before all other constraints are considered for reasoning. 
+
+Algorithm \ref{algTranslateAnnotationDefaults} receives the declaration of the actual variable and a potential compound access expression $ca$ to $d$ if the algorithm is called for slots of a compound value. For all annotations of $v$ (as for $v$ here all inherited annotations are available), the algorithm creates the respective constraints through calling Algorithm \ref{algTranslateDeclaration}.
+
+%constraints that assign the annotation $a$ (accessed either directly through $d$ or, if given, through $ca$) the value of the default value expression of $a$ and substitutes variables in $\variableMapping$. The created constraints are either added to the set of default constraints $\defaultConstraints$.
 
 \begin{algorithm}[H]
   \SetAlgoLined
   \KwIn{declaration $d$, variable $v$, compound access $ca$}
-  \KwData{configuration $cfg$, constraints $\otherConstraints$}
-
-  $a \assng annotations(v)$\;
-  $add(\otherConstraints, \setWith{\createDefaultConstraint{\IVML{assign}(\closedCases{\IVMLMeta{acc}(d,r), & \text{if } ca = \undef \\ \IVMLMeta{acc}(ca,r), &\text{else}}, default(r))}}{r\in a}, false)$\; 
+  \KwData{constraints $\otherConstraints$}
+
+      %$s\assng \undef$\;
+      %\uIf{$isCompound(t)$}{$s \assng d$\;} \uElseIf{$ca \neq \undef$}{$s \assng ca$} 
+      \ForEach{$a\in annotations(v)$}{
+         $translateDeclaration(decl(a), a, ca)$\;
+         %$c\assng \createDefaultConstraint{\varSubstitutionSelfVarMapping{\IVML{assign}(\closedCases{\IVMLMeta{acc}(d,a), & \text{if } ca = \undef \\ \IVMLMeta{acc}(ca,a), &\text{else}}, default(a))}{s}}$\;
+         %\uIf{$\IVMLself{} \in dflt$}{$dfltS \assng \deferredDefaultConstraints$}\uElse{$dfltS \assng \defaultConstraints$}
+         %$add(dfltS, c, false)$\; 
+       }
  \caption{Translating annotation defaults (\IVML{translateAnnotationDefaults}).}\label{algTranslateAnnotationDefaults}
 \end{algorithm}
