M4.1. Background and History
A definitive notation
= a simple formal language in which to express definitions
A set of definitions is called a definitive script
Definitive notations different according to
types of the variables that appear on the LHS of definitions
operators that can be used in formulae on the RHS.
Use of definitive notation concept
Related developments
spreadsheets with visualisation mechanisms
spreadsheet-style environments for end-user programming (e.g. AgentSheets)
generalised spreadsheet principles in application-builders (e.g. ACE)
"linked" vs "embedded" objects in the Windows o/s.
What does definitive mean?
definition has a technical meaning in this module
definitive means "definition-based"
"definitive" means
more than informal use of a particular programming technique.
Definitive notations are
a means to represent state by definitive scripts
and how scripts are interpreted is highly significant.
For instance
Miranda can be viewed as a definitive notation
over an underlying algebra of functions and constructors
but this interpretation emphasises
program design as a state-based activity
rather than
declarative techniques for program specification.
M4.2. DoNaLD: a definitive notation for line-drawing
Donald = a definitive notation for 2-d line-drawing
underlying algebra has 6 primary data types:
integer, real, boolean, point, line, and shapeA shape = a set of points and lines
A point is represented by a pair of scalar values {x,y}.
Points can be treated as position vectors:
they can be added: p+q
and multiplied by a scalar factor: p*k
A line [p,q] is a line segment that joins two points p and q
The operators currently implemented in DoNaLD include:
dist() intersects() intersect()
A DoNaLD file should begin with a "%donald".
To process the DoNaLD file example.d, type
tkeden example.d
Elementary DoNaLD use: writing a script
# this is a donald comment
# the following script defines m to be the midpoint of the line l
# joining points p and q, and om as the line from origin to m
point o, p, q, m
line l
l = [p,q]
m = (p+q) div 2
line om
# new declarations can be introduced at any stage
o = {0,0}
om = [o,m]
.....
{0,0} bottom-left to {1000,1000} top-right.
[Can specify extent of donald display explicitly using SCOUT]
Defining shapes in DoNaLD
Two kinds of shape variable in DoNaLD:
these are declared as shape and openshape
An openshape variable S is defined componentwise
as a collection of points, lines and subshapes
given explicit identifiers typically declared
" within the context of the openshape S ", thus:
openshape S
within S {
# there is a change to the input window# to reflect the new context
int m
# this is equivalent to declaring int S/m outside S
point p, q
openshape T
p = {m, 2*m}
within T {
# the change of context is again}# reflected in the input window
point p, q
# this point has the identifier S/T/p
p , q = ~/q, ~/p
# a multiple definition: p = ~/q and q=~/p
# ~/... refers to the enclosing context for T
# viz S, so that ~/p refers to the variable S/p
.....
# a syntax error in here will cause an escape
# from the "within S { ... within T {..." context
# as if " <donald_error> } } " had been entered
# The error is recorded in the command history
...
}
Other mode of definition of shape in DoNaLD is
shape RSQ- illustrated in definition of vehicle in cruisecontrolBridge1991.RSQ=rotate(SQ)
DoNaLD and EDEN
A donald translator is built-in to the tkeden interpreter. This translator can be studied through inspection of the eden definitions via tkeden.
Some features of donald are only accessible via eden
For example:
the dashed line for the cable in the donald room demoTo switch to eden use whilst in donald input mode, you should typeis defined by changing its attributes (A_cable) in eden.
%eden
To embellish the donald script by adding eden definitions, you need to know how donald definitions are represented in eden.
[The donald-eden interface is discussed in M3]
When donald is used without scout, tkeden creates a default donald screen.
NB the screen doesn't appear
until the first declaration or definition is introduced.
M4.3.1. Reference and Moding
A definition creates a relationship between reference and value
reference = value
definitive variable differs from
Reference = a concept of identity
For instance, a double point on a self-intersecting curve is difficult to describe satisfactorily using formal mathematical variables.
A definitive script may have distinct variables with same values:
a = beach with a different "identity" and significance.b = 3
c = 2*a-b
....
Modes of definition
mode of definition
= the way in which reference and value are associatedform of a definitive notation
not determined by the underlying algebra alone
possible modes of definition also important
..... there are many ways to define a complex structure
e.g
Issues for mode of definition
Related issue:
can list components be treated as independent variables?: cflist4[1] = list1
list4[2] = list3
list4[3] = [l5,list5]
many different modes of definition => potential inconsistency.
For instance:
list1 = reverse(list2); list1[1]=3;involves two independent definitions of list1[1]
Different modes of definition represented
M4.3.2. Agents and semantics
Archetypal use of definitive notation: human-computer interaction
Variables in a definitive script represent
cf the role of spreadsheets in describing and predicting
A script supplies an environment rather than a document.
In a document:
meaning of a symbol has to be represented in a stateless fashionIn a definitive script:
the reader animates it by studying the contexts in which it occurs
explore significance of symbols via experiment and observation.Definitive methods for concurrent systems modelling
= generalising definitive principles for the user-computer interface
to modelling the relationship between all interacting agents
Each agent-system interface is treated as a domain for experiment
M4.3.3. Objects vs observations
A definitive script
represents the atomic transformations of a geometric symbol
DoNaLD room can be transformed through redefinition in ways that correspond exactly to the observed patterns of change associated with opening a door, or moving a table.
Thesis:
set of atomic transformations of a symbol captures its semanticsThe digit eight vs the floor-plan of a filing cabinet: a geometric pun
cf Klein's view of a geometry
Is the DoNaLD room an object in the OOP sense?
Can view each room transformation as a method for the object.
BUT definitive script is an object specification only if
set_of_transformations_performed_on_room circumscribed
Circumscription creates objects
BUT
definitive modelling merely records observed transformations
Comprehending an object = knowing everything we can do with it
BUT
definitive script doesn't circumscribe transformations we can apply
The distinction is between an object and an account of observation
An account of observation is the more primitive concept:
needs fewer preconceptions about what might be observed
"Definitive scripts neutral wrt agent's views & privileges"definitive script differs from an object:
can express different agent views and privileges to transform
What architect can do to the room layout (e.g. relocate the door)
vs what the room user can do (e.g. open/shut the door).
=> significance of script relative to view of possible transformations
M4.3.4. Variable values, observations and state
Definitive variables
correspond to observations of real-world objects and processes external to the computer system
are defined by having an identity and a value that changes according to the circumstances of observation.
The term state refers to what we understand by
sets of observations made at the same time
the current state =
what I deem to be simultaneous observations of the world
The concept of state is
relative to the observer ("observing agent")
relative to focus of attention and mode of observation
A definitive script can represent many different states at once
Broad objective:
Examples:
an object can be viewed in terms of observations and transformations that can be modelled by agent protocols
a data type is complex when "there are several ways in which the object can be observed"
For instance, we can regard the value of a list as an entity, or
think about the values of constituent elements.
Aim to express via "states within states" by extracting subsets of variables
from a script cf Miranda script + evaluated function
References
WMB Definitive Notations for Interaction
WMB et al DoNaLD specification
WMB et al Scientific Visualisation etc etc
Todd ISBL: The Peterlee Relational Test Vehicle
Wyvill
Chmilar, Wyvill
Miranda Manual