informatics education: hopes or hypes or ubiquitous ...computer science is notinformatics hussein...

112
Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it! Hussein Zedan c Software Technology Research Laboratory (STRL) August 24, 2011 Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computi

Upload: others

Post on 25-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics Education: Hopes or HypesOR

Ubiquitous computing will empower us, ONLY ifwe understand it!

Hussein Zedan

c©Software Technology Research Laboratory (STRL)

August 24, 2011

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 2: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics - The discipline I

Informatics is a multi-disciplinary activity that requires thetalent and expertise of various disciplines in a rather unifiedand integrated fashion: Computational Science, Engineering,Psychology, Sociology and Domain Experts (e.g., Biologist,Chemist, Physicist, Mathematician, Space Scientist CivilEngineer, Archaeologist, etc.).

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 3: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics - The discipline II

Computer Science fundamentally concentrates on the theoryand the basics/fundamentals of computations.

Basics titles include Programming Paradigms, Specification,Verification, Logics and Semantics and systems andapplications, such as Operating Systems, Compilers,Databases, Networking, Communication Protocols .

The spectrum varies from the highly theoretical to the highlypractical.

Computer Science is not Informatics

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 4: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics - The discipline III

Software Engineering deals with the process and theengineering of building the artifact.

This involves also standards .

We find topics such as, Testing, Requirements, Validation,Certification, Maintenance, Management, Risk, etc.

Software Engineering is not Informatics

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 5: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics - The discipline IV

Information Systems focuses on the totality and holisticnature of the artifact: what it is, who it is for and how .

We find topics such as, Requirements, Methodologies,Analysis, etc.

Information Systems is not Informatics

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 6: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics - The discipline V

Unlike those disciplines, Informatics is all of the above but inaddition, domains play fundamental and crucial part in itstreatment.

We can see that in the proliferation of the X-Informaticssubjects: for example, Bio-informatics, Health-informatics,Space-informatics, etc.

Even those X-Informatics subjects, only utilises electroniccomputation techniques to solve their problems.

However, domains bring extra models which need to beintegrated with that of the electronic computation.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 7: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics and Ubiquity - I

Populations of computing entities will be a significant part ofour environment, performing tasks that support us, and weshall be largely unaware of them. (Mark Weiser, 1994)

