analyst ! 1 � employee, 1500 � eur, (14)

	- employee ¼ max, (16)
		- eur ≤120000, (17)

$$1 \le m \le 5 \tag{18}$$

$$1 \le n \le 3,\tag{19}$$

1≤l ≤6: (20)

adequacy are not proved usually in the mathematical sense. As a consequence, quality of the adopted decisions, based on such heuristics, in many cases may be far

boundary restrictions and/or optimality criteria.

lem formalization and solution.

tions, may be described in such a way:

This set of constructions is of the form:

2. Informal description

identical positions:

70

This chapter is dedicated to a primary survey of the developed knowledge representation model, providing convergence of classical operations research and modern knowledge engineering. This convergence creates new opportunities for complicated problem formalization and solution by integrating best features of mathematical programming (strict optimal solution search in solution space, defined by goal functions and boundary conditions) and constraint programming [15–17] (natural and easily updated top-down representation of logic of the decision-making in various situations). Kernel of the considered model is multisets (MS)—relatively long ago known and in the last 20 years intensively applied object of classical mathematics [18–29]. This background is generalized to the recursively generated, or, for short, recursive multisets (RMS) by introduction of so-called multiset grammars, or, again for short, multigrammars (MGs), which were described by the author in [30, 31]. Last, in turn, are peculiar "projection" of the conceptual basis of classical formal grammars by Chomsky [32, 33], operating strings of symbols, to the multisets universum in such a way, that MGs provide generation of one multiset from another and selection (filtration) of those, which satisfy necessary integral conditions:

MGs may be considered as prolog-like constraint programming language for solution of problems in operations research and systems analysis areas. Taking into account relative novelty of the multigrammatical approach and absence of any substantial associations with mathematical constructions presented lower, we introduce main content of the chapter by short informal description of the main elements of this approach in Section 2. Basic formal definitions are presented in Section 3. Section 4 is dedicated to multiset grammars, while Section 5—to detailed

Let us consider a company, which consists of director, three departments, and

In this notation, a whole structure of the company, detailed to employee posi-

describes following set, created by multiplying and summarizing quantities of

f1 � director; 3 � head � department; 10 � head � laboratory; 20 � analyst; 30 � assistantg,

company ! 1 � director, 3 � department, 1 � laboratory: (1)

laboratory ! <sup>1</sup> � head � laboratory, <sup>2</sup> � analyst, <sup>3</sup> � assistant: (2)

a ! n<sup>1</sup> � a1, …, nm � am (3)

(4)

consideration of the so-called unitary multigrammars (UMGs) and unitary multimetagrammars (UMMGs), which are main tool of the aforementioned prob-

one separate laboratory. This fact may be simply represented as follows:

department ! 1 � head � department, 3 � laboratory,

of optimal.

Enhanced Expert Systems

As seen, along with already introduced "detailing" constructions, there are additional constructions, defining sets of values of variables, having places in the first ones, as well as conditions, determining optimization criterion (there may be several such criteria), and bounds of quantities of some objects in the resulting sets. Evidently, due to presence of alternatives in the description of company structure (there are three such alternatives) and variables in some of "detailing" constructions, there may be more than one resulting set like Eq. (4). These sets are of the form f g x � employee; y � eur , where x is the quantity of employees, while y—total salary, corresponding to this variant. Conditions (16)–(20) provide selection of those sets, which satisfy them in the described sense. In general, Eqs. (16)–(20) may be interpreted as a query, determining subset of all possible variants, described by Eqs. (6)–(15).

To "mark" "detailing" constructions, used while resulting set creation, one can add to their "bodies" elements like 1 � variant‐i, for example,

$$\mathbf{1}\text{ company} \rightarrow \mathbf{1} \cdot \text{variant-1, 1} \cdot \text{director, 3} \cdot \text{department, 1} \cdot \text{laboratory},\tag{21}$$

$$\begin{array}{c} \text{compancy} \rightarrow \texttt{1\text{-}variant-2, 1\text{-}divector, 2\text{-}departement, 3\text{-}labortary,\end{array} \tag{22}$$

company ! <sup>1</sup> � variant‐3, <sup>1</sup> � director, <sup>4</sup> � department: (23)

If so, then resulting sets will be of the form:

$$\{\mathbf{1} \cdot \mathbf{v} \cdot \mathbf{r} \mathbf{i} \, \text{ant-i}, \mathbf{x} \cdot \mathbf{e} \, \text{m} \} \, \mathbf{y} \, \text{e} \, \mathbf{y} \cdot \mathbf{e} \, \text{tr}\} \, \text{.} \tag{24}$$

Expression (26) is recorded as:

DOI: http://dx.doi.org/10.5772/intechopen.81698

of this object in the multiset:

called basis of multiset v.

Consider two multisets:

v ¼ f g n<sup>1</sup> � a1; …; nm � am , (27)

where v is called multiset, a1, …, am—objects, n1, …, nm—multiplicities of these objects, and n<sup>1</sup> � a1, …, nm � am—multiobjects. Following Eq. (27), one may consider v as set of multiobjects; also, from substantial point of view, set f g a1; …; am and multiset 1f g � a1; …; 1 � am are equivalent. Empty multiset, as well as empty set, is designated as f g ∅ . Multiplicity of object may be zero, what is equivalent to absence

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale…

Fact that object a or multiobject n � a belongs to multiset v ("enters v") is designated by one and the same symbol ∈ : a∈ v, n � a∈v. Set βð Þ¼ v f g ajn � a∈v is

There are five main operations on multisets, used lower: join, intersection,

v ¼ f g n<sup>1</sup> � a1; …; nm � am ,

<sup>1</sup>; …; n<sup>0</sup>

<sup>1</sup>; …; a<sup>0</sup> m0 � �

> <sup>1</sup>; …; a<sup>0</sup> m0 � �

<sup>m</sup><sup>0</sup> � a<sup>0</sup> m0

� �: (29)

1

CCCCCCCCCCA ∪

(30)

max n; n<sup>0</sup> f g ð Þ� a

1

CCCA ∪

1

CCCA,

min n, n<sup>0</sup> f g ð Þ� a

1

CCCCCCCCCA

: (31)

f g n�a

n0 �a<sup>0</sup> f g

<sup>1</sup> � a<sup>0</sup>

addition, subtraction, and multiplication by constant [26, 27].

v<sup>0</sup> ¼ n<sup>0</sup>

a ∈f g a1; …; am ∩ a<sup>0</sup>

∪ ⋃ a ∈ a1; …; a<sup>0</sup>

∪ ⋃

Result of v, v<sup>0</sup> multisets intersection (recorded as ⋂) is multiset.

a∈f g a1; …; am ∩ a<sup>0</sup>

n � a∈v n<sup>0</sup> � a∈v

a0 ∈ a<sup>0</sup> <sup>1</sup>; …; a<sup>0</sup> m � � � f g <sup>a</sup>1; …; am n0 �a<sup>0</sup> ∈v

theoretical join of sets determined by underwritten conditions.

n � a∈v n<sup>0</sup> � a ∈ v

m0 � � � <sup>a</sup><sup>0</sup>

n�a ∈v

where ∪, ∩ and� designate operations of set-theoretical join, intersection, and subtraction of two sets correspondingly, while ⋃ designates operation of set-

> <sup>1</sup>; …; a<sup>0</sup> m0 � �

Result of their join (recorded as ∪) is multiset.

0

BBBBBBBBBB@

0

BBB@

0

BBB@

v⋂v<sup>0</sup> ¼ ⋃

0

BBBBBBBBB@

73

v⋃v<sup>0</sup> ¼ ⋃

f g n<sup>1</sup> � a1; …; nm � am; 0 � amþ<sup>1</sup> ¼ f g n<sup>1</sup> � a1; …; nm � am : (28)

To implant to these sets values of variables, it is sufficient to represent them in resulting sets in "usual" form j � v, where v is variable and j is its value, so considered example will lead us to sets like:

$$\{\mathbf{1} \cdot \mathbf{v} \mathbf{i} \cdot \mathbf{n} \mathbf{i} \cdot \mathbf{i}, \mathbf{x} \cdot \mathbf{e} \mathbf{m} \mathbf{b} \mathbf{y} \mathbf{e} \mathbf{e}, \mathbf{y} \cdot \mathbf{e} \mathbf{u} \mathbf{r}, \mathbf{i} \cdot \mathbf{m}, \mathbf{j} \cdot \mathbf{n}, \mathbf{k} \cdot \mathbf{l}\}. \tag{25}$$

As seen, shortly introduced by this example knowledge and query representation language, being easy to understand and to use, allows formalization of multicriterial optimization problems, for years associated with mathematical programming. On the other hand, "detailing" constructions have form of productions (rules), far and wide used in knowledge engineering and being common background of prolog-like declarative (nonprocedural) knowledge representation [34–36]. As will be shown lower, such constructions may be used not only for structuring, but in many other cases, enabling description of various systems behavior and interaction, as well as their mutual impacts. For such reasons, this informally described technique is taken as a basis for the description of the developed mathematical toolkit considered thoroughly in the following sections.

#### 3. Basic operations on multisets

Classical set theory is based on the concept of set as unordered assembly of elements, different from one another. Theory of multisets assumes presence of equal ("indistinguishable") elements:

$$v = \left\{ \underbrace{a\_1 \dots a\_1}\_{n\_1 \text{ times}}, \dots, \underbrace{a\_i \dots a\_i}\_{n\_i \text{ times}}, \dots, \underbrace{a\_m \dots a\_m}\_{n\_m \text{ times}} \right\} \tag{26}$$

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale… DOI: http://dx.doi.org/10.5772/intechopen.81698

Expression (26) is recorded as:

As seen, along with already introduced "detailing" constructions, there are additional constructions, defining sets of values of variables, having places in the first ones, as well as conditions, determining optimization criterion (there may be several such criteria), and bounds of quantities of some objects in the resulting sets. Evidently, due to presence of alternatives in the description of company structure (there are three such alternatives) and variables in some of "detailing" constructions, there may be more than one resulting set like Eq. (4). These sets are of the form f g x � employee; y � eur , where x is the quantity of employees, while y—total salary, corresponding to this variant. Conditions (16)–(20) provide selection of those sets, which satisfy them in the described sense. In general, Eqs. (16)–(20) may be interpreted as a query, determining subset of all possible variants, described by

To "mark" "detailing" constructions, used while resulting set creation, one can

company ! <sup>1</sup> � variant‐1, <sup>1</sup> � director, <sup>3</sup> � department, <sup>1</sup> � laboratory, (21) company ! <sup>1</sup> � variant‐2, <sup>1</sup> � director, <sup>2</sup> � department, <sup>3</sup> � laboratory, (22)

To implant to these sets values of variables, it is sufficient to represent them in resulting sets in "usual" form j � v, where v is variable and j is its value, so considered

As seen, shortly introduced by this example knowledge and query representa-

Classical set theory is based on the concept of set as unordered assembly of elements, different from one another. Theory of multisets assumes presence of

