Title: Formalisation of Functional Dependency
1Formalisation ofFunctional Dependency
- Mercantile House
- 28th February 2003
- Room 1-2 1300-1400
- By Bart-Floris Visscher
2Overview
- AMUSE project
- Informal definition
- Overview of context
- Formal definition
- Spin-offs
- Direction to take
3AMUSE project
- Architectural Modelling to Understand System
Evolution - EPSRC funded feasibility study
- Dr. Tom Addis, J. J. Townsend Addis, B.
Visscher, A. Gegov - G. Galal, N. Clark
- C/Fortran programs transformed to functional
form. - All subroutines/functions/global memory converted
to functions. - Structure of a program is determined by
functional dependencies between functions
4Informal Definition
- Two definition for functional dependency
- Function A depends on function B if and only if
function B has the possibility of influencing and
thereby effectively determining the behaviour of
function A. - Function A relies upon a function B for its own
functionality .
5Overview of context
- Source code (functional form)
- Definitions of identifiable functions (name)
- Syntax constraints
- This sentence is correct. (Correct)
- This is sentence correct. (Incorrect)
- Running program (behaviour)
- Interpretation of definition
- Semantic constraints
- This sentence is true. (valid, single
interpretation) - This sentence is false (contradiction, no
interpretation) - This sentence means whatever you want it to mean.
(ambiguous, multiple interpretations)
6Relating back to CC / Simple-OS
7Simplification / Alternative view
- Source code
- Function definitions
- Interpretation of definition depends on
Libraries, Op-codes and source code (all this is
contained in Behaviour n function tuple ) - Result of interpreting a definition is a function
8Definition of functionSemantic constraint
9Examples of function
- Not (True, False) (False, True)
- Not(True) False
- Not(False) True
- Domain Range True, False
And ((False, False), False), ((True,
False), False), ((False, True), False),
((True, True), True) And((True,True))
True And((False, True)) False Domain
(False,False), (True,False), (False,True),
(True, True) Range True, False
Succ (0, 1), (1, 2), (2, 3), . Succ(1234)
1235 Succ(0) 1 Domain 0, 1, Range
1, 2, ...
10Definitions 2 3
F Not, Succ, And, . F (True, False),
(False, True) , (0, 1), (1, 2), (2, 3), (3,
4),. , .
?3 (Not, Not, Not), (Not, Not, And), (Not,
Not, Succ), (Not, And, Not), (Not, And,
And), (Not, And, Succ), (Not, Succ, Not), (Not,
Succ, And), (Not, Succ, Succ), etc ?n are
all possible behaviours for a source code of n
definitions
11Definitions 4 5
?1 (Not), (Succ), (And) df
((Not),Not),((Succ),Not),((And),Succ) Ff
Not, Succ dNot ((Not),Not),((Succ),Not),((An
d),Not) FNot Not
Source code (Dn) consists out of n identifiable
function definitions (di)
12Definition 6
D2 (d1, d2), F1 Not, Succ, F2 Not
then P2 (Not, Not), (Succ, Not ) Shows how
the definitions limit the set of function that
the source code can have. Every behaviour in this
set can be reached without altering all
definitions
13Definition 7
Example F Not, Succ ?2 (Not, Not), (Not,
Succ), (Succ, Not), (Succ, Succ) D2 (d1,
d2) d1 ((Not,Not),Succ),((Not,Succ),Not),((Su
cc, Not),Succ) ,((Succ, Succ),Succ) I1 (Not,
Succ), (Succ, Not), (Succ, Succ) d2
((Not,Not),Not),((Not,Succ),Succ),((Succ,
Not),Succ) ,((Succ, Succ),Not) I2 (Not, Not),
(Not, Succ)
14Definition 8 Valid example
Example valid F Not, Succ ?2 (Not, Not),
(Not, Succ), (Succ, Not), (Succ, Succ) D2
(d1, d2) d1 ((Not,Not),Succ),((Not,Succ),Not)
,((Succ, Not),Succ) ,((Succ, Succ),Succ) d2
((Not,Not),Not),((Not,Succ),Succ),((Succ,
Not),Succ) ,((Succ, Succ),Not) F1 Succ,
Not F2 Succ, Not P2 ?2 I (Not,
Succ)
15Theorem 4
This means that the behaviour of source code (I)
is the common behaviour for each definition (Ii).
Example F Not, Succ ?2 (Not, Not), (Not,
Succ), (Succ, Not), (Succ, Succ) D2 (d1,
d2) d1 ((Not,Not),Succ),((Not,Succ),Not),((Su
cc, Not),Succ) ,((Succ, Succ),Succ) I1 (Not,
Succ), (Succ, Not), (Succ, Succ) d2
((Not,Not),Not),((Not,Succ),Succ),((Succ,
Not),Succ) ,((Succ, Succ),Not) I2 (Not, Not),
(Not, Succ) I (Not, Succ)
16Formal definition of functional dependency
17Spin-offs
- Generic framework for program interpretation and
semantic structure. (def. 1-8) - Used as a basis for source-code analysis. (def.
11) - Generic framework for semantics?
- Basis for correctness proving?
- How is it related to the halting problem?
18Halting problem (in a nutshell)
- Is is possible to determines if T halts for input
x? Answer No, Proof - Assume D solves this problem
- D(T,x) ? True , False
- Z(T,x) if D(T,x) then dont stop
- else stop
- Z(Z,x) ? contradiction, therefore assumption must
be wrong.
19Combining the two
- If a definition can be interpreted as a function
than it halts. (can be replaced by a lookup
table) - If a definition cannot be interpreted as a
function, it is said not to halt. This means
that the definition with some input - Goes on for infinity on a Turing Machine
- Does not produce a single output tape for some
input (contradicts the semantic constraint of a
function and the deterministic nature of a
Turing machine) - Framework solves the problem of getting a
function given a definition.
20Solving the halting problem
- Replace definition by Turing machine with its
input and the halting problem is solved!! - f f ? F?df(f) f 1 with df T(x)
- Consequence Z(Z,x) does not halt. (because
there is no single output tape for this
definition) - Same as G(X) Not G(X) Contradictory
- Not (True, False),(?,True)
- Contradictory definition (at the syntax level)
does not prove anything about the semantic
level!!!!!
21Direction