Giter Club home page Giter Club logo

cs410-17's Introduction

CS410-17

being the lecture materials and exercises for the 2017/18 session of CS410 Advanced Functional Programming at the University of Strathclyde

Strathclyders only: one minute papers and lecture videos will appear on our Marx site.

Installation instructions

  1. Check if you're using bash $ echo $0

  2. If using bash: Add "export PATH=$HOME/.cabal/bin:$PATH" to the bottom of your .profile file if it isn't already there. Else if using tcsh: Add "set path = ($home/.cabal/bin $path)" to the bottom of your .cshrc file if it isn't already there.

  3. $ cabal update

  4. $ cabal install alex

  5. $ cabal install cpphs

  6. $ cabal install happy

  7. $ cabal install Agda

  8. $ agda-mode setup

  9. $ emacs test.agda -- You should see an Agda menu and (Agda) in the mode line.

  10. $ git clone https://github.com/pigworker/CS410-17

Lecture videos on YouTube

  1. Tuesday 19 September Programs and Proofs
  2. Friday 22 September more Programs and Proofs, Introducing "with"
  3. Tuesday 26 September Proof by Induction
  4. Friday 29 September Sigma, Difference, Vector Take
  5. Tuesday 3 October How Rewrite Works
  6. Friday 6 October A Comedy of (Entirely Non-Deliberate) Errors
  7. Tuesday 10 October "Dominoes", no really, this time
  8. Friday 13 October Functors
  9. Tuesday 17 October From Functors to Monads
  10. Friday 20 October Natural Transformations and Monads
  11. Tuesday 24 October From Monads to Input/Output
  12. Friday 27 October How to Run a Program (and come a-cropper) bug report
  13. Tuesday 31 October Monads on Indexed Sets (Ex2)
  14. Friday 3 November What is an Application?
  15. Tuesday 7 November Coinduction and Coalgebras
  16. Friday 10 November Polynomial Data and Codata
  17. Tuesday 14 November A Polynomial Universe
  18. Friday 17 November The Zipper (Differentiating Polynomial Types)

Other useful stuff

  1. SpaceMonads! my keynote from CodeMesh 2016, on which Ex2 is based

cs410-17's People

Contributors

bishboria avatar jmchapman avatar pigworker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cs410-17's Issues

Regarding Lecture 6 and the equation order problem with `findSplit`.

My github-fu isn't strong, so hopefully opening an issue as means of communication isn't in bad taste.

In lecture six (actually, at the end of lecture five, if you take the bite and try to implement it yourself), the last equation of findSplit makes you experience first-hand why the order of equations matters.

While following along with the lecture(s) I noticed that the last defining equation of _>[_]<_ gets highlighted in white for me. Since I had no idea what this meant (and after restarting the editor twice), I followed the instructions on the Agda Wiki on how to configure agda-mode highlighting, I saw that this particular color seems to be chosen for catchall-clauses, which - although I'm no expert - seems suspiciously related to me.

I use spacemacs in console-mode by the way, which because of the dark background makes this warning really stick out for me.

So it appears that Agda might be able to warn about these kind of issues, it might have actually been doing so in your case as well, but you didn't see it because of the peculiar choice of default colou for highlighting. I wonder if there is a -Wall kind of configuration to make these things more explicit with a textual message?

Anyway, thanks for making this course available online. Written tutorials don't capture what it means to "think like an Agdaist" in the same way.

Builtin CONS no longer exists

Doing exercise 1 I found this warning:

/Volumes/Dev/Programming/Proof/Agda/exercises/CS410-2017/course/exercises/CS410-Prelude.agda:173,1-26
Builtin CONS no longer exists. It is now bound by BUILTIN LIST
when checking the pragma BUILTIN CONS _,-_

/Volumes/Dev/Programming/Proof/Agda/exercises/CS410-2017/course/exercises/CS410-Prelude.agda:172,1-23
Builtin NIL no longer exists. It is now bound by BUILTIN LIST
when checking the pragma BUILTIN NIL []

I'll continue as it is just a warning and try to fix later when I get better.

Question about using the equational reasoning operators.

Starting from Lecture 9 or so, some operators are introduced which allow writing a proof in an equational reasoning style. Specifically, I am talking about _=[_>=_, _=<_]=_ and _[QED], the equivalents of which are also found in the Agda Standard Library, defined for different underlying equality definitions (I have no idea about).

However, at least to my knowledge (that is, until the end of Lecture 12), the issue of how to work with these operators in practice wasn't explained, and my search on the interwebs came up empty (I only found a video in french). So, how do you use them?

So far I can think of:

  • refactoring an already existing "conventional" Agda proof. Normalization steps then correspond to refl something and rewrites become/are the application of laws. What becomes of a with abstraction then? Or
  • trying to work your way from top to bottom, like you would on paper,
  • trying to burn the candle from both ends by starting with the left-hand and right-hand side of the Goal and a hole in the middle.

Furthermore, the documentation states that if the equality reasoning primitives are in scope, "then Auto will do equality reasoning using these constructs". I couldn't really get that to work though. Or maybe I did, but I have no idea what the expected behavior is supposed to be.

There are some finished proofs in the lecture and exercise files, all of which are considered either tedious or hairy. Was your usage of equality reasoning necessary, easier than just using pattern-matching/with-abstractions/rewrites etc., or just for documentation purposes?

Any hints would be greatly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.