> ; …; ai, …, ai |fflfflfflffl{zfflfflfflffl} ni times

; …; am, …, am |fflfflfflfflffl{zfflfflfflfflffl} nm times

9 = ;

(26)

tion language, being easy to understand and to use, allows formalization of multicriterial optimization problems, for years associated with mathematical programming. On the other hand, "detailing" constructions have form of productions (rules), far and wide used in knowledge engineering and being common background of prolog-like declarative (nonprocedural) knowledge representation [34–36]. As will be shown lower, such constructions may be used not only for structuring, but in many other cases, enabling description of various systems behavior and interaction, as well as their mutual impacts. For such reasons, this informally described technique is taken as a basis for the description of the developed mathematical toolkit considered thoroughly in the following sections.

company ! <sup>1</sup> � variant‐3, <sup>1</sup> � director, <sup>4</sup> � department: (23)

f g <sup>1</sup> � variant‐i; <sup>x</sup> � employee; <sup>y</sup> � eur; <sup>i</sup> � <sup>m</sup>; <sup>j</sup> � <sup>n</sup>; <sup>k</sup> � <sup>l</sup> : (25)

f g <sup>1</sup> � variant‐i; <sup>x</sup> � employee; <sup>y</sup> � eur : (24)

add to their "bodies" elements like 1 � variant‐i, for example,

If so, then resulting sets will be of the form:

example will lead us to sets like:

3. Basic operations on multisets

equal ("indistinguishable") elements:

72

v ¼ a1, …, a<sup>1</sup> |fflfflfflffl{zfflfflfflffl} n<sup>1</sup> times

8 < :

Eqs. (6)–(15).

Enhanced Expert Systems

$$v = \{n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m\},\tag{27}$$

where v is called multiset, a1, …, am—objects, n1, …, nm—multiplicities of these objects, and n<sup>1</sup> � a1, …, nm � am—multiobjects. Following Eq. (27), one may consider v as set of multiobjects; also, from substantial point of view, set f g a1; …; am and multiset 1f g � a1; …; 1 � am are equivalent. Empty multiset, as well as empty set, is designated as f g ∅ . Multiplicity of object may be zero, what is equivalent to absence of this object in the multiset:

$$\{n\_1 \cdot a\_1, \ldots, n\_m \cdot a\_m, 0 \cdot a\_{m+1}\} = \{n\_1 \cdot a\_1, \ldots, n\_m \cdot a\_m\}.\tag{28}$$

Fact that object a or multiobject n � a belongs to multiset v ("enters v") is designated by one and the same symbol ∈ : a∈ v, n � a∈v. Set βð Þ¼ v f g ajn � a∈v is called basis of multiset v.

There are five main operations on multisets, used lower: join, intersection, addition, subtraction, and multiplication by constant [26, 27].

Consider two multisets:

