pigworker / CS410-17

being the lecture materials and exercises for the 2017/18 session of CS410 Advanced Functional Programming at the University of Strathclyde
263 stars 27 forks source link

Question about using the equational reasoning operators. #5

Open mbwgh opened 6 years ago

mbwgh commented 6 years ago

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:

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!

mbwgh commented 6 years ago

For what it's worth, I asked this question on StackOverflow as well.

jiangsy commented 3 years ago

I am currently trying to solve Ex2, and have some thoughts on this problem

if the goal is x = y, x =[ (the proof of x=x') >= x' changes the proof to x' = y and y' =< (the proof of y=y') ]= y changes the proof to x = y' you can use the first one only to transform the proof all the way to y = y or use both to get x = z and z = y in the middle, the last proof in either case is y [QED]