SlideShare a Scribd company logo
1 of 17
 modelling state
looking within


what is state
that in the present
of that in the past
which affects that of the future
time
modelling state
describe state using variables
– a bit like programming
types of variables:
– basic type:
x: Nat – non-negative integer {0,1,2,...}
– individual item from set:
shape: {circle, line, rectangle}
– subset of bigger set:
selection: set Nat – set of integers
– function (often finite):
objects: Nat  shape
– user defined:
Point = x, y: Real – e.g. (1.79,-3.2)
also:
Int – pos or neg integer
Real – fractional number
String, etc.
stages
iteratively define:
state – what needs to be remembered
invariants – what is always true
initial state – how it starts
actions – what can happen to the state
(need to relate these to mouse, keys, etc.)
display – what the user sees (hears etc.)
use scenarios to check they are what you want
example: car clock
three buttons:
mode – cycles between hours, mins, seconds
+/– – increments/decrements selected item
we will define state and actions
N.B. will not be right first time ... spot the mistakes ...
16:55:00
mode – +
clock state – first attempt
state
hours: Nat
mins: Nat – all just numbers
secs: Nat
hours < 24 ∧ mins < 60 ∧ secs < 60
initial state
hours = 0
mins = 0
secs= 0
display
hours “:” mins “:” secs
invariant
clock actions – first attempt
increment (+)
add 1 to selected item
others unchanged
decrement (–)
similar
mode
cycle selected item
what is it?
clock state – second attempt
state
hours: Nat, mins: Nat, secs: Nat – all just numbers
selected: { ‘NONE’, ‘HRS’, ‘MINS’, ‘SECS’ }
hours < 24 ∧ mins < 60 ∧ secs < 60
initial state
hours = 0, mins = 0, secs= 0
selected = ‘NONE’
display
hours “:” mins “:” secs (with selected flashing)
clock actions – second attempt
increment (+)
if ( selected = ‘NONE’ ) do nothing
if ( selected = ‘HRS’ ) hours’ = hours+1
...
decrement (–)
similar
mode
if ( selected = ‘NONE’ ) selected’ = ‘HRS’
...
variable with apostrophe
(called ‘prime’)
is state after action
clock– scenario
time is 22:58:33
user types: mode mode + +
action selected hours mins secs
NONE 22 58 33
mode
HRS 22 58 33
mode
MINS 22 58 33
increment (+)
MINS 22 59 33
increment (+)
MINS 22 60 33
!!!
clock actions – third attempt
increment (+)
if ( selected = ‘NONE’ ) do nothing
if ( selected = ‘HRS’ )
if ( hours < 23 ) hours’ = hours+1
if ( hours = 23 ) hours’ = 0
if ( selected = ‘MINS’ )
if ( mins< 59 ) mins’ = mins+1
if ( mins= 59 ) mins’ = 0
...
clock– scenario revisited
time is 22:58:33
user types: mode mode + +
action selected hours mins secs
NONE 22 58 33
mode
HRS 22 58 33
mode
MINS 22 58 33
increment (+)
MINS 22 59 33
increment (+)
MINS 22 0 33
but does this want
to become 23?
defining state
two problems:
• too little state
elements missing from specification
may be deliberate
e.g. dialogue level spec.
• too much state
too many states, too complex state
may be deliberate
redundancy, extensibility
too little state
forgotten elements
e.g. ‘selected’ mode in car clock
checking:
– dialogue state
can you work out current dialogue state?
– action specification
do you have enough information?
– implicit global variables (see also later)
suggest state missing
too much state
unreachable states
too few actions (see later)
constraints
spare variables: constant/functional dependent
dependent state
e.g. first point of line, number being typed
indistinguishable states
what is observable?
states are not orthogonal
defining actions
framing problems
= too little in result state
unreachable states – insufficient actions
using ‘global’ variables
implicit in operation definition
beware extreme cases
(e.g. empty document, cursor at end of line)
internal and external consistency
state
scenarios
actions
invariants preserved?
actions complete?
missing state?
makes sense?
general
properties
specific
examples 


More Related Content

Similar to Modelling the State of a Digital Clock

REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1Embeddedcraft Craft
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for SpeedYung-Yu Chen
 
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Dan Robinson
 
Polyglot Persistence in the Real World: Cassandra + S3 + MapReduce
Polyglot Persistence in the Real World: Cassandra + S3 + MapReducePolyglot Persistence in the Real World: Cassandra + S3 + MapReduce
Polyglot Persistence in the Real World: Cassandra + S3 + MapReducethumbtacktech
 