In the next five to ten years the computer will be erased fromour consciousness. We will simply not talk about it anylonger, we will not read about it, apart from experts of course.(Joseph Weizenbaum (2001)

Ubiquitous (Informatics) computing will empower us, ifwe understand it. (Robin Milner (2008) )

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 8: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Informatics and Ubiquity - II

Informatics is the study of the structure, the behaviour, andthe interactions of natural and engineered computationalsystems. (INFO, Edinbrugh)

The central focus of Informatics is the transformation ofinformation - whether by electronic computation orcommunication, whether by organisms or artefacts.Understanding informational phenomena - such ascomputation, cognition, and communication - enablestechnological advances.

Informatic, as a discipline, should be treated asUbiquitous Computing

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 9: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Qualities of an informatics system

What is new about an informatics system?

It will continually make decisions hitherto made by us

It will be vast, maybe 100 times todays systems

It must continually adapt, on-line, to new requirements

Individual system will interact with one another

Can traditional software engineering cope?

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 10: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

An Informatics Model I

Entities in a model explain, or are realised by, entities in thephysical world (as in natural science).

Just as we say that Newtons laws explain the movement ofbodies with mass, so we can say in informatics that a modelconsisting of programs and their meaning explains the realityof computers and what their screens display.

What distinguishes the science of informatics is that itsartifacts demand explanation at many levels.

ENTITIES: PROGRAMSrealised by→ COMPUTERS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 11: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

An informatics Model II

Entities and Behaviour in a model explain, or are realised by,entities in the physical worldas in natural science.

ENTITIES:

PROGRAMSrealised by→ COMPUTERS

BEHAVIOUR:

actions on memory, i/orealised by→ keyboard & screen events

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 12: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Layered informatics models with behaviour I

Entities and Behaviour in a model explain, or are realised by,entities in the physical worldas in natural science, or in a lowermodel .

ENTITIES:LOGICAL FORMULAS

specify→ PROGRAMS → ASSEBLY CODE→ HARDWARE DESIGN

realised by→ COMPUTERS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 13: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

BEHAVIOUR:valuation set & predicates → action on memory, i/o → actionon memory, i/o → voltage, bitmaps, switches → keyboard &screen events

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 14: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Combining models I

Real systems combine interacting sub-systems; we must alsocombine partial models.

Thus, combine models of the electro-mechanical andinformatic parts of an aircraft:

ELECTRO-MECH DESIGNrealised by→ PHYSICAL AIRCRAFT

‖EMBEDDED SOFTWARE

realised by→ EMBEDDED COMPUTERS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 15: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Combining models II

Real systems combine interacting sub-systems; we must alsocombine partial models. Also, combine models of artifactualand natural systems .

METEO-MODELexplains→ WEATHER

‖ELECTRO-MECH DESIGN

realised by→ PHYSICAL AIRCRAFT‖

EMBEDDED SOFTWARErealised by→ EMBEDDED COMPUTERS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 16: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Combining models II

For a program, we may combine different explanatorymodels .

INRIA did this for the Airbus using abstract interpretation,following successful analysis of the failure of the Ariane-5rocket:

METEO-MODELexplains→ WEATHER

‖ELECTRO-MECH DESIGN

realised by→ PHYSICAL AIRCRAFT‖

A1explains→ EMBEDDED SOFTWARE

realised by→ EMBEDDEDCOMPUTERS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 17: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Models and their pyramids

A model consists of some entities, and their behaviour.

EXAMPLE: flowcharts, and how to execute them.

A pyramid of models is built by explanation and combination :

Model A explains model B if

A abstracts from or specifies B, or ifB implements or realises A.

EXAMPLE: a specification logic specifies programs.

Model C combines models A and B if

its entities and behaviours combine those of A and B.

EXAMPLE: combine distributed programs with a networkmodel.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 18: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

How do we validate an explanation?

Natural science:

Explanation of reality by a model can only be supported byobservation. Complete validation impossible (Karl Popper).

Informatics at lowest level:

Similar (e,g. realisation of circuit diagrams by a computer).

Informatics at higher levels:

Higher levels abound in the model pyramid. Can aspire tocomplete validation between precise models.

PROPOSITION: Informatics is a science just to the extentthat it aspires to complete validation.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 19: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Scientific status of the Pyramid of Models

Useful models, and validations, may well be informal

Different models suit different people, including non-experts

Many instances of models and validations exist

Can we derive languages from models , not vice-versa?

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 20: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Concepts for Informatics

Each informatics domain, hence each model, will involve severalconcepts. Here are a few:

locality security authenticity compilation intentions reflectivityspecification beliefs encapsulation delegation provenanceobligations data-protection continuous time role policyauthorisation verification connectivity continuous space

simulation mobility failure self-management negotiation truststochastics

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 21: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

locality security authenticity compilation intentions reflectivityspecification beliefs encapsulation delegation provenanceobligations data-protection continuous time role policyauthorisation verification connectivity continuous space

simulation mobility failure self-management negotiation truststochastics

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 22: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Topics and Laboratories for Informatics

Mixed models

Model Integration and/or linkage

Engineering aspects

Verification and Validation

Language design and cross compilation

Labs include: civil eng, space science, bio-medicine, health, etc

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 23: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

A Caculus ofContext-aware Ambients

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 24: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

What is CCA?

CCA stands for Calculus of Context-aware Ambients.

It is a process calculus for modelling and reasoning about thebehaviours of context-aware and mobile concurrent systems.

A process calculus is a formalism for the high-level descriptionof interactions, communications, and synchronizationsbetween a collection of independent processes.

CCA is developed in an effort of providing a suitable formalismfor modelling interactions and context-awareness in pervasivesystems.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 25: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Why CCA?

To provide a process calculus where mobility andcontext-awareness are first-class citizens.

To provide a formal notation for high-level description ofmobile and context-aware concurrent systems.

To enable formal reasoning about the properties ofcontext-aware systems.

To help understanding the behaviour of mobile andcontext-aware concurrent systems throughsimulation/animation.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 26: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Other Related Process Calculi

π-calculus (Milner et al., 1992)

Milner(1992). A calculus of mobile processes. Information andComputation 100 (100): 1–40http://en.wikipedia.org/wiki/Pi-calculus

Ambient Calculus (Cardelli & Gordon, 2000)

Cardelli, L., Gordon, A. (2000). Mobile Ambients. TheoreticalComputer Science 240, 1777–213.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 27: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Other Related Process Calculi (cont’d)

Bigraphs (Milner, 2006)

Milner, R. (2006). Pure bigraphs: structure and dynamics.Information and Computation 204(1):60–122.http://www.itu.dk/research/pls/wiki/index.php/A Brief Introduction To Bigraphs

Calculus for Context-Awareness (Zimmer 2005, Bucur 2008)

Zimmer, P. (2005). A Calculus for Context-awareness. Tech.Rep., BRICS.Bucur, D. Nielsen, M. (2008). Secure Data Flow in a Calculusfor Context Awareness. Lecture Notes in Computer ScienceVol. 5065. Springer, PP. 439–456.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 28: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Main Features of CCA

A single concept, ambient, to model any entity of a UbiComsystem: users, devices, location, sensors, buildings and so on.

Mobility a la Ambient Calculus:

ambients can be mobile, e.g. a user, a robot or a car.

A modal logic for context specification

Context-awareness/-adaptation: two mechanisms

context guarded capabilitiesprocess abstraction/call

A theory of contextual equivalence to establish whether twocontext-aware systems are equivalent.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 29: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Syntax of CCA

3 main syntactic categories:

Processes: which denote a compuation

Capabilities: which are elementary actions a process canperform

Context expression: which is a formula expressing someproperty of a process’ context.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 30: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Syntax of Processes and Capabilities

P,Q ::= Process0 inactivityn[P] ambient(νn) P restrictionP|Q composition!P replication

inherited fromAmbient Calculus

κ?M.P context-guarded capabilityx . (y).P process abstraction x

M ::= in n | out | del n | α x〈z〉 | α (y) | α 〈z〉 capabilities

α ::= ↑ | n ↑ | ↓ | n↓ | :: | n :: | ε locations

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 31: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Syntax of Processes and Capabilities

P,Q ::= Process0 inactivityn[P] ambient(νn) P restrictionP|Q composition!P replication

inherited fromAmbient Calculus

κ?M.P context-guarded capabilityx . (y).P process abstraction x

M ::= in n | out | del n | α x〈z〉 | α (y) | α 〈z〉 capabilities

α ::= ↑ | n ↑ | ↓ | n↓ | :: | n :: | ε locations

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 32: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Syntax of Processes and Capabilities

P,Q ::= Process0 inactivityn[P] ambient(νn) P restrictionP|Q composition!P replication

inherited fromAmbient Calculus

κ?M.P context-guarded capabilityx . (y).P process abstraction x

M ::= in n | out | del n | α x〈z〉 | α (y) | α 〈z〉 capabilities

α ::= ↑ | n ↑ | ↓ | n↓ | :: | n :: | ε locations

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 33: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Inactive Process

The inactive process or null process 0

does nothing

terminates immediately

is the unit element for the parallel composition of processes,i.e.

0 | P ≡ P | 0 ≡ P

where the symbol ‘≡’ means ‘equivalent’.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 34: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Parallel Composition of Processes

P | Q

means that the process P and the process Q executeconcurrently

we also say P and Q execute in parallel

i.e. P and Q execute at the same time

during their execution, P and Q can communicate by messagepassing

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 35: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Parallel Composition of Processes

Properties of parallel composition of processes

0 is the unit element

0 | P ≡ P | 0 ≡ P

CommutativeP | Q ≡ Q | P

Associative

P | (Q | R) ≡ (P | Q) | R ≡ P | Q | R

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 36: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Replication !P

!P denotes a process which can always creates a new copy ofP

!P ≡ P | !P

Is used to model iteration and recursion

First introduced by Milner (1999) in the π-Calculus

Examples:

This process always send the value 2:

!〈2〉.0

This process always prompts to receive a message and thensimply forwards the received message:

!(x).〈x〉.0

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 37: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Restriction (νn) P

The restriction (νn) P

states that the scope of the name n is limited to the processP.

So the name n cannot be referred to outside P.

Similar to the declaration of local variables in programminglanguages.

Also use to hide the name n in P so that no other process can‘see’ it.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 38: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

What is an ambient?

An ambient

is a bounded place in which computation take place

has a name, a boundary and can be nested inside an otherambient

can be mobile

first introduce by Cardelli and Gordon (2000) in their AmbientCalclus

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 39: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Syntax of ambient

Textual:n[P]

where n is the ambient’s name and P is a computation(process) describing the behaviour of this ambient.

Graphicaln

P

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 40: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Modelling with ambients: smart devices and users

A smart mobile phone device can be modelled as an ambient:

phone[P]

where P encompasses the fonctionalities of the smart phone.

the user, bob, carrying the phone can also be modelled as anambient:

bob[phone[P] | Q]

Q here characterises the behaviour of the user, bob, includingthe user (implicit) interactions with the phone.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 41: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Modelling with ambients: smart devices and users

So, Bob carrying a phone is modelled as

bob[phone[P] | Q]

Graphically it looks like this:

bob

phone

PQ

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 42: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Modelling with ambients: smart devices and users

Bob might carry more than one device: a phone and a PDA

bob[phone[P] | pda[R] | Q]

Graphically it looks like this:

bob

phone

P

pda

RQ

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 43: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Modelling with ambients: user’s location

The location of the user can be modelled as an ambient

E.g. Bob is carrying a phone at the conference room

conf [bob[phone[P] | Q] | R]

Graphically it looks like this:

conf

bob

phone

PQ R

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 44: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Modelling with ambients: user is with an other person

Bob is with Alice at the conference room, Bob carrying amobile phone while Alice holding a PDA

conf [bob[phone[P] | Q] | alice[pda[R] | S ]]

Graphically it looks like this:

conf

bob

phone

PQ

alice

pda

RS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 45: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Modelling with ambients: user/device enviroment

the conference room is next to the reception room

Bob is at the conference room , carrying a mobile phone

Alice is at the reception room , carrying a pda

conf [bob[phone[P] | Q]] | recept[alice[pda[R] | S ]]

Graphically it looks like this:

conf

bob

phone

PQ

recept

alice

pda

RS

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 46: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Mobility Primitives

Two mobility capabilities: in and out

in m: allows an ambient to move into a sibling ambient m

n

in m.P

m

Qderives into

m

n

PQ

The corresponding reduction rule

n[in m.P] | m[Q] −→ m[n[P] | Q]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 47: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Mobility Primitives

Two mobility capabilities: in and out

in m: allows an ambient to move into a sibling ambient m

n

in m.P

m

Qderives into

m

n

PQ

The corresponding reduction rule

n[in m.P] | m[Q] −→ m[n[P] | Q]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 48: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Mobility Primitives

out: allows an ambient to move out of its parent

m

n

out.PQ

derives into

n

P

m

Q

The corresponding reduction rule

m[n[out.P] | Q] −→ n[P] | m[Q]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 49: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Mobility Primitives

out: allows an ambient to move out of its parent

m

n

out.PQ

derives into

n

P

m

Q

The corresponding reduction rule

m[n[out.P] | Q] −→ n[P] | m[Q]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 50: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Mobility Primitives: Examples

Agent ag moves into computer win.

ag [in win.out.0] | win[0] → win[ag [out.0]]

Agent ag exits computer win.

win[ag [out.0]] → ag [0] | win[0]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 51: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Mobility Primitives: Examples

Agent ag moves into computer win.

ag [in win.out.0] | win[0] → win[ag [out.0]]

Agent ag exits computer win.

win[ag [out.0]] → ag [0] | win[0]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 52: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Message passing communication: one process (the sender)sends a message and another one (the receiver) receives it.

Sender : 〈y〉.PReceiver : (x).Q

The reduction rule for message passing is

〈y〉.P | (x).Q −→ P | Q{x ← y}

where Q{x ← y} denotes the substitution of y for each freeoccurrence of x in Q.

Example

〈n〉.0 | (x).x [0] −→ n[0]〈5〉.0 | (x).print〈x〉.0 −→ print〈5〉.0

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 53: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Communication can be synchronous or asynchronous

Synchronous communication: both the sender and thereceiver wait for each other

Sender : 〈2〉.PReceiver : (x).Q

Asynchronous communication: the sender does not wait forthe communication to take place.

Sender : 〈2〉.0 | PReceiver : (x).Q

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 54: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Capabilities to send a message:

〈a〉: capability to send a message a to self

n ↑ 〈a〉: capability to send a message a to the parent ambientn

↑ 〈a〉: capability to send a message a to any parent ambient

n ↓ 〈a〉: capability to send a message a to the child ambient n

↓ 〈a〉: capability to send a message a to any child ambient

n :: 〈a〉: capability to send a message a to the sibling ambientn

:: 〈a〉: capability to send a message a to any sibling ambient

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 55: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Capabilities to receive a message:

(a): capability to receive a message a from self

n ↑ (a): capability to receive a message a from the parentambient n

↑ (a): capability to receive a message a from any parentambient

n ↓ (a): capability to receive a message a from the childambient n

↓ (a): capability to receive a message a from any childambient

n :: (a): capability to send receive a message a from thesibling ambient n

:: (a): capability to receive a message a from any siblingambient

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 56: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Self communication:

n

〈a〉.P | (x).Qderives into

n

P | Q{x ← a}

The corresponding reduction rule

n[〈a〉.P | (x).Q] −→ n[P | Q{x ← a}]

Example

n[〈5〉.0 | (x).print〈x〉.0] −→ n[print〈5〉.0]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 57: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Self communication:

n

〈a〉.P | (x).Qderives into

n

P | Q{x ← a}

The corresponding reduction rule

n[〈a〉.P | (x).Q] −→ n[P | Q{x ← a}]

Example

n[〈5〉.0 | (x).print〈x〉.0] −→ n[print〈5〉.0]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 58: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Child-parent communication:

m

n

m ↑ 〈a〉.P n ↓ (x).Qderives into

m

n

PQ{x ← a}

The corresponding reduction rule

m[n[m ↑ 〈a〉.P] | n ↓ (x).Q] −→ m[n[P] | Q{x ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 59: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Child-parent communication:

m

n

m ↑ 〈a〉.P n ↓ (x).Qderives into

m

n

PQ{x ← a}

The corresponding reduction rule

m[n[m ↑ 〈a〉.P] | n ↓ (x).Q] −→ m[n[P] | Q{x ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 60: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Sibling-sibling communication:

n

m :: 〈a〉.P

m

n :: (x).Qderives into

n

P

m

Q{x ← a}

The corresponding reduction rule

n[m :: 〈a〉.P] | m[n :: (x).Q] −→ n[P] | m[Q{x ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 61: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives

Sibling-sibling communication:

n

m :: 〈a〉.P

m

n :: (x).Qderives into

n

P

m

Q{x ← a}

The corresponding reduction rule

n[m :: 〈a〉.P] | m[n :: (x).Q] −→ n[P] | m[Q{x ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 62: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Communication Primitives: Exercises

See the full semantics of communication primitives in thepaper intitled “The calculus of Context-aware Ambients”available on Blackboard.

Specify a simple Switch device with a single input port andfour output ports connected to specific devices.

Specify a simple Server that receives service requests fromclients, invokes the requested services and send the results tocorresponding clients.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 63: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call

A process abstraction links a name x to a process P usingthe syntax:

x . (y1, y2, . . . , yn).P

where y1, y2, . . . , yn are formal parameters.

A process call invokes a process abstraction x using thesyntax:

αx〈z1, z2, . . . , zn〉.

where z1, z2, . . . , zn are actual parameters and α indicates thelocation of the process abstraction called and is defined asfollows:

α ::=↑ | n ↑ | ↓ | n↓ | :: | n :: | ε

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 64: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Local process call

n

x . (y).P |x〈a〉

derives into

n

x . (y).P |P{y ← a}

The corresponding reduction rule

n[x . (y).P | x〈a〉] −→ n[x . (y).P | P{y ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 65: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Local process call

n

x . (y).P |x〈a〉

derives into

n

x . (y).P |P{y ← a}

The corresponding reduction rule

n[x . (y).P | x〈a〉] −→ n[x . (y).P | P{y ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 66: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Calling a process abstraction defined in a child ambient

m

n

x . (y).Pn ↓ x〈a〉 derives into

m

n

x . (y).PP{y ← a}

The corresponding reduction rule

m[n[x . (y).P] | n ↓ x〈a〉] −→ m[n[x . (y).P] | P{y ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 67: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Calling a process abstraction defined in a child ambient

m

n

x . (y).Pn ↓ x〈a〉 derives into

m

n

x . (y).PP{y ← a}

The corresponding reduction rule

m[n[x . (y).P] | n ↓ x〈a〉] −→ m[n[x . (y).P] | P{y ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 68: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Calling a process abstraction defined in a child ambient

m

n

m ↑ x〈a〉 x . (y).Pderives into

m

n

P{y ← a} x . (y).P

The corresponding reduction rule

m[n[m ↑ x〈a〉] | x . (y).P] −→ m[n[P{y ← a}] | x . (y).P]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 69: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Calling a process abstraction defined in a child ambient

m

n

m ↑ x〈a〉 x . (y).Pderives into

m

n

P{y ← a} x . (y).P

The corresponding reduction rule

m[n[m ↑ x〈a〉] | x . (y).P] −→ m[n[P{y ← a}] | x . (y).P]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 70: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Calling a process abstraction defined in a sibling ambient

n

x . (y).P

m

n :: x〈a〉 derives into

n

x . (y).P

m

P{y ← a}

The corresponding reduction rule

n[x . (y).P] |m[n :: x〈a〉] −→ n[x . (y).P] |m[P{y ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 71: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Semantics

Calling a process abstraction defined in a sibling ambient

n

x . (y).P

m

n :: x〈a〉 derives into

n

x . (y).P

m

P{y ← a}

The corresponding reduction rule

n[x . (y).P] |m[n :: x〈a〉] −→ n[x . (y).P] |m[P{y ← a}]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 72: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Example

Context Provision using Process Abstraction

User preferences, Available services, Device configuration

My favourite text editor on Windows is notepad

win[edit . (file).notepad〈file〉.0]

My favourite text editor on Linux is emacs

lin[edit . (file).emacs〈file〉.0]

A Context-aware file editing agent can be specified as

ag [↑edit〈doc.txt〉.0]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 73: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Process Abstraction/Call: Example

Context Provision using Process Abstraction

User preferences, Available services, Device configuration

My favourite text editor on Windows is notepad

win[edit . (file).notepad〈file〉.0]

My favourite text editor on Linux is emacs

lin[edit . (file).emacs〈file〉.0]

A Context-aware file editing agent can be specified as

ag [↑edit〈doc.txt〉.0]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 74: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Acquisition using Process Call

When the file editing agent runs

on my Windows machine, notepad is used

win[edit . (file).notepad〈file〉.0 | ag [↑edit〈doc.txt〉.0]]→

win[edit . (file).notepad〈file〉.0 | ag [notepad〈doc.txt〉.0]]

on my Linux machine, emacs is used

lin[edit . (file).emacs〈file〉.0 | ag [↑edit〈doc.txt〉.0]]→

lin[edit . (file).emacs〈file〉.0 | ag [emacs〈doc.txt〉.0]]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 75: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Acquisition using Process Call

When the file editing agent runs

on my Windows machine, notepad is used

win[edit . (file).notepad〈file〉.0 | ag [↑edit〈doc.txt〉.0]]→

win[edit . (file).notepad〈file〉.0 | ag [notepad〈doc.txt〉.0]]

on my Linux machine, emacs is used

lin[edit . (file).emacs〈file〉.0 | ag [↑edit〈doc.txt〉.0]]→

lin[edit . (file).emacs〈file〉.0 | ag [emacs〈doc.txt〉.0]]

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 76: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context-guarded Action Capabilities

Syntax: κ?M.Pwhere

κ is a condition over the environment, called context expressionM is an action capabilityP is a continuation process

Semantics:waits until the environment satisfies the contextexpression κ, then performs the capability M andcontinues like the process P.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 77: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context-guarded Action Capabilities

Syntax: κ?M.Pwhere

κ is a condition over the environment, called context expressionM is an action capabilityP is a continuation process

Semantics:waits until the environment satisfies the contextexpression κ, then performs the capability M andcontinues like the process P.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 78: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Example: a Smart Phone

Requirements

carried by the user

silent when user at conference

divert calls when user with a friend Alice say

phone

! usr with(alice)?switchto〈divert〉.0 |

! (usr at(conf ) ∧ ¬usr with(alice))?switchto〈silent〉.0 |

! (¬usr at(conf ) ∧ ¬usr with(alice))?switchto〈normal〉.0

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 79: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Example: a Smart Phone

Requirements

carried by the user

silent when user at conference

divert calls when user with a friend Alice say

phone

! usr with(alice)?switchto〈divert〉.0 |

! (usr at(conf ) ∧ ¬usr with(alice))?switchto〈silent〉.0 |

! (¬usr at(conf ) ∧ ¬usr with(alice))?switchto〈normal〉.0

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 80: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

What is Context?

Dey (1993):

Context is any information that can be used tocharacterise the situation of an entity. An entity isa person, place, or object that is considered relevantto the interaction between a user and an application,including the user and applications themselves.

Important aspects of context include:

user locationnearby peopleavailable resourcesuser activity

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 81: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

What is Context?

Dey (1993):

Context is any information that can be used tocharacterise the situation of an entity. An entity isa person, place, or object that is considered relevantto the interaction between a user and an application,including the user and applications themselves.

Important aspects of context include:

user locationnearby peopleavailable resourcesuser activity

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 82: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

What is Context?

Dey (1993):

Context is any information that can be used tocharacterise the situation of an entity. An entity isa person, place, or object that is considered relevantto the interaction between a user and an application,including the user and applications themselves.

Important aspects of context include:

user locationnearby peopleavailable resourcesuser activity

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 83: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model

In CCA, a process is described as a hierarchy of nestedambients.

So, the context of each individual (sub-)process correspond tothe surrounding of that process in the hierarchy.

This is obtained by replacing the process by a ‘hole’ in thehierarchy.

A hole is represented by the symbol � and can be thought ofas a place holder.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 84: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Examples of Context (cont’d)

Context of a mobile device carried by a user, Bob:

bob[� | Q]

where Q is a continuation process.

Graphically it looks like this:

bob

� | Q

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 85: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Examples of Context (cont’d)

Context of a mobile device carried by Bob at the conferenceroom:

conf [bob[� | Q] | R]

where Q and R are continuation processes.

Graphically it looks like this:

conf

bob

� | QR

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 86: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Examples of Context (cont’d)

Context of a smart device carried by Bob who is with Alice atconference, Alice carrying a pda:

conf [bob[� | Q] | alice[pda[R] | S ] | T ]

Graphically it looks like this:

conf

bob

� | Q

alice

pda

RS T

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 87: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Syntax

In CCA, a context is described by the following syntax:

C ::= Context0 nil� holen[C ] locationC | P parallel composition(νn) C restriction

where the symbol C stands for context (environment), n rangesover names and P ranges over processes.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 88: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Syntax (cont’d)

The context 0 is the empty context, also called the nilcontext. It contains no context information.

The position of a process in that process’ context is denotedby the symbol �. This is a special context called the holecontext.

The context (νn) C means that the scope of the name n islimited to the context C .

The context n[C ] means that the internal environment of theambient n is described by the context C .

The context C | P says that the process P runs in parallelwith the context C , and so C is part of process P’s context.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 89: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: some definitions

Ground context: is a context containing no holes

Example: any process is a ground context.

Context evaluation: Let C1 and C2 be contexts. Theevaluation of the context C1 at the context C2, denoted byC1(C2), is the context obtained by replacing the hole in C1 (ifany) by C2, viz

C1(C2) =

{C1 if C1 is a ground contextC1{� ← C2} otherwise.

where C1{� ← C2} is the substitution of C2 for � in C1.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 90: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Examples

Let e1 be the context of a mobile device carried by Bob at theconference room:

e1 = conf [bob[� | Q]]

Then the process

e1(phone[P]) = conf [bob[phone[P] | Q]]

models Bob at the conference room carrying a mobile phone

while the process

e1(pda[S ]) = conf [bob[pda[S ] | Q]]

models Bob at the conference room carrying a PDA

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 91: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Examples (cont’d)

Graphically it looks like this:

conf

bob

� | QR

e1

conf

bob

phone

PQ

R

e1(phone[P])

conf

bob

pda

SQ

R

e1(pda[S ])

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 92: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Examples (cont’d)

Graphically it looks like this:

conf

bob

� | QR

e1

conf

bob

phone

PQ

R

e1(phone[P])

conf

bob

pda

SQ

R

e1(pda[S ])

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 93: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Examples (cont’d)

Graphically it looks like this:

conf

bob

� | QR

e1

conf

bob

phone

PQ

R

e1(phone[P])

conf

bob

pda

SQ

R

e1(pda[S ])

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 94: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Context Model: Exercise

Consider the following process:

conf

bob

phone

PQ

alice

pda

RS T

What is the context of the ambient phone in that process?

What is the context of the ambient alice in that process?

What is the context of the process T in that process?

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 95: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context

The algebraic semantics of the context model is given interms of the following equalities

C | 0 = C(Cont-0)

C1 | C2 = C2 | C1

(Cont-1)

C1 | (C2 | C3) = (C1 | C2) | C3

(Cont-2)

(νn) (νm) C = (νm) (νn) C(Cont-3)

(νn) C1 | C2 = (νn) (C1 | C2) if n 6∈ fn(C2)(Cont-4)

where fn(C2) is the set of free names in C2

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 96: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context

The algebraic semantics of the context model is given interms of the following equalities

C | 0 = C(Cont-0)

C1 | C2 = C2 | C1

(Cont-1)

C1 | (C2 | C3) = (C1 | C2) | C3

(Cont-2)

(νn) (νm) C = (νm) (νn) C(Cont-3)

(νn) C1 | C2 = (νn) (C1 | C2) if n 6∈ fn(C2)(Cont-4)

where fn(C2) is the set of free names in C2

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 97: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context

The algebraic semantics of the context model is given interms of the following equalities

C | 0 = C(Cont-0)

C1 | C2 = C2 | C1

(Cont-1)

C1 | (C2 | C3) = (C1 | C2) | C3

(Cont-2)

(νn) (νm) C = (νm) (νn) C(Cont-3)

(νn) C1 | C2 = (νn) (C1 | C2) if n 6∈ fn(C2)(Cont-4)

where fn(C2) is the set of free names in C2

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 98: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context

The algebraic semantics of the context model is given interms of the following equalities

C | 0 = C(Cont-0)

C1 | C2 = C2 | C1

(Cont-1)

C1 | (C2 | C3) = (C1 | C2) | C3

(Cont-2)

(νn) (νm) C = (νm) (νn) C(Cont-3)

(νn) C1 | C2 = (νn) (C1 | C2) if n 6∈ fn(C2)(Cont-4)

where fn(C2) is the set of free names in C2

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 99: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context

The algebraic semantics of the context model is given interms of the following equalities

C | 0 = C(Cont-0)

C1 | C2 = C2 | C1

(Cont-1)

C1 | (C2 | C3) = (C1 | C2) | C3

(Cont-2)

(νn) (νm) C = (νm) (νn) C(Cont-3)

(νn) C1 | C2 = (νn) (C1 | C2) if n 6∈ fn(C2)(Cont-4)

where fn(C2) is the set of free names in C2

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 100: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context

The algebraic semantics of the context model is given interms of the following equalities

C | 0 = C(Cont-0)

C1 | C2 = C2 | C1

(Cont-1)

C1 | (C2 | C3) = (C1 | C2) | C3

(Cont-2)

(νn) (νm) C = (νm) (νn) C(Cont-3)

(νn) C1 | C2 = (νn) (C1 | C2) if n 6∈ fn(C2)(Cont-4)

where fn(C2) is the set of free names in C2

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 101: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context (cont’d)

Additional equalities

(νn) m[C ] = m[(νn) C ] if n 6= m(Cont-5)

(νn) 0 = 0(Cont-6)

C1 = C2 ⇒ (νn) C1 = (νn) C2

(Cont-7)

C1 = C2 ⇒ C1 | C3 = C2 | C3

(Cont-8)

C1 = C2 ⇒ n[C1] = n[C2](Cont-9)

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 102: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context (cont’d)

Additional equalities

(νn) m[C ] = m[(νn) C ] if n 6= m(Cont-5)

(νn) 0 = 0(Cont-6)

C1 = C2 ⇒ (νn) C1 = (νn) C2

(Cont-7)

C1 = C2 ⇒ C1 | C3 = C2 | C3

(Cont-8)

C1 = C2 ⇒ n[C1] = n[C2](Cont-9)

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 103: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context (cont’d)

Additional equalities

(νn) m[C ] = m[(νn) C ] if n 6= m(Cont-5)

(νn) 0 = 0(Cont-6)

C1 = C2 ⇒ (νn) C1 = (νn) C2

(Cont-7)

C1 = C2 ⇒ C1 | C3 = C2 | C3

(Cont-8)

C1 = C2 ⇒ n[C1] = n[C2](Cont-9)

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 104: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context (cont’d)

Additional equalities

(νn) m[C ] = m[(νn) C ] if n 6= m(Cont-5)

(νn) 0 = 0(Cont-6)

C1 = C2 ⇒ (νn) C1 = (νn) C2

(Cont-7)

C1 = C2 ⇒ C1 | C3 = C2 | C3

(Cont-8)

C1 = C2 ⇒ n[C1] = n[C2](Cont-9)

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 105: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context (cont’d)

Additional equalities

(νn) m[C ] = m[(νn) C ] if n 6= m(Cont-5)

(νn) 0 = 0(Cont-6)

C1 = C2 ⇒ (νn) C1 = (νn) C2

(Cont-7)

C1 = C2 ⇒ C1 | C3 = C2 | C3

(Cont-8)

C1 = C2 ⇒ n[C1] = n[C2](Cont-9)

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 106: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Algebraic Semantics of Context (cont’d)

Additional equalities

(νn) m[C ] = m[(νn) C ] if n 6= m(Cont-5)

(νn) 0 = 0(Cont-6)

C1 = C2 ⇒ (νn) C1 = (νn) C2

(Cont-7)

C1 = C2 ⇒ C1 | C3 = C2 | C3

(Cont-8)

C1 = C2 ⇒ n[C1] = n[C2](Cont-9)

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 107: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Spatial Reduction Relation

The spatial reduction relation ��

allows the navigation through the hierarchical structure ofcontext.

is defined as follows:

C1 �� C2 iff C1 = (n[C2] | C3) for some name n

Read: C1 contains C2.

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 108: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Spatial Reduction Relation: Examples

1 phone[�] �� �2 (phone[�] | pda[R]) �� �3 bob[phone[�] | Q] �� phone[�]

4 bob[phone[�] | Q] 6�� �5 bob[phone[�] | Q] �� Q

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 109: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Spatial Reduction: Reflexive and Transitive Closure

The reflexive and transitive closure of spatial reduction relationis denoted by ��∗

represents a finite iteration of ��

is defined as follows:

C1 ��∗ C2 iff C1 = C2 or (C1 �� C3 and C3 ��

∗ C2),

for some context C3

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 110: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Reflexive and Transitive Closure: Examples

1 C ��∗ C , for any context C

2 (phone[�] | pda[R]) ��∗ �3 bob[phone[�] | Q] ��∗ �4 bob[phone[�] | Q] ��∗ Q

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 111: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

Summary

Context Model for CCA Processes has been presented

Syntax and semantics of context are defined

A spatial modal logic for specifying properties of contexts isgiven in the next Lecture.

Formulas in this logic are called context expressions

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!

Page 112: Informatics Education: Hopes or Hypes OR Ubiquitous ...Computer Science is notInformatics Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us,

SO....

My Vision is that Informatics will empower us, only if weunderstand it.

Can traditional software engineering cope?

What we need is to organise the principles for an engineeringscience which will embed computing in our scientific culture

Hussein Zedan Informatics Education: Hopes or Hypes OR Ubiquitous computing will empower us, ONLY if we understand it!