Index: /reasoner/reasoner.tex
===================================================================
--- /reasoner/reasoner.tex	(revision 12)
+++ /reasoner/reasoner.tex	(revision 13)
@@ -16,4 +16,7 @@
 \newcommand\set[1]{\{#1\}}
 \newcommand\setWith[2]{\{#1:#2\}}
+\newcommand\createConstraint[1]{\langle #1 \rangle}
+\newcommand\createDefaultConstraint[1]{\langle_d\text{ } #1 \rangle}
+\newcommand\createInternalConstraint[1]{\langle_i\text{ } #1 \rangle}
 
 \begin{document}
@@ -45,6 +48,8 @@
   \item usually, if not used otherwise, $v$ is variable, $d$ is declaration, $t$ is type, $val$ is value
   \item $\undef$ is the undefined value, e.g., an undfined constraint, type or declaration. \TBD{what is a constraint, how to denote a constraint creation in contrast to mathematical/algorithmic notation}
+  \item $decision(cfg, d)$ the variable from the configuration $cfg$. In contrast to a declaration, a (decision) variable is linked to a respective configuration, has an assignment state and holds the actually configured value.
   \item $declaration(v)$ the declaration of variable $v$
-  \item $type(d)$ the type of the variable declaration $d$, similarly $type(v) = type(declaration(v))$ and $type(val)$ the (potentially sub-)type of the value $val$
+  \item $type(d)$ the type of the declaration $d$, similarly $type(v) = type(declaration(v))$ and $type(val)$ the (potentially sub-)type of the value $val$
+  \item $annotations(d)$ returns the set of orthogonal IVML annotations declarations for declaration $d$. Similarly, $annotations(v)$ returns the set of actual annotations for the variable $v$. There is a significant difference between $annotations(d)$ and $annotations(decision(cfg,d))$, as a declaration can only holds the specifically declared attributes for $d$, while a variable is instantiated with all annotations applied to the containing project or variables (in case of compounds or collections).
   \item $varDeclarations(p)$ the set of all variable declarations in project $p$
   \item $name(s)$ is the default value expression of slot $s$
@@ -59,4 +64,5 @@
   \item $allRefines(t) = \begin{cases}\emptySet, & \text{if } refines(t) = \emptySet \\  allRefines(t) \cup \bigcup_{u\in refines(t)} allRefines(u), & \text{else}\\ \end{cases}$
   \item $allRefines^+(t) = \begin{cases}allRefines(t) \cup \set{t}, & \text{if } isCompound(t) \\ \emptySet, & \text{else} \\  \end{cases}$
+  \item Creating a constraint through OCL function call notation in angle brackets, e.g., $\createConstraint{\IVML{assign}(x, 25)}$ represents the IVML constraint \IVML{x = 25;}. If the constraint is marked as a default constraint, then we denote $\createDefaultConstraint{\IVML{assign}(x, 25)}$, if it is an internal \TBD{clarify semantics }constraint for reasoning we use $\createInternalConstraint{\IVML{assign}(x, 25)}$. We indicate IVML operations in teletype font.
 \end{itemize}
 \TBD{Algorithms + implementation name}
@@ -76,5 +82,5 @@
   \SetAlgoLined
   \KwIn{configuration $cfg$, boolean $incremental$ \TBD{inc?}}
-  \KwData{problem records $m$, relevant constraints $t$}
+  \KwData{problem records $m$, relevant constraints $t$ \TBD{$t$??}}
   \KwResult{Reasoning result $r$}
   
@@ -84,5 +90,5 @@
       %evaluator.setResolutionListener(Algorithm \ref{algVarChange})\;
       %evaluator.setScopeAssignments(sAssng)\;
-      $base \assng translateDefaults(p, t)$\;
+      $base \assng translateDefaults(p, cfg, t)$\;
       $base \assng base \addSeq translateConstraints(p, t)$\;
       $evaluateConstraints(p, base)$\;
@@ -151,4 +157,5 @@
 \begin{itemize}
   \item translates the constraints stemming from derived types (cf. Section \ref{sectDerivedTypes}) and stores them into the global set of internal constraints $c_i$
+  \item constructs the default value assingment constraints for the annotations (cf. Section \ref{sectAnnotationDefaults}) and stores them into the global set of annotation constraints $c_i$
   \item \TBD{fill}
 \end{itemize}
@@ -156,12 +163,13 @@
 \begin{algorithm}[H]
   \SetAlgoLined
-  \KwIn{project $p$}
-  \KwData{constraint $base$, variable mapping $m$, internal constraints $c_i$}
-  
-  \ForAll{$d \iterAssng varDeclarations(p)$}{ %translateDefaultForDeclaration
+  \KwIn{project $p$, configuration $cfg$}
+  \KwData{constraint $base$, variable mapping $m$, internal constraints $c_i$, attribute constraints $c_a$}
+  
+  \ForAll{$d \iterAssng varDeclarations(p)$}{ %translateDeclarationDefaults
       $c_i \assng c_i \cup translateDerivedDatatypeConstraints(d)$\;
+      $c_a \assng c_a \cup translateAnnotationDefaults(cfg, d, \undef)$\;      
       \TBD{fill}\;
   }
- \caption{Translating default value expressions to constraints (\IVML{translateDefaults, translateDefaultForDeclaration}).}\label{algTranslateDefaults}
+ \caption{Translating default value expressions to constraints (\IVML{translateDefaults, translateDeclarationDefaults}).}\label{algTranslateDefaults}
 \end{algorithm}
 
@@ -175,9 +183,25 @@
   \KwOut{instantiated constraints for derived type $d$}
 
-  $\setWith{c|_{decl(s)=d}}{c\in constraints(s) \wedge s\in allBase(type(d))}$\; 
- \caption{Translating constraints for derived types (\IVML{translateDerivedDatatypeConstraints}).}\label{algTranslateDerivedDatatypeConstraints}
-\end{algorithm}
-
-\subsection{Default constraints}
+  $\setWith{\createInternalConstraint{c|_{decl(s)=d}}}{c\in constraints(s) \wedge s\in allBase(type(d))}$\; 
+ \caption{Translating constraints for derived types (\IVML{translateDerivedDatatypeConstraints, createInternalConstraints}).}\label{algTranslateDerivedDatatypeConstraints}
+\end{algorithm}
+
+\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$.
+
+\begin{algorithm}[H]
+  \SetAlgoLined
+  \KwIn{configuration $cfg$, declaration $d$, compound access $ca$}
+  \KwOut{instantiated constraints for annotations of $v$}
+
+  $a \assng annotations(decision(cfg, d))$\;
+  $\setWith{\createDefaultConstraint{\IVML{assign}(\left.\begin{cases}d.r, & \text{if } ca = \undef \\ ca.r, &\text{else}\end{cases}\right\}, default(r))}}{r\in a}$\; 
+ \caption{Translating annotation defaults (\IVML{translateAnnotationDefaults}).}\label{algTranslateAnnotationDefaults}
+\end{algorithm}
+
+
+
+\subsection{Default expressions}
 
 \subsubsection{Compound default constraints}
