Keywords

1 Introduction

The main objective of this paper is to apply the theory of intermediate quantifiers (TIQ) which was in detail studied in our previous papers [1,2,3,4]. TIQ is one from three main theories of Fuzzy natural logic (FNL) which was proposed based on the concept of Natural logic [5]. The idea for this work is to use FNL and propose mathematical model of specific human thinking that uses natural language.

FNL is a formal mathematical theory containing a model of the semantics of natural language which includes three theories:

  • the theory of evaluative linguistic expressions [6];

  • the theory of fuzzy IF-THEN rules and approximate reasoning [7, 8];

  • the formal theory of intermediate quantifiers, generalized syllogisms and generalized square of opposition [1,2,3,4].

At first, we put together the theory of evaluative linguistic expressions, which provides formalization of the meaning of vague quantitative expressions of natural language, for example, extremely small, roughly medium, very big, very long, etc., with the theory of generalized intermediate quantifiers.

At second, we apply Fuzzy GUHA method [9] and we introduce an algorithm for a linguistic characterization of natural data using generalized intermediate quantifiers. Fuzzy GUHA is a special method for automated search of association rules from numerical data. Generally, obtained associations are in the form \(A\thicksim B\), which means that the occurrence of A is associated with the occurrence of B, where A and B are formulae created from objects’ attributes. As proposed by Hájek et al. [9], the original GUHA method allowed only Boolean attributes to be involved. Some parts of their approach was independently re-invented by Agrawal [10] many years later and is also known as the mining of association rules or market basket analysis. A detailed book on the GUHA method is [11], where one can find distinct statistically approved associations between attributes of given objects. Fuzzy GUHA is an extension of a classical GUHA method for fuzzy data. In this paper, we work with associations in the form of IF-THEN rules composed of evaluative linguistic expressions, which allow the quantities to be characterized with vague linguistic terms such as “very small”, “big”, “medium” etc.

To measure the interestingness of a rule of the GUHA method, many numerical characteristics or indices have been proposed (see [12, 13] for a nice overview). As a supplement to them, we try to utilize the theory of intermediate quantifiers to characterize the intensity of association, which allows us to use linguistic characterizations such as “Almost all”, “Most”, “Some”, or “A few”. The novelty of this approach is to use mathematical formal definitions of quantifiers which could be use and apply in every model. As a result, we may automatically obtain e.g. the following sentences from medical data:

  • Almost all people, who suffer from respiratory diseases, suffer from asthma.

  • Most people, who live in area affected by heavy industry, suffer from respiratory diseases.

  • Most people, who smoke and suffer from respiratory diseases, also suffer from ischemic disease of leg.

Then we plane to apply the theory of graded square of opposition, mainly graded Peterson’s square of opposition, which was syntactically and semantically studied in [4]. We will use definitions of contrary, contradictory, sub-contrary and sub-alterns which defined graded Peterson’s square and will be used for an inference of new results. The similar approach based on applying of modern square of opposition was proposed in [14]. The authors applied expressions such as “Most”, “Few” and “Many” where, for example, “Most” is defined as contradiction with “Many” which does not agree with new approach of Peterson (see [15], Chap. 2).

There are also many authors who are interested in linguistic summarization of data. In [16], authors showed the use of linguistic database summarizes introduced by Yager in [17,18,19,20]. Later these approaches were considerably advanced in [21, 22] and implemented by Kasprzyk and Zadrożny [23].

The paper is organized as follows. Firstly, the background information is presented in Sect. 2 to provide basic definitions. As we want this paper to be rather introductory, we omit (although precise, but quite complicated) definitions, which can be found in detail elsewhere [1,2,3,4, 6,7,8]. Section 3 motivates and provides the need for a modified definition for the computation of truth values of intermediate quantifiers. Section 5 provides some features of the quantifiers and Sect. 4 presents an algorithm for fast evaluation of intermediate quantifiers in data. Section 7 concludes the paper.

2 Background

