Give an example of non-conflicting operations that would be defined as conflicting under read-write semantics. [3 marks]
Question:
Give an example of non-conflicting operations that would be defined as conflicting under read-write semantics. [3 marks] (b) Define the necessary and sufficient condition for two transactions to be serialisable. Give an example of a non-serialisable execution of a pair of transactions. [3 marks] 9 [TURN OVER
CST.2004.5.10
11 Semantics of Programming Languages
The language L has expression syntax
e ::= n | skip | fn x:T e | e1 e2 | x | e1 := e2 |!e | refe | `
with types
T ::= int | unit | T1 T2 | T ref
It is intended to have a call-by-value semantics.
(a) Define the set of values for L. [2 marks] Computer Design (a) What is a pipeline bubble and why might a branch instruction introduce one or more bubbles? [4 marks] (b) Explain, with the aid of an example, how conditional instructions may be used to reduce the number of bubbles in a pipeline. [4 marks] (c) What is the difference between branches, interrupts, software interrupts (initiated by a SWI instruction on the ARM) and exceptions? [8 marks] (d) In this way the common and expensive query can be answered by a single key-based read. (Note: Sum should be 0 if no matching records exist.) (a) Explain how the operation insert (a, b) into S can be correctly implemented in the {S 0 , R, T} database. [4 marks] (b) Explain how the operation insert (c, v) into T can be correctly implemented in the {S 0 , R, T} database. [4 marks] (a=v or b=v)
(R ./ S) = (a=v(R)) ./ (b=v(S))
If yes, provide a short proof. If no, provide a counter-example. [2 marks]
(d) Various normal forms are important in relational schema design.
(i) Define Third Normal Form (3NF). [3 marks]
(ii) Define Boyce-Codd Normal Form (BCNF). [3 marks]
(iii) For databases with many concurrent update transactions, explain why
schemas in normal form are important for good performance. Explain how five independent dimensions of visual processing are multiplexed together into the three available spatial dimensions of neural tissue, by the structure of the cubic millimetre hypercolumns in the brain's visual cortex. [5 marks] (c) The retina is often regarded as an crimage capture device; but it has about 100 million input sensors (photoreceptors) yet only 1 million output fibres (optic nerve axons). For a transaction model based on objects and object operation time-stamps: (a) (i) Define how conflict may be specified in terms of object operation semantics. (ii) What are some implications of this 100-to-1 ratio of input channels to output channels? [4 marks] Comment on the scope of concurrency control in relation to the discussion in (a). [5 marks] [Hint: you may assume that operations on bank account objects, such as debit, credit and add-interest are atomic.] Give an example of conflicting operations. (iii) (c) Explain how the operation insert (a, c) into R can be correctly implemented in the {S 0 , R, T} database. [4 marks] In schema normalisation, is Boyce-Codd Normal Form (BCNF) always to be preferred over 3rd Normal Form (3NF)? Explain your answer.