$$\begin{aligned} v &= \{n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m\}, \\ v' &= \{n'\_1 \cdot a'\_1, \dots, n'\_{m'} \cdot a'\_{m'}\}. \end{aligned} \tag{29}$$

Result of their join (recorded as ∪) is multiset.

v⋃v<sup>0</sup> ¼ ⋃ a ∈f g a1; …; am ∩ a<sup>0</sup> <sup>1</sup>; …; a<sup>0</sup> m0 � � n � a∈v n<sup>0</sup> � a ∈v max n; n<sup>0</sup> f g ð Þ� a 0 BBBBBBBBBB@ 1 CCCCCCCCCCA ∪ ∪ ⋃ a ∈ a1; …; a<sup>0</sup> m0 � � � <sup>a</sup><sup>0</sup> <sup>1</sup>; …; a<sup>0</sup> m0 � � n�a ∈v f g n�a 0 BBB@ 1 CCCA ∪ ∪ ⋃ a0 ∈ a<sup>0</sup> <sup>1</sup>; …; a<sup>0</sup> m � � � f g <sup>a</sup>1; …; am n0 �a<sup>0</sup> ∈v n0 �a<sup>0</sup> f g 0 BBB@ 1 CCCA, (30)

where ∪, ∩ and� designate operations of set-theoretical join, intersection, and subtraction of two sets correspondingly, while ⋃ designates operation of settheoretical join of sets determined by underwritten conditions.

Result of v, v<sup>0</sup> multisets intersection (recorded as ⋂) is multiset.

$$\|v\|\|v' = \begin{pmatrix} \bigcup \bigcup \{ \min(n, a') \cdot a \} \\ a \in \{ a\_1, \dots, a\_m \} \cap \{ a'\_1, \dots, a'\_{m'} \} \\ n \cdot a \in v \\ n' \cdot a \in v \end{pmatrix} \tag{31}$$

Result of v, v<sup>0</sup> multisets addition (recorded as bold þ) is multiset.

$$\begin{aligned} \boldsymbol{v} + \boldsymbol{v}' &= \left( \cup \bigcup\_{\substack{\bigcup \{a\_1, \ldots, a\_m\} \cap \{a'\_1, \ldots, a'\_{m'}\} \\ \boldsymbol{n} \cdot a \in \boldsymbol{v}}} \{ (\boldsymbol{n} + \boldsymbol{n}') \cdot \boldsymbol{a} \} \right) \cup \\ & \boldsymbol{n}' \cdot \boldsymbol{a} \in \boldsymbol{v} \end{aligned} \tag{32}$$
 
$$\cup \left( \begin{pmatrix} \cup \\ \cup \\ \cup \\ a \in \{a\_1, \ldots, a\_m\} - \{a'\_1, \ldots, a'\_{m'}\} \cdot \{\boldsymbol{n} \cdot a\} \end{pmatrix} \cup \\ \cup \left( \begin{pmatrix} \\ \cup \\ \cup \\ a' \in \{a'\_1, \ldots, a'\_{m'}\} - \{a\_1, \ldots, a\_m\} \cdot \{\boldsymbol{n}' \cdot a\} \end{pmatrix} \right) . \end{aligned} \tag{33}$$

v1∪v<sup>2</sup> ¼ f g 3 � analyst; 4 � assistant; 1 � director ,

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale…

v1þv<sup>2</sup> ¼ f g 3 � analyst; 6 � assistant; 1 � director ,

All defined operations are known from widespread sources (e.g., aforementioned [26, 27]). At the same time, filtering operations, defined lower, operate sets of multisets (SMS), creating subsets of these sets by selection of multisets, which

> nρa, (36) aρn, (37)

e1ρ1e2ρ2…eiρieiþ<sup>1</sup>…emρmemþ<sup>1</sup>, (39)

, if n � a∈ v, n<sup>0</sup> � a<sup>0</sup> ∈v, and nρn

0 <sup>¼</sup> <sup>0</sup> .

e1ρ1e2, e2ρ2e3, …, eiρieiþ<sup>1</sup>, …, emρmemþ<sup>1</sup>, (40)

, (38)

0

, multiplicity n in

, that

is true. There is

Boundary condition may be elementary or concatenated (for short, "chain"). Elementary boundary condition (EBC) may have one of the following

aρa<sup>0</sup>

where a and a<sup>0</sup> are the objects, n is the integer number, and ρ∈f g , ; ¼; ≤ . Chain boundary condition (CBC) is constructed from elementary by writing them

where e1, …, emþ<sup>1</sup> are the objects or nonnegative integers, while ρ1, …, ρ<sup>m</sup> are the

EBC semantics is following. Let V be set of multisets, and v∈V. Multiset v satisfies EBC nρa, if n � a∈V, and nρn is true. Similarly, v satisfies EBC aρn, if nρn is

CBC semantics is defined as follows. CBC (39) is replaced by CBC sequence

and v∈V is considered satisfying CBC (39), if it satisfies all EBC having place in

Result of application of boundary condition b to SMS V is recorded as V↓b. Example 2. Let V ¼ f g v1; v<sup>2</sup> , where v<sup>1</sup> ¼ f g 5 � analyst; 3 � assistant; 1 � director ,

assistant , 5: Table 1 contains result of application of listed boundary conditions to V.∎

. Similarly, v∈V satisfies condition a ¼ max, if for every v<sup>0</sup> ∈V, such that

opt∈f g min; max . Semantics of this construction is following. Multiset v∈V sat-

, multiplicity n in multiobject n � a∈ v is not less, than multiplicity n<sup>0</sup> in

multiobject n � a∈ v is not greater, than multiplicity n<sup>0</sup> in multiobject n<sup>0</sup> � a∈v<sup>0</sup>

v<sup>2</sup> ¼ f g 2 � assistant; 4 � director; 3 � employee , and boundary conditions are 2≤ analyst≤ 4, assistant , employee, 1≤director ≤assistant ≤3, and analyst ¼

Optimizing condition has form a = opt, where a is the object, and

isfies condition a ¼ min, if for every v<sup>0</sup> ∈V, such that v 6¼ v<sup>0</sup>

0

one addition to all listed definitions, concerning particular case, when

� <sup>a</sup>∉<sup>v</sup> , which is equivalent to <sup>n</sup> <sup>¼</sup> <sup>0</sup> <sup>n</sup>

v1∩v<sup>2</sup> ¼ f g 2 � assistant ,

DOI: http://dx.doi.org/10.5772/intechopen.81698

v<sup>2</sup> � v<sup>1</sup> ¼ f g 2 � assistant ,

satisfy some conditions, being operands of these operations. There are two types of conditions: boundary and optimizing.

forms:

sequentially:

n � a∉v n<sup>0</sup>

Eq. (40).

is, n≤ n<sup>0</sup>

v 6¼ v<sup>0</sup>

75

symbols of relations ( , , ¼ , ≤).

also true. At last, v satisfies EBC aρa

v1∗2 ¼ f g 6 � analyst; 4 � assistant , f g 1 � analyst; 2 � assistant ⊂v1, f g 4 � assistant; 1 � director ⊆v2: ∎

Result of v<sup>0</sup> multiset subtraction from v multiset (recorded as bold �) is multiset.

$$v - v' = \begin{pmatrix} \cup \\ \\ \cup \\ \cup \\ a \in \{a\_1, \dots, a\_m\} \cap \{a'\_1, \dots, a'\_{m'}\} \\ \cdot n \cdot a \in v \\ n' \cdot a \in v' \\ n \cdot n' \\\\ \cup \\\\ a \in \{a\_1, \dots, a\_m\} - \{a'\_1, \dots, a'\_{m'}\} \wedge^{(n\cdot a)} \end{pmatrix} \tag{33}$$

At last, result of v multiset multiplication by integer number n (recorded as v∗n) is multiset.

$$w \ast n = \{ (n \times n\_1) \cdot a\_1, \ldots, (n \times n\_m) \cdot a\_m \} \tag{34}$$

(here integers' usual multiplication is recorded as �)

There are also two basic relations on multisets: inclusion (⊆) and strict inclusion (⊂).

Multiset v is included to multiset v<sup>0</sup> , that is, v⊆v<sup>0</sup> , if

$$[(\forall n \cdot a \in v)][((\exists n' \cdot a \in v') \; n \le n')],\tag{35}$$

and multiset v is strictly included to multiset v<sup>0</sup> , that is, v⊂v<sup>0</sup> , if v⊆v<sup>0</sup> & v6¼v<sup>0</sup> : Example 1. Let v<sup>1</sup> ¼ f g 3 ∙ analyst; 2 ∙ assistant , v<sup>2</sup> ¼ f g 4 ∙ assistant; 1 ∙ director , then Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale… DOI: http://dx.doi.org/10.5772/intechopen.81698

> v1∪v<sup>2</sup> ¼ f g 3 � analyst; 4 � assistant; 1 � director , v1∩v<sup>2</sup> ¼ f g 2 � assistant , v1þv<sup>2</sup> ¼ f g 3 � analyst; 6 � assistant; 1 � director , v<sup>2</sup> � v<sup>1</sup> ¼ f g 2 � assistant , v1∗2 ¼ f g 6 � analyst; 4 � assistant , f g 1 � analyst; 2 � assistant ⊂v1, f g 4 � assistant; 1 � director ⊆v2: ∎

All defined operations are known from widespread sources (e.g., aforementioned [26, 27]). At the same time, filtering operations, defined lower, operate sets of multisets (SMS), creating subsets of these sets by selection of multisets, which satisfy some conditions, being operands of these operations.

There are two types of conditions: boundary and optimizing.

Boundary condition may be elementary or concatenated (for short, "chain"). Elementary boundary condition (EBC) may have one of the following forms:

$$n\rho a,\tag{36}$$

$$
\mathfrak{a}\rho\mathfrak{m},
\tag{37}
$$

$$
\mathfrak{a}\mathfrak{a}',\tag{38}
$$

where a and a<sup>0</sup> are the objects, n is the integer number, and ρ∈f g , ; ¼; ≤ . Chain boundary condition (CBC) is constructed from elementary by writing them sequentially:

$$
\omega\_1 \rho\_1 \varepsilon\_2 \rho\_2 \dots \varepsilon\_i \rho\_i \varepsilon\_{i+1} \dots \varepsilon\_m \rho\_m \varepsilon\_{m+1},\tag{39}
$$

where e1, …, emþ<sup>1</sup> are the objects or nonnegative integers, while ρ1, …, ρ<sup>m</sup> are the symbols of relations ( , , ¼ , ≤).

EBC semantics is following. Let V be set of multisets, and v∈V. Multiset v satisfies EBC nρa, if n � a∈V, and nρn is true. Similarly, v satisfies EBC aρn, if nρn is also true. At last, v satisfies EBC aρa 0 , if n � a∈ v, n<sup>0</sup> � a<sup>0</sup> ∈v, and nρn 0 is true. There is one addition to all listed definitions, concerning particular case, when n � a∉v n<sup>0</sup> � <sup>a</sup>∉<sup>v</sup> , which is equivalent to <sup>n</sup> <sup>¼</sup> <sup>0</sup> <sup>n</sup> 0 <sup>¼</sup> <sup>0</sup> .

CBC semantics is defined as follows. CBC (39) is replaced by CBC sequence

$$
\sigma\_1 \rho\_1 \varepsilon\_2 \,\, \sigma\_2 \rho\_2 \varepsilon\_3 \,\, \dots \,\, \varepsilon\_i \rho\_i \varepsilon\_{i+1} \,\, \dots \,\, \sigma\_m \rho\_m \varepsilon\_{m+1} \,\, \tag{40}
$$

and v∈V is considered satisfying CBC (39), if it satisfies all EBC having place in Eq. (40).

Result of application of boundary condition b to SMS V is recorded as V↓b.

Example 2. Let V ¼ f g v1; v<sup>2</sup> , where v<sup>1</sup> ¼ f g 5 � analyst; 3 � assistant; 1 � director , v<sup>2</sup> ¼ f g 2 � assistant; 4 � director; 3 � employee , and boundary conditions are 2≤ analyst≤ 4, assistant , employee, 1≤director ≤assistant ≤3, and analyst ¼ assistant , 5: Table 1 contains result of application of listed boundary conditions to V.∎

Optimizing condition has form a = opt, where a is the object, and opt∈f g min; max . Semantics of this construction is following. Multiset v∈V satisfies condition a ¼ min, if for every v<sup>0</sup> ∈V, such that v 6¼ v<sup>0</sup> , multiplicity n in multiobject n � a∈ v is not greater, than multiplicity n<sup>0</sup> in multiobject n<sup>0</sup> � a∈v<sup>0</sup> , that is, n≤ n<sup>0</sup> . Similarly, v∈V satisfies condition a ¼ max, if for every v<sup>0</sup> ∈V, such that v 6¼ v<sup>0</sup> , multiplicity n in multiobject n � a∈ v is not less, than multiplicity n<sup>0</sup> in

Result of v, v<sup>0</sup> multisets addition (recorded as bold þ) is multiset.

a∈f g a1; …; am ∩ a<sup>0</sup>

a∈ f g a1; …; am � a<sup>0</sup>

<sup>1</sup>; …; a<sup>0</sup> m0 � � � f g <sup>a</sup>1; …; am

a∈f g a1; …; am ∩ a<sup>0</sup>

∪ ⋃

a∈f g a1; …; am � a<sup>0</sup>

There are also two basic relations on multisets: inclusion (⊆) and strict

n�a∈v

At last, result of v multiset multiplication by integer number n (recorded as v∗n)

, that is, v⊆v<sup>0</sup>

Example 1. Let v<sup>1</sup> ¼ f g 3 ∙ analyst; 2 ∙ assistant , v<sup>2</sup> ¼ f g 4 ∙ assistant; 1 ∙ director , then

n � a∈v n<sup>0</sup> � a∈v<sup>0</sup> n>n<sup>0</sup>

n0 �a∈v<sup>0</sup>

Result of v<sup>0</sup> multiset subtraction from v multiset (recorded as bold �) is multiset.

<sup>1</sup>; …; a<sup>0</sup> m0 � �

> <sup>1</sup>; …; a<sup>0</sup> m0 � �

v∗n ¼ f g ð Þ� n � n<sup>1</sup> a1; …;ð Þ� n � nm am (34)

, if

ð Þ ∀n � a∈v ∃n<sup>0</sup> � a∈ v<sup>0</sup> ð Þ n≤n<sup>0</sup> ½ � ð Þ , (35)

, that is, v⊂v<sup>0</sup>

, if v⊆v<sup>0</sup> & v6¼v<sup>0</sup>

:

n � a∈v n<sup>0</sup> � a∈v

n�a∈v

<sup>1</sup>; …; a<sup>0</sup> m0 � �

<sup>1</sup>; …; a<sup>0</sup> m0 � �

f g n�a

n<sup>0</sup> f g �a

n þ n<sup>0</sup> f g ð Þ� a

1

CCCA ∪

1

CCCA:

n � n<sup>0</sup> f g ð Þ� a

f g n�a

1

CCCA:

1

CCCCCCCCCCA ∪

1

CCCCCCCCCCCCCCCCA ∪ (32)

(33)

vþv<sup>0</sup> ¼ ⋃

∪ ⋃

∪ ⋃ a<sup>0</sup> ∈ a<sup>0</sup>

v � v<sup>0</sup> ¼ ⋃

0

BBB@

(here integers' usual multiplication is recorded as �)

and multiset v is strictly included to multiset v<sup>0</sup>

Multiset v is included to multiset v<sup>0</sup>

is multiset.

inclusion (⊂).

74

0

Enhanced Expert Systems

BBBBBBBBBB@

0

BBB@

0

BBB@

0

BBBBBBBBBBBBBBBB@


#### Table 1.

Results of application of boundary conditions.

multiobject n<sup>0</sup> � a∈ v<sup>0</sup> , that is, n≥n<sup>0</sup> . If a∉v a<sup>0</sup> ð Þ ∉v , we consider n � a∈ v n<sup>0</sup> ð Þ � a∈v , where n ¼ 0 nð Þ <sup>0</sup> ¼ 0 .

Filter is join of boundary F <sup>≤</sup> and optimizing Fopt subfilters:

$$F = F\_{\leq} \cup F\_{opt\text{\textquotedblleft}opt\text{\textquotedblright}} \tag{41}$$

Filtration is performed as follows:

DOI: http://dx.doi.org/10.5772/intechopen.81698

4. Multiset grammars

Rule has the form:

generation chain.

following:

where

77

shall define multigrammar as a couple.

rule r∈R to multiset v is denoted as v)

V↓f g 1≤ analyst≤3 ¼ f g v1; v3; v<sup>4</sup> , V↓f g 2≤director ≤ 4 ¼ f g v1; v2; v<sup>4</sup> ,

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale…

f g v1; v<sup>4</sup> ↓f g assistant ¼ min ¼ f g v<sup>1</sup> , f g v1; v<sup>4</sup> ↓f g employee ¼ max ¼ f g v1; v<sup>4</sup> ,

Due to commutativity of set-theoretic join and intersection operations, filtration

As mentioned higher, multiset grammars are tool, providing generation of one

By analogy with classical grammars, operating strings of symbols [32, 33], we

where v<sup>0</sup> is a multiset called kernel, while R, called scheme, is finite set of the socalled rules, which are used for generation of new multisets from already generated.

v ! v<sup>0</sup>

where v (left part of the rule) and v<sup>0</sup> (right part of the rule) are multisets, and v 6¼ f g ∅ : Semantics of rule is as follows. Let v be multiset; with that we shall speak, that rule (48) is applicable to v, if v ⊆ v, and result of its application is a multiset.

v<sup>0</sup> ¼ v�vþv<sup>0</sup>

Set of multisets, defined by MGs S ¼ h i v0; R , is denoted as VS. Iterative representation of MG semantics, that is, SMS VS generation by application of MG S, is the

<sup>π</sup> <sup>v</sup>; <sup>v</sup> ! <sup>v</sup><sup>0</sup> ð Þ¼ <sup>v</sup>�vþv<sup>0</sup> f g, if v <sup>⊆</sup> v,

�

⋃ r∈R

f g ∅ otherwise:

!

v0, and any sequence v)

πð Þ v;r

Speaking informally, if v includes v, then the last is replaced by v<sup>0</sup>

<sup>V</sup>ð Þ <sup>i</sup>þ<sup>1</sup> <sup>¼</sup> <sup>V</sup>ð Þ<sup>i</sup> ∪ ⋃<sup>v</sup> <sup>∈</sup>Vð Þ<sup>i</sup>

r

S ¼ h i v0; R , (47)

, (48)

: (49)

r … ) r0

Vð Þ <sup>0</sup> ¼ f g v<sup>0</sup> , (50)

VS ¼ Vð Þ <sup>∞</sup> , (52)

. Application of

(53)

v<sup>0</sup> is called

, (51)

multisets from another, or, what is the same, generation sets of multisets.

V↓F ¼ f g v<sup>1</sup> ∩f g v1; v<sup>4</sup> ¼ f g v<sup>1</sup> : ∎

V↓F <sup>≤</sup> ¼ f g v1; v<sup>4</sup> ,

inside subfilters may be executed in the arbitrary order.

where F <sup>≤</sup> is set of boundary conditions, and Fopt is set of optimizing conditions. Result of filtration of set of multisets V by filter F is denoted as V↓F and is defined by expression

$$V \downarrow F = (V \downarrow F\_{\leq}) \downarrow F\_{opt} \tag{42}$$

where

$$F\_{\leq} = \{c\_1, \dots, c\_k\},\tag{43}$$

$$F\_{opt} = \{opt\_1, \dots, \text{opt}\_l\},\tag{44}$$

$$V\downarrow F\_{\leq} = \bigcap\_{i=1}^{k} (V\downarrow c\_i) = V',\tag{45}$$

$$V' \downarrow F\_{opt} = \bigcap\_{j=1}^{l} \left( V' \downarrow opt\_j \right), \tag{46}$$

and c1, …, ck are EBC. As seen, set V is filtered by boundary conditions, so there are selected multisets, satisfying all of these conditions, and intermediate result V<sup>0</sup> is then filtered by optimizing conditions, so, that multisets, satisfying all of them, are included to the final result.

Example 3. Consider set V ¼ f g v1; v2; v3; v<sup>4</sup> , where

v<sup>1</sup> ¼ f g 3 � analyst; 2 � assistant; 2 � employee , v<sup>2</sup> ¼ f g 6 � assistant; 2 � director , v<sup>3</sup> ¼ f g 1 � analyst; 3 � assistant; 5 � director; 2 � employee , v<sup>4</sup> ¼ f g 1 � analyst; 2 � assistant; 2 � employee :

Let F ¼ f g 1≤analyst ≤3; 2≤ director ≤employee; analyst ¼ min; assistant ¼ max : Then, according to Eqs. (41)–(46),

$$V \downarrow F = (V \downarrow F\_{\leq}) \downarrow F\_{optr}$$

where

$$\begin{aligned} F\_{\leq} &= \{ \mathbf{1} \leq \textit{analysis} \leq \mathbf{3}, \mathbf{2} \leq \textit{direction} \leq \textit{empleyee} \}, \\ F\_{opt} &= \{ \textit{assistant} = \mathbf{min}, \textit{empleyee} = \mathbf{max} \}. \end{aligned}$$

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale… DOI: http://dx.doi.org/10.5772/intechopen.81698

Filtration is performed as follows:

$$\begin{aligned} V \downarrow \{1 \le \text{analytic} \le 3\} &= \{v\_1, v\_3, v\_4\}, \\ V \downarrow \{2 \le \text{direct} \le 4\} &= \{v\_1, v\_2, v\_4\}, \\ V \downarrow F\_{\le} &= \{v\_1, v\_4\}, \\ \{v\_1, v\_4\} \downarrow \{\text{assistant} = \min\} &= \{v\_1\}, \\ \{v\_1, v\_4\} \downarrow \{\text{empleye} = \max\} &= \{v\_1, v\_4\}, \\ V \downarrow F &= \{v\_1\} \cap \{v\_1, v\_4\} = \{v\_1\}. \end{aligned}$$

Due to commutativity of set-theoretic join and intersection operations, filtration inside subfilters may be executed in the arbitrary order.

### 4. Multiset grammars

multiobject n<sup>0</sup> � a∈ v<sup>0</sup>

Enhanced Expert Systems

Table 1.

by expression

where

included to the final result.

Then, according to Eqs. (41)–(46),

where

76

where n ¼ 0 nð Þ <sup>0</sup> ¼ 0 .

Results of application of boundary conditions.

, that is, n≥n<sup>0</sup>

Filter is join of boundary F <sup>≤</sup> and optimizing Fopt subfilters:

where F <sup>≤</sup> is set of boundary conditions, and Fopt is set of optimizing conditions. Result of filtration of set of multisets V by filter F is denoted as V↓F and is defined

condition V↓condition 2≤analyst ≤4 f g v<sup>2</sup> assistant , employee f g v<sup>2</sup> 1≤ director ≤assistant ≤3 f g v<sup>1</sup> analyst ¼ assistant , 5 f g ∅

Fopt ¼ opt1; …; opt<sup>l</sup>

k i¼1

> l j¼1

and c1, …, ck are EBC. As seen, set V is filtered by boundary conditions, so there are selected multisets, satisfying all of these conditions, and intermediate result V<sup>0</sup> is then filtered by optimizing conditions, so, that multisets, satisfying all of them, are

v<sup>3</sup> ¼ f g 1 � analyst; 3 � assistant; 5 � director; 2 � employee ,

Let F ¼ f g 1≤analyst ≤3; 2≤ director ≤employee; analyst ¼ min; assistant ¼ max :

V↓F ¼ ð Þ V↓F <sup>≤</sup> ↓Fopt,

F <sup>≤</sup> ¼ f g 1≤ analyst≤3; 2 ≤director ≤employee , Fopt ¼ f g assistant ¼ min;employee ¼ max :

ð Þ¼ V↓ci V<sup>0</sup>

V0 ↓optj 

V↓F <sup>≤</sup> ¼ ⋂

↓Fopt ¼ ⋂

v<sup>1</sup> ¼ f g 3 � analyst; 2 � assistant; 2 � employee ,

v<sup>4</sup> ¼ f g 1 � analyst; 2 � assistant; 2 � employee :

V0

Example 3. Consider set V ¼ f g v1; v2; v3; v<sup>4</sup> , where

v<sup>2</sup> ¼ f g 6 � assistant; 2 � director ,

. If a∉v a<sup>0</sup> ð Þ ∉v , we consider n � a∈ v n<sup>0</sup> ð Þ � a∈v ,

F ¼ F <sup>≤</sup> ∪ Fopt, (41)

V↓F ¼ ð Þ V↓F <sup>≤</sup> ↓Fopt (42)

F <sup>≤</sup> ¼ f g c1; …;ck , (43)

, (44)

, (45)

, (46)

As mentioned higher, multiset grammars are tool, providing generation of one multisets from another, or, what is the same, generation sets of multisets.

By analogy with classical grammars, operating strings of symbols [32, 33], we shall define multigrammar as a couple.

$$\mathcal{S} = \langle \boldsymbol{\nu}\_0, \boldsymbol{R} \rangle,\tag{47}$$

where v<sup>0</sup> is a multiset called kernel, while R, called scheme, is finite set of the socalled rules, which are used for generation of new multisets from already generated. Rule has the form:

$$v \to v',$$
 
$$(48)$$

where v (left part of the rule) and v<sup>0</sup> (right part of the rule) are multisets, and v 6¼ f g ∅ : Semantics of rule is as follows. Let v be multiset; with that we shall speak, that rule (48) is applicable to v, if v ⊆ v, and result of its application is a multiset.

$$
\overline{v}' = \overline{v} - v + v'. \tag{49}
$$

Speaking informally, if v includes v, then the last is replaced by v<sup>0</sup> . Application of rule r∈R to multiset v is denoted as v) r v0, and any sequence v) r … ) r0 v<sup>0</sup> is called generation chain.

