A Rule-Based Calculus and Processing of Complex Events