**7. Conclusions**

In this paper, we proposed a duration calculus for integrable functions (DC4F). It is a natural, conservative extension of the well-known and widely used duration calculus. DC was used in numerous applications to specify various kinds of real-time and hybrid systems, to synthesize controllers, and so on. However, it allows to deal only with state functions, i.e., functions with Boolean values only. It did not aim to specify signals and measurements. The theoretical value of the proposed extension seems to be rather modest; however, its applications appear to be interesting. We are wondering why DC was not developed in this way from the beginning, as this would naturally broaden its application range and would be a consequent thing to do.

DC4F, like DC, is a type of interval logic providing a formal language, uniform mathematical models, and a reasoning system to deal with time series. Both calculi provide axioms and inference rules allowing to reason about properties of systems and to draw conclusions. However, they differ in expressivity, the scope of their applications, and, of course, maturity. Expressivity is achieved, in most cases, at the cost of complexity of the proof system and methods. This is the case of DC and DC4F as well. As the general form of DC is not decidable, i.e., there is no algorithm that decides whether a given formula is provable or not; the extended expressivity of DC4F relative to DC does not change much in that respect. DC, in contrary to DC4F, is aimed exclusively at the specification of durations of properties. The properties are specified by Boolean-valued functions. A grea<sup>t</sup> amount of research has been conducted about DC. Model-checking algorithms were created for its restricted versions and various tools were developed. It has been used to synthesize controllers. DC4F allows to integrate arbitrary Riemann integrable functions. Consequently, it provides a consistent general model for general form time series. The models can be handled using integral calculus, computer algebra, and so on. It allows one to specify several factors, parameters, and signals in one coherent language, to model them in a uniform manner, and to reason about them. Consequently, DC4F extends the ideas of DC to a qualitatively new area of applications.

We demonstrated that DC4F can be used to specify various temporal properties of time series, such as monotonicity, boundedness, and periodicity. We used it to specify different aspects of volcano monitoring activities, with a particular emphasis placed on Strombolian effects. DC4F proved to be a framework that is useful for integrating various types of data expressed in terms of time series and diagrams. Usually, in other papers, such types of data are informally related and reasoned about using informal textual descriptions in natural languages, such as English, and some mathematical formulas. This way of

handling data is, of course, imprecise and error-prone. Thus, DC4f provides a remedy for this problem in the form of a unifying logic.

DC4F can be used to formulate specifications and hypotheses, reason about them, and validate them. Informally speaking, the difference between validation and deduction is that validation is performed for a concrete data set, on a specific model, semantic deduction concerns all possible data sets and all concrete models, and syntactic deduction relies solely on the application of sound deduction rules. The proposed logic can be combined with other methods, such as algorithms, and in particular with trained neural networks and other methods used in artificial intelligence (cf., e.g., [19]).

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A. Formal Semantics**

To make the paper self-contained, we present in this section the formal semantics of the proposed DC extension. The semantics were already outlined in Section 5.2, but the formal definitions, thought a bit tedious, offer full mathematical precision.

These semantics are closely related to the original semantics of DC. The main difference is that we use general Riemann integrable functions instead of functions with Boolean values. DC4F generalizes the scope of integral operator, but it does not add new logical operators to DC. From the logic point of view, DC4F is a conservative extension of DC. Thus, a formula of DC is a tautology of DC4F if, and only if, it is a tautology of DC. We define the semantics of the formulas defined in Section 5.1. The definition has three parts corresponding to the three syntactic categories defined there: functions *Fn*, terms *Real*, and formulas *Fo*.

The time domain Time is the set R+ consisting of all non-negative real numbers. The discrete case, when the time domain is the set of natural numbers N, can be dealt with as a special case of R<sup>+</sup>, as was shown in Section 5.2. In particular, if Time = N, then we assume that the set of IFun consists of functions that change their values at most at natural numbers and are constant elsewhere. Set IFun contains some unary Riemann integrable functions on positive reals. The symbols from the set **FSym** are interpreted as functions from IFun. For a function symbol *f* ∈ **FSym**, the corresponding interpretation is an integrable function *I*[*f*] ∈ IFun of one variable of type R.

The semantics of *Fn* is defined in a standard way. Interpretation function *I* is the key here. Let *f* , *f*1, *f*2 ∈ **FSym** and *c* ∈ **CSym**. For the terms of category *Fn*, it is defined as follows:


The set Inte consists of all intervals: Inte = {[*<sup>a</sup>*, *b*] ∣ *a*, *b* ∈ Time ∧ *a* ⩽ *b*}. The set Val = {*val* ∣ *val* ∶ **VSym** ↦ R} contains all valuations of variables. Let Fls be a set containing functionals, i.e., functions that map time intervals to real numbers. The functional symbols **FlSym** (cf. Section 5.1) are interpreted as elements of Fls. We assume that *d* is the usual measure on R.


• *<sup>I</sup>*[*<sup>t</sup>*1 ⊕ *<sup>t</sup>*2](*val*,[*<sup>a</sup>*, *b*]) = *<sup>I</sup>*[⊕](*I*[*<sup>t</sup>*1](*val*,[*<sup>a</sup>*, *b*]), *<sup>I</sup>*[*<sup>t</sup>*2](*val*,[*<sup>a</sup>*, *b*])), where *t*1, *t*2 are terms, ⊕ ∈ {+,<sup>−</sup>,∨, }, and *I*[⊕] are interpreted as the addition, subtraction, maximum, or division, respectively.

We say that two valuations *val*, *val*′ differ at most on variable *x* if *val*(*y*) = *val*′(*x*) for every variable *y* is different from *x*. To define the semantics terms, the interpretation function *Int* needs pairs consisting of a valuation function *val* ∈ Val and an interval [*a*, *b*] ∈ Inte.

We define now the satisfaction relation ⊧ for the elements of category *Fo*. The relation has three arguments: a valuation, an interval, and a formula. It is defined as follows:

