modelling state - PowerPoint PPT Presentation

About This Presentation
Title:

modelling state

Description:

selection dom objects. selection must consist of valid objects ... id dom objects' objects'(id) = objects(id) remaining objects unchanged ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 12
Provided by: andy85
Category:
Tags: dom | modelling | state

less

Transcript and Presenter's Notes

Title: modelling state


1
modelling state
  • Alan Dix
  • http//www.hcibook.com/alan/topics/formal/

2
model based methods
  • describe state using variables
  • 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_Type

3
define your own types
Shape_Type
shape circle, line, rectangle x, y Nat
position of centre wid Nat ht Nat size of
shape
4
use them to define state
objects Nat ? Shape_Type selection set Nat
selected objects
5
invariants and initial state
invariants conditions that are always be
true must be preserved by every operation
selection ? dom objects selection must consist
of valid objects
initial state how the system starts!
objects no objects selection
selection is empty
6
define operations
delete
dom objects' dom objects selection remove
selected objects ? id ? dom objects' objects'(id)
objects(id) remaining objects
unchanged selection' new selection is
empty
? note use of primed variables for new state
7
display/presentation
  • details usually very complex (pixels etc.) but
    can define what is visible

Shape_Type highlight Bool
Visible_Shape_Type
display
vis_objects set Visible_Shape_Type
vis_objects ( objects(id), sel(id) )
id ? dom objects where sel(id ) id ?
selection
8
defining state
  • two problems
  • too little state
  • elements missing from specification
  • may be deliberatee.g. dialogue level spec.
  • too much state
  • too many states, too complex state
  • may be deliberateredundancy, extensibility

9
too little state
  • forgotten elements
  • e.g. typing flag for calculator
  • 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

10
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
11
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)
Write a Comment
User Comments (0)
About PowerShow.com