Set of multisets, defined by MGs S ¼ h i v0; R , is denoted as VS. Iterative representation of MG semantics, that is, SMS VS generation by application of MG S, is the following:

$$V\_{(0)} = \{v\_0\},\tag{50}$$

$$V\_{(i+1)} = V\_{(i)} \cup \left( \bigcup\_{\overline{v} \in V\_{(i)}} \bigcup\_{r \in R} \pi(\overline{v}, r) \right),\tag{51}$$

$$V\_{\mathbb{S}} = V\_{(\infty)}.\tag{52}$$

where

$$\pi(\overline{v}, v \to v') = \begin{cases} \{\overline{v} - v + v'\}, \text{if } v \subseteq \overline{v}, \\\{\mathcal{Q}\} \text{ otherwise}. \end{cases} \tag{53}$$

As seen, function (53) implements application of rule v ! v<sup>0</sup> to multiset v as described higher. As a result of i + 1-th step of generation, new SMS is formed by application of all rules r∈R to all multisets v∈Vð Þ<sup>i</sup> , and it is joined to SMS Vð Þ<sup>i</sup> . If multiset v<sup>0</sup> is generated from multiset v by some sequence of such steps, it is denoted as v) ∗ v<sup>0</sup> .

VS is fixed point of the described process, that is, VS ¼ Vð Þ<sup>i</sup> , where i ! ∞. If for some finite i Vð Þ<sup>i</sup> ¼ Vð Þ <sup>i</sup>þ<sup>1</sup> , then VS ¼ Vð Þ<sup>i</sup> , and VS is finite. In the introduced notation,

$$V\_S = \left\{ \boldsymbol{\nu} | \boldsymbol{\nu}\_0 \stackrel{\*}{\Rightarrow} \boldsymbol{\nu} \right\}. \tag{54}$$

Iterative representation of UMG semantics, i.e., generation of SMS VS, where

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale…

v∈Vð Þ<sup>i</sup>

VS ¼ vjv∈VS & βð Þv ⊆ As

<sup>π</sup>ðv;h i <sup>a</sup> ! <sup>n</sup><sup>1</sup> � <sup>a</sup>1; …; nm � am Þ ¼ <sup>v</sup>�f gþ <sup>n</sup> � <sup>a</sup> <sup>n</sup>∗f g <sup>n</sup><sup>1</sup> � <sup>a</sup>1; …; nm � am , if n � <sup>a</sup><sup>∈</sup> v, f g ∅ otherwise:

Here, As is set of the so-called terminal objects, such that a∈ As, if and only if R does not include URs, which head is a (i.e., a has place only in the UR bodies). As is subset of set As of all objects, having places in scheme R of UMG S. Multiset, generated by UMG S, all objects of which are terminal, is also called terminal multiset (as seen, this notion of TMS does not contradict to the defined higher regarding MGs). In Eq. (61), UR a ! n<sup>1</sup> � a1, ⋯, nm � am is written in the angle

As seen, Eq. (59) defines VS—set of all multisets, generated by UMG S,—while Eq. (60) by condition βð Þv ⊆ As provides selection of VS—set of terminal multisets

Example 5. Consider unitary multigrammar S ¼ h i company; R , where R includes

company ! 3 � group, 2 � analyst,

VS ¼ ff g 1 � company ; f g 3 � group; 2 � analyst ; f g 3 � analyst ; f g 5 � analyst ; f g 8 � analyst g,

Filtering unitary multigrammars (FUMGs) are UMG generalization, providing generation of terminal multisets and selection those of them, which satisfy condi-

FUMGs are triple S ¼ h i a0; R; F , where a0, R, and F have the same sense, as

that is, set of terminal multisets, generated by S, is result of filtering STMS,

Example 6. Let S ¼ h i company; R; F , where R is as in Example 5, while

F ¼ f g analyst>3; analyst ¼ min . Then, according to Eqs. (57)–(62),

VS ¼ Vh i <sup>a</sup>0;<sup>R</sup> ↓F, (62)

company ! 3 � analyst, group ! 1 � analyst, group ! 2 � analyst:

tions, assembled to filters, which were described higher in Section 3.

above, and set of terminal multisets, generated by S, is defined as follows:

⋃ r∈R

Vð Þ <sup>i</sup>þ<sup>1</sup> ¼ Vð Þ<sup>i</sup> ∪ ⋃

Vð Þ <sup>0</sup> ¼ f g 1 � a<sup>0</sup> , (57)

VS ¼ Vð Þ <sup>∞</sup> , (59)

, (60)

f g πð Þ v;r , (58)

(61)

S ¼ h i a0; R , is following:

DOI: http://dx.doi.org/10.5772/intechopen.81698

brackets for unambiguity.

(STMS)—from VS.

following unitary rules:

According to Eqs. (57)–(61),

generated by UMGs h i a0; R , by filter F.

79

VS ¼ f g f g 3 � analyst ; f g 5 � analyst ; f g 8 � analyst : ∎

where

VS includes subset Vs⊆Vs of the so-called terminal multisets (TMS) v∈Vs such that πð Þ¼ v;r f g ∅ for all r∈R, that is, no one multiset may be generated from terminal multiset. Set VS is called final; final set consists of terminal multisets only.

Example 4. Let S ¼ h i v0; R , where v<sup>0</sup> ¼ f g 3 � eur; 4 � usd , R ¼ f g r1;r<sup>2</sup> , where r<sup>1</sup> is 2f g � eur; 1 � usd ! f g 1 � eur; 1 � gbp , r<sup>2</sup> is 1f g � eur; 2 � usd ! f g 1 � eur; 2 � gbp . As seen,

$$v\_0 = \{3 \cdot \iota ur, 4 \cdot \iota usd\} \stackrel{r\_1}{\Rightarrow} \{2 \cdot \iota ur, 3 \cdot \iota usd, 1 \cdot gbp\} \stackrel{r\_1}{\Rightarrow} \{1 \cdot \iota ur, 2 \cdot \iota usd, 2 \cdot gbp\} \stackrel{r\_2}{\Rightarrow} \{1 \cdot \iota usd, 4 \cdot gbp\},$$

$$\{2 \cdot \iota ur, 3 \cdot \iota usd, 1 \cdot gbp\} \stackrel{r\_1}{\Rightarrow} \{1 \cdot a\_1, 2 \cdot \iota usd, 3 \cdot gbp\} \stackrel{r\_2}{\Rightarrow} \{1 \cdot \iota usd, 5 \cdot gbp\},$$

f g 3 � eur; 4 � usd ) r2 f g 2 � eur; 3 � usd; 2 � gbp ) r1 f g 1 � eur; 2 � usd; 3 � gbp ) r2 f g 1 � usd; 5 � gbp ,

f g 2 � eur; 3 � usd; 2 � gbp ) r2 f g 1 � eur; 2 � usd; 4 � gbp ) r2 f g 1 � usd; 6 � gbp

(for short, identical parts of different generation chains are omitted). So

$$\overline{\nabla}\_s = \{ \{ \mathbf{1} \cdot \epsilon \boldsymbol{u} r, \mathbf{4} \cdot \mathbf{g} b p \}, \{ \mathbf{1} \cdot \boldsymbol{u} s \boldsymbol{d}, \mathbf{5} \cdot \mathbf{g} b p \}, \{ \mathbf{1} \cdot \boldsymbol{u} s \boldsymbol{d}, \mathbf{6} \cdot \mathbf{g} b p \} \} \quad \mathbf{1}.$$

By analogy with classical string-generating grammars, multigrammars may be context-sensitive and context-free (CF). In the last one, left parts of all rules have form 1f g � a , while in the first, there are no any limitations on both parts of rules, excluding, that left part must be nonempty multiset.

#### 5. Unitary multiset grammars and metagrammars

Start point for unitary multigrammars (UMGs), developed on the considered basis, is simplified representation of CF rules: instead of

$$\{1 \cdot a\} \to \{n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m\} \tag{55}$$

they are written as:

$$a \to n\_1 \cdot a\_1, \ldots, n\_m \cdot a\_m. \tag{56}$$

Construction (56) is called unitary rule (UR), object a—its head, and unordered sequence (list) n<sup>1</sup> � a1, …, nm � am—its body.

Let us consider UMG formal definition and illustrating example. Unitary multigrammar is couple S ¼ h i a0; R , where a is the so-called title object, and R, as in multigrammars, is scheme—set of unitary rules (56).

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale… DOI: http://dx.doi.org/10.5772/intechopen.81698

Iterative representation of UMG semantics, i.e., generation of SMS VS, where S ¼ h i a0; R , is following:

$$V\_{(0)} = \{\mathbf{1} \cdot \mathbf{a}\_0\},\tag{57}$$

$$V\_{(i+1)} = V\_{(i)} \cup \bigcup\_{\overline{\upsilon} \in V\_{(i)}} \bigcup\_{r \in R} \{\overline{\pi}(\overline{\upsilon}, r)\},\tag{58}$$

$$V\_{\mathbb{S}} = V\_{(\mathfrak{so})},\tag{59}$$

$$\overline{V}\_{\mathcal{S}} = \{ \overline{v} | \overline{v} \in V\_{\mathcal{S}} \: \mathfrak{E} \not\simeq \beta(\overline{v}) \subseteq \overline{A}\_{\mathfrak{s}} \}, \tag{60}$$

where

As seen, function (53) implements application of rule v ! v<sup>0</sup> to multiset v as described higher. As a result of i + 1-th step of generation, new SMS is formed by application of all rules r∈R to all multisets v∈Vð Þ<sup>i</sup> , and it is joined to SMS Vð Þ<sup>i</sup> . If multiset v<sup>0</sup> is generated from multiset v by some sequence of such steps, it is

VS is fixed point of the described process, that is, VS ¼ Vð Þ<sup>i</sup> , where i ! ∞. If for

∗ v n o

: (54)

r2

f g 1 � usd; 5 � gbp ,

r2

f g 1 � usd; 6 � gbp

f g 1 � usd; 4 � gbp ,

f g 1 � usd; 5 � gbp ,

some finite i Vð Þ<sup>i</sup> ¼ Vð Þ <sup>i</sup>þ<sup>1</sup> , then VS ¼ Vð Þ<sup>i</sup> , and VS is finite. In the introduced

VS ¼ vjv0)

that πð Þ¼ v;r f g ∅ for all r∈R, that is, no one multiset may be generated from terminal multiset. Set VS is called final; final set consists of terminal multisets only.

Example 4. Let S ¼ h i v0; R , where v<sup>0</sup> ¼ f g 3 � eur; 4 � usd ,

f g 2 � eur; 3 � usd; 1 � gbp )

r2

r2

f g 2 � eur; 3 � usd; 2 � gbp )

excluding, that left part must be nonempty multiset.

5. Unitary multiset grammars and metagrammars

basis, is simplified representation of CF rules: instead of

sequence (list) n<sup>1</sup> � a1, …, nm � am—its body.

multigrammars, is scheme—set of unitary rules (56).

r<sup>1</sup> is 2f g � eur; 1 � usd ! f g 1 � eur; 1 � gbp , r<sup>2</sup> is 1f g � eur; 2 � usd ! f g 1 � eur; 2 � gbp .

r1

f g 2 � eur; 3 � usd; 1 � gbp )

f g 2 � eur; 3 � usd; 2 � gbp )

r2

they are written as:

78

VS includes subset Vs⊆Vs of the so-called terminal multisets (TMS) v∈Vs such

r1

r1

(for short, identical parts of different generation chains are omitted). So

Vs ¼ f g f g 1 � eur; 4 � gbp ; f g 1 � usd; 5 � gbp ; f g 1 � usd; 6 � gbp ∎: By analogy with classical string-generating grammars, multigrammars may be context-sensitive and context-free (CF). In the last one, left parts of all rules have form 1f g � a , while in the first, there are no any limitations on both parts of rules,

Start point for unitary multigrammars (UMGs), developed on the considered

Construction (56) is called unitary rule (UR), object a—its head, and unordered

Let us consider UMG formal definition and illustrating example. Unitary multigrammar is couple S ¼ h i a0; R , where a is the so-called title object, and R, as in

f g 1 � a1; 2 � usd; 3 � gbp )

f g 1 � eur; 2 � usd; 4 � gbp )

f g 1 � eur; 2 � usd; 2 � gbp )

r2

r2

f g 1 � eur; 2 � usd; 3 � gbp )

f g 1 � a ! f g n<sup>1</sup> � a1; …; nm � am (55)

a ! n<sup>1</sup> � a1, …, nm � am: (56)

denoted as v)

notation,

∗ v0 .

Enhanced Expert Systems

R ¼ f g r1;r<sup>2</sup> , where

As seen,

v<sup>0</sup> ¼ f g 3 � eur; 4 � usd )

f g 3 � eur; 4 � usd )

$$
\overline{\pi}(\overline{v}, \langle a \to n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m \rangle) = \begin{cases}
\overline{v} - \{n \cdot a\} + n \ast \{n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m\}, \text{if } n \cdot a \in \overline{v}, \\
\{\mathcal{Q}\} \text{ otherwise}. \end{cases} \tag{61}
$$

Here, As is set of the so-called terminal objects, such that a∈ As, if and only if R does not include URs, which head is a (i.e., a has place only in the UR bodies). As is subset of set As of all objects, having places in scheme R of UMG S. Multiset, generated by UMG S, all objects of which are terminal, is also called terminal multiset (as seen, this notion of TMS does not contradict to the defined higher regarding MGs). In Eq. (61), UR a ! n<sup>1</sup> � a1, ⋯, nm � am is written in the angle brackets for unambiguity.

As seen, Eq. (59) defines VS—set of all multisets, generated by UMG S,—while Eq. (60) by condition βð Þv ⊆ As provides selection of VS—set of terminal multisets (STMS)—from VS.

Example 5. Consider unitary multigrammar S ¼ h i company; R , where R includes following unitary rules:

$$\begin{array}{l}\text{company} \rightarrow \mathbf{3} \cdot \text{group}, \, 2 \cdot \text{analytic},\\\text{company} \rightarrow \mathbf{3} \cdot \text{analytic},\\\text{group} \rightarrow \mathbf{1} \cdot \text{analytic},\\\text{group} \rightarrow \mathbf{2} \cdot \text{analytic}.\end{array}$$

According to Eqs. (57)–(61),

VS ¼ ff g 1 � company ; f g 3 � group; 2 � analyst ; f g 3 � analyst ; f g 5 � analyst ; f g 8 � analyst g, VS ¼ f g f g 3 � analyst ; f g 5 � analyst ; f g 8 � analyst : ∎

Filtering unitary multigrammars (FUMGs) are UMG generalization, providing generation of terminal multisets and selection those of them, which satisfy conditions, assembled to filters, which were described higher in Section 3.

FUMGs are triple S ¼ h i a0; R; F , where a0, R, and F have the same sense, as above, and set of terminal multisets, generated by S, is defined as follows:

$$
\overline{V}\_{\mathbb{S}} = \overline{V}\_{\langle a\_0, \mathbb{R} \rangle} \downarrow F\_{\mathbb{S}} \tag{62}
$$

that is, set of terminal multisets, generated by S, is result of filtering STMS, generated by UMGs h i a0; R , by filter F.

Example 6. Let S ¼ h i company; R; F , where R is as in Example 5, while F ¼ f g analyst>3; analyst ¼ min . Then, according to Eqs. (57)–(62),

$$\overline{V}\_S = (\{\{\mathbf{3} \cdot \mathbf{analysis}\}, \{\mathbf{5} \cdot \mathbf{a}\_2\}} \mathbf{3} \cdot \mathbf{3} \cdot \mathbf{3} \mathbf{3} \cdot \mathbf{3}) \cup \{\mathbf{a} \cdot \mathbf{a} \mathbf{3} \cdot \mathbf{3} \cdot \mathbf{a} \} = \mathbf{m} \mathbf{3}$$
 
$$= (\{\{\mathbf{5} \cdot \mathbf{a} \mathbf{1} \cdot \mathbf{3} \cdot \mathbf{a} \mathbf{3} \cdot \mathbf{3} \cdot \mathbf{a} \}) \cup \{\mathbf{a} \cdot \mathbf{a} \mathbf{1} \cdot \mathbf{a} \} = \{\{\mathbf{5} \cdot \mathbf{a} \mathbf{1} \cdot \mathbf{a} \} \cup \{\mathbf{5} \cdot \mathbf{a} \cdot \mathbf{a} \} \cup \{\mathbf{5} \cdot \mathbf{a} \} \cup \{\mathbf{5} \cdot \mathbf{a} \cdot \mathbf{a} \} = \mathbf{0}$$

Filtering unitary multigrammars are, in turn, basis for unitary multiset metagrammars, or, for short, multimetagrammars, which are considered at all the rest part of the chapter and are main toolkit for the description and solution of the optimization problems, mentioned in the introduction.

Unitary multimetagrammar S is, as higher, triple h i a0; R; F , where a<sup>0</sup> is the title object, and R is the scheme, containing unitary rules and so-called unitary metarules (UMR), while F is the filter. Consider UMMG syntax and semantics.

Unitary metarule has the form:

$$a \rightarrow \mu\_1 \cdot a\_1, \ldots, \mu\_m \cdot a\_m,\tag{63}$$

N nð Þ¼ f g 1; 2; 3 , (68) N lðÞ¼ f g 1; 2; 3; 4; 5; 6 , (69)

A↓F, (70)

<sup>a</sup>0; <sup>R</sup>◦ <sup>γ</sup>1; …; <sup>γ</sup><sup>l</sup> f g h i h i , (71)

F ¼ F � FΓ, (73)

� �, (74)

(76)

so, this one UMMG, consisting of 15 lines, replaces 5 � 3 � 5 ¼ 75 filtering uni-

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale…

Let us now give strict definition of unitary multimetagrammar notion. UMMG

VS

ni ≤γ<sup>i</sup> ≤n<sup>0</sup>

1

<sup>R</sup>◦h i <sup>n</sup>1; …; nl <sup>¼</sup> f g <sup>r</sup>◦h ij <sup>n</sup>1; …; nl <sup>r</sup>∈<sup>R</sup> , (72)

i

<sup>a</sup> ðμ<sup>1</sup>◦h i <sup>n</sup>1; …; nl Þ � <sup>a</sup>1, …,ðμ<sup>m</sup>◦h i <sup>n</sup>1; …; nl Þ � am, (75)

nj, if μ<sup>i</sup> is γ<sup>j</sup> ∈ Γ:

S∈S<sup>∗</sup>

and, at last, if <sup>r</sup> is <sup>a</sup> <sup>μ</sup><sup>1</sup> � <sup>a</sup>1, …, <sup>μ</sup><sup>m</sup> � am, then <sup>r</sup>◦h i <sup>n</sup>1; …; nl is unitary rule.

<sup>μ</sup><sup>i</sup>◦h i <sup>n</sup>1; …; nl <sup>¼</sup> <sup>μ</sup>i, if <sup>μ</sup><sup>i</sup> <sup>∈</sup> <sup>N</sup>,

(

As seen, according to Eqs. (75) and (76), all multiplicities-variables of unitary metarule a μ<sup>1</sup> � a1, …, μ<sup>m</sup> � am are replaced by their corresponding values from the tuple h i n1; …; nl , while all multiplicities-constants (elements of positive integer numbers set N) remain unchanged. Evidently, if all μ1, …, μ<sup>m</sup> are constants, that is,

Let us note, that multiplicities-variables area of actuality is whole UMMG scheme,

that is, if there are n > 1 occurrences of one and the same variable γ in different unitary metarules (and, of course, in one and the same unitary metarule), they all are

> company ! 2 � group, γ<sup>1</sup> � analyst, group ! 3 � analyst, γ<sup>2</sup> � assistant, group ! γ<sup>1</sup> � analyst, γ<sup>2</sup> � assistant,

and filter F includes following conditions, the first being boundary, the second—

2 ≤analyst ≤6, assistant ¼ min, 0≤γ<sup>1</sup> ≤ 1, 2 ≤γ<sup>2</sup> ≤3:

substituted by one and the same value from the applied sequence h i n1; …; nl . Example 7. Let us consider UMMG S ¼ , company, R, F>, where scheme R

tary multigrammars, each scheme consisting of 10 lines.

DOI: http://dx.doi.org/10.5772/intechopen.81698

<sup>S</sup><sup>∗</sup> <sup>¼</sup> <sup>⋃</sup> n0 1 γ<sup>1</sup> ∈n<sup>1</sup>

if unitary metarule is UR, it remains unchanged.

contains following three unitary metarules:

optimizing, while the last two—variable declarations:

where

81

S ¼ h i a0; R; F defines set of terminal multisets VS in such a way:

VS ¼ ⋃

… ⋃ n0 l γ<sup>l</sup> ∈nl

F<sup>Γ</sup> ¼ ⋃ l i¼1

0 @

where μ<sup>i</sup> is the positive integer number, as in UMGs/FUMGs, or variable γ ∈Γ, where Γ is the universum of variables. When μ<sup>i</sup> is γ<sup>i</sup> ∈Γ, then it is called multiplicity-variable (MV). As seen, unitary rule is the simplest particular case of unitary metarule with all multiplicities μ1, …, μ<sup>m</sup> being constants. As in URs, object a in Eq. (55) is called head, while μ<sup>1</sup> � a1, …, μ<sup>m</sup> � am—body of metarule.

Filter F is set of conditions, which may be of the following forms:

$$m \le a \le n',\tag{64}$$

$$
\mathfrak{a} = \mathfrak{opt},
\tag{65}
$$

$$n \le \chi \le n',\tag{66}$$

where opt∈ f g max; min . As seen, boundary condition (64) and optimizing condition (65) are the same, as in FUMG filters, while boundary condition (65), called variable declaration, defines set of values (domain) of variable γ and is denoted lower as Nð Þγ . If F includes subfilter F<sup>Γ</sup> ¼ n<sup>1</sup> ≤γ<sup>1</sup> ≤ n<sup>0</sup> <sup>1</sup>; …; nl ≤ γ<sup>l</sup> ≤ n<sup>0</sup> l , containing boundary conditions of form (66), then every combination of variable values n<sup>1</sup> ∈ N γ<sup>1</sup> ð Þ, …, nl ∈ N γ<sup>l</sup> ð Þ provides creation of one unitary multigrammar by substitution of n1, …, nl to all unitary metarules, having places in scheme R, instead of multiplicities-variables being in their bodies; unitary rules, already having place in <sup>R</sup>, are transferred to new scheme, denoted <sup>R</sup>◦h i <sup>n</sup>1; …; nl , without any transformations. Every such UMGs generates set of terminal multisets, after what all these STMS are joined, and resulting set is filtered by filter F ¼ F � FΓ, containing all "FUMG-like" conditions (From the described, it is obvious nature of "multimetagrammar" notion—in mathematical logic, or "metamathematics," "metalanguage" is language, used for description of another language, so "multimetagrammar" is "unitary-like" multigrammar, used for description of other unitary multigrammars by means of unitary metarules, variables-multiplicities, and boundary conditions, defining their domains.). As may be seen from this informal description, UMMGs are simple unified tool for compact representation of sets of FUMGs (for practically valuable problems, containing very large numbers of elements—millions and greater).

Coming back to Section 2, one can see that Eqs. (6)–(20) are set of elements of unitary metamultigrammar: Eqs. (6)–(8) and Eqs. (11)–(15) are unitary rules, Eqs. (9)–(10) are unitary metarules, Eq. (16) is optimizing condition, Eq. (17) is boundary condition, while Eqs. (18)–(20) are variable declarations. As seen,

$$N(m) = \{1, 2, 3, 4, 5\},\tag{67}$$

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale… DOI: http://dx.doi.org/10.5772/intechopen.81698

$$N(n) = \{1, 2, 3\},\tag{68}$$

$$N(l) = \{1, 2, 3, 4, 5, 6\},\tag{69}$$

so, this one UMMG, consisting of 15 lines, replaces 5 � 3 � 5 ¼ 75 filtering unitary multigrammars, each scheme consisting of 10 lines.

Let us now give strict definition of unitary multimetagrammar notion. UMMG S ¼ h i a0; R; F defines set of terminal multisets VS in such a way:

$$
\overline{V}\_S = \begin{pmatrix} \bigcup \ \overline{V}\_S \\ \overline{S} \in \mathcal{S}^\* \end{pmatrix} \downarrow \mathcal{F}, \tag{70}
$$

$$\mathcal{S}^\* = \bigcup\_{\gamma\_1 \in \pi\_1}^{n\_1'} \dots \bigcup\_{\gamma\_l \in \pi\_l}^{n\_l'} \{ \langle a\_0, R \circ \langle \gamma\_1, \dots, \gamma\_l \rangle \rangle \}, \tag{71}$$

$$R\diamond \langle \overline{n}\_1, \dots, \overline{n}\_l \rangle = \{ r \diamond \langle \overline{n}\_1, \dots, \overline{n}\_l \rangle | r \in R \}, \tag{72}$$

$$\mathbf{F} = F - F\_{\rm D} \tag{73}$$

$$F\_{\Gamma} = \bigcup\_{i=1}^{l} \{ n\_i \le \gamma\_i \le n\_i' \},\tag{74}$$

and, at last, if <sup>r</sup> is <sup>a</sup> <sup>μ</sup><sup>1</sup> � <sup>a</sup>1, …, <sup>μ</sup><sup>m</sup> � am, then <sup>r</sup>◦h i <sup>n</sup>1; …; nl is unitary rule.

$$a \leftarrow \left(\mu\_1 \diamond \langle \overline{n}\_1, \dots, \overline{n}\_l \rangle\right) \cdot a\_1, \dots, \left(\mu\_m \diamond \langle \overline{n}\_1, \dots, \overline{n}\_l \rangle\right) \cdot a\_m. \tag{75}$$

where

VS ¼ ð Þ f g f g 3 � analyst ; f g 5 � a<sup>2</sup> analyst; f g 8 � analyst ↓f g analyst>3 ↓f g analyst ¼ min ¼ ð Þ f g f g 5 � analyst ; f g 8 � analyst ↓f g analyst ¼ min ¼ f g f g 5 � analyst : ∎ Filtering unitary multigrammars are, in turn, basis for unitary multiset metagrammars, or, for short, multimetagrammars, which are considered at all the rest part of the chapter and are main toolkit for the description and solution of the

Unitary multimetagrammar S is, as higher, triple h i a0; R; F , where a<sup>0</sup> is the title object, and R is the scheme, containing unitary rules and so-called unitary metarules

where μ<sup>i</sup> is the positive integer number, as in UMGs/FUMGs, or variable γ ∈Γ,

multiplicity-variable (MV). As seen, unitary rule is the simplest particular case of unitary metarule with all multiplicities μ1, …, μ<sup>m</sup> being constants. As in URs, object a

n ≤a≤n<sup>0</sup>

n≤γ ≤ n<sup>0</sup>

boundary conditions of form (66), then every combination of variable values n<sup>1</sup> ∈ N γ<sup>1</sup> ð Þ, …, nl ∈ N γ<sup>l</sup> ð Þ provides creation of one unitary multigrammar by substitution of n1, …, nl to all unitary metarules, having places in scheme R, instead of multiplicities-variables being in their bodies; unitary rules, already having place in <sup>R</sup>, are transferred to new scheme, denoted <sup>R</sup>◦h i <sup>n</sup>1; …; nl , without any transformations. Every such UMGs generates set of terminal multisets, after what all these STMS are joined, and resulting set is filtered by filter F ¼ F � FΓ, containing all "FUMG-like" conditions (From the described, it is obvious nature of "multimetagrammar" notion—in mathematical logic, or "metamathematics," "metalanguage" is language, used for description of another language, so "multimetagrammar" is

"unitary-like" multigrammar, used for description of other unitary

multigrammars by means of unitary metarules, variables-multiplicities, and boundary conditions, defining their domains.). As may be seen from this informal description, UMMGs are simple unified tool for compact representation of sets of FUMGs (for practically valuable problems, containing very large numbers of

Coming back to Section 2, one can see that Eqs. (6)–(20) are set of elements of unitary metamultigrammar: Eqs. (6)–(8) and Eqs. (11)–(15) are unitary rules, Eqs. (9)–(10) are unitary metarules, Eq. (16) is optimizing condition, Eq. (17) is boundary condition, while Eqs. (18)–(20) are variable decla-

where opt∈ f g max; min . As seen, boundary condition (64) and optimizing condition (65) are the same, as in FUMG filters, while boundary condition (65), called variable declaration, defines set of values (domain) of variable γ and is denoted

a ! μ<sup>1</sup> � a1, …, μ<sup>m</sup> � am, (63)

, (64)

, (66)

a ¼ opt, (65)

<sup>1</sup>; …; nl ≤ γ<sup>l</sup> ≤ n<sup>0</sup>

N mð Þ¼ f g 1; 2; 3; 4; 5 , (67)

, containing

l

optimization problems, mentioned in the introduction.

lower as Nð Þγ . If F includes subfilter F<sup>Γ</sup> ¼ n<sup>1</sup> ≤γ<sup>1</sup> ≤ n<sup>0</sup>

elements—millions and greater).

rations. As seen,

80

Unitary metarule has the form:

Enhanced Expert Systems

(UMR), while F is the filter. Consider UMMG syntax and semantics.

where Γ is the universum of variables. When μ<sup>i</sup> is γ<sup>i</sup> ∈Γ, then it is called

in Eq. (55) is called head, while μ<sup>1</sup> � a1, …, μ<sup>m</sup> � am—body of metarule. Filter F is set of conditions, which may be of the following forms:

$$
\mu\_i \circ \langle \overline{n}\_1, \dots, \overline{n}\_l \rangle = \begin{cases}
\mu\_i, \text{if } \mu\_i \in \mathbb{N}, \\
\overline{n}\_j, \text{if } \mu\_i \text{ is } \gamma\_j \in \Gamma.
\end{cases} \tag{76}
$$

As seen, according to Eqs. (75) and (76), all multiplicities-variables of unitary metarule a μ<sup>1</sup> � a1, …, μ<sup>m</sup> � am are replaced by their corresponding values from the tuple h i n1; …; nl , while all multiplicities-constants (elements of positive integer numbers set N) remain unchanged. Evidently, if all μ1, …, μ<sup>m</sup> are constants, that is, if unitary metarule is UR, it remains unchanged.

Let us note, that multiplicities-variables area of actuality is whole UMMG scheme, that is, if there are n > 1 occurrences of one and the same variable γ in different unitary metarules (and, of course, in one and the same unitary metarule), they all are substituted by one and the same value from the applied sequence h i n1; …; nl .

Example 7. Let us consider UMMG S ¼ , company, R, F>, where scheme R contains following three unitary metarules:

$$\begin{aligned} compoundy &\rightarrow 2 \cdot group, \,\gamma\_1 \cdot analysis, \\ group &\rightarrow 3 \cdot analysis, \,\gamma\_2 \cdot assignment, \\ group &\rightarrow \gamma\_1 \cdot analysis, \,\gamma\_2 \cdot assignment, \end{aligned}$$

and filter F includes following conditions, the first being boundary, the second optimizing, while the last two—variable declarations:

$$\begin{aligned} 2 &\le \text{analytic} \le 6, \\ \text{assistant} &= \text{min}, \\ \mathbf{0} \le \mathbf{y}\_1 &\le \mathbf{1}, \\ 2 &\le \mathbf{y}\_2 \le \mathbf{3}. \end{aligned}$$

According to Eqs. (70)–(76), this UMMG defines four UMGs:

$$\begin{aligned} S\_{0,2} &= , \\ S\_{0,3} &= , \\ S\_{1,2} &= , \\ S\_{1,3} &= , \end{aligned}$$

a0

of R, and substituting all optimizing conditions of the form γ ¼ opt by γ ¼ opt in filter F, thus converting them to the "canonical" form (65)—remember, γ is object not variable and, more, terminal object, because there is no any UR or UMR with

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale…

ni<sup>1</sup> � ai<sup>1</sup> ; …; nik � aik ; n<sup>1</sup> � γ1; …; nl � γ<sup>l</sup>

ni<sup>1</sup> � ai<sup>1</sup> ; …; nil � ail

and TMS (79) will be selected to VS0, if and only if TMS (80) satisfies all conditions, entering F and concerning terminal objects ai<sup>1</sup> , …, aik , as well as TMS n<sup>1</sup> � γ1; …; nl � γ f g<sup>l</sup> satisfies all optimizing conditions of the form γ<sup>i</sup> ¼ opt ∈F<sup>0</sup>

It is not difficult to define VS by subtracting from all v<sup>0</sup> ∈VS<sup>0</sup> multisets of the form n<sup>1</sup> � γ1; …; nl � γ f g<sup>l</sup> , but from the practical point of view, it is more useful to consider not VS but VS<sup>0</sup> as a result of application of unitary multimetagrammar S: it is clear that all v<sup>0</sup> ∈VS<sup>0</sup> contain values n1, …, nl of variables γ1, …, γ<sup>l</sup> as terminal objects γ1, …, γ<sup>l</sup> multiplicities, which computation is often main purpose of the

Example 8. As may be seen, problem, described in Section 2, is to obtain m quantity of laboratories, as well as n and l quantities of analysts and assistants, respectively, in one laboratory. Although Eqs. (18)–(20) do not contain optimizing

is much more useful than TMS like {100�employee, 115,000�eur} because of Eq. (81) with greater informativity (here, we use m, n, l instead of n, m, l). ∎

UMG/UMMG algorithmics and applications are considered in the separate

cation, even if R does not include variable-containing optimizing conditions.

So we shall use VS<sup>0</sup> as a result of S ¼ h i a0; R; F unitary multimetagrammar appli-

To finish with syntax and semantics of UMGs/UMMGs, let us note that class of unitary multigrammars is strict subclass of filtering unitary multiset grammars (UMGs ⊂ FUMGs): every UMGs is FUMGs with empty filter. From the other side, FUMGs are strict subclass of unitary multiset metagrammars (UMGs ⊂ FUMGs): every FUMGs is UMMGs without variable multiplicities and corresponding variable

f g 100 � employee; 115000 � eur; 3 � m; 2 � n; 5 � l (81)

<sup>0</sup>; R<sup>0</sup>

.

to scheme R, thus creating scheme R<sup>0</sup>

DOI: http://dx.doi.org/10.5772/intechopen.81698

As seen now, UMMG S<sup>0</sup> ¼ a<sup>0</sup>

corresponding γ<sup>i</sup> ¼ opt∈F:.

mentioned application.

declarations inside filter.

chapter of this book.

83

where

head γ in R. Obtained filter will be denoted as F<sup>0</sup>

conditions of the form γ ¼ opt, generating TMS like

<sup>0</sup> ! 1 � a0, γ<sup>1</sup> � γ1, …, γ<sup>k</sup> � γ<sup>l</sup> (78)

; F<sup>0</sup> generates terminal multisets of the form:

∈VS, (80)

, (79)

, which contains Eq. (78) and all elements

,

where

$$\begin{split} \text{Ro} < 0, \text{2>} &= \{ < \text{company} \to 2 \cdot \text{group} \}, \\ &< \text{group} \to 3 \cdot \text{analytic}, 2 \cdot \text{assistants}, \text{<} \text{group}\_1 \to 2 \cdot \text{assistants} \}, \\ \text{Ro} < 0, \text{3>} &= \{ < \text{company} \to 2 \cdot \text{group} \}, \\ &< \text{group} \to 3 \cdot \text{analyst}, 3 \cdot \text{assistants}, \text{<} \text{group} \to 3 \cdot \text{assistants} \}, \\ \text{Ro} < 1, \text{2>} &= \{ < \text{company} \to 2 \cdot \text{group}, 1 \cdot \text{and} \text{syst} \}, \\ &< \text{group} \to 3 \cdot \text{analyst}, 2 \cdot \text{assistants}, \text{<} \text{group} \to 1 \cdot \text{analytic} \}, \\ \text{Ro} < 1, \text{3>} &= \{ < \text{company} \to 2 \cdot \text{group}, 1 \cdot \text{and} \text{ysst} \}, \\ &< \text{group} \to 3 \cdot \text{analyst}, 3 \cdot \text{assistants} \}, \text{<} \text{group} \to 1 \cdot \text{and} \text{yst}, 3 \cdot \text{assistants} \}. \end{split}$$

