paper

Tractable Gap-Constraint Languages for Complex Event Recognition

arXiv:2606.18878

Abstract

For strings , a subsequence embedding of in is a function with for every and the -th symbol of equals the -th symbol of . A gap-constraint for is a triple with and is a regular language over . An embedding satisfies a gap-constraint if the factor of strictly between positions and is a word from . We investigate the subsequence matching problem with gap-constraints, which is relevant in the context of complex event recognition (CER): given and a set of gap-constraints, find an embedding of in that satisfies all gap-constraints from . In general, subsequence matching is NP-complete and the only known tractable variants restrict the interval structure of the gap-constraints. In this work, we show that we can solve subsequence matching with gap-constraints with an arbitrary interval structure rather efficiently (in fact, optimally under SETH) in time if the gap-constraint languages satisfy a property which we dub left-convexity: whenever and , then also . Left-convex languages are sufficiently expressive to model interesting real-world scenarios considered in CER, e.g., length constraints for . We also show how our algorithm can be used in order to efficiently enumerate all satisfying embeddings, which is particularly relevant for possible applications in CER. Finally, we show how non-left-convex languages can lead to intractability, i.e., if in addition to length constraints we allow as the only non-left-convex constraint language, then the problem is NP-complete again.

50 pages

Tractable Gap-Constraint Languages for Complex Event Recognition · wovepaper