Tues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiy
Tues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiyTues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiy
Tues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiyAnton Yazovskiy
 
iv. minggu keempat
iv. minggu keempativ. minggu keempat
iv. minggu keempatIsna Aryanty
 
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfJAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfkarymadelaneyrenne19
 

Similar to Modelling the State of a Digital Clock (12)

Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for Speed
 
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
 
Polyglot Persistence in the Real World: Cassandra + S3 + MapReduce
Polyglot Persistence in the Real World: Cassandra + S3 + MapReducePolyglot Persistence in the Real World: Cassandra + S3 + MapReduce
Polyglot Persistence in the Real World: Cassandra + S3 + MapReduce
 
Tues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiy
Tues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiyTues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiy
Tues 115pm cassandra + s3 + hadoop = quick auditing and analytics_yazovskiy
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
iv. minggu keempat
iv. minggu keempativ. minggu keempat
iv. minggu keempat
 
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfJAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
 
Week08.pdf
Week08.pdfWeek08.pdf
Week08.pdf
 
Bb2
Bb2Bb2
Bb2
 
2 презентация rx java+android
2 презентация rx java+android2 презентация rx java+android
2 презентация rx java+android
 

More from Alan Dix

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Human-Centred Artificial Intelligence – Malta 2024
Human-Centred Artificial Intelligence – Malta 2024Human-Centred Artificial Intelligence – Malta 2024
Human-Centred Artificial Intelligence – Malta 2024Alan Dix
 
The future of UX design support tools - talk Paris March 2024
The future of UX design support tools - talk Paris March 2024The future of UX design support tools - talk Paris March 2024
The future of UX design support tools - talk Paris March 2024Alan Dix
 
Qualitative–Quantitative reasoning and lightweight numbers
Qualitative–Quantitative reasoning and lightweight numbersQualitative–Quantitative reasoning and lightweight numbers
Qualitative–Quantitative reasoning and lightweight numbersAlan Dix
 
Invited talk at Diversifying Knowledge Production in HCI
Invited talk at Diversifying Knowledge Production in HCIInvited talk at Diversifying Knowledge Production in HCI
Invited talk at Diversifying Knowledge Production in HCIAlan Dix
 
Exceptional Experiences for Everyone
Exceptional Experiences for EveryoneExceptional Experiences for Everyone
Exceptional Experiences for EveryoneAlan Dix
 
Inclusivity and AI: opportunity or threat
Inclusivity and AI: opportunity or threatInclusivity and AI: opportunity or threat
Inclusivity and AI: opportunity or threatAlan Dix
 
Hidden Figures architectural challenges to expose parameters lost in code
Hidden Figures architectural challenges to expose parameters lost in codeHidden Figures architectural challenges to expose parameters lost in code
Hidden Figures architectural challenges to expose parameters lost in codeAlan Dix
 
ChatGPT, Culture and Creativity simulacrum and alterity
ChatGPT, Culture and Creativity simulacrum and alterityChatGPT, Culture and Creativity simulacrum and alterity
ChatGPT, Culture and Creativity simulacrum and alterityAlan Dix
 
Why pandemics and climate change are hard to understand and make decision mak...
Why pandemics and climate change are hard to understand and make decision mak...Why pandemics and climate change are hard to understand and make decision mak...
Why pandemics and climate change are hard to understand and make decision mak...Alan Dix
 
Beyond the Wireframe: tools to design, analyse and prototype physical devices
Beyond the Wireframe: tools to design, analyse and prototype physical devicesBeyond the Wireframe: tools to design, analyse and prototype physical devices
Beyond the Wireframe: tools to design, analyse and prototype physical devicesAlan Dix
 
Forever Cyborgs – a long view on physical-digital interaction
Forever Cyborgs – a long view on physical-digital interactionForever Cyborgs – a long view on physical-digital interaction
Forever Cyborgs – a long view on physical-digital interactionAlan Dix
 
Truth in an Age of Information
Truth in an Age of InformationTruth in an Age of Information
Truth in an Age of InformationAlan Dix
 
Rome Seminar: Designing User Interactions with AI
Rome Seminar: Designing User Interactions with AIRome Seminar: Designing User Interactions with AI
Rome Seminar: Designing User Interactions with AIAlan Dix
 
