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.

Lecture 13-1

COMP105 Lectures

Polymorphic Types Some functions accept many different types. An example of this is length which accepts many different types of lists. if you ask what the type of then function length is then it will return the type: length :: [a] -> Int a is a type variable. This means...

Read More

Algebra of Sets

COMP109 Lectures

Suppose that A,B,C,U are sets with AU,BU,CU. Commutative Laws These laws say that is doesn’t matter in which order the operation takes place. AB=BA AB=BA Associative Laws These laws say that is...

Read More

Tutorial 1

COMP107 Tutorials

In this tutorial the first main focus was the group project. User Stories You might want to use user stories or define user personas: As a… [which type of user has this need?] I need… [what does the user want to do?] So that… [why does the user want to...

Read More

Lecture 12-2

COMP105 Lectures

Function Types Functions also have types in the type system. The type of a function is based on the values it takes as an argument and returns. Single Argument Functions For a one argument function, the type is written as: [input type] -> [output type] Multi-Argument Functions For a function...

Read More

Lecture 12-1

COMP105 Lectures

Types Everything in Haskell has a type. In GHCI :type or :t will display the type of an expression. Basic Types Int Holds a 64-bit integer between 263 and 2631 Integer Holds arbitrary size integers but is slightly slower than an Int. Ideally you should use an Int if you...

Read More

Relations & Non-Unary Rule-Based Systems

COMP111 Lectures

You cannot express relations between objects using the concepts we have learned so far. Relations are expressed as such: A relation name R denotes a set of pairs of individual object. Relation names are also called binary predicates: sonOf grandsonOf These call also be denotes by upper case letters R,S,R1,R2...

Read More

Derived Assertions Algorithm

COMP111 Lectures

The following algorithm take as input the knowledge base K containing Ka and Kr and computes all assertions E(a) with E a class name and a an individual name such that KE(a). This set is stored in: DerivedAssertions In only remains to check whether A(b) is in DerivedAssertions. The...

Read More

Rule Based Languages

COMP111 Lectures

Syntax An individual name denote an individual object. They are also called constant symbols: England We also use lower case letters: a,b,c,a1,a2, An individual variable is a placeholder for an individual name. They are denoted by lower case letters: x,y,z,x1,x2, A class name denotes a set of individual objects. They...

Read More

Basic Knowledge Representation and Reasoning

COMP111 Lectures

Declarative Approach The declarative approach to building agents includes telling the agent what it needs to know. From this the agent uses reasoning to deduce relevant consequences. It requires: A knowledge base / ontology Which contains fact and general knowledge about a domain in some formal language. A reasoning engine...

Read More

Alpha - Beta Pruning

COMP111 Lectures

If you know half way through a calculation that it will succeed or fail, then there is no point in doing the rest of it. This removes redundant information. graph TD subgraph max1[MAX] A0 end subgraph MIN A1 A2 A3 end subgraph max2[MAX] A11 A12 A13 A21 A22 A23 A31...

Read More