2. Syntax and mathematical semantics of the augmented Post systems

The augmented Post system P¼ , S, D . is the composition of set S of the socalled augmented, or string (S-), productions, and set D of context-free generating rules, being metadatabase. Following the terminology of knowledge engineering, we shall call P also as APS-represented knowledge base (for short, APS KB).

S-production σ ¼ , q, d . is couple, the first component of which, named body, has the form of postproduction:

$$s\_0 \leftarrow s\_1, \ldots, s\_m,\tag{1}$$

where m ≥ 0 and s0, s1, …, sm are terms.

Term s<sup>0</sup> is called header, while terms s1, …, sm are called conditions. The set of conditions is unordered, i.e., S-productions:

$$<\mathfrak{s}\_0 \leftarrow \mathfrak{s}\_{i\_1}, \dots, \mathfrak{s}\_{i\_m}, d \ge , \tag{2}$$

and

$$<\mathfrak{s}\_0 \leftarrow \mathfrak{s}\_{\mathfrak{j}\_1}, \dots, \mathfrak{s}\_{\mathfrak{j}\_m}, d \ge , \tag{3}$$

where f g i1; …; im ¼ j <sup>1</sup>; …; j m <sup>¼</sup> f g <sup>1</sup>; …; <sup>m</sup> are identical. The aforementioned set of conditions may be empty in general case, i.e., m ¼ 0. The S-production with the empty conditions set looking like

$$<\mathfrak{s}\_0 \leftarrow, d \rhd,\tag{4}$$

is called S-axiom.

Component d of S-production σ ¼ , q, d . is set of rules γ ! β and is called here variables declaration.

Rule γ ! β ∈d is called variable declaration of γ, which defines Vð Þ γ; β set of possible values (domain) of this variable:

$$\mathsf{V}(\mathsf{y},\beta) = \{ u \mid \beta \Longrightarrow u \& u \in \mathsf{V}^\* \}, \tag{5}$$

$$\mathsf{G}$$

where G is CF-grammar, corresponding to metadatabase D. It is essential that there is one and only one variable declaration γ ! β for every variable γ, having place in the body of S-production. S-production σ, which body s<sup>0</sup> s1, …, sm has no any variables, i.e.,

$$s\_i \in V^\*,$$

for all i ¼ 0, 1, …, m, is called concrete S-production (for short CS-production). CS-production:

Augmented Post Systems: Syntax, Semantics, and Applications DOI: http://dx.doi.org/10.5772/intechopen.86207

$$<\varsigma\_0 \leftarrow, d \rhd,\tag{7}$$

such that s<sup>0</sup> ∈Vþ, d ¼ f g ∅ is called CS-axiom. S-production σ ¼ , q, d . defines set of CS-productions σ in the following way:

$$\overline{\sigma} = \bigcup\_{\delta \in \overline{d}} < \mathfrak{s}\_0[\delta] \leftarrow \mathfrak{s}\_1[\delta], \dots, \mathfrak{s}\_m[\delta], \{\mathfrak{Q}\} \rhd,\tag{8}$$

$$\overline{d} = \bigcup\_{\mathcal{V}(u\_1, \gamma\_1, \beta\_1)} \dots \bigcup\_{\mathcal{V}(u\_k, \gamma\_k, \beta\_k)} \{ \{ \gamma\_1 \to u\_1, \dots, \gamma\_k \to u\_k \} \}, \tag{9}$$

where si½ � δ are strings in terminal alphabet V, which are created by the replacement of variables γ1, …, γ<sup>k</sup> by strings u1, …, uk in the same alphabet, respectively; all occurrences of one and the same variable γ<sup>i</sup> in all terms s0, s1, …, sm are replaced by one and the same string ui.

If

$$(\forall \, \boldsymbol{w}\_0 \leftarrow \boldsymbol{w}\_1, \dots, \boldsymbol{w}\_m, \{\mathcal{Q}\} \rhd \in \overline{\sigma})$$

$$\{\boldsymbol{w}\_0, \boldsymbol{w}\_1, \dots, \boldsymbol{w}\_m\} \underline{\mathsf{C}}(\mathcal{G}), \tag{10}$$

then S-production σ ∈S is correct to MDB D. This means that all terms of every CS-production from set σ are words of context-free language L Gð Þ, and where G is context-free grammar with set of generating rules D.

APS KB P ¼ , S, D . is correct, if all S-productions σ ∈S are correct to metadatabase D.

Notion of the APS KB extensional, i.e., set of facts, which may be derived from the knowledge base by means of logical inference, is defined as follows.

Let P ¼ , S, D . be correct APS KB. Consider

$$\overline{S} = \bigcup\_{\sigma \in \mathcal{S}} \overline{\sigma}, \tag{11}$$

i.e., S is a set of all CS-productions defined by all S-productions of this knowledge base in the sense (8)–(9).

Define