Intermediate quantifiers, which form a transition between universal and existential generalized quantifiers, have been studied already for many years (cf., for example,[24, 25]), are linguistic expressions of natural language, for example, most, many, almost all, a few, a large part of, etc. This theory was further generalized to the fuzzy approach (cf. [26]). Intermediate quantifiers are special fuzzy generalized quantifiers of type \(\langle 1, 1\rangle \) (cf. [24, 27, 28]) which are isomorphism-invariant (cf. [29], have extension property, and are conservative. The formal theory of intermediate quantifiers using the fuzzy type theory (a higher-order fuzzy logic) was introduced in [1]. Other mathematical models of some of these quantifiers were suggested by several authors, for example Hájek, Pereira and others [30,31,32].

Evaluative linguistic expressions are expressions of natural language, such as very small, medium, extremely big, very short, more or less deep, quite roughly strong, and will be used in definitions of intermediate quantifiers. Theory of linguistic expressions is a special theory of higher order fuzzy logic introduced in [6], which is based on the standard Łukasiewicz MV-algebra.

Łukasiewicz MV\(_\varDelta \)-algebra is a tuple

$$\begin{aligned} \mathscr {L}=\langle [0, 1], \vee , \wedge , \otimes , \rightarrow , 0, 1, \varDelta \rangle , \end{aligned}$$
(1)

where [0, 1] is the interval of truth degrees, \(\vee \) is a supremum, \(\wedge \) is an infimum, \(\oplus \) is Łukasiewicz conjunction, \((a\oplus b)=0\vee (a+b-1)\), \(\rightarrow \) is Łukasiewicz implication, \(a\rightarrow b=1\wedge (1-a+b)\), 0 and 1 are zero and neutral elements, and \(\varDelta (a)=1\) if \(a=1\), otherwise it is equal to zero.

A general model \(\mathscr {M}\) is a model of a theory T denoted by \(\mathscr {M}\models T\) if \(\mathscr {M}(A_o)=1\) holds for all axioms of T.

3 The Original and the Modified Definition

The main goal of this section is to recall and explain the definition of the intermediate quantifier which was proposed in our previous paper. The definition of intermediate quantifier was introduced in higher order fuzzy logic. The aim of this section is to apply intermediate quantifiers for an analysis and linguistic interpretation of natural data using proposed algorithm. Furthermore, we will work with intermediate quantifiers defined in first order predicate fuzzy logic.

Please recall that Zadeh [33] defined a fuzzy set as a mapping from universe of discourse U to a real interval [0, 1], i.e. F : U \(\rightarrow \) [0, 1]. Unlike crisp sets, where an object fully belongs or does not belong to a set, fuzzy sets enable an object \(u\in U\) to belong partially to a set F in a degree F(u). We will denote it by . We work with a finite universe U in this paper, \(|U| = n\). A fuzzy set X is a subset of a fuzzy set Y, \(X\subseteq Y\), if \(X(u) \le Y(u)\), for all \(u\in U\). A size of a fuzzy set X is \(|X|=\sum _{u\in U} X(u)\).

3.1 Motivation

The general definition of the intermediate quantifier is defined as follows:

$$ \begin{aligned} (Q^{\forall }_{\mathop { Ev}\nolimits }x)(B, A)\mathrel {:=}\,(\exists z)((\pmb {\varDelta }(z\subseteq B)\mathop {\pmb { \& }}\nolimits (\forall x)(zx\pmb {\Rightarrow }Ax)) \pmb {\wedge }(\mathop { Ev}\nolimits )((\mu B) z)), \end{aligned}$$
(2)

where . The \((\mu B)z\) represents a measure of the fuzzy sets z w.r.t. B (which is supposed to be normal) and \(\mathop { Ev}\nolimits \) is an evaluative expression. For our application we use the evaluative linguistic expressions “extremely big”, “very big” and “not small” which will be used for the definition of intermediate quantifiers “Almost all”, “Most” and “Many”. Please recall, that the \(\pmb {\Rightarrow }\) is interprets by Łukasiewicz implication and \( \mathop {\pmb { \& }}\nolimits \) is interprets as Łukasiewicz conjunction which were defined above.

Fig. 1.
figure 1

Scheme of the construction of extensions of evaluative expressions in the context [0, 1].

The motivation to apply evaluative linguistic expressions and some measure can be explained using the following example: “Almost all people who are strong smokers of cigarettes are later affected by cancer”. We suppose a non-empty fuzzy set B in finite universe U which represents “people who are strong smokers of cigarettes” and the fuzzy set A in U which represents the property “affected by cancer”. The goal is to find the biggest fuzzy set z from the support B which represents the intermediate quantifier “Almost all”. It means to find the fuzzy set which will be “extremely big” with respect the fuzzy set B. Similarly we apply other evaluative linguistic expressions for the definitions of “Most” and “Many”.

Furthermore, by replacing of \(\mathop { Ev}\nolimits \) in (2) by a specific evaluative linguistic expression we obtain the definition of the concrete intermediate quantifier. For example, by putting \(\text { Ex}\mathop { Bi}\nolimits \) we understand that the fuzzy set z is “extremely big” w.r.t. B and we obtain the definition of “Almost all”, the formula \(\mathop { Bi}\nolimits \text { Ve}\) means the fact that the fuzzy set z is “very big” w.r.t. B and we can define “Most”, finally, by putting \(\pmb {\lnot }(\mathop { Sm}\nolimits \bar{\mathop {\pmb {\nu }}\nolimits })\) we understand that z is “not small” w.r.t. B which holds for the quantifier “Many”. The precise definitions can be found in Table 1 below.

Table 1. A definition of special intermediate quantifiers

The general definition can be rewritten in the finite model as follows:

$$\begin{aligned} Q_f(B, A) \mathrel {:=}\,\bigvee _{z \subseteq B}\left( \bigwedge _{u\in U} \bigl ( z(u) \rightarrow A(u)\bigr ) \wedge f\left( \frac{|z|}{|B|}\right) \right) , \end{aligned}$$
(3)

where \(\wedge \) stands for infimum, \(\vee \) for supremum, \(\rightarrow \) for Łukasiewicz implication, and \(f: [0, 1] \rightarrow [0, 1]\) is a non-decreasing function representing \(\mathop { Ev}\nolimits \).

The intermediate quantifier \(Q_f\) is defined as a supremum over all fuzzy sets \(z\subseteq B\) that maximizes the function of size of the set z (f(|z| / |B|)) together with the infimum over all \(u\in \mathscr {U}\) of the implication \(z(u)\rightarrow A(u)\). Clearly larger subsets z imply higher values of f(|z| / |B|) and lower values of the implication \(z(u)\rightarrow A(u)\). In [34], we have shown that the supremum is found for z that makes both parts equal.

Such definition works well e.g. for the quantifier “Almost all” that is realized using f corresponding to “extremely big”. More generally, the definition seems non-problematic for such f that \(f(0.5) > 0.5\). But consider such quantifier that there exists some \(x<0.5\) such that \(f(x) > 0.5\): this is the case for the “Many” quantifier, for which the f function corresponds to “not small” so that even \(f(0.36) = 1\) (see Fig. 1).

We are going to show that such quantifiers have high truth degrees regardless of the content of fuzzy sets A and B, which is a feature that does not correspond with reality. Consider e.g. a set B to be a set of participants of this conference and A to be a set of people from Mars. Accordingly to Definition 3, a sentence “Many participants of this conference are from Mars” would have the truth degree greater than 0.64, which is obviously not desirable.

Let us firstly show, why it happens. Let us therefore consider such quantifier that is realized using a function f (see Fig. 1) that \(f(0.36)=1\). Let \(B(u) = 1\) and \(A(u) = 0\) for each \(u\in U\). For such fuzzy sets, the Łukasiewicz implication \(B(u) \rightarrow A(u)\) equals 0. But accordingly to Definition 3, the truth value of the quantifier equals to supremum over all \(z \subseteq B\). Let us take such \(z \subseteq B\) that \(z(u) = 0.36\) for any \(u\in U\). Then the implication \(z(u) \rightarrow A(u)\) would equal 0.64 for all u and \(f\left( \frac{|z|}{|B|}\right) =f(0.36)=1\). For that z, the equation inside the outer brackets in Definition 3 would be equal 0.64. Evidently, the supremum over all \(z\subseteq B\) must be greater or equal to 0.64, hence also \(Q_f(B,A)\ge 0.64\).

3.2 A Modified Definition

This unrealistic result is caused by the fact that we take the supremum over all z such that \(z(u) \le B(u)\) for all u. That enables e.g. the requirement of “36 % of objects in a set B” to be satisfied also by a universe of objects that are all members of B in a 0.36 degree. We believe that the intuitive human understanding of the linguistic “Many” quantifier is that the given condition is satisfied by “not small number of elements”. Therefore, we propose an updated definition of linguistic quantifiers:

$$\begin{aligned} Q'_f(B, A) \mathrel {:=}\,\bigvee _{z \sqsubseteq B}\left( \bigwedge _{u\in U} \bigl ( z(u) \rightarrow A(u)\bigr ) \wedge f\left( \frac{|z|}{|B|}\right) \right) . \end{aligned}$$
(4)

Please mind the difference to Equation (3), \(z\sqsubseteq B\), which is defined as follows: \(z(u) \in \bigl \{0, B(u)\bigr \}\), \(\forall u\in U\) Note that \(\sqsubseteq \) is more strict than \(\subseteq \), i.e.\( (X\sqsubseteq Y)\Rightarrow (X\subseteq Y)\) for any fuzzy set X and Y. That is, the revised definition 4 takes a supremum of a subset of possible z’s and therefore \(Q'_f(B, A) \le Q_f(B, A).\)

4 The Algorithm

The Algorithm 1 obtains the membership degree of the quantifier for given fuzzy sets AB, and a function f representing the evaluative linguistic expression that models the intensity of the quantifier, as discussed above. Note that B must not be empty set.

figure a

Theorem 1

Let AB be fuzzy sets on a non-empty finite universe U such that \(|B|>0\) and let \(f: [0, 1] \rightarrow [0, 1]\) be a non-decreasing function. Then Algorithm 1 finishes after a finite number of steps and returns a value of \(Q'_f(B, A)\) as defined in Equation (4).

Proof

The first 6 steps set \(n=|U|\), \(d=|B|\), and create a fuzzy set I such that \(I(u) = B(u) \rightarrow A(u)\), for each \(u\in U\). From the initial conditions we know that \(n \ge 1\) and \(d > 0\).

In step 7, a sequence \((u_1, \ldots , u_n)\) is created so that the sequence of membership degrees of the fuzzy set I, \(I(u_1), \ldots , I(u_n))\), is non-increasing. Clearly for any \(j\in \{1, \ldots , n\}\), if we define a fuzzy set \(z_j\) as

$$z_j(u_i) \mathrel {:=}\,{\left\{ \begin{array}{ll} B(u_i) &{} \text{ if } i \le j,\\ 0 &{} \text{ otherwise }, \end{array}\right. }$$

then \(z_j \sqsubseteq B\) and also \(\bigwedge _{u\in U} \bigl ( z_j(u) \rightarrow A(u)\bigr ) = \bigwedge _{i\le j} I(u_i) = I(u_j).\) Hence, in order to obtain a value of \(Q'_f(B, A)\), it lasts to find

$$\max _{j\in \{1, \ldots , n\}}\left\{ I(u_j) \wedge f\left( \frac{j}{n}\right) \right\} .$$

Instead of traversing through all \(j\in \{1, \ldots , n\}\), we perform a binary search in steps 816 to find a least l such that \(I(u_l) < f(l/d)\). Then the solution is either

$$\beta \mathrel {:=}\,I(u_l) \wedge f\left( \frac{l}{n}\right) \quad \text {or}\quad \alpha \mathrel {:=}\,I(u_{l-1}) \wedge f\left( \frac{l-1}{n}\right) ,$$

i.e. \(Q'_f(B, A) = \max \{\alpha , \beta \}\) (see step 27).

5 The Graded Square of Opposition

Let us start with a motivation example. Assume we know that “Almost all people, who are strong smokers of cigarettes, are later affected by cancer” is true, for example, in the degree 0.75. The question is: what is possible to infer from that information?

We stem our analysis on graded Peterson’s square of opposition, which is based on basic formulae with quantifiers defined in Table 1.

The Peterson’s square shows the properties contraries, contradictories, subcontraries and subalterns. The idea of classical definitions (see [4]) was adopted and extended for fuzzy case with generalized definitions as follows:

  • two formulas \(P_1\) and \(P_2\) are contraries if \(\mathscr {M}(P_1)\otimes \mathscr {M}(P_2)= 0\) holds for every model \(\mathscr {M}\models T\),

  • two formulas \(P_1\) and \(P_2\) are sub-contraries if \(\mathscr {M}(P_1)\oplus \mathscr {M}(P_2)=1\) holds for every model \(\mathscr {M}\models T\),

  • \(P_1\) and \(P_2\) are contradictories Footnote 1 if both \(\mathscr {M}(\pmb {\varDelta }P_1)\otimes \mathscr {M}(\pmb {\varDelta }P_2)=0\) as well as \(\mathscr {M}(\pmb {\varDelta }P_1)\oplus \mathscr {M}(\pmb {\varDelta }P_2)=1\) hold for every model \(\mathscr {M}\models T\).

  • The formula \(P_2\) is a subaltern of \(P_1\) in T if \(\mathscr {M}(P_1)\le \mathscr {M}(P_2)\) holds true in every model \(\mathscr {M}\models T\). We will call \(P_1\) a superaltern of \(P_2\).

Based on that, a graded Peterson’s square of opposition with intermediate quantifiers may be presented:

figure b

The straight lines mark contradictories, the dashed lines contraries and the dotted lines sub-contraries. The arrows indicate the relation superaltern–subaltern.

We can observe that, for example, if we know that “Almost all people, who are strong smokers of cigarettes, are later affected by cancer” is true in the degree 0.75, then, by the position of “Almost all”, we can infer that “Few people, who are strong smokers of cigarettes, are later affected by cancer” is true at most in degree 0.25.

Table 2. Example of rules obtained from the Iris dataset
Table 3. Membership degrees of quantifiers “all”, “almost all”, “most”, “many”, “exists” applied to the rules from Table 2, and their interpretation within the graded Peterson’s square

6 Example

To illustrate the use of intermediate quantifiers on real data, we have applied the GUHA method [9] on a commonly known Anderson’s Iris dataset [35, 36], which captures some morphologic variations of iris flowers. GUHA is an automated method for obtaining association rules from data, similarly to Agrawal’s market basket case analysis [37], which was discovered independently many years later. Some of the rules obtained from Iris data can be found in Table 2. Table 3 summarizes the membership degrees of intermediate quantifiers applied to that rules.

6.1 An Explanation of Contraries

Applying of the relationships between the quantifiers we will comment the results in Table 2 and Table 3.

A main role here plays the presupposition. In classical logic, it is the requirement \((\exists x)(Bx)\). In fuzzy logic, we generalize the presupposition as \( (\exists x)(zx\mathop {\pmb { \& }}\nolimits z'x)\) where \(z,z'\subseteq B\). We can observe from Table 3, for example, “Almost all irises with sepal length small have petal length small” is true in the degree 0.995 and its negative quantifier “A few irises with sepal length small have not petal length small” is true in the degree 0.242. We conclude that both quantifiers are contraries. It means that \(0\vee (0.995+0.242-1)=0.237\) and finally applying by presupposition we have \(0.237\otimes 0.516=0\vee (0.237+0.516-1)=0\).

6.2 An Explanation of Sub-contraries

From Table 3 we also observe that the quantifiers \(\mathbf {K}\) and \(\mathbf {G}\) are sub-contraries. For example, “Many irises with medium sepal width have its sepal length very small” is true in the degree 0.973 and “Many irises with medium sepal width have not its sepal length very small” is true in the degree 1 then \(\mathscr {M}(\mathbf {K})\oplus \mathscr {M}(\mathbf {G})=1\wedge (1+0.973)=1\).

6.3 An Explanation of Sub-alterns

We can observe that “All irises with both sepal and petal small length have its petal width small” is true in the degree 0.954. It means that “All” is superaltern of “Almost all” which is superaltern of “Most” and etc. For example, “Almost all irises with both sepal and petal small length have its petal width small” is true in the degree 0.995 and “Most irises with both sepal and petal small length have its petal width small” is true in the degree 1. Similarly, we can analyze negative quantifiers. “Almost all irises with both sepal and petal small length have not its petal width small” is true in the degree 0.242 and “Most irises with both sepal and petal small length have not its petal width small” is true in the degree 0.491. Finally we conclude that the property of contradictories for classical quantifiers with presupposition is trivially fulfilled while contradictories of others quantifiers will be studied in prepared paper.

7 Conclusion

The main objective of this paper was to introduce a modified definition of generalized intermediate quantifiers. We have proposed an algorithm based on the theory of intermediate quantifiers and applied it together with the fuzzy GUHA method on real data. We have found linguistic associations which were analyzed using expressions of natural language such as “Almost all”, “Most” and “Many”. We have also demonstrated an application of graded Peterson’s square of opposition, which yields the possibility to infer new information from the results that were found before. We plan to apply the theory of syllogistic reasoning to be able to infer even more, in the future.