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
不確実性下における目的と手段の統合的探索に向けた連続腕バンディットの応用 / iot70_gp_rff_mab
monochromegane
2
190
AWSで実現した大規模日本語VLM学習用データセット "MOMIJI" 構築パイプライン/buiding-momiji
studio_graph
2
740
地域丸ごとデイサービス「Go トレ」の紹介
smartfukushilab1
0
150
単施設でできる臨床研究の考え方
shuntaros
0
3k
MetaEarth: A Generative Foundation Model for Global-Scale Remote Sensing Image Generation
satai
4
320
AI エージェントを活用した研究再現性の自動定量評価 / scisci2025
upura
1
160
20250624_熊本経済同友会6月例会講演
trafficbrain
1
680
Minimax and Bayes Optimal Best-arm Identification: Adaptive Experimental Design for Treatment Choice
masakat0
0
180
【輪講資料】Moshi: a speech-text foundation model for real-time dialogue
hpprc
3
760
Towards a More Efficient Reasoning LLM: AIMO2 Solution Summary and Introduction to Fast-Math Models
analokmaus
2
910
VectorLLM: Human-like Extraction of Structured Building Contours via Multimodal LLMs
satai
4
330
Stealing LUKS Keys via TPM and UUID Spoofing in 10 Minutes - BSides 2025
anykeyshik
0
140
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
75
5.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
How STYLIGHT went responsive
nonsquared
100
5.8k
Making Projects Easy
brettharned
120
6.4k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Designing Experiences People Love
moore
142
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Git: the NoSQL Database
bkeepers
PRO
431
66k
How to Ace a Technical Interview
jacobian
280
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
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