next up previous
Next: Property definitions Up: The knowledge base Previous: The knowledge base


Composable relations

The knowledge base in this approach consists of partial models that can be instantiated and composed into more complex scenario models. The composition of partial models into a scenario model may involve the composition of partial relations (coming from different partial models) in compounded relations. In the sample scenario model of section 3.2.2, the following relation describes the changes of population size of the prey population

$\displaystyle \frac{d}{dt}N_{\text{prey}}=B_{\text{prey}}-D_{\text{prey}}-P_{\text{prey}}$ (7)

In (7), $ N_{\text{prey}}$ is the population size, $ B_{\text{prey}}$ the number of births, $ D_{\text{prey}}$ the number of natural deaths and $ P_{\text{prey}}$ the number of prey who died due to predation. Thus, relation (7) actually describes two phenomena that affect the population size $ N_{\text{prey}}$: natural population growth ( $ B_{\text{prey}}-D_{\text{prey}}$) and predation related deaths ( $ P_{\text{prey}}$). When constructing the knowledge base, it is desirable to represent these two phenomena in isolation because they do not always occur in combination. For example, some species do not have predators, and it is therefore unnecessary to always include predation as a cause of death. From this viewpoint, relation (7) can be seen as composed from different composable relations in the knowledge base:

$\displaystyle \frac{d}{dt}N_{\text{prey}}=C^+(B_{\text{prey}})\qquad \frac{d}{d...
...y}}=C^-(D_{\text{prey}})\qquad \frac{d}{dt}N_{\text{prey}}=C^-(P_{\text{prey}})$    

The use of composable relations enables the knowledge base to cover as many combinations of the phenomena that may affect a relation as possible, by representing each phenomenon individually rather than precompiling everything together. Because only the component parts (i.e. the composable relations) of relations need to be represented, instead of all possible, and however complex, combinations of them, the knowledge base can be smaller and more effective. This section describes how such composable relations are represented in the knowledge base, as well as whether and how they can be composed to form compounded relations.


Table 2: Composable functors and composable relations
Name Syntax (infix notation) Syntax (prefix notation)
?var$ = C^+($formula$ )$ (== ?var (C-add formula))
?var$ = C^-($formula$ )$
?var$ = C^{\times}($formula$ )$ (== ?var (C-mul formula))
?var$ = C^{\div}($formula$ )$
?var$ =C^{\text{if},p}(\text{antecedent}, \text{formula})$ (== ?var (C-if antecedent formula :priority $ p$))
?var$ =C^{\text{else}}(\text{formula})$


Composable relations are those containing composable functors and for which a method of composition exists (that describes how a complete set of composable relations can be composed). The composable functors employed are those proposed by Bobrow et al. [3] with a new addition: composable selection. A summary of such composable relations is presented in table 2.

The composable relations introduced by Bobrow et al. [3] are easy to understand. The formulae $ f$ in $ v=C^+(f)$ and $ v=C^-(f)$ represent terms (respectively $ f$ and $ -f$) of a sum, and the formulae $ f$ in $ v=C^{\times}(f)$ and $ v=C^{\div}(f)$ represent factors (respectively $ f$ and $ \frac{1}{f}$) of a product.

However, ecological models in use typically contain selection statements which declare that one certain equation must be employed when a condition is satisfied and some other one otherwise. Formally, a selection is a relation of the form

if $\displaystyle c_1$ then $\displaystyle v=r_1$ else if $\displaystyle c_2\ldots$ else $\displaystyle v=r_n$ (8)

where $ v$ is a participant, each $ c_i$ (with $ i=1,\ldots,n-1$) is a relation describing a condition statement and each $ r_j$ (with $ j=1,\ldots,n$) is a relation. This selection relation consists of the partial relations:

\begin{displaymath}\begin{split}&\text{if }c_i\text{ then }v=r_i\qquad\text{ with }i=1,\ldots,n-1\\ &\text{else }v=r_n \end{split}\end{displaymath}    

Therefore, a selection relation can be composed from two types of composable relation. The first is a composable ``if'' relation, which has the form $ v=C^{\text{if},p}(a,f)$, where $ v$ is a participant, $ p$ is an element taken from a total order, such as the set of natural numbers $ \mathds{N}$, which denotes the priority of the composable ``if'' relation in the sequence, and $ a$ and $ f$ are two given relations. The second type of composable relation is a composable ``else'' relation, which has the form $ v=C^{\text{else}}(f_{\text{else}})$, where $ f_{\text{else}}$ is a given relation assigned to $ v$ if none of the antecedents in the composable ``if'' relations is true.

To illustrate this notation, the selection relation (8) can be composed from the following composable relations:

\begin{displaymath}\begin{split}v&=C^{\text{if},p_1}(c_1,r_1)\\ &\vdots\\ v&=C^{...
...p_{n-1}}(c_{n-1},r_{n-1})\\ v&=C^{\text{else}}(r_n) \end{split}\end{displaymath}    

