Definition
An instance r of the data type Rule is a rule
p1 ...
pk
q,
where
p1,...pk, q are properties (of type AgdKey).
The interpretation of such a rule is, that property q
holds if all properties
p1,..., pk are satisfied,
e.g.,
forest
singlesource
tree means
that a graph which represents a forest with a single source
is a tree.
If a rule is stored in a rule administrator admin, it is assigned a unique index, which, e.g., can be used for realizing arrays indexed by rules in admin.
We use the following abbreviations:
p q1
...
qk
stands for the k rules
p
q1,..., p
qk, and
q
p1
...
pk stands for the k + 1 rules
p1
...
pk
q and
q
p1,..., q
pk.
#include < AGD/Rule.h >
Creation
Rule | r | creates an instances r of type Rule
initialized to
![]() |
Rule | r(AgdKey q) | creates an instances r of type Rule
initialized to
![]() |
Rule | r(AgdKey p1, AgdKey q) | creates an instances r of type Rule
initialized to
p1 ![]() |
Rule | r(AgdKey p1, AgdKey p2, AgdKey q) | |
creates an instances r of type Rule
initialized to
p1 ![]() ![]() |
||
Rule | r(AgdKey p1, AgdKey p2, AgdKey p3, AgdKey q) | |
creates an instances r of type Rule
initialized to
p1 ![]() ![]() ![]() |
||
Rule | r(const Rule& r) | creates an instances r of type Rule identical to r. |
Operations
const leda_list<AgdKey>& | r.left() | returns the left side of r, i.e.,
p1 ![]() ![]() |
AgdKey | r.right() | returns the right side of r, i.e., q. |
int | r.length() | returns the number k of properties on the left side of r. |
int | r.index() | returns the index of r. |
Rule& | r.And(AgdKey p) | extends r to
p1 ![]() ![]() ![]() ![]() |
Rule& | r.implies(AgdKey q) | sets the right side of r to q and returns r. |
Rule& | r.index(int id) | sets the index of r to id and returns r. |
ostream& | ostream& os << const Rule& r | |
writes rule r to output stream os. |
© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13