Time-Series Constraints: Improvements and Application in CP and MIP Contexts Ekaterina Arafailova , Nicolas Beldiceanu, Rémi Douence, Pierre Flener, M. Andreína Francisco R., Justin Pearson, and Helmut Simonis May 31, 2016
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Contents Linear Decomposition Time-Series Simplified Benchmarks start Automata Constraints Automata CP and MIP Implied Constraints 2 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Contents Linear Decomposition Time-Series Simplified Benchmarks start Automata Constraints Automata CP and MIP Implied Constraints 3 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Time-series constraint A time-series constraint 1 g _ f _ σ ( � X 1 , . . . , X n � , M ) where every X i is over D i ⊂ Z is specified by ◮ A pattern, a regular expression over the alphabet { <, = , > } , e.g. Peak = ‘<(<|=)*(>|=)*>’. Currently 22 patterns in the framework ◮ A feature, a function over a subseries, e.g. one . Currently 5 features in the framework ◮ An aggregator, a function over a feature sequence, e.g. Sum . Currently 3 aggregators in the framework 1 Beldiceanu, N., Carlsson, M., Douence, R., Simonis, H.: Using finite transducers for describing and synthesising structural time-series constraints. Constraints 21(1), 22-40 (January 2016): summary on p. 723 of LNCS 9255, Springer, 2015 4 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion NbPeak (IV) output : aggregation sum 3 (III) feature sequence one 1 1 1 2 6 7 10 11 12 13 14 (II) e-occurrences = = = = peak < < > > < < > > > > < < = = = = > > s-occurrences = = = = = = > < > < < > > < > (I) signature sequence 4 3 5 3 5 5 6 3 1 1 2 2 2 2 2 1 time series : input sequence 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Example NbPeak ( � 4 , 3 , 5 , 3 , 5 , 5 , 6 , 3 , 1 , 1 , 2 , 2 , 2 , 2 , 2 , 1 � , 3 ) holds ! 5 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Contents Linear Decomposition Time-Series Simplified Benchmarks start Automata Constraints Automata CP and MIP Implied Constraints 6 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Automata for time-series constraints Every time-series constraint can be encoded as an automaton with three accumulators: D ( potential ) , C ( current ) , R ( aggregation ) R ← default g , f , C ← default g , f , ≥ s ≥ D ← id f = , < { D ← φ f ( D , δ f ) } g ( R , C ) >, � C ← φ f ( D , δ f ) , � D ← id f ≤ , ≤ r ≥ t { D ← φ f ( D , δ f ) } <, R ← g ( R , C ) , >, � C ← φ f ( C , φ f ( D , δ f )) , � C ← default g , f , D ← id f D ← id f Automaton for the g_f_peak constraints. δ i Feature f id f min f max f φ f Aggregator g default g , f f 1 1 1 max 0 0 one Sum 7 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Automaton instantiation When f is one and g is Sum the automaton becomes C ← 0 ≥ s D ← 0 ≥ R ← 0 < R + C > � C ← max ( D , 1 ) � D ← 0 > � C ← max ( C , max ( D , 1 )) ≤ ≤ r ≥ t � { D ← max ( D , 1 ) } D ← 0 < = C ← 0 { D ← max ( D , 1 ) } D ← 0 R ← R + C Obviously, this automaton can be simplified 8 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Contents Linear Decomposition Time-Series Simplified Benchmarks start Automata Constraints Automata CP and MIP Implied Constraints 9 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Automata simplifications Goal ◮ Reduce the number of accumulators and aggregate as early as possible ◮ Simplify the automata at the stage of their synthesis Three simplification types ◮ Simplifications coming from the properties of patterns, ex.: aggregate-once ◮ Simplifications coming from the properties of the feature/aggregator pairs, ex.: immediate-aggregation ◮ Removing the never used accumulators. 10 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion “Aggregate-once” simplification What is the “Aggregate-once” simplification ? It allows to compute the feature value of a curent pattern occurrence only once and, possibly, earlier than the end of a pattern occurrence. When is the simplification applicable ? There must exist a transition on which the value of the feature from the current pattern occurrence is known. 11 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Example: counting number of peaks 4 3 2 1 0 x 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 S 0 = ‘<’ S 1 = ‘<’ S 2 = ‘=’ S 3 = ‘<’ S 4 = ‘<’ S 5 = ‘>’ S 6 = ‘>’ S 7 = ‘<’ S 8 = ‘=’ S 9 = ‘>’ 1. First peak is detected upon consuming s 5 2. Second peak is detected upon consuming s 9 12 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Two automata for nb_peak C ← 0 ≥ s D ← 0 ≥ R ← 0 < R + C > � C ← max ( D , 1 ) � > D ← 0 � C ← max ( C , max ( D , 1 )) ≤ ≤ r ≥ t � { D ← max ( D , 1 ) } D ← 0 < = C ← 0 { D ← max ( D , 1 ) } D ← 0 R ← R + C ≥ s ≥ { R ← 0 } < R > { R ← R + 1 } ≤ r ≥ t ≤ > < = 13 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Percentage of simplified constraints Simplification Percentage aggregate once 28.9 % immediate aggreg. 45.9 % other properties 11.6 % unchanged automata 13.6 % 14 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Contents Linear Decomposition Time-Series Simplified Benchmarks start Automata Constraints Automata CP and MIP Implied Constraints 15 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Input Input ◮ Time-series variables X i with i in [ 0 , n − 1 ] over their domains [ a i , b i ] ◮ An automaton with accumulators for a time-series constraint with ◮ a set of states Q ; ◮ an input alphabet Σ ; ◮ an m -tuple of integer accumulators with their initial values I = � I 1 , . . . , I m � ; ◮ a transition function δ : Q × Z m × Σ → Q × Z m . 16 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Goal Goal A way to generate a model for an automaton with linear or linearisable accumulator updates, for example containing min and max. Linear decomposition of automata without accumulators Côté, M.C., Gendron, B., Rousseau, L.M.: Modeling the regular constraint with integer programming. In: CPAIOR 2007. LNCS, vol. 4510, pp. 29–43. Springer (2007) 17 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Signature constraint Introduced variables: S i over Σ with i ∈ [ 0 , n − 2 ] . What do the values of S i mean ? S i = ‘>’ ⇔ X i > X i + 1 , ∀ i ∈ [ 0 , n − 2 ] S i = ‘=’ ⇔ X i = X i + 1 , ∀ i ∈ [ 0 , n − 2 ] S i = ‘<’ ⇔ X i < X i + 1 , ∀ i ∈ [ 0 , n − 2 ] 18 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Transition function constraints Introduced variables: Q i over Q with i ∈ [ 0 , n − 1 ] ; T i over Q × Σ with i ∈ [ 0 , n − 2 ] σ q δ 1 ( q , σ ) Each transition constraint has a form: Q i = q ∧ S i = σ ⇔ Q i + 1 = δ 1 ( q , σ ) ∧ T i = � q , σ � , ∀ i ∈ [ 0 , n − 2 ] , ∀ q ∈ Q , ∀ σ ∈ Σ Initial state is fixed Q 0 = q 0 19 / 32
Background Automata simplification Linear Decomposition Implied constraints Benchmark Conclusion Accumulator updates ≥ s { R ← 0 } ≥ < R > { R ← R + 1 } ≤ r ≤ ≥ t > < = Accumulator updates R i over [ a , b ] with i in [ 0 , n − 1 ] ; T i over Q × Σ with i in [ 0 , n − 2 ] . ◮ R 0 = 0 ◮ T i = � r , > � ⇒ R i + 1 = R i + 1 , ∀ i ∈ [ 0 , n − 2 ] ◮ T i = � q , σ � ⇒ R i + 1 = R i , ∀ i ∈ [ 0 , n − 2 ] , ∀� q , σ � ∈ ( Q × Σ) \ � r , > � ◮ M = R n − 1 20 / 32
Recommend
More recommend