2. Algorithmics of unitary multigrammars and multimetagrammars

Let us begin from filtering unitary multigrammars (FUMG).

From the computational complexity point of view, definition (58) from the first part of this work may be without loss of generated TMS transformed to

in the area of their functions in such a way that every new function call operates its

variables F, V, FT global; variables v, R local;

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

/\* initial values of optimized multiplicities settings \*/

∈F then FT : ∪ a; min; k<sup>0</sup> ; else FT : ∪ f g h i a; min; MAX ;

∈F then FT : ∪ f g h i a; max; k ; else FT : ∪ f g h i a; max; 0 ;

/\*v is non-terminal multiset, and following operators provide selection of

∈F & n>k<sup>0</sup> /\* n already exceeds higher bound \*/

then if l<n /\* current minimized multiplicity of object a is already

unperspective multisets and redundant generation cut-off \*/

/\* branch is perspective, so new multisets are generated \*/

do h i a; w ∈R ; /\* all non-terminal object a alternatives \*/

then if ð Þ <sup>n</sup> <sup>&</sup>lt; <sup>k</sup> <sup>∨</sup> <sup>n</sup>>k<sup>0</sup> /\* <sup>n</sup> is out of <sup>k</sup>; <sup>k</sup><sup>0</sup> \*/

then if l<n /\* n is greater than already stored min value \*/

then if l>n /\* n is less than already stored max value \*/

own values of these variables. TMSG body is the following:

TMSG: procedure (v, R, F) returns (V);

{min : if k≤ a≤k<sup>0</sup>

max : if k≤ a≤k<sup>0</sup>

/\*main part: generation function G call \*/

do n � a∈v where a is terminal object;

lower than n, which cannot decrease \*/ then return;

select n � a∃ ∈v where a is non-terminal object;

call G vð Þ � f g n � a þ n∗w, R ;

∈ F

if h i a; min; l ∈ FT

if h i a; max; l ∈FT

FILTER: procedure (v); /\* generated TMS v filtration \*/

then return;

then return;

v ≔ ∅f g; FT ≔ ∅f g;

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

do a ¼ opt∈F; case opt:

};

call G(v, R);

/\*function G body\*/ G: procedure (v, R);

return;};

then return; if h i a; min; l ∈FT

if k≤ a≤ k<sup>0</sup>

end v;

end aw; end;

variables v, x local; do n � a∈v ; if k≤a≤k<sup>0</sup>

end G;

89

