This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.
Boolean Functions Below are two tables containing all the possible outputs and possible inputs of the two variables $P$ and $Q$. We should be able to deduce the function of $P$ and $Q$ that gives the results: $P$ $Q$ $\bot$ $P\wedge Q$ $\neg(P\Rightarrow Q)$ $P$ $\neg(Q\Rightarrow P)$ $Q$ $\neg(P\equiv Q)$...
Sequential Circuits Rules for a Sequential Circuit Never combine two input wires. A singe input wire can be split partway and used as input for two separate gates. An output wire can be used as input. An output of a gate can eventually feed back into that gate. The only...
Map EER $\rightarrow$ Relations This mapping extends on ER to relational mapping with a step 8. This converts each specialisation with $m$ subclasses $S_1,S_2,\ldots,S_m$ of a generalised superclass $C$ into relation schemas. There are several options available depending on the nature of the specialisation. Step 8a - Multiple Relations for...
Map ER $\rightarrow$ Relations The aim of this phase is to construct a logical schema, that correctly an efficiently represent all of the information described by the conceptual schema. This is not always just a simple translation: In some cases there is no close correspondence between conceptual and logical schema....
Relations A relation is an ordered list of tuples: Relation $R=$ set of all pairs $(\text{Computer Scientist}$$,\text{Language they designed})$. $R=\{(x,y)\in C\times P \text { such that } x$$ \text{ is the designer of } y\}$. Relational Model An application of concepts from a branch of mathematics (relational algebra) to the...
Data Information encoded in some form. Database A logically coherent collection of data with inherent meaning. Collection of related data stored on some physical medium. Should be grouped. Advantages Better control over redundancy. Better consistency of data: enforcing integrity. Allow independence between data and the mechanism for their usage. Enforce...
Example Let us suppose the following: Need to organise data about university courses. For each module: We have information about who are the lecturer(s) Where their office is located Which semester the module is in which department is offering that module. You could put this in a spreadsheet but you...
Digital Logic Circuits In Series This circuit produces similar results to an AND gate: In Parallel This circuit produces similar results to an OR gate: Modern computers use logic gates. Basic Logic Gates AND Gate $P$ $Q$ $R$ 1 1 1 1 0 0 0 1 0 0 0 0...
Useful IO Functions This lecture covers many useful functions included with Haskell. I won’t be writing out examples but I will be writing down names and descriptions to search through. For more detailed examples view the slides for this lecture. print This prints out any show-able type. putStr This prints...
Writing Programs To write a program in Haskell we write a main function. main :: IO () main = putStrLn "Hello world!" main always: Takes no arguments Returns an IO type. To run the program, we first need to compile it: $ ghc -dynamic hello.hs [1 of 1] Compiling Main...