with $ p_1>\ldots>p_{n-1}$.


Table 3: Composibility of composable relations
  $ C^+(f_2)$ $ C^-(f_2)$ $ C^{\times}(f_2)$ $ C^{\div}(f_2)$ $ C^{\text{if},p_2}(a_2,f_2)$ $ C^{\text{else}}(f_2)$
$ C^+(f_1)$ yes yes no no no no
$ C^-(f_1)$ yes yes no no no no
$ C^{\times}(f_1)$ no no yes yes no no
$ C^{\div}(f_1)$ no no yes yes no no
$ C^{\text{if},p_1}(a_1,f_1)$ no no no no yes yes
$ C^{\text{if},p_2}(a_1,f_1)$ no no no no no yes
$ C^{\text{else}}(f_1)$ no no no no yes no


To combine the composable relations, a number of rules are defined to implement the semantics of the representational formalism. In theory, a set of rules can be generated that enables the aggregation of any set of composable relations. In practice, however, a trade-off must be made between flexibility (the ability to combine many different types of composable relation) and comprehensibility (the use of a set of rules that is easily understood by the knowledge engineer who employs composable relations). Thus, the types of composable relations that can be combined has to be restricted.

Table 3 summarises what composable relations can be joined to form compounded relations. The principle guiding the construction of this table is to allow only the composition of relations of certain types for which a resulting compound relation is intuitively obvious. For example, according to Table 3, a composable addition relation $ x=C^+(y)$ can be combined with a composable subtraction relation $ x=C^-(z)$ because their combination is clearly $ x=y-z$. However, according to Table 3, a composable addition relation $ x=C^+(y)$ can not be combined with a composable multiplication relation $ x=C^{\times}(z)$, because an arbitrary and non-intuitive rule would otherwise have to be defined to decide whether the compound relation would be $ x=y+z$ or $ x=y\times z$.

The order in which the composable selections must be considered is defined by the priorities (or is implicit in the case of $ C^{\text{else}}$). Therefore, composable selections can be combined with one another provided no two composable ``if'' relations have the same priority.

In order to derive the actual rules of composition, the sets of all composable relations with the same functor for a given model $ \langle
P,R\rangle$ are defined first:

$\displaystyle R(v,C^+)=\{v=C^+(f_i)\mid (v=C^+(f_i))\in R\}$    
$\displaystyle R(v,C^-)=\{v=C^-(f_i)\mid (v=C^-(f_i))\in R\}$    
$\displaystyle R(v,C^{\times})=\{v=C^{\times}(f_i)\mid (v=C^{\times}(f_i))\in R\}$    
$\displaystyle R(v,C^{\div})=\{v=C^{\div}(f_i)\mid (v=C^{\div}(f_i))\in R\}$    
$\displaystyle R(v,C^{\text{if}})=\{v=C^{\text{if},p_i}(a_i,f_i)\mid (v=C^{\text{if},p_i}(a_i,f_i))\in R\}$    
$\displaystyle R(v,C^{\text{else}})=\{v=C^{\text{else}}(f_i)\mid (v=C^{\text{else}}(f_i))\in R\}$    

From this, the rules of composition can be built as given in the expressions (9), (10) and (11). They jointly state how a given set of composable relations can be rewritten as a single compound relation. Each of these rules contains a complete set of all composable relations in the antecedent. In particular, the antecedent of rule (9) contains the set of all composable addition and subtraction relations with the same participant $ v$ in the left-hand side.

Similarly, the antecedent rule (10) contains the complete set of composable multiplication relations. Finally, the antecedent of rule (11) is satisfied for the complete set of composable if and else relations with the same left-hand participant $ v$, provided that the priorities are strictly ordered (i.e. no two priorities are equal) and that there is only a single composable else relation. The latter two conditions are added because two composable if relations with the same priority or two composable else relations can not be compounded. The consequents of the rules of composition explain how these complete sets of composable relations can be joined. This is simply a matter of applying the appropriate mathematical operation to the provided terms.

\begin{displaymath}\begin{split}R(v,C^+)=\{v=C^+(f_{1+}),\ldots,v=C^+(f_{m+})\}&...
...ow\\ v=f_{1+}+\ldots+f_{m+}-(f_{1-}+\ldots+f_{n-})& \end{split}\end{displaymath} (9)

\begin{displaymath}\begin{split}R(v,C^{\times})=\{v=C^{\times}(f_{1{\times}}),\l...
...imes}}}{f_{1{\div}}\times\ldots\times f_{n{\div}}}& \end{split}\end{displaymath} (10)

\begin{displaymath}\begin{split}R(v,C^{\text{if}})=&\{v=C^{\text{if},p_1}(a_1,f_...
...if }a_m\text{ then }f_m,\text{else }f_{\text{else}} \end{split}\end{displaymath} (11)


next up previous
Next: Property definitions Up: The knowledge base Previous: The knowledge base
Jeroen Keppens 2004-03-01