$$\mathcal{W}\_{(0)} = \{ w \mid $$

$$\mathcal{W}\_{(i+1)} = \mathcal{W}\_{(i)} \cup \left( \bigcup\_{\substack{\circ: w\_0 \leftarrow w\_1, \ldots, w\_{n\_r} \{\otimes\} \rangle > \sqrt{3} \\ \cdots \\ \cdots \\ w\_n \in \mathcal{W}\_{(i)}}} \{w\_0\} \right), \tag{13}$$

and extensional Ex Pð Þof APS KB P ¼ , S, D . , i.e., set of facts, defined by this knowledge base, is fixed point of the sequence Wð Þ <sup>0</sup> , …, Wð Þ<sup>i</sup> ,Wð Þ <sup>i</sup>þ<sup>1</sup> , …, which is in general case infinite:

$$E\mathfrak{x}(P) = W\_{(\infty)}.\tag{14}$$

Evidently, due to P correctness,

$$\operatorname{Ext}(P)\!\!\!\!\!\!L(G),\tag{15}$$

and Ex Pð Þ is finite, if their exists i such, that

$$\mathcal{W}\_{(i)} = \mathcal{W}\_{(i+1)} \tag{16}$$

If we consider the notion of extensional of APS KB from the linguistic point of view, then Ex Pð Þ is a language in alphabet V, which, according to (15), is sublanguage of L Gð Þ. At the same time, from the point of view of knowledge engineering, Ex Pð Þ is the join of set of facts w ∈Wð Þ <sup>0</sup> , which are known explicitly (they are called lower ground facts), and set of facts, which are derived from ground facts and/or another derived facts. As it is easy to see, set of ground facts Wð Þ <sup>0</sup> is nothing else, than SDB, while S-productions with nonempty sets of conditions form APS KB intensional, providing the aforementioned inference.

Now we can define semantics of language of queries to APS KB.

Set-theoretical (S-) semantics of this language is similar to S-semantics of SDB query languages:

$$A = \overline{W} \cap I \tag{17}$$

where W is APS KB extensional and I is set of facts, which actuality check is the purpose of the query.

Here we shall use the simplest query language, being set of couples , s, d . , where s is term and d is its variable declaration.

Mathematical (M-) semantics of this language is based on (14) and the following evident equation:

$$I = \text{Ex}(<\{~~\}, D>) \tag{18}~~$$

Here, , ,f g s ; d . , D . is correct APS KB, which one-element set of S-productions—selection criterion—contains S-axiom, defining set of facts, which may belong to Ex Pð Þ.

Example 1. Consider metadatabase from Example 2 of the chapter of this book, describing SSF. We shall add to it the following three rules:

$$ \rightarrow \text{SENSOR} < i > \text{AT} < time> - < state>,$$

$$ *\rightarrow  ,*$$

$$ \rightarrow \text{SENSOR} < i > \text{LOCATEDAT} \text{AT}  .$$

Facts like SENSOR NN AT 17:00 � NORMAL contain information about sensors, which gather and send to the fusion center the data about the state of the atmosphere in the surrounding area. Facts like

SENSOR NN LOCATED AT AREA Y…Y contain information about sensors' location.

Consider APS knowledge base P ¼ , S, D . , where MDB D was described higher, and S contains following S-productions:

$$\sigma\_1: < A \text{REA } a \text{ IS } s \text{ AT } t \leftarrow$$

$$\text{SENSOR } e \text{ AT } t \text{ } -s,$$

$$\text{SENSOR } e \text{ LOCATED } AT \text{ AREA } a,$$

$$\{a \to \text{ } < \text{name } of \text{ } area >, s \to < \text{state }>, e \to < i >, a\}$$

$$t \to ] \ge,$$

Augmented Post Systems: Syntax, Semantics, and Applications DOI: http://dx.doi.org/10.5772/intechopen.86207

σ<sup>2</sup> : , SENSOR AX AT 16:00 � NORMAL , f g ∅ . ,

σ<sup>3</sup> : , SENSOR FY AT 11:30 � SMOKED , f g ∅ . ,

σ<sup>4</sup> : , SENSOR AX LOCATED AT AREA HIGHLANDS , f g ∅ . ,

σ<sup>5</sup> : , SENSOR FY LOCATED AT AREA GREEN VALLEY , f g ∅ . :

As seen, σ<sup>2</sup> � σ<sup>5</sup> are concrete S-productions, and set Wð Þ <sup>0</sup> , corresponding to this APS KB, consists of ground facts, being headers of these CS-productions.

Query, whose purpose is to get information about smoked areas, may be as follows:

, AREA z IS SMOKED AT t, zf g !, name of area . ; t ! , time . . ,

while query, whose purpose is to get information about sensor FY location, may look like

> , SENSOR YF LOCATED AT AREA v, f g v !, name of area . . :

Evidently, this knowledge base extensional is

fAREA HIGHLANDS IS AT NORMAL STATE AT 16:00, AREA GREEN VALLEY IS SMOKED AT 11:30, SENSOR AX AT 16:00 � NORMAL, SENFOR FY AT 11:30 � SMOKED, SENSOR AX LOCATED AT AREA HIGHLANDS, SENSOR FY LOCATED AT AREA GREEN VALLEYg.∎:
