*3.2. Temporal Modalities*

In this subsection, we present three temporal modalities definable in DC: the chop, the after-modality, the sometime-modality, and the always-modality. The chop is denoted by ⌢ (cf., e.g., [10]); it applies to two neighboring intervals. It allows one to express the fact that a property holds in the first interval and another property holds in the second interval. The last two modalities occur in all kinds of modal and temporal logics (cf., e.g., [2]), but they have a specific meaning in DC. The sometime-modality is denoted by ◊ and requires a property to hold for some time interval. The always-modality is denoted by ◻ and means that a property holds for all time periods.

Formally, for two formulas *F*, *G*, the formula *F* ⌢ *G* means that for an interval [*a*, *b*] in question, there exists a number *x* such that *a* ⩽ *x* ⩽ *b*, *F* holds for interval [*a*, *x*] and *G* holds for interval [*<sup>x</sup>*, *b*]. For example, the fact that *sin* is initially positive and then negative (see the previous subsection) can be described in respect to two subintervals dividing the interval in question. We may express it by formula (∫ *sp* = *π*)⌢ (∫ *sn* = *<sup>π</sup>*). It is true on the interval [0, <sup>2</sup>*π*] as the interval can be split into two subintervals [0,*π*] and [*<sup>π</sup>*, <sup>2</sup>*π*]; thus, we chose *x* = *π*.

Note that the operator ⌢ is associative; thus, the formula of the form *F* ⌢ (*G* ⌢ *H*) is equivalent to formula (*F* ⌢ *G*)⌢ *H*, since the formulas depend on splitting an underlying interval [*a*, *d*] into three parts [*a*, *b*],[*b*, *<sup>c</sup>*],[*<sup>c</sup>*, *d*] where the subformulas *F*, *G*, *H* have to hold, respectively. Consequently, we will drop the brackets when using chop.

Given a formula *G* and an interval [*a*, *b*], the fact that ◊ *G* holds for interval [*a*, *d*] means that it has a subinterval [*b*, *<sup>c</sup>*], i.e., *a* ⩽ *b* ⩽ *c* ⩽ *d*, such that *G* holds in [*b*, *c*]. The may-modality may be expressed using the chop operator *true*⌢ *G* ⌢ *true*, which means that we can divide the underlying interval into three subintervals and that *G* holds for the middle subinterval, whereas we do not require anything from its adjacent subintervals on the left- and right-hand sides. For example, we have the following property:

$$
\pi r < \ell \implies \Diamond \text{ 0 } < \int \text{ } \text{sp} = \ell \tag{2}
$$

This formula says that if the length of the underlying interval is larger than *π*, then there is a subinterval of length larger than 0 where the property *sp* holds all the time, i.e., *sin* is positive.

The modal formula ◻ *G* means that for all subintervals of an underlying interval, the formula *G* holds. For example, for all subintervals of interval [0,*π*], the function *sp* is true all the time: ◻ ∫ *sp* = -. Modality ◻ can be expressed using the sometime-modality ◊: ¬◊ ¬*G*; the formula means that no subinterval exists where *G* does not hold. Vice versa, ◊ *G* can be expressed as ¬◻ <sup>¬</sup>*G*. Thus, both modalities are dual. Both are definable in terms of the chop operator, but we will use them as syntactic sugar to facilitate readability of the formulas.

#### **4. The Idea of Duration Calculus for Functions**

In this section, we present the idea of duration calculus for functions (DC4F). The objective is to treat Riemann integrable functions with values of type real. Such functions can represent continuous as well as discrete time series. We informally present features of the proposed calculus and illustrate them with simple examples demonstrating its basic characteristics, the way it can be used, and the capabilities of the logic.

#### *4.1. DC versus DC4F*

DC allows one to treat Boolean-valued functions only and to reason about their durations. It does not allow to integrate general functions. In this subsection, we propose an extension of DC supporting all Riemann integrable functions. We present the basic features of the proposed logic. We also present examples that are specific to DC4F and, thus, cannot be expressed in DC.

In DC, a state function *f* , we can consider the time intervals, or periods, when this states holds. Such a case corresponds to considering the corresponding characteristic functions: <sup>1</sup>{*y* ∣ 0<*f* (*y*)}(*t*). The integrals of the characteristic functions correspond to the duration of the characterized state or property. For example, as explained in the previous section, the fact that *sin* is first negative and then positive can be expressed in DC only via the auxiliary characteristic functions *sp* and *sn*, but not directly. In DC, we can integrate function *sp*(*x*) and obtain the duration over which it remains true, but we cannot integrate *sin* or any other function that is not Boolean. Thus, for example, we can express the property that for intervals of length 2*π*, *sin* is positive as equally long as it is negative - = *2π* ⇒ ∫ *sp* = ∫ *sn*.

However, not all properties of integrals can be expressed in this way. For example, we cannot express properties such as - = *2π* ⇒ ∫ *sin* = *0*, i.e., that if the length of the underlying interval is 2*π*, then the integral is equal to 0. Thus, DC is not expressive enough to treat time series in general.

DC4F is a natural extension of DC as allows all integrable functions. For example, we can consider ∫ *sin*. In logical terms, it is a conservative extension of DC. Conservativity means that a formula of DC is a tautology in the sense of DC if, and only if, it is a tautology of DC4F; equivalently, it is satisfied in a DC model if, and only if, there is a DC4F extension of the model in which the formula is satisfied. In general, DC can be expressed in DC4F by restricting the set of integrable functions so that it contains Boolean-valued functions only.