if v is terminal multiset then {call FILTER(v);

end F;

$$V\_{\langle i+1\rangle} = V\_{\langle i\rangle} \cup \left( \cup \begin{array}{c} \cup \\ \cup \\ v \in V\_{\langle i\rangle} \end{array} \cup \begin{array}{c} \cup \\ \cup \\ n \cdot a \cong \emptyset \end{array} \{v - \langle n \cdot a \rangle + n \ast \{n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m\} \} \\ \{a \to n\_1 \cdot a\_1, \dots, n\_m \cdot a\_m\} \in R \end{array} \right) \tag{1}$$

where ∃ ∈ means selection of any one multiobject n � a from the multiset v instead of repeating such selection for all multiobjects n � a∈v . This provides essential reduction of the computational complexity of TMS generation [1] and is basic for all algorithms, described lower in this section.

As may be seen, sufficiently valuable part of multisets, generated by FUMG unitary rules (UR) application, may be eliminated after few generation steps, because all the following steps do not lead to TMS, satisfying FUMG filter boundary conditions, or have no opportunity for further optimization over terminal multisets, generated earlier, if concerning optimizing conditions. So essence of general approach, which is described further, is to apply filter to every new generated multiset (not only terminal) and to cut off those multisets, which are not perspective in the aforementioned sense. Thus we apply well known and widely used in operations research "branches and bounds" scheme to TMS generation. Of course, filter application to generated nonterminal multisets cannot be identical to filter application to terminal multisets; that is why some additional considerations are necessary.

Let us take the definition of TMS generation logic (57)–(61) from the first part of the work as a basis and construct rather simple and transparent procedurefunction terminal multisets generation (TMSG), providing reduced generation of set of terminal multisets, defined by FUMG.

We shall use the following variables in the TMSG body:


In TMSG body, F, FT, and V are global variables, which are available from all subfunction calls while generation is executed. Note F is read-only variable, while V and FT are updated (read-write) variables. All other variables are local and are used Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

in the area of their functions in such a way that every new function call operates its own values of these variables.

```
TMSG body is the following:
TMSG: procedure (v, R, F) returns (V);
        variables F, V, FT global; variables v, R local;
        v ≔ ∅f g; FT ≔ ∅f g;
       /* initial values of optimized multiplicities settings */
       do a ¼ opt∈F;
       case opt:
              {min : if k≤ a≤k0
                                  ∈F
                        then FT : ∪ a; min; k0     ;
                        else FT : ∪ f g h i a; min; MAX ;
              max : if k≤ a≤k0
                                 ∈F
                        then FT : ∪ f g h i a; max; k ;
                        else FT : ∪ f g h i a; max; 0 ;
              };
       end F;
       /*main part: generation function G call */
       call G(v, R);
        /*function G body*/
       G: procedure (v, R);
          if v is terminal multiset
            then {call FILTER(v);
              return;};
       /*v is non-terminal multiset, and following operators provide selection of
       unperspective multisets and redundant generation cut-off */
       do n � a∈v where a is terminal object;
          if k≤ a≤ k0
                      ∈F & n>k0 /* n already exceeds higher bound */
            then return;
          if h i a; min; l ∈FT
            then if l<n /* current minimized multiplicity of object a is already
             lower than n, which cannot decrease */
                        then return;
        end v;
        /* branch is perspective, so new multisets are generated */
       select n � a∃ ∈v where a is non-terminal object;
       do h i a; w ∈R ; /* all non-terminal object a alternatives */
          call G vð Þ � f g n � a þ n∗w, R ;
        end aw;
        end;
end G;
FILTER: procedure (v); /* generated TMS v filtration */
variables v, x local;
       do n � a∈v ;
          if k≤a≤k0
                      ∈ F
              then if ð Þ n < k ∨ n>k0   /* n is out of k; k0   */
                     then return;
          if h i a; min; l ∈ FT
              then if l<n /* n is greater than already stored min value */
                     then return;
          if h i a; max; l ∈FT
              then if l>n /* n is less than already stored max value */
```
2. Algorithmics of unitary multigrammars and multimetagrammars

From the computational complexity point of view, definition (58) from the first

<sup>∪</sup> <sup>n</sup>�a∃ ∈ <sup>v</sup>

where ∃ ∈ means selection of any one multiobject n � a from the multiset v instead of repeating such selection for all multiobjects n � a∈v . This provides essential reduction of the computational complexity of TMS generation [1] and is

As may be seen, sufficiently valuable part of multisets, generated by FUMG unitary rules (UR) application, may be eliminated after few generation steps, because all the following steps do not lead to TMS, satisfying FUMG filter boundary conditions, or have no opportunity for further optimization over terminal multisets, generated earlier, if concerning optimizing conditions. So essence of general approach, which is described further, is to apply filter to every new generated multiset (not only terminal) and to cut off those multisets, which are not perspective in the aforementioned sense. Thus we apply well known and widely used in operations research "branches and bounds" scheme to TMS generation. Of course, filter application to generated nonterminal multisets cannot be identical to filter application to terminal multisets; that is why some additional considerations are

Let us take the definition of TMS generation logic (57)–(61) from the first part

2. R, which value is set of unitary rules (FUMG scheme), applied to multisets in

3. F, which value is FUMG filter used for selection of terminal multisets to the

5. FT, which value is set of triples <a, opt, l>, each corresponding to optimizing condition a ¼ opt∈ F, where a is object, opt∈f g max; min , and l is current value of object a multiplicity obtained after previous generation steps.

In TMSG body, F, FT, and V are global variables, which are available from all subfunction calls while generation is executed. Note F is read-only variable, while V and FT are updated (read-write) variables. All other variables are local and are used

4.V, accumulating terminal multisets, satisfying filter F, while generation.

6.Couples <a, w> and <a, c>, which are representations of unitary rule a n<sup>1</sup> � a1, …, nm � am, where w as well as c is multiset f g n<sup>1</sup> � a1; …; nm � am .

of the work as a basis and construct rather simple and transparent procedurefunction terminal multisets generation (TMSG), providing reduced generation of

We shall use the following variables in the TMSG body:

f g v�f gþ n � a n∗f g n<sup>1</sup> � a1; ⋯; nm � am

1

CCCCA (1)

Let us begin from filtering unitary multigrammars (FUMG).

h i a ! n<sup>1</sup> � a1; ⋯; nm � am ∈R

basic for all algorithms, described lower in this section.

set of terminal multisets, defined by FUMG.

order to generate new multisets.

resulting set V.

1. v, which value is current generated multiset.

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

0

Enhanced Expert Systems

BBBB@

necessary.

88

part of this work may be without loss of generated TMS transformed to

### then return;

```
end na;
/* correction min/max values by new terminal multiset*/
x ≔ 0; /* flag "no values corrected" */
do h i a; opt; l ∈FT
   do n � a∈v ;
      if l 6¼ n /* at least one value corrected */
         then FT : �f g h i a; opt; l ∪ f g h i a; opt; n ; =∗replacement∗ f g =x ≔ 1 ;
        =∗flag reset∗
                      =
   end na;
end opt;
if x=0 /* no values corrected */
   then V : ∪ f gv ; /* one more TMS added to the accumulated set */
   else V ≔ f gv ; /* replacement of earlier accumulated set */
end FILTER;
```
The third section of G corresponds to nonterminal multiset, which was not

branches, corresponding to unitary rules with the same head, in full accordance with UMG semantics and improvement (1), by G recursive calls with new

Function FILTER with unique input (multiset v) implements check of all conditions, having place in filter F. This is done by the first do-end loop for all terminal multiobjects, entering v. If one of these checks failed, return from FILTER is performed without any additional actions. If all checks were successful, second section is executed. It begins from the installation of flag variable x to 0 value; that means no min/max values in the accumulating variable FT were replaced (i.e., v has no multiobjects n � a with value n more or less over already having place in FT). After that, do-end loop for all FT elements is executed. If multiplicity n of object a in TMS v is not equal to value l in the considered element h i a; opt; l ∈FT; that means n is less (when opt ¼ min) or greater (when opt ¼ max)

than l, so l must be replaced by n, and flag x must get value 1 (at least one

of V is replaced by one-element set {v}.

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

confirmed by the following statement [2, 3].

defined by unitary multimetagrammars.

where every Cai

tion branch, leading to object a.

replacement was done). The third section of function FILTER operates according to variable x value. If x = 0 (i.e., all optimized multiplicities in v are equal to already obtained in the previous generation steps), then v is joined to the resulting set V as new element. If x = 1 (i.e., at least one multiplicity was replaced, so v is "better" than earlier created and stored terminal multisets), then previous value

As seen, the described algorithm due to its simplicity may be implemented easily on every available software/hardware environment. Correctness of this algorithm is

Statement. Let S ¼ h i a0; R; F , and TMSG ð Þ f g 1 � a<sup>0</sup> ; R; F is result of TMSG call.

(Note TMSG operates only elementary boundary conditions aρn, not EBC aρa<sup>0</sup>

Let us describe now the main idea of algorithmics of generation sets of TMS,

<sup>1</sup> � ai<sup>1</sup> ; …;Caim � aim

polynom of variables-multiplicities, having places in unitary metarules, used while

where NCa is number of monoms, each being product of all occurrences of variables-multiplicities and constants-multiplicities, having places in one genera-

k<sup>1</sup> ≤ai<sup>1</sup> ≤k<sup>0</sup>

:… kl ≤ ail ≤k<sup>0</sup>

1,

l

<sup>j</sup> is so-called variables-containing multiplicity (VCM), being

<sup>1</sup> � … � <sup>γ</sup><sup>i</sup>

mi � �<sup>l</sup> a imi

, (4)

(5)

neither CBC. TMSG generalization is not associated with any difficulties).

As shown in [2, 3], all multisets, generated by any UMMG, have form

v ¼ Cai

generation of multiset v. In the general case, object a VCM is

<sup>i</sup> þ ∑ NCa i¼1 na <sup>i</sup> � <sup>γ</sup><sup>i</sup> 1 � �<sup>l</sup> a i

Ca <sup>¼</sup> na

If filter F of UMMG contains boundary conditions

TMSGð Þ¼ f g <sup>1</sup> � <sup>a</sup><sup>0</sup> ; <sup>R</sup>; <sup>F</sup> VS: ▪ (2)

n o, (3)

,

eliminated, being perspective, so generation is continued by all possible

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

input data.

Then

91

end TMSG

Let us comment on the represented procedure-function TMSG.

As seen, it contains prefix, which provides V and FT variable values initialization. FT value is set of triples, each corresponding to one optimizing condition, entering filter F. If there is boundary condition k≤a≤k<sup>0</sup> ∈ F, then initial value of object a multiplicity would be k<sup>0</sup> in the case condition is a ¼ min, and k otherwise. Both values correspond to the worst cases. If there is not any boundary condition with the same object a, where a ¼ opt∈F, then, obviously, the worst case for a ¼ min is MAX (the largest possible multiplicity for the considered problem), while for a ¼ max, it is 0. After prefix execution, there is unique operation, returning result of recursive procedure G call with input values v and R, passed without any changes from TMSG call itself.

Procedure G is core of the described algorithm; it implements the main part of generation and consists of three sections.

First section corresponds to that case, when v is terminal multiset, and all that is necessary here is to apply FUMG filter to v, what is really done by procedure FILTER call with v input data. After this call, processing of TMS v is terminated.

If v is not terminal multiset, it is clear that v contains one or more nonterminal objects, which may be used for generation continuation. The last is performed by the second section of G in such a way that multiset v is checked, where it is perspective in the above sense or it may be eliminated from generation, because all TMS, generated from v, would not satisfy F. For this purpose, all terminal multiobjects are checked by two selection criteria:


(There may be more sophisticated and efficient criteria for earlier recognition and cutting off unperspective generation branches [2, 3], but chapter volume limits make their description impossible). If one of the checked conditions is not satisfied, further generation from multiset v is terminated by return from G without any operation.

Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

The third section of G corresponds to nonterminal multiset, which was not eliminated, being perspective, so generation is continued by all possible branches, corresponding to unitary rules with the same head, in full accordance with UMG semantics and improvement (1), by G recursive calls with new input data.

Function FILTER with unique input (multiset v) implements check of all conditions, having place in filter F. This is done by the first do-end loop for all terminal multiobjects, entering v. If one of these checks failed, return from FILTER is performed without any additional actions. If all checks were successful, second section is executed. It begins from the installation of flag variable x to 0 value; that means no min/max values in the accumulating variable FT were replaced (i.e., v has no multiobjects n � a with value n more or less over already having place in FT). After that, do-end loop for all FT elements is executed. If multiplicity n of object a in TMS v is not equal to value l in the considered element h i a; opt; l ∈FT; that means n is less (when opt ¼ min) or greater (when opt ¼ max) than l, so l must be replaced by n, and flag x must get value 1 (at least one replacement was done). The third section of function FILTER operates according to variable x value. If x = 0 (i.e., all optimized multiplicities in v are equal to already obtained in the previous generation steps), then v is joined to the resulting set V as new element. If x = 1 (i.e., at least one multiplicity was replaced, so v is "better" than earlier created and stored terminal multisets), then previous value of V is replaced by one-element set {v}.

As seen, the described algorithm due to its simplicity may be implemented easily on every available software/hardware environment. Correctness of this algorithm is confirmed by the following statement [2, 3].

Statement. Let S ¼ h i a0; R; F , and TMSG ð Þ f g 1 � a<sup>0</sup> ; R; F is result of TMSG call. Then

$$\text{TMSG}(\{\mathbf{1} \cdot \mathbf{a}\_0\}, \mathbf{R}, \mathbf{F}) = \overline{\mathbf{V}}\_{\mathbf{S}}. \qquad \blacksquare \tag{2}$$

(Note TMSG operates only elementary boundary conditions aρn, not EBC aρa<sup>0</sup> , neither CBC. TMSG generalization is not associated with any difficulties).

Let us describe now the main idea of algorithmics of generation sets of TMS, defined by unitary multimetagrammars.

As shown in [2, 3], all multisets, generated by any UMMG, have form

$$\boldsymbol{\nu} = \left\{ \mathbf{C}\_{a\_{i\_1}} \cdot \boldsymbol{a}\_{i\_1}, \dots, \mathbf{C}\_{a\_{i\_m}} \cdot \boldsymbol{a}\_{i\_m} \right\}, \tag{3}$$

where every Cai <sup>j</sup> is so-called variables-containing multiplicity (VCM), being polynom of variables-multiplicities, having places in unitary metarules, used while generation of multiset v. In the general case, object a VCM is

$$\mathbf{C}\_{a} = n\_{i}^{a} + \sum\_{i=1}^{N\_{\rm C}} n\_{i}^{a} \cdot \left(\boldsymbol{\upchi}\_{1}^{i}\right)^{l\_{i\_{1}}^{a}} \cdot \dots \cdot \left(\boldsymbol{\upchi}\_{m\_{i}}^{i}\right)^{l\_{i\_{m\_{i}}^{a}}^{r}},\tag{4}$$

where NCa is number of monoms, each being product of all occurrences of variables-multiplicities and constants-multiplicities, having places in one generation branch, leading to object a.

If filter F of UMMG contains boundary conditions

$$\begin{aligned} k\_1 \le a\_{i\_1} \le k\_1', \\ \dots \\ k\_l \le a\_{i\_l} \le k\_l' \end{aligned} \tag{5}$$

then return;

x ≔ 0; /\* flag "no values corrected" \*/

=

/\* correction min/max values by new terminal multiset\*/

then FT : �f g h i <sup>a</sup>; opt; <sup>l</sup> <sup>∪</sup> f g h i <sup>a</sup>; opt; <sup>n</sup> ; <sup>=</sup>∗replacement<sup>∗</sup> f g <sup>=</sup><sup>x</sup> <sup>≔</sup> <sup>1</sup> ;

∈ F, then initial value of

then V : ∪ f gv ; /\* one more TMS added to the accumulated set \*/

else V ≔ f gv ; /\* replacement of earlier accumulated set \*/

As seen, it contains prefix, which provides V and FT variable values initialization. FT value is set of triples, each corresponding to one optimizing condition,

object a multiplicity would be k<sup>0</sup> in the case condition is a ¼ min, and k otherwise. Both values correspond to the worst cases. If there is not any boundary condition with the same object a, where a ¼ opt∈F, then, obviously, the worst case for a ¼ min is MAX (the largest possible multiplicity for the considered problem), while for a ¼ max, it is 0. After prefix execution, there is unique operation, returning result of recursive procedure G call with input values v and R, passed

Procedure G is core of the described algorithm; it implements the main part of

First section corresponds to that case, when v is terminal multiset, and all that is

perspective in the above sense or it may be eliminated from generation, because all

1. If in terminal multiobject n � a multiplicity n already exceeds upper bound k<sup>0</sup> of

steps, object a multiplicity would only increase or in the utmost case remain

2. If mentioned multiplicity is greater than value l already having place in the triple h i a; min; l ∈ FT (again it's obvious that the following steps would not decrease this multiplicity, so all TMS generated from V would not satisfy

(There may be more sophisticated and efficient criteria for earlier recognition and cutting off unperspective generation branches [2, 3], but chapter volume limits make their description impossible). If one of the checked conditions is not satisfied, further generation from multiset v is terminated by return from G without any

∈F . (it's obvious that while following generation

necessary here is to apply FUMG filter to v, what is really done by procedure FILTER call with v input data. After this call, processing of TMS v is terminated. If v is not terminal multiset, it is clear that v contains one or more nonterminal objects, which may be used for generation continuation. The last is performed by the second section of G in such a way that multiset v is checked, where it is

TMS, generated from v, would not satisfy F. For this purpose, all terminal

if l 6¼ n /\* at least one value corrected \*/

Let us comment on the represented procedure-function TMSG.

end na;

Enhanced Expert Systems

do h i a; opt; l ∈FT do n � a∈v ;

end na; end opt;

end FILTER;

end TMSG

=∗flag reset<sup>∗</sup>

if x=0 /\* no values corrected \*/

entering filter F. If there is boundary condition k≤a≤k<sup>0</sup>

without any changes from TMSG call itself.

multiobjects are checked by two selection criteria:

boundary condition k≤ a≤k<sup>0</sup>

optimizing filter a ¼ min).

unchangeable).

operation.

90

generation and consists of three sections.

as well as optimizing conditions

$$a\_{j\_1} = \text{opt}\_{1'},$$

$$\dots$$

$$a\_{j\_t} = \text{opt}\_t,$$

va <sup>¼</sup> na

survey.

<sup>0</sup> � γ<sup>0</sup> � �; na

where <sup>k</sup> <sup>¼</sup> NCa , <sup>γ</sup><sup>i</sup>

is represented by multiset

polynoms multiplication and addition.

that is, their application to various practical problems.

Petri nets, vectors addition, substitution systems, etc.).

(manufacturing) STS, being most complicated for modeling.

as follows: object a consists of n<sup>1</sup> objects a1, …, nm objects am .

3. Assessment of the producing sociotechnical systems

model, are described in [1, 14].

We shall understand UR

93

<sup>1</sup> � γ0;e a <sup>11</sup> � γ 1 1 ; …;e a 1m<sup>1</sup> � γ1 m<sup>1</sup>

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

n o; …; <sup>n</sup><sup>a</sup>

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

n o n o ,

object, corresponding to constants, having place in polynom. For example, polynom

This representation is sufficiently flexible, and it is the basis of implementation

More detailed description of algorithmics, providing efficient generation of sets

However, presented formal definitions of syntax, semantics, and algorithmics of UMG/UMMG are, in our opinion, sufficient for consideration of their pragmatics,

Multigrammatical paradigm and UMG/UMMG toolkit are sufficiently general and simple to formalize and solve a lot of practical problems from various areas of operations research and systems analysis. Techniques, shortly described in Section 2 of the first part of this work, is one of the many possible to apply. Some more examples from hierarchical sociotechnical systems assessment and design concerned reader may find in [2, 3], where one may find also description of multigrammatical emulation of well-known classical problems of optimization theory: shortest path, traveling salesman, maximal flow, maximal pair matching, opti-

Lower in this section, we shall consider problems, associated with the producing

In turn, technological interpretation of unitary rules is generalization of the

structural one and is as follows: production of one object (unit of resource) a requires n<sup>1</sup> objects (units of resource) a1, …, nm objects (units of resource) am: One may consider (13) as a black box, representing producing device or manufacturing facility (factory, plant, etc.), containing a lot of such devices, working cooperatively. Set R of such URs represents technological base (TB) of some social group,

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

Let us introduce the following structural interpretation of unitary rules.

mal assignments problems, and transport problem as well as integer linear programming problem. (Note that in [2, 3], there is also analysis of interconnections between multigrammars' family and known computational models, such as

Implementation issues, related with the proposed knowledge representation

of mixed computation in the multisets case; the core of this implementation is

of terminal multisets, defined by unitary multimetagrammars, needs separate

<sup>j</sup> are objects, corresponding to variables, while γ<sup>0</sup> is fictive

va ¼ 5 � γ f g<sup>0</sup> ; 3 � γ0; 2 � γ1; 4 � γ f g<sup>3</sup> ; 1 � γ0; 5 � γ2; 1 � γ f g f g<sup>3</sup> : (12)

Ca <sup>¼</sup> <sup>5</sup> <sup>þ</sup> <sup>3</sup> � <sup>γ</sup><sup>1</sup> ð Þ<sup>2</sup> � <sup>γ</sup><sup>2</sup> ð Þ<sup>4</sup> <sup>þ</sup> <sup>γ</sup><sup>2</sup> ð Þ<sup>5</sup> � <sup>γ</sup><sup>3</sup> (11)

<sup>k</sup> � γ0;e a <sup>k</sup><sup>1</sup> � γ k 1 ; …;e a kmk � γk mk

(10)

they induce l inequalities

$$\begin{aligned} \lambda k\_1 \le C\_{a\_{i\_1}} \le k\_1', \\ \dots \\ k\_l \le C\_{a\_{i\_l}} \le k\_l', \end{aligned} \tag{7}$$

and t goal functions

$$\begin{aligned} \mathbf{C}\_{a\_{j\_1}} & \rightarrow \text{opt}\_{j\_1}, \\ & \cdots \\ \mathbf{C}\_{a\_{j\_t}} & \rightarrow \text{opt}\_{j\_t}. \end{aligned} \tag{8}$$

Domain of every variable γ, having place in polynoms Cai 1 , …, Cai l , Cj 1 , …, Cj t , is defined by boundary condition

$$k\_{\gamma} \le \gamma \le k\_{\gamma}' \in F. \tag{9}$$

As seen from (3)–(9), set of terminal multisets, generated in the UMMG case, corresponds to set of solutions of multicriterial problem of discrete polynomial programming. There are well-known approaches to such problems' consideration [4, 5], but their common feature is they provide search of any one of the solutions, not all multi-element solutions set, if it exists. Proposed UMMG TMS generation algorithmics [2, 3] is initially oriented to UMMG semantic precise implementation and combines mixed computation and interval analysis techniques [6–9] with global optimization based on theory [10–13]. Aforementioned algorithmics provides multidirectional reduction of redundant generation branches by procedure, similar to TMSG, and extended by splitting of intervals, defined by boundary conditions, which describe variable domains, to subintervals, until the last become points. Every such step is accompanied by the estimation of lower and upper bounds of VCMs, containing variable, which current domain is splitted, so if both bounds of at least one VCM are out of interval, defined by corresponding object multiplicity bounds, having place in UMMG filter, then created interval is eliminated, and generation branch is terminated.

As TMSG, another powerful tool of unperspective branches early recognition and cutoff is comparison of mentioned lower and upper bound estimates with already obtained values of optimized multiplicities. If corresponding optimizing condition is a = min, and current value of object a multiplicity, obtained as a result of previous steps execution, is n, then when lower bound estimate of VCM of a is n, and already n>n, so further generation by this branch, which leads only to growth of VCM (or it remains unchangeable in the best case), is senseless, and branch may be terminated. Similarly, if optimizing condition is a = max, and current value of corresponding multiplicity is n, while VCM upper bound estimate is n<sup>0</sup> < n, then further generation by this branch will not lead to object a multiplicity increase, and branch may be terminated.

VCM generation is based on unified representation of polynoms in (4) form as sets of multisets: Ca is represented as

Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

$$\boldsymbol{\nu}\_{a} = \left\{ \left\{ \boldsymbol{n}\_{0}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{0} \right\}, \left\{ \boldsymbol{n}\_{1}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{0}, \boldsymbol{\varepsilon}\_{1\_{1}}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{1}^{1}, \dots, \boldsymbol{\varepsilon}\_{1\_{m\_{1}}}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{m\_{1}}^{1} \right\}, \dots, \left\{ \boldsymbol{n}\_{k}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{0}, \boldsymbol{\varepsilon}\_{k\_{1}}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{1}^{k}, \dots, \boldsymbol{\varepsilon}\_{k\_{m\_{k}}}^{a} \cdot \overline{\boldsymbol{\gamma}}\_{m\_{k}}^{k} \right\} \right\}. \tag{10}$$

where <sup>k</sup> <sup>¼</sup> NCa , <sup>γ</sup><sup>i</sup> <sup>j</sup> are objects, corresponding to variables, while γ<sup>0</sup> is fictive object, corresponding to constants, having place in polynom. For example, polynom

$$\mathbf{C}\_{a} = \mathbf{S} + \mathbf{3} \cdot (\boldsymbol{\chi}\_{1})^{2} \cdot (\boldsymbol{\chi}\_{2})^{4} + (\boldsymbol{\chi}\_{2})^{5} \cdot \boldsymbol{\chi}\_{3} \tag{11}$$

is represented by multiset

as well as optimizing conditions

Enhanced Expert Systems

they induce l inequalities

and t goal functions

defined by boundary condition

nated, and generation branch is terminated.

branch may be terminated.

92

sets of multisets: Ca is represented as

aj

aj <sup>t</sup> ¼ optt ,

k<sup>1</sup> ≤Cai

Caj

Caj

Domain of every variable γ, having place in polynoms Cai

:… kl ≤Cai

<sup>1</sup> ¼ opt1, :…

> <sup>1</sup> ≤k<sup>0</sup> 1,

<sup>l</sup> ≤k<sup>0</sup> l ,

<sup>1</sup> ! optj 1 ,

<sup>t</sup> ! optj t :

> 1 , …, Cai l , Cj 1 , …, Cj t , is

<sup>γ</sup> ∈F: (9)

:…

k<sup>γ</sup> ≤γ ≤k<sup>0</sup>

As seen from (3)–(9), set of terminal multisets, generated in the UMMG case, corresponds to set of solutions of multicriterial problem of discrete polynomial programming. There are well-known approaches to such problems' consideration [4, 5], but their common feature is they provide search of any one of the solutions, not all multi-element solutions set, if it exists. Proposed UMMG TMS generation algorithmics [2, 3] is initially oriented to UMMG semantic precise implementation and combines mixed computation and interval analysis techniques [6–9] with global optimization based on theory [10–13]. Aforementioned algorithmics provides multidirectional reduction of redundant generation branches by procedure, similar to TMSG, and extended by splitting of intervals, defined by boundary conditions, which describe variable domains, to subintervals, until the last become points. Every such step is accompanied by the estimation of lower and upper bounds of VCMs, containing variable, which current domain is splitted, so if both bounds of at least one VCM are out of interval, defined by corresponding object multiplicity bounds, having place in UMMG filter, then created interval is elimi-

As TMSG, another powerful tool of unperspective branches early recognition and cutoff is comparison of mentioned lower and upper bound estimates with already obtained values of optimized multiplicities. If corresponding optimizing condition is a = min, and current value of object a multiplicity, obtained as a result of previous steps execution, is n, then when lower bound estimate of VCM of a is n, and already n>n, so further generation by this branch, which leads only to growth of VCM (or it remains unchangeable in the best case), is senseless, and branch may be terminated. Similarly, if optimizing condition is a = max, and current value of corresponding multiplicity is n, while VCM upper bound estimate is n<sup>0</sup> < n, then further generation by this branch will not lead to object a multiplicity increase, and

VCM generation is based on unified representation of polynoms in (4) form as

(6)

(7)

(8)

$$v\_a = \{ \{ \mathbf{5} \cdot \overline{\gamma}\_0 \}, \{ \mathbf{3} \cdot \overline{\gamma}\_0, \mathbf{2} \cdot \overline{\gamma}\_1, \mathbf{4} \cdot \overline{\gamma}\_3 \}, \{ \mathbf{1} \cdot \overline{\gamma}\_0, \mathbf{5} \cdot \overline{\gamma}\_2, \mathbf{1} \cdot \overline{\gamma}\_3 \} \}. \tag{12}$$

This representation is sufficiently flexible, and it is the basis of implementation of mixed computation in the multisets case; the core of this implementation is polynoms multiplication and addition.

More detailed description of algorithmics, providing efficient generation of sets of terminal multisets, defined by unitary multimetagrammars, needs separate survey.

Implementation issues, related with the proposed knowledge representation model, are described in [1, 14].

However, presented formal definitions of syntax, semantics, and algorithmics of UMG/UMMG are, in our opinion, sufficient for consideration of their pragmatics, that is, their application to various practical problems.

#### 3. Assessment of the producing sociotechnical systems

Multigrammatical paradigm and UMG/UMMG toolkit are sufficiently general and simple to formalize and solve a lot of practical problems from various areas of operations research and systems analysis. Techniques, shortly described in Section 2 of the first part of this work, is one of the many possible to apply. Some more examples from hierarchical sociotechnical systems assessment and design concerned reader may find in [2, 3], where one may find also description of multigrammatical emulation of well-known classical problems of optimization theory: shortest path, traveling salesman, maximal flow, maximal pair matching, optimal assignments problems, and transport problem as well as integer linear programming problem. (Note that in [2, 3], there is also analysis of interconnections between multigrammars' family and known computational models, such as Petri nets, vectors addition, substitution systems, etc.).

Lower in this section, we shall consider problems, associated with the producing (manufacturing) STS, being most complicated for modeling.

Let us introduce the following structural interpretation of unitary rules. We shall understand UR

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

as follows: object a consists of n<sup>1</sup> objects a1, …, nm objects am .

In turn, technological interpretation of unitary rules is generalization of the structural one and is as follows: production of one object (unit of resource) a requires n<sup>1</sup> objects (units of resource) a1, …, nm objects (units of resource) am: One may consider (13) as a black box, representing producing device or manufacturing facility (factory, plant, etc.), containing a lot of such devices, working cooperatively. Set R of such URs represents technological base (TB) of some social group,

possessing represented by this set producing (manufacturing) equipment. If R contains l > 1 URs with identical head and different bodies, this means that one and the same object may be produced in l various ways (by l various devices, or by one and the same device, but by various methods, or by l various facilities). Objects, having places in URs, may be manufactured devices, their blocks, spare parts, chips, pieces of connecting cables, various measured resources involved (necessary amounts of electrical energy, liquids, solid materials, etc. "down to ore"), as well as time and money. Manufactured devices may be, in turn, manufacturing ("means of production") and may be used further in production processes/chains.

separate device, and typical form of "local time" description is multiobject

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

and engine, 6000 USD; time interval necessary for one car assembling is

car ! 28 � h i mnt � car , 3000 � usd, 1 � body, 1 � engine, 1 � transmission, 4 � wheel,

logical base, defined by R. Order may be represented as multiset

which means customer needs m<sup>1</sup> objects b1, …, mk objects bk:

unitary multigrammar Sq generates one-element SMS, that is, VSq

unique variant of aforementioned resources collection. Otherwise, VSq

that is, order is to assemble three cars. According to (17)–(19),

<sup>3</sup> � motor; <sup>3</sup> � cooling‐system; <sup>3</sup> � accumulatorgg:

there are various ways of some objects' assembling, each consuming its own

terminal multiset v being element of set of TMS VSq , where

for syntactical unambiguity).

<sup>1</sup> � fuel‐cisterm,

resources collection.

unitary rule

95

may be rewritten in the following way:

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

<sup>2</sup> � first‐door, <sup>2</sup> � back‐door,

n � h i t � x , where x may be manufacturing device name as well as assembled technical object name, while t is time measurement unit (here angle brackets are used

28 minutes, body, 21 minutes; and engine, 63 minutes. Then URs from Example 1

body ! <sup>21</sup> � h i mnt � body , <sup>2000</sup> � usd, <sup>1</sup> � front‐glass, <sup>1</sup> � back‐glass, <sup>1</sup> � engine‐cover, <sup>1</sup> � baggage‐place,

If we have knowledge base, prepared as shown above, then it may be used to estimate resources amounts, necessary to complete any order by means of techno-

Then, as it is easy to see, resources collection, necessary to complete this order, is

Sq ¼ aq; Rq

Rq ¼ R ∪ aq ! m<sup>1</sup> � b1; …; mk � bk

(unitary rule, having place in (19), is in angle brackets for unambiguity). If

Example 3. Let q ¼ f g 3 � car : Then Rq consists of all URs from Example 2 and

VSq <sup>¼</sup> ff<sup>84</sup> � h i mnt‐car ; <sup>63</sup> � h i mnt‐body ; <sup>180</sup> � h i mnt‐engine ; <sup>27000</sup> � usd,

<sup>3</sup> � engine‐cover, <sup>3</sup> � baggage‐place, <sup>6</sup> � first‐door, <sup>6</sup> � back‐door,

That means order completion requires spare parts from external suppliers as well as money and time for assembling segments of manufacturing facility in amounts, being multiplicities of corresponding objects, having places in VSq . There is the only one variant of resources set necessary for order completion. ▪ If it is necessary to evaluate (estimate) total cost of order completion, then it is sufficient to join to the KB R unitary rules, defining costs of all necessary spare parts

<sup>3</sup> � transmission, <sup>12</sup> � wheel, <sup>3</sup> � fuel‐cistern, <sup>3</sup> � front‐glass, <sup>3</sup> � back‐glass,

q ¼ f g m<sup>1</sup> � b1; …; mk � bk , (17)

, (18)

 

 

¼ 1, there is

>1, and

(19)

order ! 3 � car, (20)

engine ! <sup>60</sup> � h i mnt � engine , <sup>6000</sup> � usd, <sup>1</sup> � motor, <sup>1</sup> � cooling‐system, <sup>1</sup> � accumulator: ▪

Example 2. Let us consider the following cost and time parameters, implanted to URs from example 1. Let cost of one car assembling is 3000 USD; body, 2000 USD;

Unitary multigrammars provide most natural "top-down" way of formal description of technological base of arbitrary producing STS, as well as deep structure of manufactured objects of any level of structural complexity (obviously, these two entities are interconnected closely). "Additivity" of multigrammatical knowledge bases (KB), being consequence of their "granularity" (due to unitary rules and metarules as knowledge representation atoms), provides creating and updating KB in near real time. Since now we shall use notations "multigrammatical knowledge base" and "scheme of UMG/UMMG" as synonyms.

Example 1. Consider car, consisting of body, engine, transmission, four wheels, and fuel cistern. Car body, in turn, consists of frame, front and back glasses, engine cover, baggage place, and two first and two second doors. Engine includes motor, cooling system, and accumulator. All the said may be represented by the following set of unitary rules in the structural interpretation:

car ! <sup>1</sup> � body, <sup>1</sup> � engine, <sup>1</sup> � transmission, <sup>4</sup> � wheel, <sup>1</sup> � fuel‐cisterm, body ! <sup>1</sup> � frame, <sup>1</sup> � front‐glass, <sup>1</sup> � back‐glass, <sup>1</sup> � engine‐cover, <sup>1</sup> � baggage‐place, <sup>2</sup> � first‐door, <sup>2</sup> � back‐door, engine ! <sup>1</sup> � motor, <sup>1</sup> � cooling‐system, <sup>1</sup> � accumulator: ▪

As it is easy to see, all terminal objects may become nonterminal after joining to this set of new URs, detailing them down to undivided spare parts. If to follow technological interpretation, then every UR reflects assembling operation, implemented by corresponding segment of manufacturing facility: one such segment is assembling car of the listed components, another segment - body, etc.

To take into account cost of any operation executed (obviously, it is "added value" in K. Marx terminology), as well as time interval necessary for its execution, it is sufficient to include to UR bodies multiobjects like n � e and m � t, where e and t are fixed-name objects being cost and time measurement units (e.g., usd and sec). There may be recalculation of both to another unit by including to the KB additional rules, reflecting currencies interrelations and different time scales, for example,

$$
\Delta \text{ } \textit{eur} \to \textbf{1.15} \cdot \textit{u} \,\text{sd},\tag{14}
$$

$$
bar{r} \to \mathsf{60} \cdot \mathsf{mut},\tag{15}$$

$$
\mathbf{\color{red}{m}mt \to \color{red}{60} \cdot \color{red}{sec}} \mathbf{\color{red}{0.8cm}} \tag{16}
$$

(rational multiplicities' appearance along with integer ones, considered higher, does not bring any principal transformations and difficulties into MG semantics and algorithmics [2, 3]). Both cost and time may be defined in "compound" units, that is, UR body may contain three multiobjects, 3 � hour, 23 � min, 15 � sec , that after application of URs (14)–(16) will be transformed to one multiobject, 10953 � sec .

Considering time intervals description in unitary rules, we must take into account that, unlike cost, time is not fully additive resource, because producing devices may operate in parallel. That's why time is additive resource only regarding Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

separate device, and typical form of "local time" description is multiobject n � h i t � x , where x may be manufacturing device name as well as assembled technical object name, while t is time measurement unit (here angle brackets are used for syntactical unambiguity).

Example 2. Let us consider the following cost and time parameters, implanted to URs from example 1. Let cost of one car assembling is 3000 USD; body, 2000 USD; and engine, 6000 USD; time interval necessary for one car assembling is 28 minutes, body, 21 minutes; and engine, 63 minutes. Then URs from Example 1 may be rewritten in the following way:

car ! 28 � h i mnt � car , 3000 � usd, 1 � body, 1 � engine, 1 � transmission, 4 � wheel, <sup>1</sup> � fuel‐cisterm,

body ! <sup>21</sup> � h i mnt � body , <sup>2000</sup> � usd, <sup>1</sup> � front‐glass, <sup>1</sup> � back‐glass, <sup>1</sup> � engine‐cover, <sup>1</sup> � baggage‐place, <sup>2</sup> � first‐door, <sup>2</sup> � back‐door,

engine ! <sup>60</sup> � h i mnt � engine , <sup>6000</sup> � usd, <sup>1</sup> � motor, <sup>1</sup> � cooling‐system, <sup>1</sup> � accumulator: ▪

If we have knowledge base, prepared as shown above, then it may be used to estimate resources amounts, necessary to complete any order by means of technological base, defined by R. Order may be represented as multiset

$$q = \{m\_1 \cdot b\_1, \ldots, m\_k \cdot b\_k\},\tag{17}$$

which means customer needs m<sup>1</sup> objects b1, …, mk objects bk:

Then, as it is easy to see, resources collection, necessary to complete this order, is terminal multiset v being element of set of TMS VSq , where

$$\mathbb{S}\_q = \langle \mathfrak{a}\_q, \mathbb{R}\_q \rangle,\tag{18}$$

$$R\_q = R \cup \left\{ \left< a\_q \to m\_1 \cdot b\_1, \dots, m\_k \cdot b\_k \right> \right\} \tag{19}$$

(unitary rule, having place in (19), is in angle brackets for unambiguity). If unitary multigrammar Sq generates one-element SMS, that is, VSq ¼ 1, there is unique variant of aforementioned resources collection. Otherwise, VSq >1, and there are various ways of some objects' assembling, each consuming its own resources collection.

Example 3. Let q ¼ f g 3 � car : Then Rq consists of all URs from Example 2 and unitary rule

$$
overline{\rightarrow \ 3 \cdot car},\tag{20}$$

that is, order is to assemble three cars. According to (17)–(19),

$$\overline{\nabla}\_{\mathbb{S}\_q} = \{ \{ \mathbf{84} \cdot \langle \text{mnt-car} \rangle, \mathbf{63} \cdot \langle \text{mnt-body} \rangle, \mathbf{180} \cdot \langle \text{mnt-engine} \rangle, \mathbf{27000} \cdot \mathbf{u}s d, \mathbf{3} \cdot \text{m-sized}, \mathbf{3} \cdot \text{f}u \text{l-} \} \}$$
 
$$\mathbf{3} \cdot \text{transmission}, \mathbf{12} \cdot \mathbf{u}s \text{hel}, \mathbf{3} \cdot \text{f}u \text{el-istern}, \mathbf{3} \cdot \text{f}v \text{t-d} \mathbf{s} \text{l-} \} \mathbf{s} \text{l-} \} \mathbf{s} \text{l-} \mathbf{b} \text{k-} \mathbf{d} \text{-} \mathbf{s} \text{d-d} \mathbf{o} \text{r}, \mathbf{1} \cdot \text{f}u \text{l-} \} \mathbf{s} \text{l-} \mathbf{b} \text{k-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \} \mathbf{s} \text{l-} \mathbf{b} \text{k-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d} \text{-} \mathbf{s} \text{l-} \mathbf{d}$$

That means order completion requires spare parts from external suppliers as well as money and time for assembling segments of manufacturing facility in amounts, being multiplicities of corresponding objects, having places in VSq . There is the only one variant of resources set necessary for order completion. ▪

If it is necessary to evaluate (estimate) total cost of order completion, then it is sufficient to join to the KB R unitary rules, defining costs of all necessary spare parts

possessing represented by this set producing (manufacturing) equipment. If R contains l > 1 URs with identical head and different bodies, this means that one and the same object may be produced in l various ways (by l various devices, or by one and the same device, but by various methods, or by l various facilities). Objects, having places in URs, may be manufactured devices, their blocks, spare parts, chips, pieces of connecting cables, various measured resources involved (necessary amounts of electrical energy, liquids, solid materials, etc. "down to ore"), as well as time and money. Manufactured devices may be, in turn, manufacturing ("means of

production") and may be used further in production processes/chains.

car ! <sup>1</sup> � body, <sup>1</sup> � engine, <sup>1</sup> � transmission, <sup>4</sup> � wheel, <sup>1</sup> � fuel‐cisterm,

engine ! <sup>1</sup> � motor, <sup>1</sup> � cooling‐system, <sup>1</sup> � accumulator: ▪

base" and "scheme of UMG/UMMG" as synonyms.

Enhanced Expert Systems

set of unitary rules in the structural interpretation:

<sup>2</sup> � first‐door, <sup>2</sup> � back‐door,

94

Unitary multigrammars provide most natural "top-down" way of formal description of technological base of arbitrary producing STS, as well as deep structure of manufactured objects of any level of structural complexity (obviously, these two entities are interconnected closely). "Additivity" of multigrammatical knowledge bases (KB), being consequence of their "granularity" (due to unitary rules and metarules as knowledge representation atoms), provides creating and updating KB in near real time. Since now we shall use notations "multigrammatical knowledge

Example 1. Consider car, consisting of body, engine, transmission, four wheels, and fuel cistern. Car body, in turn, consists of frame, front and back glasses, engine cover, baggage place, and two first and two second doors. Engine includes motor, cooling system, and accumulator. All the said may be represented by the following

body ! <sup>1</sup> � frame, <sup>1</sup> � front‐glass, <sup>1</sup> � back‐glass, <sup>1</sup> � engine‐cover, <sup>1</sup> � baggage‐place,

As it is easy to see, all terminal objects may become nonterminal after joining to

(rational multiplicities' appearance along with integer ones, considered higher, does not bring any principal transformations and difficulties into MG semantics and algorithmics [2, 3]). Both cost and time may be defined in "compound" units, that is, UR body may contain three multiobjects, 3 � hour, 23 � min, 15 � sec , that after application of URs (14)–(16) will be transformed to one multiobject, 10953 � sec . Considering time intervals description in unitary rules, we must take into account that, unlike cost, time is not fully additive resource, because producing devices may operate in parallel. That's why time is additive resource only regarding

eur ! 1:15 � usd, (14) hour ! 60 � mnt, (15) mnt ! 60 � sec (16)

this set of new URs, detailing them down to undivided spare parts. If to follow technological interpretation, then every UR reflects assembling operation, implemented by corresponding segment of manufacturing facility: one such segment is assembling car of the listed components, another segment - body, etc. To take into account cost of any operation executed (obviously, it is "added value" in K. Marx terminology), as well as time interval necessary for its execution, it is sufficient to include to UR bodies multiobjects like n � e and m � t, where e and t are fixed-name objects being cost and time measurement units (e.g., usd and sec). There may be recalculation of both to another unit by including to the KB additional rules, reflecting currencies interrelations and different time scales, for example,

and other external ("outsourced") resources. These URs may have form a ! n � e, where a is terminal object from R, while e is monetary unit, used for cost calculation. As may be seen, if one would eliminate from URs time-defining multiobjects, then e becomes unique terminal object of the created scheme R<sup>0</sup> , and set of terminal multisets generated by UMG S<sup>0</sup> ¼ aq; R<sup>0</sup> q D E would contain one-element TMS of form f g n � e , where n is total cost of order completion, corresponding to one of its variants (as was said higher, there may be more than one such variant).

Example 4. Let us add to the KB from Example 3 the following unitary rules, defining prices of car the outsourced elements:

```
transmission ! 100 � usd,
wheel ! 50 � usd,
            …
accumulator ! 10 � usd:
```
As seen, new UMG provides generation of one-element set

ff<sup>84</sup> � h i mnt‐car ; <sup>63</sup> � h i mnt‐body ; <sup>180</sup> � h i mnt‐engine ;<sup>X</sup> � usdgg,

where X is total cost of order completion, that is, three car assembling.

If multiobjects 28 � h i mnt‐car , <sup>21</sup> � h i mnt‐body and 60 � h i mnt‐engine are eliminated from UR set presented in Example 10, then obtained UMG will generate oneelement set {{<sup>X</sup> �usd}}. ▪

In practice every STS, which is capable to complete input orders and manufacture some output production, possesses usually not only technological base but also resource base (RB). For this reason, assessment of STS capability to orders completion requires comparison of two resources collections—being in system's ownership and necessary. In multigrammatical paradigm, this problem is solved quite simply.

Let R be technological base, while multiset v ¼ m<sup>1</sup> � b1; …; mk � bk � � is resource base of the system, that is, STS possesses m<sup>1</sup> objects b1, …, mk objects bk: As it is easy to see, order q ¼ m<sup>1</sup> � b1; …; ml f g � bl may be completed by this system, if there exists multiset v∈VSq such that

$$
v \subsetneq \overline{v},\tag{21}$$

After recognition of system's inability to complete order q, there may be two

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

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

1. What amount of resources must be acquired by the system to complete the

The answer to the first question is obvious: if v∈VSq , and v is not subset of v, then additional amount of resources, necessary for order completion, is v–v: Thus variants of necessary resources acquisition are elements of set of terminal multisets

ΔVSq ¼ v�vjv∈VSq

One more area of useful application of UMG/UMMG is assessment of sociotechnical systems sustainability/vulnerability to various destructive impacts, which was in details considered in [1]. The main result of this work is as

∃v∈VSq

if there is no one TMS v∈VSq , satisfying (23), considered STS is vulnerable to

C ¼ ∑ m i¼1

To produce one unit of i-th product, the system needs respective resources, namely, aij units of the j-th resource, where j ¼ 1, …, n, and n is total number of different resources, consumed by the system for production. There are b1, …, bn amount of resources available, and the problem is to maximize profit C under

so-called reverse multigrammars are used for this problem solution.

The answer to the second question concerned reader may find in [1], where the

Let Rq be scheme, corresponding to technological base of the system and order q in the sense (17)–(19); v is total resource of this system (resource base, joined with multiset representation of technological base, as it was suggested in [1]), and Δv is impact, destructing some part of the aforementioned total resource. We shall call STS with technological base R and total resource v sustainable to impact Δv while

That is, despite impact there is at least one way of order completion. Otherwise,

Another important issue to be discussed here is profit optimization in production economy (POPE). We shall consider it not only because of its practical value but also in order to illustrate techniques of UMG/UMMG application to the multigrammatical representation and solution of classical optimization problems. POPE is formulated as follows [15]. Let there be n products, manufactured by STS, xi is amount of i-th product, and ci is its price. Profit, which producing STS

n o: (22)

� � <sup>v</sup>⊆<sup>v</sup> � <sup>Δ</sup>v: (23)

ci � xi: (24)

2.What part of order may be completed, given resources, owned by STS?

questions:

follows.

impact Δv.

would obtain, is

restrictions

97

completing order q, if

4. Optimization problems

order?

that is, collection of resources, belonging to the STS, is sufficient for order q completion by one of the implementable ways. In this case order completion is possible. Otherwise, that is, if there is no one multiset v∈V satisfying (21), then system is not able to complete q.

Example 5. Let KB from Example 2 be STS technological base, while

<sup>v</sup> <sup>¼</sup> <sup>f</sup><sup>6</sup> � transmission, <sup>10</sup> � wheel, <sup>2</sup> � fuel‐cistern, <sup>7</sup> � front‐glass, <sup>9</sup> � back‐glass, <sup>180</sup> � h i mnt‐car , <sup>240</sup> � h i mnt‐body , <sup>600</sup> � h i mnt‐engine , 1000000 � eur, 500000 � usdg

is its resource base. As may be seen, this resource base is not sufficient for order q = {3 � car} from Example 11 completion, because condition (21) is not satisfied: there are objects, entering all v∈VSq , which do not enter v at all (motor, accumulator, etc.). At the same time multiplicities of some terminal objects are less than it is necessary for order <sup>q</sup> completion 2 � fuel‐cistern<sup>∈</sup> <sup>v</sup> while 3 � fuel‐cistern∈v∈VSq � �. ▪

Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

After recognition of system's inability to complete order q, there may be two questions:


The answer to the first question is obvious: if v∈VSq , and v is not subset of v, then additional amount of resources, necessary for order completion, is v–v: Thus variants of necessary resources acquisition are elements of set of terminal multisets

$$
\Delta \overline{V}\_{\mathbb{S}\_q} = \left\{ \overline{v} - v \, \vert \, v \in \overline{V}\_{\mathbb{S}\_q} \right\}. \tag{22}
$$

The answer to the second question concerned reader may find in [1], where the so-called reverse multigrammars are used for this problem solution.

One more area of useful application of UMG/UMMG is assessment of sociotechnical systems sustainability/vulnerability to various destructive impacts, which was in details considered in [1]. The main result of this work is as follows.

Let Rq be scheme, corresponding to technological base of the system and order q in the sense (17)–(19); v is total resource of this system (resource base, joined with multiset representation of technological base, as it was suggested in [1]), and Δv is impact, destructing some part of the aforementioned total resource. We shall call STS with technological base R and total resource v sustainable to impact Δv while completing order q, if

$$\left(\exists v \in \overline{V}\_{\mathbb{S}\_q}\right) v \underline{\mathsf{C}} \overline{v} - \Delta \overline{v}. \tag{23}$$

That is, despite impact there is at least one way of order completion. Otherwise, if there is no one TMS v∈VSq , satisfying (23), considered STS is vulnerable to impact Δv.

#### 4. Optimization problems

Another important issue to be discussed here is profit optimization in production economy (POPE). We shall consider it not only because of its practical value but also in order to illustrate techniques of UMG/UMMG application to the multigrammatical representation and solution of classical optimization problems.

POPE is formulated as follows [15]. Let there be n products, manufactured by STS, xi is amount of i-th product, and ci is its price. Profit, which producing STS would obtain, is

$$\mathbf{C} = \sum\_{i=1}^{m} c\_i \cdot \boldsymbol{\varkappa}\_i. \tag{24}$$

To produce one unit of i-th product, the system needs respective resources, namely, aij units of the j-th resource, where j ¼ 1, …, n, and n is total number of different resources, consumed by the system for production. There are b1, …, bn amount of resources available, and the problem is to maximize profit C under restrictions

and other external ("outsourced") resources. These URs may have form a ! n � e, where a is terminal object from R, while e is monetary unit, used for cost calculation. As may be seen, if one would eliminate from URs time-defining multiobjects,

> q D E

f g n � e , where n is total cost of order completion, corresponding to one of its variants

Example 4. Let us add to the KB from Example 3 the following unitary rules,

transmission ! 100 � usd, wheel ! 50 � usd, … accumulator ! 10 � usd:

ff<sup>84</sup> � h i mnt‐car ; <sup>63</sup> � h i mnt‐body ; <sup>180</sup> � h i mnt‐engine ;<sup>X</sup> � usdgg,

If multiobjects 28 � h i mnt‐car , <sup>21</sup> � h i mnt‐body and 60 � h i mnt‐engine are eliminated from UR set presented in Example 10, then obtained UMG will generate one-

In practice every STS, which is capable to complete input orders and manufacture some output production, possesses usually not only technological base but also resource base (RB). For this reason, assessment of STS capability to orders completion requires comparison of two resources collections—being in system's ownership and necessary. In multigrammatical paradigm, this problem is solved

base of the system, that is, STS possesses m<sup>1</sup> objects b1, …, mk objects bk: As it is easy to see, order q ¼ m<sup>1</sup> � b1; …; ml f g � bl may be completed by this system, if there exists

that is, collection of resources, belonging to the STS, is sufficient for order q completion by one of the implementable ways. In this case order completion is possible. Otherwise, that is, if there is no one multiset v∈V satisfying (21), then

<sup>v</sup> <sup>¼</sup> <sup>f</sup><sup>6</sup> � transmission, <sup>10</sup> � wheel, <sup>2</sup> � fuel‐cistern, <sup>7</sup> � front‐glass,

is its resource base. As may be seen, this resource base is not sufficient for order q = {3 � car} from Example 11 completion, because condition (21) is not satisfied: there are objects, entering all v∈VSq , which do not enter v at all (motor, accumulator, etc.). At the same time multiplicities of some terminal objects are less than it is necessary

<sup>9</sup> � back‐glass, <sup>180</sup> � h i mnt‐car , <sup>240</sup> � h i mnt‐body , <sup>600</sup> � h i mnt‐engine ,

� �

Example 5. Let KB from Example 2 be STS technological base, while

1000000 � eur, 500000 � usdg

for order <sup>q</sup> completion 2 � fuel‐cistern<sup>∈</sup> <sup>v</sup> while 3 � fuel‐cistern∈v∈VSq

where X is total cost of order completion, that is, three car assembling.

Let R be technological base, while multiset v ¼ m<sup>1</sup> � b1; …; mk � bk

, and set of terminal

would contain one-element TMS of form

� � is resource

. ▪

v⊆ v, (21)

then e becomes unique terminal object of the created scheme R<sup>0</sup>

(as was said higher, there may be more than one such variant).

As seen, new UMG provides generation of one-element set

multisets generated by UMG S<sup>0</sup> ¼ aq; R<sup>0</sup>

Enhanced Expert Systems

element set {{<sup>X</sup> �usd}}. ▪

multiset v∈VSq such that

system is not able to complete q.

quite simply.

96

defining prices of car the outsourced elements:

$$\sum\_{i=1}^{m} a\_{ij} \boldsymbol{\omega}\_i \le b\_j,\tag{25}$$

That means STS is producing two products, which prices are 2 and 3, respectively, and there is resource base, containing 10 units of the first resource and 18 units of the second. To produce one unit of the first product, STS needs 3 units of the first resource and 5 units of the second, while producing of one unit of the second product needs 2 units of the first resource and 3 units of the second resource. According to (26)–(30), scheme R of the corresponding UMMG S ¼ < q, R, F>

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

q ! x<sup>1</sup> � u1, x<sup>2</sup> � u2,

u<sup>1</sup> ! 3 � e1, 5 � e1, 2 � e, u<sup>2</sup> ! 2 � e1, 3 � e2, 3 � e:

> e<sup>1</sup> ≤ 10, e<sup>2</sup> ≤18,

e ¼ max,

0≤x<sup>1</sup> ≤10, 0≤x<sup>2</sup> ≤ 10,

where 10 is maximal amount of any product, which may be produced by STS.

VS ¼ f g f g 10 � e1; 16 � e2; 10 � e; 2 � x1; 2 � x<sup>2</sup> , which means STS would get maximal profit of 10 units, producing 2 units of both products and, spending for that purpose, 10 units of the first resource and

Let us note that classical matrix–vector POPE modeling is limiting set of the considered cases to the simplest two-level structures of the manufactured objects ("object-component"), represented by unitary rules like (27). In practice, all such objects have much more complicated, multilevel heterogeneous hierarchical structure, that is clearly illustrated by the previous Examples 1–3, concerning car

UMMG application provides natural representation of the POPE problem in the most general formulation. Namely, it is sufficient to join to set of URs, describing technological base of the STS, the only UMR like (26). Similarly, to represent resource base of the STS, filter of the created UMMG would contain boundary conditions like (28); it is important that absence of some resource e in the RB must be represented by boundary condition e = 0; otherwise any generated TMS, containing multiobject n � e, where n > 0, may enter one of the solutions, and this contradicts reality. The goal of STS is defined by the optimizing condition like (29), and domains of variables, having place in the aforementioned UMR, are defined by variable declarations like (30). If it is necessary to maximize profit, taking into account expenses for some resources acquisition, it is very convenient to use

includes UMR

As seen,

manufacturing.

99

as well as two URs:

one optimizing condition

Filter F contains two boundary conditions

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

as well as two variables declarations:

16 units of the second resource. ▪

where j ¼ 1, …, n:

This problem may be represented by unitary multiset metagrammar S ¼ < q, R, F>, which scheme R contains one unitary metarule

$$q \to \mathfrak{x}\_1 \cdot u\_1, \dots, \mathfrak{x}\_m \cdot u\_m,\tag{26}$$

where x1, …, xm are variables, and m unitary rules

$$u\_i \to a i\_1 \cdot e\_1, \dots, a i\_n \cdot e\_n, c\_i \cdot e,\tag{27}$$

where i ¼ 1, …, m, and aij is nonzero amount of j-th resource, needed for i-th product, while ci is its price. Filter F contains n boundary conditions

$$e\_j \le b\_j,\tag{28}$$

where j ¼ 1, …, n, as well as one optimizing condition

$$
\varepsilon = \max,\tag{29}
$$

along with m variable declarations

$$0 \le \mathfrak{x}\_i \le \mathcal{M}\_{i\flat} \tag{30}$$

where i ¼ 1, …, m and Mi is maximal amount of i-th product, which may be manufactured by the system. As seen, terminal objects e1, …, en are measurement units of corresponding resources, while terminal object e is price measurement unit. Nonterminal objects u1, …, um represent products, and UMR (26) along with optimizing condition (29) represents order, while n URs (27) represent STS technological base. STS resource base, as it was introduced higher, is represented by boundary conditions (28).

As may be seen, set of POPE solutions is

$$\overline{V\_{\mathcal{S}}} = \{v\_1, \dots, v\_t\}, \tag{31}$$

where

$$\left\{l\_1 \cdot e\_1, \ldots, l\_n \cdot e\_n, \mathcal{C} \cdot e, p\_1 \cdot \overline{\mathfrak{x}}\_1, \ldots, p\_m \cdot \overline{\mathfrak{x}\_m}\right\} \in \overline{V\_S} \tag{32}$$

means that maximal profit is C and it is gotten when STS produces p<sup>1</sup> units of the first product, …, pm units of the m-th product. In general case

$$|\overline{V\_S}| \text{ 1, }\tag{33}$$

so there may be t>1 solutions of the specific POPE. Example 6. Let POPE is

$$2\mathbf{x}\_1 + \mathbf{3}\mathbf{x}\_2 \to \mathbf{max}$$

under restrictions

$$\mathbf{3x}\_1 + \mathbf{2x}\_2 \le \mathbf{10}.$$

$$\mathbf{5x}\_1 + \mathbf{3x}\_2 \le \mathbf{18}.$$

Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

That means STS is producing two products, which prices are 2 and 3, respectively, and there is resource base, containing 10 units of the first resource and 18 units of the second. To produce one unit of the first product, STS needs 3 units of the first resource and 5 units of the second, while producing of one unit of the second product needs 2 units of the first resource and 3 units of the second resource.

According to (26)–(30), scheme R of the corresponding UMMG S ¼ < q, R, F> includes UMR

$$q \rightarrow \mathfrak{x}\_1 \cdot \mathfrak{u}\_1, \mathfrak{x}\_2 \cdot \mathfrak{u}\_2,$$

as well as two URs:

∑ m i¼1

This problem may be represented by unitary multiset metagrammar

where i ¼ 1, …, m, and aij is nonzero amount of j-th resource, needed for i-th

where i ¼ 1, …, m and Mi is maximal amount of i-th product, which may be manufactured by the system. As seen, terminal objects e1, …, en are measurement units of corresponding resources, while terminal object e is price measurement unit. Nonterminal objects u1, …, um represent products, and UMR (26) along with optimizing condition (29) represents order, while n URs (27) represent STS technological base. STS resource base, as it was introduced higher, is represented by boundary

l<sup>1</sup> � e1; …; ln � en;C � e; p<sup>1</sup> � x1; …; pm � xm

VS 

2x<sup>1</sup> þ 3x<sup>2</sup> ! max

3x<sup>1</sup> þ 2x<sup>2</sup> ≤10 5x<sup>1</sup> þ 3x<sup>2</sup> ≤18:

first product, …, pm units of the m-th product. In general case

so there may be t>1 solutions of the specific POPE.

Example 6. Let POPE is

under restrictions

98

means that maximal profit is C and it is gotten when STS produces p<sup>1</sup> units of the

S ¼ < q, R, F>, which scheme R contains one unitary metarule

product, while ci is its price. Filter F contains n boundary conditions

where j ¼ 1, …, n, as well as one optimizing condition

along with m variable declarations

As may be seen, set of POPE solutions is

conditions (28).

where

where x1, …, xm are variables, and m unitary rules

where j ¼ 1, …, n:

Enhanced Expert Systems

aijxi ≤bj, (25)

q ! x<sup>1</sup> � u1, …, xm � um, (26)

ui ! ai<sup>1</sup> � e1, …, ain � en, ci � e, (27)

ej ≤ bj, (28)

e ¼ max, (29)

0≤xi ≤ Mi, (30)

VS ¼ f g v1; …; vt , (31)

>1, (33)

∈VS (32)

$$u\_1 \to \mathbf{3} \cdot e\_1, \mathbf{5} \cdot e\_1, \mathbf{2} \cdot e,$$

$$u\_2 \to \mathbf{2} \cdot e\_1, \mathbf{3} \cdot e\_2, \mathbf{3} \cdot e.$$

Filter F contains two boundary conditions

$$e\_1 \le 10,$$

$$e\_2 \le 18,$$

one optimizing condition

e ¼ max,

as well as two variables declarations:

$$0 \le x\_1 \le 10,$$

$$0 \le x\_2 \le 10,$$

where 10 is maximal amount of any product, which may be produced by STS. As seen,

$$\overline{V}\_S = \{ \{ 10 \cdot \varepsilon\_1, 16 \cdot \varepsilon\_2, 10 \cdot \mathbf{e}, 2 \cdot \overline{\mathbf{x}}\_1, 2 \cdot \overline{\mathbf{x}}\_2 \} \},$$

which means STS would get maximal profit of 10 units, producing 2 units of both products and, spending for that purpose, 10 units of the first resource and 16 units of the second resource. ▪

Let us note that classical matrix–vector POPE modeling is limiting set of the considered cases to the simplest two-level structures of the manufactured objects ("object-component"), represented by unitary rules like (27). In practice, all such objects have much more complicated, multilevel heterogeneous hierarchical structure, that is clearly illustrated by the previous Examples 1–3, concerning car manufacturing.

UMMG application provides natural representation of the POPE problem in the most general formulation. Namely, it is sufficient to join to set of URs, describing technological base of the STS, the only UMR like (26). Similarly, to represent resource base of the STS, filter of the created UMMG would contain boundary conditions like (28); it is important that absence of some resource e in the RB must be represented by boundary condition e = 0; otherwise any generated TMS, containing multiobject n � e, where n > 0, may enter one of the solutions, and this contradicts reality. The goal of STS is defined by the optimizing condition like (29), and domains of variables, having place in the aforementioned UMR, are defined by variable declarations like (30). If it is necessary to maximize profit, taking into account expenses for some resources acquisition, it is very convenient to use

representation of prices of the acquired resources, as it was illustrated by Example 4, but with negative multiplicities (such techniques are described in [2, 3]), that is, as to URs from Example 4,

ni

<sup>1</sup> objects ai

Sq ¼ aq; Rq

will be

b i j <sup>1</sup>, …, ni

mi objects ai

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

corresponding subjects, and replace set (34) by

order q completion and every multiobject m<sup>i</sup>

ditions, defining some of terminal object b

q ¼ f g 3 � car and F ¼ f g usd ¼ min , then

<sup>F</sup> <sup>¼</sup> f g usd <sup>¼</sup> min;h i mnt‐car <sup>¼</sup> min , then

simultaneously. ▪

101

Example 7. Let us consider following unitary rules:

it takes all order to complete.

mi

<sup>a</sup> <sup>1</sup> � <sup>s</sup>1, n<sup>1</sup>

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

<sup>a</sup> <sup>1</sup> � sk, nk

element of VSq , transforming UMG Sq to FUMG Sq ¼ aq; Rq; Fq

<sup>n</sup> � si; mi

Let q ¼ f g n � a , and Rq is set of URs, containing UR

implemented, let us introduce k terminal objects s1, …, sk, being names of

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

<sup>1</sup> � <sup>a</sup><sup>k</sup>

k URs (35), and all unitary rules from set R, excluding (35). Consider UMG

variant of order q completion. If we establish filter Fq to select one and only one

<sup>1</sup> � b i <sup>1</sup>; …; m<sup>i</sup>

where multiobject n � si corresponds to n operation cycles of subject si during

, required for these cycles' implementation. In this context, filter Fq may contain boundary conditions, defining required resources limits, as well as optimizing con-

i

electrical energy, or fuel consumed) or maximal (e.g., some integral parameters of quality of produced objects or given services). If subject si becomes the only winner,

car ! <sup>1</sup> � first, <sup>30</sup> � h i mnt‐car , <sup>2800</sup> � usd, <sup>1</sup> � accessories � set, car ! <sup>1</sup> � second, <sup>40</sup> � h i mnt‐car , <sup>2700</sup> � usd, <sup>1</sup> � accessories � set, car ! <sup>1</sup> � third, <sup>45</sup> � h i mnt‐car , <sup>2500</sup> � usd, <sup>1</sup> � accessories � set: These URs being joined with URs, detailing nonterminal object accessories set from R, describe competition of three car manufacturers (first, second, and third), assembling cars from one and the same accessories but differing by the time spent

for this operation and its cost. If we consider FUMG Sq <sup>¼</sup> aq; <sup>R</sup>; <sup>F</sup> � �, where

which corresponds to the choice of the third manufacturer. If

VSq ¼ f g f g 1 � third;X � usd; 135 � h i mnt � car ; … ,

VSq ¼ f g ∅ ,

because no one of the possible order executors is optimal by time and cost

As it is well known from practice, approach, described higher, may be not rational from various points of view, especially, when capabilities of no one of the

<sup>j</sup> � b i

� �. As seen, VSq is set of terminal multisets, each corresponding to some

li � b i li n o, (37)

…

<sup>1</sup>, …, n<sup>1</sup>

<sup>1</sup> , …, nk

<sup>m</sup><sup>1</sup> � <sup>a</sup><sup>1</sup> m<sup>1</sup> ,

mk � ak mk :

aq ! n � a, (36)

<sup>j</sup> corresponds to mi

<sup>j</sup> multiplicities as minimal (e.g., cost,

� �, this element

<sup>j</sup> terminal objects

: To simplify and unify recognition of variant

(35)

$$
\begin{array}{ccc}
\textit{transmission} \rightarrow \textbf{-100} \cdot \textit{usd}, \\
\textit{whel} & \rightarrow \textbf{-50} \cdot \textit{usd}, \\
& \cdots \\
\textit{acumulator} \rightarrow \textbf{-10} \cdot \textit{usd}.
\end{array}
$$

To cut off generated TMS with nonpositive multiplicities of object e (such TMS correspond to unprofitable variants), it is sufficient to join to UMMG filter one more boundary condition e > 0. However, the use of negative multiplicities leads to some corrections in UMG/UMMG algorithmics, which would be considered separately.

All the said higher in this section is very close to the Leontief model and other "input–output" models of mathematic economy, developed on the matrix–vector algebra basis [16]. As may be seen, transfer to the UMG/UMMG basis makes such modeling much more flexible and closer to the reality. That is why we consider multigrammatical paradigm as very perspective for the development of various issues in the future digital economy [17, 18], first of all, planning and scheduling in the cyberphysical industry, integrated with deeply robotized logistics [19, 20]. However, application of the described here approach to the core areas of digital economy (Industry 4.0) needs separate publications.

Concerning implementation issues, it would be aptly to say that multisets processing is very promising area for application of non-conventional computing paradigms [21, 22].

Now let us spend some place of this section for multiset modeling of competitions and works distribution in the concurrent environment, typical for market economy.

The main tool of the last is the so-called variative unitary multigrammars and multimetagrammars, which schemes include unitary rules (metarules) with the same head and different bodies. UMG/UMMG variativity provides representation of coexistence of various subjects able to complete one and the same order. We assume these subjects are non-antagonistic, that is, they all are ready to execute any part of the total work.

There may be at least three possible approaches to multigrammatical modeling of competitions:

1. "The winner takes it all."

2. Splitting order among various subjects.

3. "The winner coalition takes it all" (combination of two previous).

Let us consider the first approach.

Let R be set of unitary rules containing, among others, k URs with one and the same head and different bodies:

$$\begin{array}{c} a \leftarrow n\_1^1 \cdot a\_1^1, \dots, n\_{m\_1}^1 \cdot a\_{m\_1}^1, \\\\ \cdots \\ a \leftarrow n\_1^k \cdot a\_1^k, \dots, n\_{m\_k}^k \cdot a\_{m\_k}^k. \end{array} \tag{34}$$

where i-th alternative corresponds to i-th subject of considered technological base, able to produce object a, consuming for that purpose

Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

ni <sup>1</sup> objects ai <sup>1</sup>, …, ni mi objects ai mi : To simplify and unify recognition of variant implemented, let us introduce k terminal objects s1, …, sk, being names of corresponding subjects, and replace set (34) by

$$\begin{aligned} a &\leftarrow \mathbf{1} \cdot s\_1, n\_1^1 \cdot a\_1^1, \dots, n\_{m\_1}^1 \cdot a\_{m\_1}^1, \\ &\cdots \\ a &\leftarrow \mathbf{1} \cdot s\_k, n\_1^k \cdot a\_1^k, \dots, n\_{m\_k}^k \cdot a\_{m\_k}^k. \end{aligned} \tag{35}$$

Let q ¼ f g n � a , and Rq is set of URs, containing UR

$$
\mathfrak{a}\_q \to \mathfrak{n} \cdot \mathfrak{a},\tag{36}
$$

k URs (35), and all unitary rules from set R, excluding (35). Consider UMG Sq ¼ aq; Rq � �. As seen, VSq is set of terminal multisets, each corresponding to some variant of order q completion. If we establish filter Fq to select one and only one element of VSq , transforming UMG Sq to FUMG Sq ¼ aq; Rq; Fq � �, this element will be

$$\left\{ n \cdot s\_i, m\_1^i \cdot \overline{b}\_1^i, \dots, m\_{l\_i}^i \cdot \overline{b}\_{l\_i}^i \right\},\tag{37}$$

where multiobject n � si corresponds to n operation cycles of subject si during order q completion and every multiobject m<sup>i</sup> <sup>j</sup> � b i <sup>j</sup> corresponds to mi <sup>j</sup> terminal objects b i j , required for these cycles' implementation. In this context, filter Fq may contain boundary conditions, defining required resources limits, as well as optimizing conditions, defining some of terminal object b i <sup>j</sup> multiplicities as minimal (e.g., cost, electrical energy, or fuel consumed) or maximal (e.g., some integral parameters of quality of produced objects or given services). If subject si becomes the only winner, it takes all order to complete.

Example 7. Let us consider following unitary rules:

$$\begin{array}{l}car \rightarrow 1 \cdot first, 30 \cdot \langle \text{mnt-car} \rangle, 2800 \cdot usd, 1 \cdot accessies \ -set, \\car \rightarrow 1 \cdot second, 40 \cdot \langle \text{mnt-car} \rangle, 2700 \cdot usd, 1 \cdot accessies \ -set, \\car \rightarrow 1 \cdot third, 45 \cdot \langle \text{mnt-car} \rangle, 2500 \cdot usd, 1 \cdot accessies \ -set. \end{array}$$

These URs being joined with URs, detailing nonterminal object accessories set from R, describe competition of three car manufacturers (first, second, and third), assembling cars from one and the same accessories but differing by the time spent for this operation and its cost. If we consider FUMG Sq <sup>¼</sup> aq; <sup>R</sup>; <sup>F</sup> � �, where q ¼ f g 3 � car and F ¼ f g usd ¼ min , then

$$\overline{V}\_{\mathbb{S}\_q} = \{ \{ \mathbf{1} \cdot \text{third}, \mathbf{X} \cdot \mathbf{us}d, \mathbf{1} \mathbf{3} \mathbf{5} \cdot \langle \mathbf{m} \mathbf{t} \cdot \mathbf{car} \rangle, \ldots \} \},$$

which corresponds to the choice of the third manufacturer. If <sup>F</sup> <sup>¼</sup> f g usd <sup>¼</sup> min;h i mnt‐car <sup>¼</sup> min , then

$$
\overline{V}\_{\mathbb{S}\_q} = \{ \mathfrak{D} \},
$$

because no one of the possible order executors is optimal by time and cost simultaneously. ▪

As it is well known from practice, approach, described higher, may be not rational from various points of view, especially, when capabilities of no one of the

representation of prices of the acquired resources, as it was illustrated by Example 4, but with negative multiplicities (such techniques are described in [2, 3]), that is,

> transmission ! ‐<sup>100</sup> � usd, wheel ! ‐<sup>50</sup> � usd, …

accumulator ! ‐<sup>10</sup> � usd: To cut off generated TMS with nonpositive multiplicities of object e (such TMS correspond to unprofitable variants), it is sufficient to join to UMMG filter one more boundary condition e > 0. However, the use of negative multiplicities leads to some corrections in UMG/UMMG algorithmics, which would be considered separately. All the said higher in this section is very close to the Leontief model and other "input–output" models of mathematic economy, developed on the matrix–vector algebra basis [16]. As may be seen, transfer to the UMG/UMMG basis makes such modeling much more flexible and closer to the reality. That is why we consider multigrammatical paradigm as very perspective for the development of various issues in the future digital economy [17, 18], first of all, planning and scheduling in the cyberphysical industry, integrated with deeply robotized logistics [19, 20]. However, application of the described here approach to the core areas of digital

Concerning implementation issues, it would be aptly to say that multisets processing is very promising area for application of non-conventional computing

Now let us spend some place of this section for multiset modeling of competitions and works distribution in the concurrent environment, typical for market

The main tool of the last is the so-called variative unitary multigrammars and multimetagrammars, which schemes include unitary rules (metarules) with the same head and different bodies. UMG/UMMG variativity provides representation of coexistence of various subjects able to complete one and the same order. We assume these subjects are non-antagonistic, that is, they all are ready to execute any

There may be at least three possible approaches to multigrammatical modeling

Let R be set of unitary rules containing, among others, k URs with one and the

<sup>1</sup>, …, n<sup>1</sup>

<sup>1</sup> , …, n<sup>k</sup>

…

where i-th alternative corresponds to i-th subject of considered technological

<sup>m</sup><sup>1</sup> � <sup>a</sup><sup>1</sup> m<sup>1</sup> ,

mk � <sup>a</sup><sup>k</sup> mk : (34)

3. "The winner coalition takes it all" (combination of two previous).

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

<sup>1</sup> � <sup>a</sup><sup>k</sup>

<sup>a</sup> <sup>n</sup><sup>1</sup>

<sup>a</sup> nk

base, able to produce object a, consuming for that purpose

economy (Industry 4.0) needs separate publications.

as to URs from Example 4,

Enhanced Expert Systems

paradigms [21, 22].

part of the total work.

1. "The winner takes it all."

same head and different bodies:

2. Splitting order among various subjects.

Let us consider the first approach.

of competitions:

100

economy.

competitors (subjects s1, …, skÞ are not sufficient for the whole order completion. In this case, more rational may be the second approach when order is splitted between non-antagonistic (cooperating) competitors in such a way that the total amount of objects produced is distributed among subjects s1, …, sk. This techniques may be modeled by unitary multimetagrammar Sq, which scheme Rq includes unitary metarule

$$a\_q \to \gamma\_1 \cdot b\_1, \dots, \gamma\_k \cdot b\_k. \tag{38}$$

which corresponds to splitting order q in such a way that five cars would be assembled by the first manufacturer, two by the second, and three by the third. ▪ Let us underline once more that time is not additive resource in relation to parallel processes; it is additive only regarding one device (manufacturing unit). Consideration of multisets with time-containing multiobjects is separate direction of the multigrammatical approach and needs special tool, which is called temporal multiset grammars (TMG), announced in [1] . This branch concerns problems,

Unitary Multiset Grammars an Metagrammars Algorithmics and Application

The third possible case of competitions ("the winner coalition takes it all") may

Presented primary survey of multigrammatical knowledge representation along with brief consideration of its possible applications is, of course, only a background

1. MG/UMG/UMMG extension by features, necessary for "single-time-scale" modeling of manufacturing and logistical processes and their optimal control, that is critically needed for the developed digital economy (Industry 4.0)

2. Development of algorithmics for local correction of solutions (generated sets of TMS) while UMG/UMMG local correction in the sense [25], which is necessary

for the aforementioned control in hard real-time and highly volatile

3. Further development of MG/UMG/UMMG improved algorithmics and its software/hardware implementation in high-parallel general-purpose

4.Development of specialized high-parallel computing environments, initially

5. Development of quantum, neural and molecular algorithmics for MG/UMG/ UMMG toolkit implementation in corresponding computer environments

convergence with other known knowledge/data engineering paradigms (first

Some of the listed directions are already developed by the author and his colleagues; some are waiting their time, being targeted to the creation of unified framework for the intellectual (knowledge-based) digital economy. This way is leading us to the Big Knowledge paradigm being generalization of the Big Data one, which is already everyday reality. The author will be glad, if this paper will be of

The author is grateful to Prof. Fred Roberts for useful discussions and support, and to Prof. Jeffrey Ullman, whose useful remarks on the primary version of this

oriented to MG/UMG/UMMG algorithmics implementation

6.MG/UMG/UMMG pragmatics expansion to new problem areas and

addressed by the classical theory of scheduling [23, 24].

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

be considered by the concerned reader on his (her) own.

for future development, which most valuable directions may be:

5. Conclusion

environment

Acknowledgements

103

computing environments

of all, multiagent systems [15, 26, 27])

any interest for some scholars working in the related areas.

and unitary rules

$$\begin{aligned} b\_1 &\rightarrow \mathbf{1} \cdot a, n\_1^1 \cdot a\_1^1, \ldots, n\_{l\_1}^1 \cdot a\_{l\_1}^1, \\ &\cdots \\ b\_k &\rightarrow \mathbf{1} \cdot a, n\_1^k \cdot a\_1^k, \ldots, n\_{l\_k}^k \cdot a\_{l\_k}^k, \end{aligned} \tag{39}$$

as well as all URs, having place in the scheme, constructed higher by application of the first approach, excluding (34). Filter Fq contains boundary condition

$$
\mathfrak{a} = \mathfrak{n},
\tag{40}
$$

which is directly induced by order q ¼ f g n � a and boundary conditions, defining domains of variables γ1, …, γk:

$$0 \le \chi\_i \le n.\tag{41}$$

As seen, terminal multisets, generated by UMMG S ¼ aq; Rq; Fq � �, have form

$$\{n \cdot a, n\_1 \cdot \overline{\gamma}\_1, \dots, n\_k \cdot \overline{\gamma}\_k, m\_1^i \cdot \overline{b}\_1^i, \dots, m\_{l\_i}^i \cdot \overline{b}\_{l\_i}^i\},\tag{42}$$

where, according to (38)–(40),

$$\sum\_{i=1}^{k} n\_i = n,\tag{43}$$

and thus values n1, …, nk are parts of order q ¼ f g n � a , distributed among subjects s1, …, sk, respectively: s<sup>1</sup> will produce n<sup>1</sup> objects a, s<sup>2</sup> � n<sup>2</sup> objects a, up to sk, which will produce nk objects a.

Example 8. Let us transform set R from Example 7 to the following:

$$\begin{array}{l} \text{over} \rightarrow \gamma\_1 \cdot \text{first}, \gamma\_2 \cdot \text{second}, \gamma\_3 \cdot \text{third}, \\\\ \text{first} \quad \rightarrow \mathbf{1} \cdot \text{car}, \mathbf{2800} \cdot \text{usd}, \mathbf{2800} \cdot \text{usd} \cdot \text{l}, \mathbf{1} \cdot \text{accessies} \cdot \text{set}, \\\\ \text{second} \rightarrow \mathbf{1} \cdot \text{car}, \mathbf{2500} \cdot \text{usd}, \mathbf{2500} \cdot \text{usd} \cdot \text{2}, \mathbf{1} \cdot \text{accessories} \cdot \text{set}, \\\\ \text{third} \quad \rightarrow \mathbf{1} \cdot \text{car}, \mathbf{2200} \cdot \text{usd}, \mathbf{2200} \cdot \text{usd} \cdot \text{3}, \mathbf{1} \cdot \text{accessories} \cdot \text{set}. \end{array}$$

If order q ¼ f g 10 � car , then Fq ¼ car ¼ 10; 0≤γ<sup>1</sup> ≤ 10; 0≤γ<sup>2</sup> ≤10; 0≤γ f g <sup>3</sup> ≤10 ∪ F<sup>0</sup> q, where F<sup>0</sup> <sup>q</sup> may contain boundary and optimizing conditions, selecting terminal multisets, for example, F<sup>0</sup> <sup>q</sup> <sup>¼</sup> <sup>f</sup>usd <sup>¼</sup> min; usd‐1≥2800; usd‐2≥5000; usd‐<sup>3</sup> <sup>≥</sup>6600g: According to such Fq, set of terminal multisets, generated by UMMG Sq ¼ aq; Rq; Fq � �, may contain element of the form <sup>f</sup><sup>10</sup> � car, <sup>25600</sup> � usd, <sup>14000</sup> � usd‐1, <sup>5000</sup> � usd‐2, <sup>6600</sup> � usd‐3, <sup>5</sup> � <sup>γ</sup>1, <sup>2</sup> � <sup>γ</sup>2, <sup>3</sup> � <sup>γ</sup>3, …g,

#### Unitary Multiset Grammars an Metagrammars Algorithmics and Application DOI: http://dx.doi.org/10.5772/intechopen.82713

which corresponds to splitting order q in such a way that five cars would be assembled by the first manufacturer, two by the second, and three by the third. ▪

Let us underline once more that time is not additive resource in relation to parallel processes; it is additive only regarding one device (manufacturing unit). Consideration of multisets with time-containing multiobjects is separate direction of the multigrammatical approach and needs special tool, which is called temporal multiset grammars (TMG), announced in [1] . This branch concerns problems, addressed by the classical theory of scheduling [23, 24].

The third possible case of competitions ("the winner coalition takes it all") may be considered by the concerned reader on his (her) own.
