Wednesday, November 4, 2009

On logic programming and event processing

Alex Alves wrote in his Blog about logic programming extensions for CEP. Logic programming is like Phoenix, it goes and comes again in different contexts. First time I heard about it, in the early 1980-ies, in the context of the fifth generation computing, that was promised to be the real computer revolution -- old guys like me may still remember the hype around it, this was based around logic programming, actually its metrics was: LIPS (logical inferences per second). Then Prolog appeared as a competitor of LISP as AI language, some of the language wars were documented in the famous paper by Bobrow, entitled: If Prolog is the answer then what is the questions? Anyway, both LISP (my own favorite language) and Prolog has stayed in AI courses, but AI oriented programming is now being written in general purpose languages. Next we saw logic programming appearing in databases, in the form of deductive databases, Datalog and its siblings; when I was a graduate student in the late 1980-ies, deductive databases were the most visible topic in database conferences, and it was also somehow vanished a few years later. Now we are observing that among the many languages styles for event processing there is also event processing based on logic programming. Alex's Blog talks about Drools, there are also some other of this type. One of the languages that will participate in the EPIA book languages experience is an open source language based on logic programming called ETALIS. I'll report about this languages experience as we advance.

Tuesday, November 3, 2009

On the patterns collections list

Back on dealing with the EPIA book, we are now in the process of the 2/3 book review, and started to work on the last 1/3. Right now I am working on a section talking about temporal issues in event processing, but before talking about that, I still wish to get back to the previous chapter that deals with event patterns, continuing the discussion that I have started in this posting, and continued in this posting. In the book we bring a collection of patterns, these patterns are not meant to be complete, and we expect to grow the collection of patterns over time using the book's website.

The patterns collected are of several types:

  • Logical operator patterns: all, any, absence that designate conjunction, disjunction and negation event patterns.
  • Threshold oriented patterns: count of events, average/maximum/minimum of some attribute of a collection of events has some binary relationship (e.g. > ) with a given threshold.
  • Relative patterns: relative max/relative min selects the events with the minimal or maximal value for a certain attribute over a collection of events.
  • Modal patterns: sometimes, always, select a collection of patterns if a certain predicate is satisfied over all/some of the events in this collection.
  • Not select pattern: This is a second level modal pattern that selects events that were not selected by a certain patterns.
  • Sequence pattern: A temporal pattern that denotes a conjunction of event that occur within a predefined order.
  • Trend patterns: Temporal patterns that detect trend, e.g. a value of a certain attribute is consistently increasing with a context.
  • Spatial distance patterns: These are similar to the threshold patterns, but relate to the distance of events from some point in space.
  • Spatial relative patterns: This are similar to relative patterns, but relate to the relative distance of events from other events
  • Spatiotemporal patterns: This combine temporal and spatial properties, and designate direction of movement (e.g. moving consistently north, moving towards some entity).

The current full list of patterns consist of 30 patterns, and this list will probably grow. Each of the patterns is defined in the book and demonstrated using an example.

More on patterns - later.