pigworker / cs410-17 Goto Github PK
View Code? Open in Web Editor NEWbeing the lecture materials and exercises for the 2017/18 session of CS410 Advanced Functional Programming at the University of Strathclyde
being the lecture materials and exercises for the 2017/18 session of CS410 Advanced Functional Programming at the University of Strathclyde
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:
refl something
and rewrites become/are the application of laws. What becomes of a with
abstraction then? OrFurthermore, 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!
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.