(URs are represented in angle brackets for unambiguity). These UMGs define, respectively, following sets of terminal multisets:

$$\begin{aligned} \overline{V}\_{\mathbb{S}\_{0,2}} &= \{ \{\mathsf{6}\cdot\text{analytic}\}, \{\mathsf{4}\cdot\text{ assignment}\} \}, \\ \overline{V}\_{\mathbb{S}\_{0,3}} &= \{ \{\mathsf{6}\cdot\text{analytic}\}, \{\mathsf{6}\cdot\text{ assignment}\} \}, \\ \overline{V}\_{\mathbb{S}\_{0,2}} &= \{ \{\mathsf{7}\cdot\text{analytic}\}, \{\mathsf{3}\cdot\text{analytic}\}, \{\mathsf{3}\cdot\text{analytic}\} \}, \\ \overline{V}\_{\mathbb{S}\_{0,3}} &= \{ \{\mathsf{7}\cdot\text{analytic}\}, \{\mathsf{6}\cdot\text{ assignment}\} \}, \{\mathsf{3}\cdot\text{analytic}\} \}, \\ \overline{V}\_{\mathbb{S}} &= \{ \overline{V}\_{\mathbb{S}\_{0,1}} \cup \overline{V}\_{\mathbb{S}\_{0,1}} \cup \overline{V}\_{\mathbb{S}\_{1,1}} \cup \overline{V}\_{\mathbb{S}\_{1,1}} \} \} \cup \{ \text{assitant} = \text{min} \} \\ &= \{ \mathsf{6}\cdot\text{analytic}\}, \{\mathsf{6}\cdot\text{analytic}\}, \{\mathsf{6}\cdot\text{analytic}\}, \{\mathsf{6}\cdot\text{ assignment}\}, \\ \{\mathsf{3}\cdot\text{analytic}\}, \{\mathsf{3}\cdot\text{analytic}\}, \{\mathsf{3}\cdot\text{analytic}\} \} \cup \{\mathsf{assitant} = \text{min} \} \\ &= \{ \{\mathsf{6}\cdot\text{analytic}, \mathsf{4}\cdot\text{ assignment}\}, \{\mathsf{3}\cdot\text{analytic}\} \}. \end{aligned}$$

