Category Archives: lecture
Instantiation and Strictness
Be careful when doing program transformation with regards to strictness. The problem is sometimes your function just passes a variable straight through as input. When this happens, ‘undefined’ can also be passed through just fine. But if you perform program … Continue reading
Backward Refinement
Backward refinement has the same goals as forward refinement, and is set up the same. However it has a different set of rules, but the same set of cases (preconditions must correspond etc.). Apparently the rules are ‘much uglier’. It’s … Continue reading
Constructing a State Based model in Alloy
Not strictly lecture notes, these are my own notes I have written based on what I have observed. They may not be factually correct, but are probably a damn bit easier to understand than other content All code is taken … Continue reading
More Gibbs Sampling
Assessment info The assessment will not cover anything from now on; will cover from lecture 14 (?) back. No lecture Tuesday Week 10 More/recap on Gibbs sampling Gibbs sampling with already instantiated variables doesn’t always work. For example: take a … Continue reading
A Propositional Simplifier
We want to make something that derive clausal forms of formulae in propositional logic. Remember on the slides/notes that > means ‘implies’. | means or. You just do a specific sequence of actions to simplify. Can see this on the … Continue reading
Gibbs Sampling
What is this? Another form of sampling, used in bayesian networks etc. In previous lecture we talked about forward, rejection, and importance sampling. So why do we need Gibbs sampling too? Limitations of importance sampling If the evidence is improbable … Continue reading
Rejection and importance sampling
We covered some of this last lecture; how to get random numbers in Python. Why sample? Some problems can be solved, but would take ages. Instead we can write a sampler to simulate the problem x number of times and … Continue reading
Interactive Functional Programs
The important bit: Don’t think about sequence. Describe the whole expected output, and then use lazy evaluation to make this act ‘interactively’.
Message Passing in a Join Forest
Given a join tree, how would we computer the probability of just ‘A’ for example. With variable elimination we’d have to sum it all out. With a join tree however, we can look at the structure of the data. There … Continue reading
Trace-Based Specifications
First. A neat little Alloy trick You can use a type of univ -> univ -> SomeSet to make a ‘generic’ function of sorts. See purse.als for an example. Recap The most general model has two components. A precondition and … Continue reading