Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Event Language
Search
Andreas Pfohl
June 09, 2015
Research
0
530
The Event Language
Rule Based Complex-Event Processing on Distributed Networks
Andreas Pfohl
June 09, 2015
Tweet
Share
More Decks by Andreas Pfohl
See All by Andreas Pfohl
DNSSEC v2
apfohl
0
52
Kore
apfohl
0
230
DNSSEC
apfohl
0
170
Domain Name System
apfohl
1
220
FreeBSD
apfohl
0
260
Other Decks in Research
See All in Research
Towards a More Efficient Reasoning LLM: AIMO2 Solution Summary and Introduction to Fast-Math Models
analokmaus
2
800
Large Language Model Agent: A Survey on Methodology, Applications and Challenges
shunk031
16
9.9k
2025年度人工知能学会全国大会チュートリアル講演「深層基盤モデルの数理」
taiji_suzuki
25
18k
20250624_熊本経済同友会6月例会講演
trafficbrain
1
610
Minimax and Bayes Optimal Best-arm Identification: Adaptive Experimental Design for Treatment Choice
masakat0
0
170
CVPR2025論文紹介:Unboxed
murakawatakuya
0
150
Panopticon: Advancing Any-Sensor Foundation Models for Earth Observation
satai
1
100
Type Theory as a Formal Basis of Natural Language Semantics
daikimatsuoka
1
290
A scalable, annual aboveground biomass product for monitoring carbon impacts of ecosystem restoration projects
satai
4
240
AWSで実現した大規模日本語VLM学習用データセット "MOMIJI" 構築パイプライン/buiding-momiji
studio_graph
2
510
最適化と機械学習による問題解決
mickey_kubo
0
170
時系列データに対する解釈可能な 決定木クラスタリング
mickey_kubo
2
940
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Bash Introduction
62gerente
615
210k
GraphQLとの向き合い方2022年版
quramy
49
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Gamification - CAS2011
davidbonilla
81
5.4k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Being A Developer After 40
akosma
90
590k
Optimizing for Happiness
mojombo
379
70k
Faster Mobile Websites
deanohume
309
31k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Transcript
The Event Language Rule Based Complex-Event Processing on Distributed Networks
Andreas Pfohl and Robert Heumüller June, 9th 2015 1
Setting • Complex-Event Processing • Embedded Networks • Different Architectures
• Varying Computational Power 2
Challenges • High-level language • Runs on different architectures •
Compiled and Just-in-Time-Compiled • Means of distribution 3
Event Processing event PositionEvent { time = [0], pos =
[1] } pos_a; event PositionEvent { time = [2], pos = [6] } pos_b; + event VelocityEvent { v = [2.5] } velocity; 4
Vector Calculation • Vectors for information • Vector Calculator •
Collections Library 5 event PositionEvent { time = [0], pos = [1] } pos_a; f = 1.123; v = [1, 2, f]; s = 3 * v; u = v + s;
Event Language 6 Event Definition: event TimedEvent { time };
event PositionEvent extends TimedEvent { position }; event VelocityEvent { velocity };
Event Language 7 Function Definition: VelocityEvent calculateVelocity(PositionEvent posEv1, PositionEvent posEv2)
:= { velocity = (posEv2.time - posEv1.time)^(-1) * (posEv2.position - posEv1.position) };
Event Language 8 Predicate Definition: predicate positionCheck(PositionEvent posEv1, PositionEvent posEv2)
:= posEv2.position > posEv1.position; predicate timeCheck(PositionEvent posEv1, PositionEvent posEv2) := posEv2.time > posEv1.time;
Event Language 9 Rule Declaration: VelocityRule: [PositionEvent, PositionEvent : positionCheck,
timeCheck] -> calculateVelocity;
Event Language 10 event TimedEvent { time }; event PositionEvent
extends TimedEvent { position }; event VelocityEvent { velocity }; VelocityEvent calculateVelocity(PositionEvent posEv1, PositionEvent posEv2) := { velocity = (posEv2.time - posEv1.time)^(-1) * (posEv2.position - posEv1.position) }; predicate positionCheck(PositionEvent posEv1, PositionEvent posEv2) := posEv2.position > posEv1.position; predicate timeCheck(PositionEvent posEv1, PositionEvent posEv2) := posEv2.time > posEv1.time; VelocityRule: [PositionEvent, PositionEvent : positionCheck, timeCheck] -> calculateVelocity;
Challenges • High-level language • Runs on different architectures •
Compiled and Just-in-Time-Compiled • Means of distribution 11
LLVM • Formerly Low Level Virtual Machine • Compiler Infrastructure
• Compiled and JIT • Different Target Architectures 12
Challenges • High-level language • Runs on different architectures •
Compiled and Just-in-Time-Compiled • Means of distribution 13
Challenges • High-level language • Runs on different architectures •
Compiled and Just-in-Time-Compiled • Means of distribution 14
Challenges • High-level language • Runs on different architectures •
Compiled and Just-in-Time-Compiled • Means of distribution 15
Implementation 16
Overview 17
Lexer / Parser Toolchains: • Lex / Yacc • Flex
/ Bison • Antlr • … 18 Jobs: • Parse Language • Build AST Flex / Lemon
Lemon • Context Free • LALR(1) Parser • Robust Syntax
• Error Handling • LibCollect AST 19 rule_declaration(NODE) ::= TYPE(T) COLON rule_signature(RS) RARROW IDENTIFIER(I). { struct payload *payload = malloc(sizeof(struct payload)); payload->type = N_RULE_DECLARATION; payload->alternative = ALT_RULE_SIGNATURE; payload->rule_declaration.name = strdup(T); payload->rule_declaration.identifier = strdup(I); NODE = tree_create_node(payload, 1, RS); }
Scoping 20 VelocityEvent calculateVelocity(PositionEvent posEv1, …) := …
Linking 21 Resolve References
Validation • Parser: Syntactic Validity • Validation: Semantic Validity •
Check: • References Resolved • Type Constraints 22 Unexpected Behavior Invalid Input
Type Checking 23 Assert: Function_Definition.Expression == EVENT Assert: Initializer.Value ==
NUMBER
Code Generation Tasks: • For each event: • Structure definition
• For each Predicate / Function: • Function • For each Rule: • Activation Function • Processing Function 24 Options: • C • “Highlevel” • Complex • No JIT • Assembler • Lowlevel • Less Complex • Plattform Specific LLVM is Middle Ground
LLVM • Intermediate Representation • Provides Optimizer • C-API 25
Meets all Requirements
LLVM-IR 26 %PositionEvent = type <{ i16, double*, i16, double*
}> %VelocityEvent = type <{ i16, double* }> define %VelocityEvent* @VelocityRule_function(%PositionEvent*, %PositionEvent*) { %3 = call %VelocityEvent* @calculateVelocity(%PositionEvent* %0, %PositionEvent* %1) ret %VelocityEvent* %3 } define %VelocityEvent* @calculateVelocity(%PositionEvent*, %PositionEvent*) { %3 = alloca %VelocityEvent* %malloccall = tail call i8* @malloc(i32 ptrtoint (%VelocityEvent* getelementptr (%VelocityEvent* null, i32 1) to i32)) %4 = bitcast i8* %malloccall to %VelocityEvent* %5 = getelementptr inbounds %VelocityEvent* %4, i32 0, i32 0 %6 = alloca double %7 = alloca <{ i16, double* }> %8 = getelementptr inbounds <{ i16, double*
Conclusion • Rule-Based language for Event-Processing • Created complete compiler
toolchain • Knowledge about compiler construction • Improved low level programming and understanding 27
28 Demo - Creating Event-Processor
Demo - Using Event-Processor