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
220
DNSSEC
apfohl
0
170
Domain Name System
apfohl
1
220
FreeBSD
apfohl
0
250
Other Decks in Research
See All in Research
CSP: Self-Supervised Contrastive Spatial Pre-Training for Geospatial-Visual Representations
satai
3
210
大規模な2値整数計画問題に対する 効率的な重み付き局所探索法
mickey_kubo
1
270
問いを起点に、社会と共鳴する知を育む場へ
matsumoto_r
PRO
0
360
Collaborative Development of Foundation Models at Japanese Academia
odashi
2
560
Adaptive Experimental Design for Efficient Average Treatment Effect Estimation and Treatment Choice
masakat0
0
130
Vision And Languageモデルにおける異なるドメインでの継続事前学習が性能に与える影響の検証 / YANS2024
sansan_randd
1
110
NLP2025参加報告会 LT資料
hargon24
1
320
「エージェントって何?」から「実際の開発現場で役立つ考え方やベストプラクティス」まで
mickey_kubo
0
120
チャッドローン:LLMによる画像認識を用いた自律型ドローンシステムの開発と実験 / ec75-morisaki
yumulab
1
470
AI エージェントを活用した研究再現性の自動定量評価 / scisci2025
upura
1
120
言語モデルによるAI創薬の進展 / Advancements in AI-Driven Drug Discovery Using Language Models
tsurubee
2
380
SSII2025 [TS2] リモートセンシング画像処理の最前線
ssii
PRO
7
2.9k
Featured
See All Featured
Faster Mobile Websites
deanohume
307
31k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
We Have a Design System, Now What?
morganepeng
53
7.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
52k
Designing for Performance
lara
610
69k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Scaling GitHub
holman
459
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Stop Working from a Prison Cell
hatefulcrawdad
270
21k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
GitHub's CSS Performance
jonrohan
1031
460k
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