Tools and technology to support rich community heritage
Tools and technology to support rich community heritageTools and technology to support rich community heritage
Tools and technology to support rich community heritageAlan Dix
 
Maps with Meaning
Maps with MeaningMaps with Meaning
Maps with MeaningAlan Dix
 
Democratising Digitisation Tools to Support Small Community Archives
Democratising Digitisation Tools to Support Small Community ArchivesDemocratising Digitisation Tools to Support Small Community Archives
Democratising Digitisation Tools to Support Small Community ArchivesAlan Dix
 
Follow your nose: history frames the future
Follow your nose: history frames the futureFollow your nose: history frames the future
Follow your nose: history frames the futureAlan Dix
 
What Next for UX Tools: from screens to smells, from sketch to code, supporti...
What Next for UX Tools: from screens to smells, from sketch to code, supporti...What Next for UX Tools: from screens to smells, from sketch to code, supporti...
What Next for UX Tools: from screens to smells, from sketch to code, supporti...Alan Dix
 
Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...
Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...
Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...Alan Dix
 

More from Alan Dix (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Human-Centred Artificial Intelligence – Malta 2024
Human-Centred Artificial Intelligence – Malta 2024Human-Centred Artificial Intelligence – Malta 2024
Human-Centred Artificial Intelligence – Malta 2024
 
The future of UX design support tools - talk Paris March 2024
The future of UX design support tools - talk Paris March 2024The future of UX design support tools - talk Paris March 2024
The future of UX design support tools - talk Paris March 2024
 
Qualitative–Quantitative reasoning and lightweight numbers
Qualitative–Quantitative reasoning and lightweight numbersQualitative–Quantitative reasoning and lightweight numbers
Qualitative–Quantitative reasoning and lightweight numbers
 
Invited talk at Diversifying Knowledge Production in HCI
Invited talk at Diversifying Knowledge Production in HCIInvited talk at Diversifying Knowledge Production in HCI
Invited talk at Diversifying Knowledge Production in HCI
 
Exceptional Experiences for Everyone
Exceptional Experiences for EveryoneExceptional Experiences for Everyone
Exceptional Experiences for Everyone
 
Inclusivity and AI: opportunity or threat
Inclusivity and AI: opportunity or threatInclusivity and AI: opportunity or threat
Inclusivity and AI: opportunity or threat
 
Hidden Figures architectural challenges to expose parameters lost in code
Hidden Figures architectural challenges to expose parameters lost in codeHidden Figures architectural challenges to expose parameters lost in code
Hidden Figures architectural challenges to expose parameters lost in code
 
ChatGPT, Culture and Creativity simulacrum and alterity
ChatGPT, Culture and Creativity simulacrum and alterityChatGPT, Culture and Creativity simulacrum and alterity
ChatGPT, Culture and Creativity simulacrum and alterity
 
Why pandemics and climate change are hard to understand and make decision mak...
Why pandemics and climate change are hard to understand and make decision mak...Why pandemics and climate change are hard to understand and make decision mak...
Why pandemics and climate change are hard to understand and make decision mak...
 
Beyond the Wireframe: tools to design, analyse and prototype physical devices
Beyond the Wireframe: tools to design, analyse and prototype physical devicesBeyond the Wireframe: tools to design, analyse and prototype physical devices
Beyond the Wireframe: tools to design, analyse and prototype physical devices
 
Forever Cyborgs – a long view on physical-digital interaction
Forever Cyborgs – a long view on physical-digital interactionForever Cyborgs – a long view on physical-digital interaction
Forever Cyborgs – a long view on physical-digital interaction
 
Truth in an Age of Information
Truth in an Age of InformationTruth in an Age of Information
Truth in an Age of Information
 
Rome Seminar: Designing User Interactions with AI
Rome Seminar: Designing User Interactions with AIRome Seminar: Designing User Interactions with AI
Rome Seminar: Designing User Interactions with AI
 
Tools and technology to support rich community heritage
Tools and technology to support rich community heritageTools and technology to support rich community heritage
Tools and technology to support rich community heritage
 
Maps with Meaning
Maps with MeaningMaps with Meaning
Maps with Meaning
 
Democratising Digitisation Tools to Support Small Community Archives
Democratising Digitisation Tools to Support Small Community ArchivesDemocratising Digitisation Tools to Support Small Community Archives
Democratising Digitisation Tools to Support Small Community Archives
 
Follow your nose: history frames the future
Follow your nose: history frames the futureFollow your nose: history frames the future
Follow your nose: history frames the future
 
What Next for UX Tools: from screens to smells, from sketch to code, supporti...
What Next for UX Tools: from screens to smells, from sketch to code, supporti...What Next for UX Tools: from screens to smells, from sketch to code, supporti...
What Next for UX Tools: from screens to smells, from sketch to code, supporti...
 
Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...
Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...
Apply for 2022 Cohort – Centre for Doctoral Training in Enhancing Human Inter...
 

Recently uploaded

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 

Recently uploaded (20)

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 

Modelling the State of a Digital Clock

  • 1.  modelling state looking within  
  • 2. what is state that in the present of that in the past which affects that of the future time
  • 3. modelling state describe state using variables – a bit like programming types of variables: – basic type: x: Nat – non-negative integer {0,1,2,...} – individual item from set: shape: {circle, line, rectangle} – subset of bigger set: selection: set Nat – set of integers – function (often finite): objects: Nat  shape – user defined: Point = x, y: Real – e.g. (1.79,-3.2) also: Int – pos or neg integer Real – fractional number String, etc.
  • 4. stages iteratively define: state – what needs to be remembered invariants – what is always true initial state – how it starts actions – what can happen to the state (need to relate these to mouse, keys, etc.) display – what the user sees (hears etc.) use scenarios to check they are what you want
  • 5. example: car clock three buttons: mode – cycles between hours, mins, seconds +/– – increments/decrements selected item we will define state and actions N.B. will not be right first time ... spot the mistakes ... 16:55:00 mode – +
  • 6. clock state – first attempt state hours: Nat mins: Nat – all just numbers secs: Nat hours < 24 ∧ mins < 60 ∧ secs < 60 initial state hours = 0 mins = 0 secs= 0 display hours “:” mins “:” secs invariant
  • 7. clock actions – first attempt increment (+) add 1 to selected item others unchanged decrement (–) similar mode cycle selected item what is it?
  • 8. clock state – second attempt state hours: Nat, mins: Nat, secs: Nat – all just numbers selected: { ‘NONE’, ‘HRS’, ‘MINS’, ‘SECS’ } hours < 24 ∧ mins < 60 ∧ secs < 60 initial state hours = 0, mins = 0, secs= 0 selected = ‘NONE’ display hours “:” mins “:” secs (with selected flashing)
  • 9. clock actions – second attempt increment (+) if ( selected = ‘NONE’ ) do nothing if ( selected = ‘HRS’ ) hours’ = hours+1 ... decrement (–) similar mode if ( selected = ‘NONE’ ) selected’ = ‘HRS’ ... variable with apostrophe (called ‘prime’) is state after action
  • 10. clock– scenario time is 22:58:33 user types: mode mode + + action selected hours mins secs NONE 22 58 33 mode HRS 22 58 33 mode MINS 22 58 33 increment (+) MINS 22 59 33 increment (+) MINS 22 60 33 !!!
  • 11. clock actions – third attempt increment (+) if ( selected = ‘NONE’ ) do nothing if ( selected = ‘HRS’ ) if ( hours < 23 ) hours’ = hours+1 if ( hours = 23 ) hours’ = 0 if ( selected = ‘MINS’ ) if ( mins< 59 ) mins’ = mins+1 if ( mins= 59 ) mins’ = 0 ...
  • 12. clock– scenario revisited time is 22:58:33 user types: mode mode + + action selected hours mins secs NONE 22 58 33 mode HRS 22 58 33 mode MINS 22 58 33 increment (+) MINS 22 59 33 increment (+) MINS 22 0 33 but does this want to become 23?
  • 13. defining state two problems: • too little state elements missing from specification may be deliberate e.g. dialogue level spec. • too much state too many states, too complex state may be deliberate redundancy, extensibility
  • 14. too little state forgotten elements e.g. ‘selected’ mode in car clock checking: – dialogue state can you work out current dialogue state? – action specification do you have enough information? – implicit global variables (see also later) suggest state missing
  • 15. too much state unreachable states too few actions (see later) constraints spare variables: constant/functional dependent dependent state e.g. first point of line, number being typed indistinguishable states what is observable? states are not orthogonal
  • 16. defining actions framing problems = too little in result state unreachable states – insufficient actions using ‘global’ variables implicit in operation definition beware extreme cases (e.g. empty document, cursor at end of line)
  • 17. internal and external consistency state scenarios actions invariants preserved? actions complete? missing state? makes sense? general properties specific examples  