We introduce the concept of regular expression characteristics as a unified way to concisely express bounds on time-series constraints. This allows us not only to define time-series constraints in a compositional way, but also to deal with their combinatorial aspect in a compositional way, without developing ad-hoc bounds for each time-series constraint separately.
IntroductionA time series is here a sequence of integers, corresponding to measurements taken over a time interval. Time series are common in many application areas, such as the output of electric power stations over multiple days [9], or the manpower required in a call-centre [5], or the daily capacity of a hospital clinic over a period of years. Time series are constrained by physical or organisational limits, which restrict the evolution of the series.We showed in [6] that many constraints γ( X 1 , X 2 , . . . , Xn , N ) on an unknown time series X = X 1 , X 2 , . . . , Xn can be specified in a compositional way by a triple σ, f, g , where σ is a regular expression over the alphabet Σ = {'<', '=', '>'} (we assume the reader is familiar with regular expressions [13]), while f ∈ {max, min, one, surf, width} is called a feature function, and g ∈ {Max, Min, Sum} is called an aggregator function. Volume II of the global constraint catalogue [4] contains 266 such functional time-series constraints. This is an extended version of parts of the CP 2016 paper [3] which involves a subset of the original authors. This paper introduces 6 new characteristics of regular expressions to express generic bounds on time-series constraints, which were not discussed in the original paper [3].1 are regular expressions that respectively describe the regular languages Lr 1 ∪ Lr 2 , Lr 1 ∩ Lr 2 , and L * r1 .Example 1 Consider the alphabet Σ = {'<', '=', '>'}.• Decreasing = '>' is a regular expression on Σ. The word v = '>' is a word of length 1 on Σ that belongs to L Decreasing , and it does not have any proper factors. The word '>>' is a word of length 2 on Σ, which does not belong to L Decreasing .• Inflexion = '<(<|=)*> | >(>|=)*<' is a regular expression on Σ. The word v = '>=<' is a word of length 3 on Σ that belongs to L Inflexion . The word υ has multiple proper factors, e.g., '>', '<'. The word '>=<<' does not belong to L Inflexion .Definition 2 A regular expression r is a non-fixed length regular expression if not all words of Lr have the same length.Example 2 We give two examples of regular expressions, a first one with a fixed length and a second one with a non-fixed length.• The Decreasing = '>' regular expression has a fixed length since L Decreasing contains a single word.• The Inflexion = '<(<|=)*> | >(>|=)*<' regular expression does not have a fixed length since L Inflexion contains words of different length.Definition 3 A regular expression over an alphabet A is disjunction-capsuled if it is in the form of 'r 1 r 2 . . . rp', where every r i (with i ∈ [1, p]) is, either a letter of the alphabet A, or a regular expression whose regular language contains the ...