SlideShare a Scribd company logo
1 of 28
Download to read offline
BIDIRECTIONAL PROGRAMMING FOR
SELF-ADAPTIVE SOFTWARE
Lionel Montrieux, NII

<lionel@nii.ac.jp>
based on discussions with Sebastian Uchitel (U. of Buenos Aires), Zhenjiang Hu (NII),Tao
Zan (NII, SOKENDAI), Zirun Zhu (NII, SOKENDAI)
TAKE AWAY: BIDIRECTIONAL
PROGRAMS ARE AWESOME,ANDYOU
SHOULD USETHEM.
WHAT IS A
BIDIRECTIONAL
TRANSFORMATION?
get :: Source -> View
put :: Source -> View -> Source
S
S’
V
V’
get
put
[BX]
WHAT IS A WELL-
BEHAVED
BIDIRECTIONAL
TRANSFORMATION?
GetPut: put s (get s) = s
S
S
V
get
put
[BX]
WHAT IS A WELL-
BEHAVED
BIDIRECTIONAL
TRANSFORMATION?
PutGet: get(put s v) = v
S
S’ V
put
get
[BX]
BIDIRECTIONAL PROGRAMS (BIFLUX)
• calendar
• event (work)
• name: Meeting
• date: 9 April 2015, 15:00
• location: room 2005
• notes: prepare slides
• event (private)
• name: Complaint
• date: 9 April 2015, 17:00
• location: pet shop
• notes: dead parrot
• calview
• event (work)
• name: Meeting
• date: 9 April 2015, 15:00
• location: room 2005
[BiFluX, SACMAT]
BIDIRECTIONAL PROGRAMS (BIFLUX)
UPDATE $event IN $source/event BY
MATCH ->
REPLACE $event/starttime WITH $starttime;
REPLACE $event/endtime WITH $endtime;
REPLACE $event/location WITH $location
| UNMATCHV -> CREATE VALUE
<event>
<starttime/>
<endtime/>
<name/>
<note>nothing</note>
<location/>
<private>False</private>
</event>
| UNMATCHS -> DELETE .
FOR VIEW event[$starttime AS v:starttime,
$endtime AS v:endtime, $name AS v:name,
$location AS v:location] IN $view/*
MATCHING SOURCE BY $event/name VIEW BY $name
WHERE private/text() = 'False' [BiFluX, SACMAT]
BIDIRECTIONAL PROGRAMS (BIGUL)
source DTD view DTDBiFluX update
BiFluX
BiGUL updatesource type view type
BiGUL
BX executable
BIDIRECTIONAL PROGRAMS (BIGUL - SRC)
type ApiCalls = [SCall]
type SCall = (SPermissions, (File, (Line, (Protected, Deleted))))
type File = String
type Line = Int
type Deleted = Bool
type Name = String
type SPermissions = [SPermission]
type SPermission = (Name, [ApiVersion])
type Protected = String
type ApiVersion = String
BIDIRECTIONAL PROGRAMS (BIGUL - SRC)
type Calls = [VCall]
type VCall = (File, (Line, VPermissions))
type VPermissions = [VPermission]
type VPermission = Name
BIDIRECTIONAL PROGRAMS (BIGUL - UPD)
t :: MonadError' e m => ApiVersion -> BiGUL m ApiCalls Calls
t ver = Align ((ps, (f, (l, (ptd, del)))) -> return (not del))
((_, (f, (l, _))) (f', (l', _)) -> return (f == f' && l == l'))
(Rearr (RVar `RProd` (RVar `RProd` RVar))
(EDir (DRight (DRight DVar)) `EProd`
(EDir (DLeft DVar) `EProd`
(EDir (DRight (DLeft DVar)) `EProd`
(EConst () `EProd` EConst ()))))
(Update (UVar (Align ((_, vers) -> return (ver `elem` vers))
(_ _ -> return True)
(Rearr RVar (EDir DVar `EProd` EConst ())
(Update (UVar Replace `UProd` UVar Skip)))
(_ -> return ("", [ver]))
(_ -> return Nothing)) `UProd`
(UVar Replace `UProd`
(UVar Replace `UProd`
(UVar Skip `UProd` UVar Skip))))))
(_ -> return ([], ("", (0, ("", False)))))
((ps, (f, (l, (ptd, del)))) -> return (Just (ps, (f, (l, (ptd, True))))))
BP AND SELF-ADAPTATION
Where it can help, and what challenges lie ahead
S
S’
V
V’
get
put
THE NORWEGIAN BLUE, INC.
online pet shop.
APACHE WEB SERVER
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/resting.norwegianblue.com.pem
SSLCertificateKeyFile /etc/ssl/private/resting.norwegianblue.com.key
SSLProtocol TLSv1:TLSv1.1:TLSv1.2
SSLCipherSuite EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH
+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH
+aRSA:!RC4:!aNULL:!eNULL:!LOW :3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!EXPORT:!aECDH:!
EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
<Directory /var/www/norwegianblue>
AllowOverride All
</Directory>
DocumentRoot /var/www/norwegianblue
ServerName resting.norwegianblue.com
</VirtualHost>
POODLE
CVE-2014-3566
Man-in-the-middle attack on SSLv3
SELF-ADAPTATION
Keeping the configuration secure
M A P E
Apache configuration (.conf)CVE DB service apache2 reload
NGINX SERVERserver {
listen 443 ssl;
server_name
stunned.norwegianblue.com;
ssl_certificate /etc/ssl/certs/
stunned.norwegianblue.com.pem;
ssl_certificate_key /etc/ssl/private/
stunned.norwegianblue.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH
+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH
+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH
+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH
+aRSA !RC4 !aNULL !eNULL !LOW !3DES !
MD5 !EXP !PSK !SRP !DSS !EXPORT !
aECDH !EDH-DSS-DES-CBC3-SHA !EDH-RSA-
DES-CBC3-SHA !KRB5-DES-CBC3-SHA";
ssl_dhparam /etc/ssl/dhparams.pem;
# Path to the root of your installation
root /var/www/norwegianblue/;
# set max upload size
client_max_body_size 10G;
fastcgi_buffers 64 4K;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(?:.htaccess|data|config|db_st
deny all;
}
}
AN ABSTRACT LAYER
Bidirectional programming for abstraction and migration
Apache conf Nginx confCVE DB service mgr
Abstract model
M A P E
BXBX
A SMALL MODEL IS A GOOD MODEL
Bidirectional programming to the rescue, again
Abstract layer
M A P E
Abstract SSL layer
BX
THE SMALLERTHE BETTER
Model size may vary at runtime
Abstract layer
M A P E
Abstract SSL layer
BX
MULTIPLE SMALL MODELS
N loops
Abstract layer
SSL
BX
MAPE
Python
BX
MAPE
access
BX
MAPE
SYNCHRONISATION
Straightforward, with bidirectional transformations
Abstract layer
SSL
BX
MAPE
Python
BX
MAPE
access
BX
MAPE
Python’
Abstract layer’
access’
BEYOND SELF-CONFIGURATION
current system vs. desired system
Concrete layer
System
Abstract layer
current state desired stateAWS APIAWS API
BX
DELTA
Bidirectional programs to the rescue, once more!
AWS APIAWS API
BX
Abstract layer
System
Concrete layer
current state
current state
current state
desired state
current state + delta
current state
current state
ASSIGNMENT:
In small groups, find where
bidirectional programs could help
you develop self-adaptive systems
S
S’
V
V’
get
put
REFERENCES
• [BiFluX]: H. Pacheco,T. Zan, and Z. Hu,“BiFluX:A Bidirectional Functional Update
Language for XML,” in 6th International Symposium on Principles and Practice of
Declarative Programming (PPDP 2014), 2014.
• [BX]: S. Fischer, Z. Hu, and H. Pacheco,“‘Putback’ is the Essence of Bidirectional
Programming,” National Institute of Informatics, GRACE-TR 2012-08, Dec. 2012.
• [SACMAT]: L. Montrieux and Z. Hu,“Towards Attribute-Based Authorisation for
Bidirectional Programming,” 2015, pp. 185–196.
IMAGE CREDITS
• Poodle by Marcia O’Connor CC-by-nc 2.0
• Python parrot 3 byTaylorHerring CC-by-nc-nd 2.0

More Related Content

What's hot

5 1. character processing
5 1. character processing5 1. character processing
5 1. character processing
웅식 전
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
Sway Wang
 
Thread介紹
Thread介紹Thread介紹
Thread介紹
Jack Chen
 

What's hot (20)

1
11
1
 
JavaScript @ CTK
JavaScript @ CTKJavaScript @ CTK
JavaScript @ CTK
 
Sol7
Sol7Sol7
Sol7
 
Streams for (Co)Free!
Streams for (Co)Free!Streams for (Co)Free!
Streams for (Co)Free!
 
Diving into HHVM Extensions (Brno PHP Conference 2015)
Diving into HHVM Extensions (Brno PHP Conference 2015)Diving into HHVM Extensions (Brno PHP Conference 2015)
Diving into HHVM Extensions (Brno PHP Conference 2015)
 
Array using recursion
Array using recursionArray using recursion
Array using recursion
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
Groovify your java code by hervé roussel
Groovify your java code by hervé rousselGroovify your java code by hervé roussel
Groovify your java code by hervé roussel
 
5 1. character processing
5 1. character processing5 1. character processing
5 1. character processing
 
Introduction of ES2015
Introduction of ES2015Introduction of ES2015
Introduction of ES2015
 
谈谈Javascript设计
谈谈Javascript设计谈谈Javascript设计
谈谈Javascript设计
 
20151224-games
20151224-games20151224-games
20151224-games
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Tools.cpp
Tools.cppTools.cpp
Tools.cpp
 
The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)
 
The Big Three
The Big ThreeThe Big Three
The Big Three
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
 
Thread介紹
Thread介紹Thread介紹
Thread介紹
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 

Viewers also liked

rbacUML at CodeGeneration 2012
rbacUML at CodeGeneration 2012rbacUML at CodeGeneration 2012
rbacUML at CodeGeneration 2012
Lionel Montrieux
 
Open University CRC Students conference 2010
Open University CRC Students conference 2010Open University CRC Students conference 2010
Open University CRC Students conference 2010
Lionel Montrieux
 
Hayley Newsome CV Current
Hayley Newsome CV CurrentHayley Newsome CV Current
Hayley Newsome CV Current
Hayley Newsome
 

Viewers also liked (18)

The Three Steps to Brand Building
The Three Steps to Brand BuildingThe Three Steps to Brand Building
The Three Steps to Brand Building
 
Functional foods 6 trends
Functional foods 6 trendsFunctional foods 6 trends
Functional foods 6 trends
 
rbacUML at CodeGeneration 2012
rbacUML at CodeGeneration 2012rbacUML at CodeGeneration 2012
rbacUML at CodeGeneration 2012
 
Security Analysis for Evolvable Software
Security Analysis for Evolvable SoftwareSecurity Analysis for Evolvable Software
Security Analysis for Evolvable Software
 
Open University CRC Students conference 2010
Open University CRC Students conference 2010Open University CRC Students conference 2010
Open University CRC Students conference 2010
 
물뽕 『 W3.ow.to 』 톡 w2015 ♡ 물뽕판매,물뽕 약효,물뽕 구입처,물뽕 구매처,물뽕 파는곳
물뽕 『 W3.ow.to  』 톡 w2015 ♡ 물뽕판매,물뽕 약효,물뽕 구입처,물뽕 구매처,물뽕 파는곳물뽕 『 W3.ow.to  』 톡 w2015 ♡ 물뽕판매,물뽕 약효,물뽕 구입처,물뽕 구매처,물뽕 파는곳
물뽕 『 W3.ow.to 』 톡 w2015 ♡ 물뽕판매,물뽕 약효,물뽕 구입처,물뽕 구매처,물뽕 파는곳
 
Gmail Login Sign in Help
Gmail Login Sign in HelpGmail Login Sign in Help
Gmail Login Sign in Help
 
Reusable Self-Adaptation through Bidirectional Programming
Reusable Self-Adaptation through Bidirectional ProgrammingReusable Self-Adaptation through Bidirectional Programming
Reusable Self-Adaptation through Bidirectional Programming
 
BRF+ Walk through
BRF+ Walk throughBRF+ Walk through
BRF+ Walk through
 
CV of Mashudu Khorombi
CV of Mashudu Khorombi CV of Mashudu Khorombi
CV of Mashudu Khorombi
 
Nemus Investor Presentation Feb 2017
Nemus Investor Presentation Feb 2017 Nemus Investor Presentation Feb 2017
Nemus Investor Presentation Feb 2017
 
Plan clase
Plan clasePlan clase
Plan clase
 
Juegos de simulación
Juegos de simulaciónJuegos de simulación
Juegos de simulación
 
David J Whipple
David J WhippleDavid J Whipple
David J Whipple
 
Hayley Newsome CV Current
Hayley Newsome CV CurrentHayley Newsome CV Current
Hayley Newsome CV Current
 
La flauta mágica
La flauta mágicaLa flauta mágica
La flauta mágica
 
Ambiente
AmbienteAmbiente
Ambiente
 
Bioelementos
BioelementosBioelementos
Bioelementos
 

Similar to Bidirectional Programming for Self-adaptive Software

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
Edward Capriolo
 

Similar to Bidirectional Programming for Self-adaptive Software (20)

The never changing face of immutability
The never changing face of immutabilityThe never changing face of immutability
The never changing face of immutability
 
Building a DSL with GraalVM (CodeOne)
Building a DSL with GraalVM (CodeOne)Building a DSL with GraalVM (CodeOne)
Building a DSL with GraalVM (CodeOne)
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Introduction to Domain-Driven Design
Introduction to Domain-Driven DesignIntroduction to Domain-Driven Design
Introduction to Domain-Driven Design
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
JIP Pipeline System Introduction
JIP Pipeline System IntroductionJIP Pipeline System Introduction
JIP Pipeline System Introduction
 
libuv, NodeJS and everything in between
libuv, NodeJS and everything in betweenlibuv, NodeJS and everything in between
libuv, NodeJS and everything in between
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
 
Working With a Real-World Dataset in Neo4j: Import and Modeling
Working With a Real-World Dataset in Neo4j: Import and ModelingWorking With a Real-World Dataset in Neo4j: Import and Modeling
Working With a Real-World Dataset in Neo4j: Import and Modeling
 
dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
 
Powershell for Log Analysis and Data Crunching
 Powershell for Log Analysis and Data Crunching Powershell for Log Analysis and Data Crunching
Powershell for Log Analysis and Data Crunching
 
Drinking from the Elixir Fountain of Resilience
Drinking from the Elixir Fountain of ResilienceDrinking from the Elixir Fountain of Resilience
Drinking from the Elixir Fountain of Resilience
 
Writing Redis in Python with asyncio
Writing Redis in Python with asyncioWriting Redis in Python with asyncio
Writing Redis in Python with asyncio
 
Is writing performant code too expensive?
Is writing performant code too expensive? Is writing performant code too expensive?
Is writing performant code too expensive?
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Bidirectional Programming for Self-adaptive Software

  • 1. BIDIRECTIONAL PROGRAMMING FOR SELF-ADAPTIVE SOFTWARE Lionel Montrieux, NII
 <lionel@nii.ac.jp> based on discussions with Sebastian Uchitel (U. of Buenos Aires), Zhenjiang Hu (NII),Tao Zan (NII, SOKENDAI), Zirun Zhu (NII, SOKENDAI)
  • 2. TAKE AWAY: BIDIRECTIONAL PROGRAMS ARE AWESOME,ANDYOU SHOULD USETHEM.
  • 3. WHAT IS A BIDIRECTIONAL TRANSFORMATION? get :: Source -> View put :: Source -> View -> Source S S’ V V’ get put [BX]
  • 4. WHAT IS A WELL- BEHAVED BIDIRECTIONAL TRANSFORMATION? GetPut: put s (get s) = s S S V get put [BX]
  • 5. WHAT IS A WELL- BEHAVED BIDIRECTIONAL TRANSFORMATION? PutGet: get(put s v) = v S S’ V put get [BX]
  • 6. BIDIRECTIONAL PROGRAMS (BIFLUX) • calendar • event (work) • name: Meeting • date: 9 April 2015, 15:00 • location: room 2005 • notes: prepare slides • event (private) • name: Complaint • date: 9 April 2015, 17:00 • location: pet shop • notes: dead parrot • calview • event (work) • name: Meeting • date: 9 April 2015, 15:00 • location: room 2005 [BiFluX, SACMAT]
  • 7. BIDIRECTIONAL PROGRAMS (BIFLUX) UPDATE $event IN $source/event BY MATCH -> REPLACE $event/starttime WITH $starttime; REPLACE $event/endtime WITH $endtime; REPLACE $event/location WITH $location | UNMATCHV -> CREATE VALUE <event> <starttime/> <endtime/> <name/> <note>nothing</note> <location/> <private>False</private> </event> | UNMATCHS -> DELETE . FOR VIEW event[$starttime AS v:starttime, $endtime AS v:endtime, $name AS v:name, $location AS v:location] IN $view/* MATCHING SOURCE BY $event/name VIEW BY $name WHERE private/text() = 'False' [BiFluX, SACMAT]
  • 8. BIDIRECTIONAL PROGRAMS (BIGUL) source DTD view DTDBiFluX update BiFluX BiGUL updatesource type view type BiGUL BX executable
  • 9. BIDIRECTIONAL PROGRAMS (BIGUL - SRC) type ApiCalls = [SCall] type SCall = (SPermissions, (File, (Line, (Protected, Deleted)))) type File = String type Line = Int type Deleted = Bool type Name = String type SPermissions = [SPermission] type SPermission = (Name, [ApiVersion]) type Protected = String type ApiVersion = String
  • 10. BIDIRECTIONAL PROGRAMS (BIGUL - SRC) type Calls = [VCall] type VCall = (File, (Line, VPermissions)) type VPermissions = [VPermission] type VPermission = Name
  • 11. BIDIRECTIONAL PROGRAMS (BIGUL - UPD) t :: MonadError' e m => ApiVersion -> BiGUL m ApiCalls Calls t ver = Align ((ps, (f, (l, (ptd, del)))) -> return (not del)) ((_, (f, (l, _))) (f', (l', _)) -> return (f == f' && l == l')) (Rearr (RVar `RProd` (RVar `RProd` RVar)) (EDir (DRight (DRight DVar)) `EProd` (EDir (DLeft DVar) `EProd` (EDir (DRight (DLeft DVar)) `EProd` (EConst () `EProd` EConst ())))) (Update (UVar (Align ((_, vers) -> return (ver `elem` vers)) (_ _ -> return True) (Rearr RVar (EDir DVar `EProd` EConst ()) (Update (UVar Replace `UProd` UVar Skip))) (_ -> return ("", [ver])) (_ -> return Nothing)) `UProd` (UVar Replace `UProd` (UVar Replace `UProd` (UVar Skip `UProd` UVar Skip)))))) (_ -> return ([], ("", (0, ("", False))))) ((ps, (f, (l, (ptd, del)))) -> return (Just (ps, (f, (l, (ptd, True))))))
  • 12. BP AND SELF-ADAPTATION Where it can help, and what challenges lie ahead S S’ V V’ get put
  • 13. THE NORWEGIAN BLUE, INC. online pet shop.
  • 14. APACHE WEB SERVER <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/resting.norwegianblue.com.pem SSLCertificateKeyFile /etc/ssl/private/resting.norwegianblue.com.key SSLProtocol TLSv1:TLSv1.1:TLSv1.2 SSLCipherSuite EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH +ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH +aRSA:!RC4:!aNULL:!eNULL:!LOW :3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!EXPORT:!aECDH:! EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA <Directory /var/www/norwegianblue> AllowOverride All </Directory> DocumentRoot /var/www/norwegianblue ServerName resting.norwegianblue.com </VirtualHost>
  • 16. SELF-ADAPTATION Keeping the configuration secure M A P E Apache configuration (.conf)CVE DB service apache2 reload
  • 17. NGINX SERVERserver { listen 443 ssl; server_name stunned.norwegianblue.com; ssl_certificate /etc/ssl/certs/ stunned.norwegianblue.com.pem; ssl_certificate_key /etc/ssl/private/ stunned.norwegianblue.com.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+ECDSA+AESGCM EECDH +aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH +ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH +aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH +aRSA !RC4 !aNULL !eNULL !LOW !3DES ! MD5 !EXP !PSK !SRP !DSS !EXPORT ! aECDH !EDH-DSS-DES-CBC3-SHA !EDH-RSA- DES-CBC3-SHA !KRB5-DES-CBC3-SHA"; ssl_dhparam /etc/ssl/dhparams.pem; # Path to the root of your installation root /var/www/norwegianblue/; # set max upload size client_max_body_size 10G; fastcgi_buffers 64 4K; location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ ^/(?:.htaccess|data|config|db_st deny all; } }
  • 18. AN ABSTRACT LAYER Bidirectional programming for abstraction and migration Apache conf Nginx confCVE DB service mgr Abstract model M A P E BXBX
  • 19. A SMALL MODEL IS A GOOD MODEL Bidirectional programming to the rescue, again Abstract layer M A P E Abstract SSL layer BX
  • 20. THE SMALLERTHE BETTER Model size may vary at runtime Abstract layer M A P E Abstract SSL layer BX
  • 21. MULTIPLE SMALL MODELS N loops Abstract layer SSL BX MAPE Python BX MAPE access BX MAPE
  • 22. SYNCHRONISATION Straightforward, with bidirectional transformations Abstract layer SSL BX MAPE Python BX MAPE access BX MAPE Python’ Abstract layer’ access’
  • 23. BEYOND SELF-CONFIGURATION current system vs. desired system Concrete layer System Abstract layer current state desired stateAWS APIAWS API BX
  • 24. DELTA Bidirectional programs to the rescue, once more! AWS APIAWS API BX Abstract layer System Concrete layer current state current state current state desired state current state + delta current state current state
  • 25. ASSIGNMENT: In small groups, find where bidirectional programs could help you develop self-adaptive systems
  • 27. REFERENCES • [BiFluX]: H. Pacheco,T. Zan, and Z. Hu,“BiFluX:A Bidirectional Functional Update Language for XML,” in 6th International Symposium on Principles and Practice of Declarative Programming (PPDP 2014), 2014. • [BX]: S. Fischer, Z. Hu, and H. Pacheco,“‘Putback’ is the Essence of Bidirectional Programming,” National Institute of Informatics, GRACE-TR 2012-08, Dec. 2012. • [SACMAT]: L. Montrieux and Z. Hu,“Towards Attribute-Based Authorisation for Bidirectional Programming,” 2015, pp. 185–196.
  • 28. IMAGE CREDITS • Poodle by Marcia O’Connor CC-by-nc 2.0 • Python parrot 3 byTaylorHerring CC-by-nc-nd 2.0