Skip to content
UoL CS Notes

Home

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.

Network Security Introduction

COMP211 Lectures

Types of Attacks There are two general classes of network attacks: Passive Attack Hard to detect. Eavesdropping - Packet sniffing. Impersonation - Spoofing source addresses. Active Attacks Man-in-the-Middle Attacks - Actively changing messages on the connection. Hijacking - Taking over an existing connection. Denial of Service - Overloading resources. Types...

Read More

Regular Closure of CFLs

COMP218 Lectures

Intersection of Context-Free & Regular Languages The intersection of a CFL and a regular language: \[L_1\cap L_2\] is context free. Combining the Languages To combine the CFL $M_1$ (a PDA) and regular language $M_2$ (a DFA) we can use the following transformations: Transition 1 stateDiagram state M1 { direction lr...

Read More

Closure Properties of Context-Free Languages

COMP218 Lectures

Union The union of two CFLs: \[L_1\cup L_2\] is context free. In general, for two context free languages $L_1$ and $L_2$ with start variables $S_1$ and $S_2$ the grammar of the union can be represented as: \[S\rightarrow S_1\vert S_2\] Where all other productions are kept the same. Concatenation The concatenation...

Read More

Pumping Lemma for GFGs

COMP218 Lectures

If a derivation is long enough, some variable must appear twice on the same path in a parse tree (pigeon hole principle): This means that any sufficiently large derivation will have a middle part that can be repeated indefinitely. Pumping in General Consider that you have a CFG that accepts...

Read More

COMP218 - PDA to CFG Conversion

COMP218 Lectures

Simplified PDA To convert a PDA to CFG you first have to convert to a simplified PDA: graph LR CFG --> PDA --> spda[Simplified PDA] --> CFG To be simplified it must have the following properties: Has a single accept state. Empties it’s stack before accepting. Each transaction is either...

Read More

CFG to PDA Conversions

COMP218 Lectures

Pushdown Automata Convention When we have a sequence of transitions like: stateDiagram direction LR q0 --> q01: x,a/b q01 --> q02: epsilon, epsilon/c q02 --> q1: epsilon, epsilon/d Pop $a$ then push $b$, $c$ and $d$. We will abbreviate it like this: stateDiagram direction LR q0 --> q1: x, a/dcb...

Read More

Interaction Diagrams - Collaboration, Sequence & Activity Diagrams

COMP201 Lectures

Interaction diagrams record how objects interact to perform a particular use-case. Collaboration Diagrams Collaboration diagrams show links, objects and actors. The labelled arrows show a message sent from one object to another. actor "aMember:BookBorrower" as member [theLibraryMember:\nLibraryMember] as librarymember member -- librarymember:borrow(theCopy) > librarymember -- librarymember:1: okToBorrow > [theCopy:Copy] as...

Read More

Class Diagrams - 2

COMP201 Lectures

Aggregation Aggregation is a way of saying that an object is part of anther class: This is opposed to an is a relation with inheritance. classDiagram direction LR HonoursCourse "1..*" o-- "6..*" Module The aggregation also allows the Module to be involved in multiple HonoursCourses. Composition This is a specialised...

Read More

Class Diagrams - 1

COMP201 Lectures

Naming Classes Classes should be named with: Nouns Non-plurals Not general process descriptors: Printing - Bad Printer - Good Class Models We can use two different methods to derive classes: Data Driven Design (DDD) - We identify all the data of the system and divide it into classes. We then...

Read More

Physical Query Plans

COMP207 Lectures

A physical query plan adds information required to execute the optimised query plan such as: Which algorithm to use for execution of operators. How to pass information from one operator to the other. Good order for computing joins, unions, etc. Additional operations such as sorting. Converting a Logical Plan to...

Read More