next up previous contents index
Next: Rule System Iterators ( Up: Pre- and Postconditions Previous: Rules ( Rule )   Contents   Index


Rule Administrators ( RuleAdmin )

Definition

An instance A of type RuleAdmin maintains a rule system R = {r1,..., rk}. The rules ri are of type Rule. Each rule has a unique index betweeen 0 and k - 1. RuleAdmin allows to add rules to the system, and to compute the closure P* of a set of properties P (a key set), which is defined as

\begin{eqnarray*}
P^0 & = & P \\
P^{i+1} & = & P^i\cup\left\{ p\mid\exists p_1,...
... p_k\rightarrow p\in R\right\} \\
P^* & = & \bigcup_{i\geq0}P^i
\end{eqnarray*}

We say that a set of properties P implies a set of properties Q (P $ \rightarrow$ Q) according to R if and only if P* $ \supseteq$ Q.

#include < AGD/RuleAdmin.h >

Creation

RuleAdmin A(const Keymapper& mapper)
    creates an rule administrator A with empty rule system and associated keymapper mapper.

Operations

int A.number_of_rules() returns the number of rules in the rule system.

const_iterator A.begin() returns an iterator pointing to first element in A.

const_iterator A.end() returns an iterator pointing to one-past-last element in A.

const_iterator A.rbegin() returns an iterator pointing to last element in A.

const_iterator A.rend() returns an iterator pointing to one-before-first element in A.

bool A.implies(const KeySet& P, const KeySet& Q)
    returns true iff P $ \rightarrow$ Q, i.e., iff Q is contained in the closure of P according to the rule system of A.

KeySet A.closure(const KeySet& P)
    returns the closure P* of P according to the rule system of A.

void A.add(const Rule& r) adds the rule r to the rule system maintained by A.


next up previous contents index
Next: Rule System Iterators ( Up: Pre- and Postconditions Previous: Rules ( Rule )   Contents   Index

© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13