SlideShare a Scribd company logo
Building blocks for aggregate programming 
of self-organising applications 
Jacob Beal, Mirko Viroli 
FoCAS Workshop 
8th IEEE SASO 
September, 2014
Goal: Reliable Distributed Adaptive Systems 
device 
neighborhood 
Field-based 
Computing Models 
Self-Organization 
Building Blocks 
Lots of distributed 
applications!
Example: Services for Mass Events 
3
Example: Managing Crowd Danger
Device-Centric Programming 
Dispersal Advice 
Congestion-Aware Navigation 
Dangerous Density Warning 
Crowd Estimation 
• Explicit design of adaptation and communication 
• Complex per-device multi-service application 
• Intractable to ensure correct behavior
Dispersal Advice 
Dangerous Density Warning 
Aggregate Programming 
Congestion-Aware Navigation 
Crowd Estimation 
• Implicit adaptation and communication 
• Code each service independently 
• Compose via scope and information flow
Foundation: Field Calculus 
Variable 
Literal Value Local Ops 
Abstract & Call 
Functions 
State 
Communication 
Domain Change 
[Viroli et al., ’13] 
• Aggregate/local coherence, space-time 
universal 
• Too low level, no adaptivity guarantees
From Principle to Practice: 
Applications 
Distributed 
Library APIs 
Building blocks 
Core Calculus 
Transparent use of 
robust distributed algorithms 
Programmer level: lots of 
useful, intuitive methods 
Domain-specific APIs 
Provable robustness, 
scalability, composability 
Provable universality, 
aggregate/local relation 
unlimited uses 
many algorithms 
5-20 combinators 
5 operators
Making a library of building blocks: 
Time-decay 
All compositions are self-stabilizing 
Converge-cast Gradient-path-integral Sparse-choice if
Building Block: G 
Information spreading 
Field Calculus Implementation: 
(def G (source initial metric accumulate) 
(2nd 
(rep distance-value 
(tuple infinity initial) 
(mux source (tuple 0 initial) 
(min-hood 
(tuple 
(+ (1st (nbr distance-value)) (metric)) 
(accumulate (2nd (nbr distance-value))))))))) 
Library Examples: 
(def distance-to (source) 
(G source 0 nbr-range (fun (v) (+ v (nbr-range))))) 
(def broadcast (source value) 
(G source value nbr-range identity))
Building Block: C 
Information collection 
Field Calculus Implementation: 
(def C (potential accumulate local null) 
(rep v local 
(accumulate local 
(accumulate-hood accumulate 
(mux (= (nbr (find-parent potential)) (uid)) 
(nbr v) null))))) 
(def find-parent (potential) 
(mux (< (1st (min-hood (nbr potential))) potential) 
(2nd (min-hood (nbr (tuple potential (uid))))) 
NaN)) 
Library Examples: 
(def summarize (sink accumulate local null) 
(broadcast sink 
(C (distance-to sink) accumulate local null))) 
(def average (sink value) 
(/ (summarize sink + value 0) 
(summarize sink + 1 0)))
Building Block: T 
Time-summarization of information 
Field Calculus Implementation: 
(def T (initial decay) 
(rep v initial 
(min initial 
(max 0 (decay v))))) 
Library Examples: 
(def timer (length) 
(T length (fun (t) (- t (dt))))) 
(def limited-memory (value timeout) 
(2nd (T (tuple timeout value) 
3 1 
1 
(fun (t) (tuple (- (1st t) (dt)) (2nd t)))))) 
4 
3 
7 
3 
0 
2
Building Block: S 
Choice of sparse subset 
Field Calculus Implementation: 
(def S (grain metric) 
(break-using-uids (random-uid) grain metric)) 
(def random-uid () 
(rep v (tuple (rnd 0 1) (uid)) 
(tuple (1st v) (uid)))) 
(def break-using-uids (uid grain metric) 
(= uid 
(rep lead uid 
(distance-competition 
(G (= uid lead) 0 metric 
(fun (v) (+ v (metric)))) 
lead uid grain metric)))) 
(def distance-competition (d lead uid grain metric) 
(mux (> d grain) uid 
(mux (>= d (* 0.5 grain)) infinity 
(min-hood 
(mux (>= (+ (nbr d) (metric)) (* 0.5 grain)) 
infinity 
(nbr lead))))))
Building Block: if 
Restrict scope to subspaces 
Field Calculus Implementation: 
(if test 
true-expression 
false-expression) 
Library Examples: 
(def distance-avoiding-obstacles (source obstacles) 
(if obstacles 
infinity 
(distance-to source))) 
(def recent-event (event timeout) 
(if event true (> (timer timeout) 0)))
Applying building blocks: 
Example API algorithms from building blocks: 
distance-to (source) max-likelihood (source p) 
broadcast (source value) path-forecast (source obstacle) 
summarize (sink accumulate local null) average (sink value) 
integral (sink value) region-max (sink value) 
timer (length) limited-memory (value timeout) 
random-voronoi (grain metric) group-size (region) 
broadcast-region (region source value) recent-event (event timeout) 
distance-avoiding-obstacles (source obstacles) 
Since based on these 5 building blocks, all 
programs built this way are self-stabilizing!
Complex Example: Crowd Management 
(def crowd-tracking (p) 
;; Consider only Fruin LoS E or F within last minute 
(if (recently-true (> (density-est p) 1.08) 60) 
;; Use S to break into ‘‘cells’’ and estimate danger of each 
(+ 1 (dangerous-density (S 30) p)) 
0)) 
(def recently-true (state memory-time) 
;; Make sure first state is false, not true... 
(rt-sub (not (T 1 1)) state memory-time)) 
(def rt-sub (started s m) 
(if state 1 (limited-memory s m))) 
(def dangerous-density (partition p) 
;; Only dangerous if above critical density threshold... 
(and 
(> (average partition (density-est p)) 2.17) 
;; ... and also involving many people. 
(> (summarize partition + (/ 1 p) 0) 300))) 
(def crowd-warning (p range) 
(> (distance-to (= (crowd-tracking p) 
2)) 
range) 
(def safe-navigation (destination p) 
(distance-avoiding-obstacles 
destination (crowd-warning p))) 
18 lines non-whitespace code 
10 library calls (18 ops) 
IF: 3 G: 9 C: 3 T: 2 S: 1
Contributions 
• Composable algebra of building block algorithms 
• Terse enough to prove universal self-stabilization 
• Applicable to a broad range of adaptive 
distributed systems 
Lots of details in our tutorial this afternoon!

More Related Content

PPTX
Build 2017 - B8037 - Explore the next generation of innovative UI in the Visu...
Windows Developer
 
PDF
CNIT 127 Ch 5: Introduction to heap overflows
Sam Bowne
 
PDF
Ch 5: Introduction to heap overflows
Sam Bowne
 
PDF
Yampa AFRP Introduction
ChengHui Weng
 
DOC
bask, bfsk, bpsk
blzz2net
 
DOCX
CellCoverage
Brian Pfeiffer
 
PPTX
R user-group-2011-09
Ted Dunning
 
PPTX
Artificial Neural Networks for Storm Surge Prediction in North Carolina
Anton Bezuglov
 
Build 2017 - B8037 - Explore the next generation of innovative UI in the Visu...
Windows Developer
 
CNIT 127 Ch 5: Introduction to heap overflows
Sam Bowne
 
Ch 5: Introduction to heap overflows
Sam Bowne
 
Yampa AFRP Introduction
ChengHui Weng
 
bask, bfsk, bpsk
blzz2net
 
CellCoverage
Brian Pfeiffer
 
R user-group-2011-09
Ted Dunning
 
Artificial Neural Networks for Storm Surge Prediction in North Carolina
Anton Bezuglov
 

What's hot (20)

PDF
Android Refactoring
Godfrey Nolan
 
PDF
Kim Hammar - Distributed Deep Learning - RISE Learning Machines Meetup
Kim Hammar
 
PDF
SSN-TC workshop talk at ISWC 2015 on Emrooz
Markus Stocker
 
PPT
Network simulator 2
AAKASH S
 
PPT
Network simulator 2
AAKASH S
 
PDF
Adaptive Channel Prediction, Beamforming and Scheduling Design for 5G V2I Net...
T. E. BOGALE
 
PPTX
NTRODUCTION TO COMPUTER PROGRAMMING Loop as repetitive statement,
imtiazalijoono
 
PDF
Fine grained asynchronism for pseudo-spectral codes - with application to tur...
Ganesan Narayanasamy
 
PDF
Q4 2016 GeoTrellis Presentation
Rob Emanuele
 
PDF
LHCb Computing Workshop 2018: PV finding with CNNs
Henry Schreiner
 
ODP
Deep Learning meetup
Ivan Goloskokovic
 
ODP
Hubba Deep Learning
Ivan Goloskokovic
 
PDF
1細胞オミックスのための新GSEA手法
弘毅 露崎
 
PPTX
Tensorflow in practice by Engineer - donghwi cha
Donghwi Cha
 
PPS
Serious Games + Computer Science = Serious CS
Katrin Becker
 
PPTX
General Programming on the GPU - Confoo
SirKetchup
 
DOCX
program on Function overloading in java
One97 Communications Limited
 
PPTX
Fractality of Massive Graphs: Scalable Analysis with Sketch-Based Box-Coverin...
Kenko Nakamura
 
PDF
TensorFlow for HPC?
inside-BigData.com
 
PPTX
AN Intelligent Realtime multiple vessel collision risk assessment system
Syed Ahmad Chan Bukhari, PhD
 
Android Refactoring
Godfrey Nolan
 
Kim Hammar - Distributed Deep Learning - RISE Learning Machines Meetup
Kim Hammar
 
SSN-TC workshop talk at ISWC 2015 on Emrooz
Markus Stocker
 
Network simulator 2
AAKASH S
 
Network simulator 2
AAKASH S
 
Adaptive Channel Prediction, Beamforming and Scheduling Design for 5G V2I Net...
T. E. BOGALE
 
NTRODUCTION TO COMPUTER PROGRAMMING Loop as repetitive statement,
imtiazalijoono
 
Fine grained asynchronism for pseudo-spectral codes - with application to tur...
Ganesan Narayanasamy
 
Q4 2016 GeoTrellis Presentation
Rob Emanuele
 
LHCb Computing Workshop 2018: PV finding with CNNs
Henry Schreiner
 
Deep Learning meetup
Ivan Goloskokovic
 
Hubba Deep Learning
Ivan Goloskokovic
 
1細胞オミックスのための新GSEA手法
弘毅 露崎
 
Tensorflow in practice by Engineer - donghwi cha
Donghwi Cha
 
Serious Games + Computer Science = Serious CS
Katrin Becker
 
General Programming on the GPU - Confoo
SirKetchup
 
program on Function overloading in java
One97 Communications Limited
 
Fractality of Massive Graphs: Scalable Analysis with Sketch-Based Box-Coverin...
Kenko Nakamura
 
TensorFlow for HPC?
inside-BigData.com
 
AN Intelligent Realtime multiple vessel collision risk assessment system
Syed Ahmad Chan Bukhari, PhD
 
Ad

Similar to Building blocks for aggregate programming of self-organising applications (20)

PDF
AWS 클라우드를 통한 쓰나미 연구 사례: 日츄오대 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
PDF
Apache Nemo
NAVER Engineering
 
PPTX
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
Akihiro Hayashi
 
PPTX
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
DataStax
 
PPTX
Real-Time Big Data with Storm, Kafka and GigaSpaces
Oleksii Diagiliev
 
PDF
Monitoring with Prometheus
Shiao-An Yuan
 
PDF
Scafi: Scala with Computational Fields
Roberto Casadei
 
PDF
Big Data and Small Devices by Katharina Morik
BigMine
 
PPTX
The Other HPC: High Productivity Computing
University of Washington
 
PPT
DieHard: Probabilistic Memory Safety for Unsafe Languages
Emery Berger
 
PDF
Programming Actor-based Collective Adaptive Systems
Roberto Casadei
 
PPTX
Seattle Scalability Meetup 6-26-13
specialk29
 
PPTX
Apache Flink Overview at SF Spark and Friends
Stephan Ewen
 
PDF
Chronix as Long-Term Storage for Prometheus
QAware GmbH
 
PDF
Scaling Apache Storm - Strata + Hadoop World 2014
P. Taylor Goetz
 
PDF
The magic behind your Lyft ride prices: A case study on machine learning and ...
Karthik Murugesan
 
PPT
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
PDF
So you think you can stream.pptx
Prakash Chockalingam
 
PDF
Productionizing your Streaming Jobs
Databricks
 
PPTX
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
MongoDB
 
AWS 클라우드를 통한 쓰나미 연구 사례: 日츄오대 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
Apache Nemo
NAVER Engineering
 
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
Akihiro Hayashi
 
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
DataStax
 
Real-Time Big Data with Storm, Kafka and GigaSpaces
Oleksii Diagiliev
 
Monitoring with Prometheus
Shiao-An Yuan
 
Scafi: Scala with Computational Fields
Roberto Casadei
 
Big Data and Small Devices by Katharina Morik
BigMine
 
The Other HPC: High Productivity Computing
University of Washington
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
Emery Berger
 
Programming Actor-based Collective Adaptive Systems
Roberto Casadei
 
Seattle Scalability Meetup 6-26-13
specialk29
 
Apache Flink Overview at SF Spark and Friends
Stephan Ewen
 
Chronix as Long-Term Storage for Prometheus
QAware GmbH
 
Scaling Apache Storm - Strata + Hadoop World 2014
P. Taylor Goetz
 
The magic behind your Lyft ride prices: A case study on machine learning and ...
Karthik Murugesan
 
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
So you think you can stream.pptx
Prakash Chockalingam
 
Productionizing your Streaming Jobs
Databricks
 
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
MongoDB
 
Ad

More from FoCAS Initiative (20)

PDF
Fundamentals of Collective Adaptive Systems Manifesto
FoCAS Initiative
 
PDF
Final FoCAS Newsletter, Issue Eight, Winter 2016
FoCAS Initiative
 
PDF
Optimal Floor Heating
FoCAS Initiative
 
PDF
Advanced Manufacturing: An Industrial Application for Collective Adaptive Sys...
FoCAS Initiative
 
PDF
FoCAS Newsletter Issue Seven
FoCAS Initiative
 
PDF
Wrangling Complex Systems
FoCAS Initiative
 
PDF
Where Shall We Have Lunch? Problems For A Computer-aided Future
FoCAS Initiative
 
PDF
Sustainability Challenges In A Complex World
FoCAS Initiative
 
PDF
On Manipulating Attractors In Collective Behaviours Of Bio-hybrid Societies W...
FoCAS Initiative
 
PDF
The Liquid Computing Paradigm
FoCAS Initiative
 
PDF
Complexity And The Relationship Between Knowledge And Action
FoCAS Initiative
 
PDF
FoCAS Newsletter Issue Six
FoCAS Initiative
 
PDF
FoCAS Newsletter Issue Five
FoCAS Initiative
 
PDF
Temporal logics for multi-agent systems
FoCAS Initiative
 
PDF
Advanced Systems Engineering
FoCAS Initiative
 
PDF
Artificial software diversity: automatic synthesis of program sosies
FoCAS Initiative
 
PDF
Tailored source-code-transformation-synthesize-computationally-diverse-progra...
FoCAS Initiative
 
PDF
Search Diverse Models for Proactive Software Diversification
FoCAS Initiative
 
PDF
Modelling Adaptation Policies As Domain-Specific Constraints
FoCAS Initiative
 
PDF
Quantified NTL
FoCAS Initiative
 
Fundamentals of Collective Adaptive Systems Manifesto
FoCAS Initiative
 
Final FoCAS Newsletter, Issue Eight, Winter 2016
FoCAS Initiative
 
Optimal Floor Heating
FoCAS Initiative
 
Advanced Manufacturing: An Industrial Application for Collective Adaptive Sys...
FoCAS Initiative
 
FoCAS Newsletter Issue Seven
FoCAS Initiative
 
Wrangling Complex Systems
FoCAS Initiative
 
Where Shall We Have Lunch? Problems For A Computer-aided Future
FoCAS Initiative
 
Sustainability Challenges In A Complex World
FoCAS Initiative
 
On Manipulating Attractors In Collective Behaviours Of Bio-hybrid Societies W...
FoCAS Initiative
 
The Liquid Computing Paradigm
FoCAS Initiative
 
Complexity And The Relationship Between Knowledge And Action
FoCAS Initiative
 
FoCAS Newsletter Issue Six
FoCAS Initiative
 
FoCAS Newsletter Issue Five
FoCAS Initiative
 
Temporal logics for multi-agent systems
FoCAS Initiative
 
Advanced Systems Engineering
FoCAS Initiative
 
Artificial software diversity: automatic synthesis of program sosies
FoCAS Initiative
 
Tailored source-code-transformation-synthesize-computationally-diverse-progra...
FoCAS Initiative
 
Search Diverse Models for Proactive Software Diversification
FoCAS Initiative
 
Modelling Adaptation Policies As Domain-Specific Constraints
FoCAS Initiative
 
Quantified NTL
FoCAS Initiative
 

Recently uploaded (20)

PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
The Future of Artificial Intelligence (AI)
Mukul
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 

Building blocks for aggregate programming of self-organising applications

  • 1. Building blocks for aggregate programming of self-organising applications Jacob Beal, Mirko Viroli FoCAS Workshop 8th IEEE SASO September, 2014
  • 2. Goal: Reliable Distributed Adaptive Systems device neighborhood Field-based Computing Models Self-Organization Building Blocks Lots of distributed applications!
  • 3. Example: Services for Mass Events 3
  • 5. Device-Centric Programming Dispersal Advice Congestion-Aware Navigation Dangerous Density Warning Crowd Estimation • Explicit design of adaptation and communication • Complex per-device multi-service application • Intractable to ensure correct behavior
  • 6. Dispersal Advice Dangerous Density Warning Aggregate Programming Congestion-Aware Navigation Crowd Estimation • Implicit adaptation and communication • Code each service independently • Compose via scope and information flow
  • 7. Foundation: Field Calculus Variable Literal Value Local Ops Abstract & Call Functions State Communication Domain Change [Viroli et al., ’13] • Aggregate/local coherence, space-time universal • Too low level, no adaptivity guarantees
  • 8. From Principle to Practice: Applications Distributed Library APIs Building blocks Core Calculus Transparent use of robust distributed algorithms Programmer level: lots of useful, intuitive methods Domain-specific APIs Provable robustness, scalability, composability Provable universality, aggregate/local relation unlimited uses many algorithms 5-20 combinators 5 operators
  • 9. Making a library of building blocks: Time-decay All compositions are self-stabilizing Converge-cast Gradient-path-integral Sparse-choice if
  • 10. Building Block: G Information spreading Field Calculus Implementation: (def G (source initial metric accumulate) (2nd (rep distance-value (tuple infinity initial) (mux source (tuple 0 initial) (min-hood (tuple (+ (1st (nbr distance-value)) (metric)) (accumulate (2nd (nbr distance-value))))))))) Library Examples: (def distance-to (source) (G source 0 nbr-range (fun (v) (+ v (nbr-range))))) (def broadcast (source value) (G source value nbr-range identity))
  • 11. Building Block: C Information collection Field Calculus Implementation: (def C (potential accumulate local null) (rep v local (accumulate local (accumulate-hood accumulate (mux (= (nbr (find-parent potential)) (uid)) (nbr v) null))))) (def find-parent (potential) (mux (< (1st (min-hood (nbr potential))) potential) (2nd (min-hood (nbr (tuple potential (uid))))) NaN)) Library Examples: (def summarize (sink accumulate local null) (broadcast sink (C (distance-to sink) accumulate local null))) (def average (sink value) (/ (summarize sink + value 0) (summarize sink + 1 0)))
  • 12. Building Block: T Time-summarization of information Field Calculus Implementation: (def T (initial decay) (rep v initial (min initial (max 0 (decay v))))) Library Examples: (def timer (length) (T length (fun (t) (- t (dt))))) (def limited-memory (value timeout) (2nd (T (tuple timeout value) 3 1 1 (fun (t) (tuple (- (1st t) (dt)) (2nd t)))))) 4 3 7 3 0 2
  • 13. Building Block: S Choice of sparse subset Field Calculus Implementation: (def S (grain metric) (break-using-uids (random-uid) grain metric)) (def random-uid () (rep v (tuple (rnd 0 1) (uid)) (tuple (1st v) (uid)))) (def break-using-uids (uid grain metric) (= uid (rep lead uid (distance-competition (G (= uid lead) 0 metric (fun (v) (+ v (metric)))) lead uid grain metric)))) (def distance-competition (d lead uid grain metric) (mux (> d grain) uid (mux (>= d (* 0.5 grain)) infinity (min-hood (mux (>= (+ (nbr d) (metric)) (* 0.5 grain)) infinity (nbr lead))))))
  • 14. Building Block: if Restrict scope to subspaces Field Calculus Implementation: (if test true-expression false-expression) Library Examples: (def distance-avoiding-obstacles (source obstacles) (if obstacles infinity (distance-to source))) (def recent-event (event timeout) (if event true (> (timer timeout) 0)))
  • 15. Applying building blocks: Example API algorithms from building blocks: distance-to (source) max-likelihood (source p) broadcast (source value) path-forecast (source obstacle) summarize (sink accumulate local null) average (sink value) integral (sink value) region-max (sink value) timer (length) limited-memory (value timeout) random-voronoi (grain metric) group-size (region) broadcast-region (region source value) recent-event (event timeout) distance-avoiding-obstacles (source obstacles) Since based on these 5 building blocks, all programs built this way are self-stabilizing!
  • 16. Complex Example: Crowd Management (def crowd-tracking (p) ;; Consider only Fruin LoS E or F within last minute (if (recently-true (> (density-est p) 1.08) 60) ;; Use S to break into ‘‘cells’’ and estimate danger of each (+ 1 (dangerous-density (S 30) p)) 0)) (def recently-true (state memory-time) ;; Make sure first state is false, not true... (rt-sub (not (T 1 1)) state memory-time)) (def rt-sub (started s m) (if state 1 (limited-memory s m))) (def dangerous-density (partition p) ;; Only dangerous if above critical density threshold... (and (> (average partition (density-est p)) 2.17) ;; ... and also involving many people. (> (summarize partition + (/ 1 p) 0) 300))) (def crowd-warning (p range) (> (distance-to (= (crowd-tracking p) 2)) range) (def safe-navigation (destination p) (distance-avoiding-obstacles destination (crowd-warning p))) 18 lines non-whitespace code 10 library calls (18 ops) IF: 3 G: 9 C: 3 T: 2 S: 1
  • 17. Contributions • Composable algebra of building block algorithms • Terse enough to prove universal self-stabilization • Applicable to a broad range of adaptive distributed systems Lots of details in our tutorial this afternoon!