As may be seen, Eqs. (64)–(66) define boundary conditions, concerning objects and variables, and optimizing conditions, concerning only objects, that is why from both theoretical and practical points of view, it is reasonable to extend UMMG filters by optimizing conditions, relating variables. By analogy with Eq. (65), such conditions will have the form:

$$
\gamma = \text{opt.}\tag{77}
$$

This form defines optimality of the generated terminal multisets through multiplicity-variable values, used while these TMS generation. Eq. (77) semantics is quite clear: select those TMS, which are generated by the help of value of variable γ, which (value) is minimal (maximal) among all other TMS, generated by γ application. As seen, Eq. (77) extends optimality definition from only multiplicitiesconstants, having places in TMS, to also multiplicities-variables, having places in unitary metarules, applied while TMS generation.

Most simple formal definition of the verbally described sense of Eq. (77) optimizing condition may be as follows. Let us introduce l auxiliary terminal objects γ1, …, γ<sup>l</sup> corresponding variables γ1, …, γl, having places in UMMG S ¼ h i a0; R; F , i.e., unitary metarules and boundary condition (66). After that, let us add one new unitary metarule:

Multiset-Based Knowledge Representation for the Assessment and Optimization of Large-Scale… DOI: http://dx.doi.org/10.5772/intechopen.81698

$$a\_0' \to \mathbf{1} \cdot \mathfrak{a}\_0, \boldsymbol{\chi}\_1 \cdot \overline{\boldsymbol{\gamma}}\_1, \dots, \boldsymbol{\chi}\_k \cdot \overline{\boldsymbol{\gamma}}\_l \tag{78}$$

to scheme R, thus creating scheme R<sup>0</sup> , which contains Eq. (78) and all elements of R, and substituting all optimizing conditions of the form γ ¼ opt by γ ¼ opt in filter F, thus converting them to the "canonical" form (65)—remember, γ is object not variable and, more, terminal object, because there is no any UR or UMR with head γ in R. Obtained filter will be denoted as F<sup>0</sup> .

As seen now, UMMG S<sup>0</sup> ¼ a<sup>0</sup> <sup>0</sup>; R<sup>0</sup> ; F<sup>0</sup> generates terminal multisets of the form:

$$\{n\_{i\_1} \cdot a\_{i\_1}, \dots, n\_{i\_k} \cdot a\_{i\_k}, \overline{n}\_1 \cdot \overline{\gamma}\_1, \dots, \overline{n}\_l \cdot \overline{\gamma}\_l\},\tag{79}$$

where

According to Eqs. (70)–(76), this UMMG defines four UMGs:

where

Enhanced Expert Systems

<sup>R</sup>◦ , <sup>0</sup>, 2> ¼ f , company ! <sup>2</sup> � group>,

<sup>R</sup>◦ , <sup>0</sup>, 3> ¼ f , company ! <sup>2</sup> � group>,

<sup>R</sup>◦ , <sup>1</sup>, 2> ¼ f , company ! <sup>2</sup> � group, <sup>1</sup> � analyst>,

<sup>R</sup>◦ , <sup>1</sup>, 3> ¼ f , company ! <sup>2</sup> � group, <sup>1</sup> � analyst>,

respectively, following sets of terminal multisets:

unitary metarules, applied while TMS generation.

VS ¼ VS0, <sup>2</sup>∪VS0,3∪VS1, <sup>2</sup>∪VS1, <sup>3</sup>

conditions will have the form:

unitary metarule:

82

VS0, <sup>2</sup> ¼ f g f g 6 � analyst; 4 � assistant ; f g 4 � assistant , VS0, <sup>3</sup> ¼ f g f g 6 � analyst; 6 � assistant ; f g 6 � assistant ,

VS1, <sup>2</sup> ¼ f g f g 7 � analyst; 4 � assistant ; f g 3 � analyst; 4 � assistant , VS1, <sup>3</sup> ¼ f g f g 7 � analyst; 6 � assistant ; f g 3 � analyst; 6 � assistant ,

¼ f g f g 6 � analyst; 4 � assistant ; f g 3 � analyst; 4 � assistant : ∎

<sup>S</sup>0, <sup>2</sup> <sup>¼</sup> , company, R◦ , <sup>0</sup>, 2>>, <sup>S</sup>0, <sup>3</sup> <sup>¼</sup> , company, R◦ , <sup>0</sup>, 3>>, <sup>S</sup>1, <sup>2</sup> <sup>¼</sup> , company, R◦ , <sup>1</sup>, 2>>, <sup>S</sup>1, <sup>3</sup> <sup>¼</sup> , company, R◦ , <sup>1</sup>, 3>>,

, group ! 3 � analyst, 2 � assistant>, , group<sup>1</sup> ! 2 � assistant>g,

, group ! 3 � analyst, 3 � assistant>, , group ! 3 � assistant>g,

(URs are represented in angle brackets for unambiguity). These UMGs define,

 <sup>↓</sup>f<sup>2</sup> <sup>≤</sup>analyst<sup>≤</sup> <sup>6</sup>gÞ↓f g assistant <sup>¼</sup> min ¼ f g 6 � analyst; 4 � assistant , f g 6 � analyst; 6 � assistant , f g 6 � assistant ,

f g 3 � analyst; 4 � assistant , f g 3 � analyst; 6 � assistant ↓f g assistant ¼ min

As may be seen, Eqs. (64)–(66) define boundary conditions, concerning objects and variables, and optimizing conditions, concerning only objects, that is why from both theoretical and practical points of view, it is reasonable to extend UMMG filters by optimizing conditions, relating variables. By analogy with Eq. (65), such

This form defines optimality of the generated terminal multisets through multiplicity-variable values, used while these TMS generation. Eq. (77) semantics is quite clear: select those TMS, which are generated by the help of value of variable γ, which (value) is minimal (maximal) among all other TMS, generated by γ application. As seen, Eq. (77) extends optimality definition from only multiplicitiesconstants, having places in TMS, to also multiplicities-variables, having places in

Most simple formal definition of the verbally described sense of Eq. (77) optimizing condition may be as follows. Let us introduce l auxiliary terminal objects γ1, …, γ<sup>l</sup> corresponding variables γ1, …, γl, having places in UMMG S ¼ h i a0; R; F , i.e., unitary metarules and boundary condition (66). After that, let us add one new

γ ¼ opt: (77)

, group ! 3 � analyst, 2 � assistant>, , group ! 1 � analyst, 2 � assistant>g,

, group ! 3 � analyst, 3 � assistant>, , group ! 1 � analyst, 3 � assistant>g,

$$\left\{n\_{i\_1} \cdot a\_{i\_1}, \ldots, n\_{i\_l} \cdot a\_{i\_l} \right\} \in \overline{V}\_{\text{St}} \tag{80}$$

and TMS (79) will be selected to VS0, if and only if TMS (80) satisfies all conditions, entering F and concerning terminal objects ai<sup>1</sup> , …, aik , as well as TMS n<sup>1</sup> � γ1; …; nl � γ f g<sup>l</sup> satisfies all optimizing conditions of the form γ<sup>i</sup> ¼ opt ∈F<sup>0</sup> , corresponding γ<sup>i</sup> ¼ opt∈F:.

It is not difficult to define VS by subtracting from all v<sup>0</sup> ∈VS<sup>0</sup> multisets of the form n<sup>1</sup> � γ1; …; nl � γ f g<sup>l</sup> , but from the practical point of view, it is more useful to consider not VS but VS<sup>0</sup> as a result of application of unitary multimetagrammar S: it is clear that all v<sup>0</sup> ∈VS<sup>0</sup> contain values n1, …, nl of variables γ1, …, γ<sup>l</sup> as terminal objects γ1, …, γ<sup>l</sup> multiplicities, which computation is often main purpose of the mentioned application.

Example 8. As may be seen, problem, described in Section 2, is to obtain m quantity of laboratories, as well as n and l quantities of analysts and assistants, respectively, in one laboratory. Although Eqs. (18)–(20) do not contain optimizing conditions of the form γ ¼ opt, generating TMS like

$$\{100 \cdot employee, 115000 \cdot eur, 3 \cdot m, 2 \cdot n, 5 \cdot l\}\tag{81}$$

is much more useful than TMS like {100�employee, 115,000�eur} because of Eq. (81) with greater informativity (here, we use m, n, l instead of n, m, l). ∎

So we shall use VS<sup>0</sup> as a result of S ¼ h i a0; R; F unitary multimetagrammar application, even if R does not include variable-containing optimizing conditions.

To finish with syntax and semantics of UMGs/UMMGs, let us note that class of unitary multigrammars is strict subclass of filtering unitary multiset grammars (UMGs ⊂ FUMGs): every UMGs is FUMGs with empty filter. From the other side, FUMGs are strict subclass of unitary multiset metagrammars (UMGs ⊂ FUMGs): every FUMGs is UMMGs without variable multiplicities and corresponding variable declarations inside filter.

UMG/UMMG algorithmics and applications are considered in the separate chapter of this book.

Enhanced Expert Systems
