| --- Log opened Wed Sep 01 00:00:16 2010 | ||
| copumpkin | edwinb: what's the error when trying to get agda to start? | 01/09 17:37 |
|---|---|---|
| edwinb | I have defeated it! | 01/09 17:40 |
| edwinb | I found the error in the *ghci* buffer | 01/09 17:40 |
| edwinb | I didn't have libncursesw somewhere visible by emacs | 01/09 17:40 |
| copumpkin | :O | 01/09 17:40 |
| copumpkin | nice | 01/09 17:40 |
| edwinb | I'm not going to pretend I understand why this was a problem, but at least I'm back where I was a couple of months ago now ;) | 01/09 17:40 |
| edwinb | In the meantime, I've uninstalled MacPorts and found the things I was using there somewhere else, which has made my ghc/libiconv problem go away | 01/09 17:41 |
| edwinb | Now I just need to remember what I was going to do when I started this nonsense [mumble] hours ago... | 01/09 17:42 |
| Saizan | edwinb: "I’d like to give a short talk about the forcing, detagging and collapsing optimisations (as described in my thesis and implemented in Idris) and discuss how these may be implemented in Agda, with the goal of improving the efficiency of the type checker by reducing sharing." <- reducing sharing? to make more terms get garbage collected? | 01/09 18:00 |
| pigworker | would that be 'reducing opportunity for loss of sharing'? | 01/09 18:24 |
| edwinb | oh, did I say that? | 01/09 18:58 |
| edwinb | Apparently I did | 01/09 18:59 |
| edwinb | I was on holiday when I wrote it, I obviously had my brain turned off... | 01/09 18:59 |
| edwinb | it's an experiment I'd quite like to do in Agda anyway - mark as many terms as possible as "you never need to look at this" and see if it has any effect on the efficiency of the type checker | 01/09 19:01 |
| copumpkin | larrytheliquid: you there? | 01/09 20:37 |
| applicative | larrytheliquid ping? | 01/09 20:37 |
| applicative | alas | 01/09 20:38 |
| shapr | So, um, is Agda purely functional? | 01/09 20:39 |
| * shapr is joking | 01/09 20:39 | |
| lispy1 | shapr: No, I think Agda is like perl, isn't it? | 01/09 20:40 |
| * lispy1 also joking | 01/09 20:40 | |
| shapr | yow! | 01/09 20:40 |
| copumpkin | be very quiet, everyone in here is thinking very hard! | 01/09 20:41 |
| copumpkin | (that's what agdaers do) | 01/09 20:41 |
| * lispy1 <3 Agda | 01/09 20:41 | |
| lispy1 | I don't want you all to think I'm a troll! | 01/09 20:41 |
| applicative | i'm not a troll, i love agda, it's the new version of ada, right? | 01/09 20:42 |
| applicative | @vixen do you like agda | 01/09 20:42 |
| applicative | ill managed channel, clearly | 01/09 20:43 |
| larrytheliquid | hey yes | 01/09 20:49 |
| larrytheliquid | here now | 01/09 20:49 |
| larrytheliquid | copumpkin: pong | 01/09 20:50 |
| lispy1 | larrytheliquid: I read about lemmachine on your github. I like the positive write up in the readme about reusing propositions and their similarity to various types of tests. I can say it re-inspires me to study agda again. | 01/09 20:50 |
| copumpkin | applicative was telling us you'd gone to agda from ruby and had written something about agda for rubyists. Do you have that still? | 01/09 20:51 |
| lispy1 | larrytheliquid: thanks! | 01/09 20:51 |
| larrytheliquid | lispy1: awesome! yeah i came to agda very strangely | 01/09 20:51 |
| larrytheliquid | originally i got stuck on some theoretical issues with genetic programming / inductive programming | 01/09 20:52 |
| larrytheliquid | and eventually admitted that i needed to search for more expressive typesystems | 01/09 20:52 |
| lispy1 | larrytheliquid: I've heard that agda has rotten performance at times. Have you found this to be the case? | 01/09 20:52 |
| lispy1 | larrytheliquid: another question: How does lemmachine compare to Ur? | 01/09 20:53 |
| larrytheliquid | lispy1: it depends, ive gotten it to perform terribly mostly when doing a lot of large conversions that arent builtins or primitives | 01/09 20:53 |
| larrytheliquid | like large string -> list -> vec -> map to something, etc | 01/09 20:53 |
| lispy1 | larrytheliquid: (thisis ur by the way: http://www.impredicative.com/ur/) | 01/09 20:54 |
| larrytheliquid | so any time ive had any performance issues theyve been fairly intuitive to resolve | 01/09 20:54 |
| copumpkin | oh, by the way, has anyone written a strongly typed STLC interpreter in agda? I've played with the NBE approach to it, but was trying to write a simple substitution function with my representation and failed no matter what I tried | 01/09 20:55 |
| lispy1 | larrytheliquid: interesting, I wonder too if that could be fixed via some of the tricks that Haskell does | 01/09 20:55 |
| lispy1 | fusion, deforestation, etc | 01/09 20:56 |
| copumpkin | strongly typed meaning you can't construct bad language terms in it (you index your terms by environment and type) | 01/09 20:56 |
| larrytheliquid | copumpkin: http://video2010.scottishrubyconference.com/show_video/11/1 | 01/09 20:56 |
| larrytheliquid | copumpkin: http://github.com/larrytheliquid/scotrubyconf | 01/09 20:56 |
| copumpkin | great, thanks :) | 01/09 20:56 |
| larrytheliquid | copumpkin: a lot of the content was simple/basic, fwiw | 01/09 20:57 |
| larrytheliquid | theres some extra content that got kind of cool at the end of the slides though, that i ran out of time for in the video | 01/09 20:57 |
| larrytheliquid | the slides have lots of speaker notes though | 01/09 20:57 |
| larrytheliquid | like getting to use ∃₂ | 01/09 20:58 |
| larrytheliquid | lispy1: my goal with lemmachine is to eventually have it share a similar feature set to urweb/opa/ocsigen, but where the framework guarantees are supportable by the host language (agda) | 01/09 21:00 |
| lispy1 | larrytheliquid: okay. I'm not familiar with opa/ocsigen, I think that answers my question | 01/09 21:00 |
| larrytheliquid | right now im working on an http protocol validator to provide a better foundation than lemmachine master has right now | 01/09 21:01 |
| lispy1 | larrytheliquid: User programs are extensions of the framework, and as such can reuse its proofs, instead of being written on top of the framework in a different notation. | 01/09 21:01 |
| larrytheliquid | lispy1: yup | 01/09 21:01 |
| lispy1 | It sounds interesting, will you publish this work at one of the FP conferences? Perhaps http://cs.utdallas.edu/padl09/? | 01/09 21:02 |
| lispy1 | well, not 09, but PADL in general | 01/09 21:03 |
| larrytheliquid | lispy1: id like very much to submit it for publication somewhere, but right now its still changing too much | 01/09 21:04 |
| * lispy1 nods | 01/09 21:04 | |
| lispy1 | Well, this is all very cool. Good luck! | 01/09 21:04 |
| larrytheliquid | thanks, fwiw the master branch doesnt do anything particularly cool with agda, mostly a non-dependent runtime with propositional equality proofs | 01/09 21:06 |
| larrytheliquid | but the http 1.0 validation branch has some fun uses of heavily nested dependent types http://github.com/larrytheliquid/Lemmachine/tree/rfc1945 | 01/09 21:06 |
| larrytheliquid | lots of nested dependent products, where parsing a request method determines the type of response possible, in addition to the response status used, whether a body is possible, which then requires a content-length to match the Vec length of the body, etc | 01/09 21:09 |
| copumpkin | why not make your own types instead of nesting sigmas? | 01/09 21:09 |
| copumpkin | or is that what you mean? | 01/09 21:10 |
| larrytheliquid | copumpkin: going to add a view function with a custom type later | 01/09 21:10 |
| larrytheliquid | copumpkin: but to be able to use a generic parser it starts as nested sigmas | 01/09 21:10 |
| copumpkin | oh I see | 01/09 21:10 |
| danbrown | copumpkin: http://acandystore.org/agda/PHOAS.Typed.html | 01/09 21:22 |
| copumpkin | danbrown: thanks, I'll take a look :) | 01/09 21:22 |
| Saizan | implementing substitution with phoas is kind of cheating :P | 01/09 21:23 |
| danbrown | intrinsically typed, PHOAS, small-step semantics, and even an IO driver | 01/09 21:23 |
| danbrown | Saizan: when substitution isn't the behavior under study, i'm happy to cheat | 01/09 21:23 |
| copumpkin | mine isn't PHOAS though | 01/09 21:23 |
| copumpkin | substitution in the representation I'm using has been a nightmare :P | 01/09 21:24 |
| danbrown | i think it often is | 01/09 21:24 |
| Saizan | substitution is easier if you do it for all the variables at once, apparently | 01/09 21:24 |
| copumpkin | yeah, I almost got it working by doing that | 01/09 21:25 |
| copumpkin | but it wasn't really what I wanted | 01/09 21:25 |
| Saizan | (it's like (>>=)) | 01/09 21:25 |
| Saizan | copumpkin: do you have the code where you got stuck? | 01/09 21:25 |
| danbrown | i'm still bothered that PHOAS isn't quite a monad... | 01/09 21:26 |
| copumpkin | Saizan: sure | 01/09 21:26 |
| copumpkin | just a sec | 01/09 21:26 |
| copumpkin | Saizan: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29644#a29644 | 01/09 21:32 |
| Saizan | where is \neg defined? | 01/09 21:48 |
| copumpkin | larrytheliquid: you should've told them that agda isn't turing-complete :) | 01/09 21:52 |
| copumpkin | Saizan: Relation.Nullary or .Core I think? | 01/09 21:52 |
| * copumpkin can never remember any of those | 01/09 21:53 | |
| copumpkin | or maybe Data.Empty? | 01/09 21:53 |
| larrytheliquid | copumpkin: i know, i answered that particular question the guy asked poorly | 01/09 21:54 |
| copumpkin | larrytheliquid: enjoying the talk though, thanks again :) | 01/09 22:00 |
| larrytheliquid | copumpkin: thx, the ending slides not in the talk are more fun ;) | 01/09 22:00 |
| larrytheliquid | which honestly would have been way too confusing for that audience, so its a good thing i didnt get to them | 01/09 22:01 |
| copumpkin | yeah | 01/09 22:02 |
| * Saizan now remembers the annoying part where you've to mangle all the other variables to fit the new indices | 01/09 22:16 | |
| copumpkin | Saizan: you mean in relation to what I pasted? | 01/09 22:16 |
| Saizan | yep | 01/09 22:16 |
| copumpkin | man, larrytheliquid is getting a lot of twitter coverage from the haskell community | 01/09 22:18 |
| copumpkin | :P | 01/09 22:18 |
| Saizan | btw, Var ctx t ~~ Data.List.Any (_\==_ t) ctx, in case you didn't realize :) | 01/09 22:18 |
| larrytheliquid | copumpkin: oh wow, thats pretty awesome | 01/09 22:19 |
| copumpkin | Saizan: oh, I was considering something like that, but wanted this to be fairly self-contained | 01/09 22:19 |
| copumpkin | Saizan: does that weird index type I wrote have a simpler presentation? | 01/09 22:19 |
| Saizan | copumpkin: it seems something you could build with Star but i'm not sure if that's "simpler" | 01/09 22:21 |
| copumpkin | ah | 01/09 22:22 |
| Saizan | subst : ∀ {σ τ Γ} → Term Γ τ → (v : Var Γ σ) -> let Γ′ = delete Γ v in Term Γ′ σ → Term Γ′ τ <- i was trying to go with a type like this though | 01/09 22:22 |
| copumpkin | Saizan: ah, yeah... I was afraid of something with a function in the type like that as I've had bad experiences with it in the past :) | 01/09 22:23 |
| copumpkin | besides, that inductive index was fairly simple | 01/09 22:23 |
| Saizan | yeah, it might work better with type inference | 01/09 22:26 |
| copumpkin | it was just helpful to have pattern matching on the index refine the types for me | 01/09 22:27 |
| copumpkin | which you wouldn't get with the function in the type | 01/09 22:27 |
| copumpkin | you'd need a with block | 01/09 22:27 |
| copumpkin | but maybe it'll work better overall | 01/09 22:27 |
| Saizan | i'm in a position where i'd have to mangle the term too | 01/09 22:34 |
| * Saizan has a dejavu | 01/09 22:34 | |
| copumpkin | yeah :/ | 01/09 22:34 |
| copumpkin | I had another version of this with Var in Term | 01/09 22:34 |
| copumpkin | where I increment the term I'm substituting as I recurse on binders | 01/09 22:34 |
| copumpkin | I don't really like that as much because you can have equivalent terms that have different representations depending on where you put the lift/suc/weaken | 01/09 22:35 |
| Saizan | it'd be easy with a constructor shift :: Term G t -> Term (s :: G) t | 01/09 22:35 |
| copumpkin | is it? | 01/09 22:36 |
| Saizan | ah, yeah, weaken would be the right term :) | 01/09 22:36 |
| copumpkin | that's what I'm talking about | 01/09 22:36 |
| copumpkin | if you move Var into Term | 01/09 22:36 |
| copumpkin | your suc is basically weaken | 01/09 22:36 |
| Saizan | i see | 01/09 22:36 |
| copumpkin | but then I run into issues with (there x) (var (suc x)) | 01/09 22:36 |
| copumpkin | (the binders are easy though, with that form) | 01/09 22:37 |
| copumpkin | but if you succeed that way I'll take it, at this point :P | 01/09 22:37 |
| copumpkin | it doesn't feel like it should be this hard even with the current representation | 01/09 22:38 |
| copumpkin | I've experimented with a bunch of different forms though and have failed on all of them :P | 01/09 22:38 |
| Saizan | well, even if you strip out all the types, you still have the problem that these vars are basically de brujin indexes, or something quite similar, so they need to be adjusted when you move them under other lambdas.. | 01/09 22:41 |
| copumpkin | yeah | 01/09 22:41 |
| copumpkin | I tried writing a lifting function with the current representation | 01/09 22:41 |
| copumpkin | or weakening, I guess | 01/09 22:41 |
| * Saizan guesses some of the syntax experts would have more interesting things to say here | 01/09 22:44 | |
| Saizan | now the problem is substituting under the weaken constructor, sigh | 01/09 22:53 |
| copumpkin | yeah :P | 01/09 22:54 |
| * Saizan has newed motivation to finish reading "A fresh look at programming with names and binders" | 01/09 23:00 | |
| copumpkin | Saizan: I haven't seen that | 01/09 23:22 |
| copumpkin | looking now :) | 01/09 23:23 |
| Mathnerd314 | I want Haskell, but with dependent types. Agda is closest, right? | 01/09 23:41 |
| Saizan | yep | 01/09 23:41 |
| Saizan | copumpkin: i'd be interesting to figure out whether or not Term is a free monad and of which functor | 01/09 23:43 |
| copumpkin | Mathnerd314: it comes at a cost, though! | 01/09 23:45 |
| copumpkin | Saizan: yeah | 01/09 23:46 |
| Mathnerd314 | a cost? what sort of cost? | 01/09 23:46 |
| copumpkin | fifty bucks, payable to me over paypal | 01/09 23:46 |
| Mathnerd314 | hmm, I've never used paypal :p | 01/09 23:48 |
| Mathnerd314 | is it a trustworthy service? | 01/09 23:50 |
| copumpkin | :) | 01/09 23:52 |
| copumpkin | nah, not at all | 01/09 23:52 |
| copumpkin | the price of using agda is really the lack of much inference, and sometimes having to jump through hoops to convince it your programs terminate | 01/09 23:53 |
| edwinb | Agda's inference seems pretty good to me... | 01/09 23:53 |
| copumpkin | and of course, writing your functions in a way that simplifies proving things about them | 01/09 23:54 |
| edwinb | as long as you have a type at the top level, of course | 01/09 23:54 |
| copumpkin | yeah, it isn't bad | 01/09 23:54 |
| Mathnerd314 | copumpkin: so are there cases where Haskell infers a type but Agda doesn't? | 01/09 23:54 |
| copumpkin | well agda actually forces you to write types for all top-level functions (unless you fool it by writing lambdas for values) | 01/09 23:55 |
| copumpkin | and even if you do fool it, it'll make your resulting value yellow | 01/09 23:56 |
| Mathnerd314 | force you to write types? :-( The whole point of using Haskell is to *not* write out those stupid function signatures... | 01/09 23:57 |
| copumpkin | well the issue is that it's fundamentally impossible with dependent types to give you general type inference | 01/09 23:57 |
| copumpkin | since your types can contain arbitrary terms, including functions | 01/09 23:57 |
| edwinb | on the other hand, the point of dependent types is to be able to explain precisely what a function is meant to do | 01/09 23:58 |
| edwinb | (one of the points...) | 01/09 23:58 |
| copumpkin | yeah | 01/09 23:58 |
| edwinb | you can't infer that sort of thing | 01/09 23:58 |
| copumpkin | I don't mind writing top-level function signatures as I tend to write them in haskell too | 01/09 23:58 |
| edwinb | and things which are essentially trival, you can infer anyway | 01/09 23:58 |
| copumpkin | and most of the inner stuff can be inferred | 01/09 23:58 |
| edwinb | actually, I sometimes wonder, in a practical language, maybe you want to ignore what's decidable and just assume simple or Hindley Milner types if there's no signature | 01/09 23:59 |
| edwinb | not that I've thought that through properly | 01/09 23:59 |
| edwinb | I usually start with a type in Haskell then work towards a program | 01/09 23:59 |
| --- Day changed Thu Sep 02 2010 | ||
| copumpkin | yeah, same | 02/09 00:00 |
| edwinb | Agda (or similar) makes that easy | 02/09 00:00 |
| copumpkin | I've found myself wishing for holes and agsy in haskell recently | 02/09 00:00 |
| copumpkin | and C-c C-r is my new best friend | 02/09 00:00 |
| edwinb | what's always fun is when you decorate the type with a bit more detail and the program still typechecks | 02/09 00:00 |
| copumpkin | Mathnerd314: hope we didn't put you off! it's still completely addictive, like a puzzle game | 02/09 00:01 |
| copumpkin | I have to pry myself away from agda with a crowbar | 02/09 00:01 |
| Mathnerd314 | I'm just wishing Agda was more Haskelly | 02/09 00:01 |
| copumpkin | you don't get anything for free, sadly :) | 02/09 00:01 |
| copumpkin | that's why haskell is interesting :) it tries to push the limits of what you can do at the type level while (mostly) retaining decidable inference | 02/09 00:02 |
| copumpkin | so it's walking a fine line along the boundary there | 02/09 00:02 |
| Mathnerd314 | but Agda already is undecidable, with termination checking. So why not do more undecidable things? :p | 02/09 00:03 |
| copumpkin | no it isn't | 02/09 00:03 |
| edwinb | I don't think it's undecidable... | 02/09 00:03 |
| copumpkin | agda just isn't turing-complete | 02/09 00:04 |
| edwinb | thing is, though, we're all new at this, and we're still figuring out how to make practical dependently typed languages | 02/09 00:04 |
| edwinb | so input from someone who wants to make it more Haskelly, say, is really valuable | 02/09 00:04 |
| Mathnerd314 | I mean that Agda does undecidable things | 02/09 00:05 |
| copumpkin | nope | 02/09 00:06 |
| Mathnerd314 | "determines properties that in the general case are undecidable" | 02/09 00:07 |
| edwinb | ah, right | 02/09 00:07 |
| copumpkin | there's a difference between being conservative and rejecting things which might terminate | 02/09 00:07 |
| copumpkin | and deciding the undecidable :P | 02/09 00:07 |
| edwinb | in the general case meaning a Turing complete language | 02/09 00:07 |
| edwinb | Turing completeness is overrated ;) | 02/09 00:08 |
| copumpkin | Mathnerd314: haskell's type system makes statements about a turing complete language too ;) Rice said we can't do that | 02/09 00:08 |
| larrytheliquid | turing completely-confusing | 02/09 00:11 |
| larrytheliquid | (i apologize for that in advance, couldnt resist a few hours before works over) | 02/09 00:12 |
| edwinb | I've yet to find a function worth writing that actually relies on Turing Completeness | 02/09 00:12 |
| copumpkin | yeah | 02/09 00:13 |
| edwinb | you might want to add coinduction for actual programs, say operating systems. | 02/09 00:14 |
| copumpkin | but productivity checking there also ensures what we consider meaningful behavior in a real system | 02/09 00:14 |
| copumpkin | so I'm not sure why you'd ever want more | 02/09 00:14 |
| copumpkin | unless you really like doing stuff that simply doesn't terminate for the fun of it | 02/09 00:14 |
| Mathnerd314 | I'm guessing Agda wouldn't let you try to verify the Collatz conjecture by writing a collatz-calculating function? | 02/09 00:15 |
| copumpkin | you can write it coinductively | 02/09 00:15 |
| copumpkin | then you could try to write a proof to give you a List from the generated Colist :) | 02/09 00:15 |
| copumpkin | (which would essentially be a proof of the conjecture) | 02/09 00:16 |
| copumpkin | Mathnerd314: you can work with infinite things just fine in agda using coinduction, but there there's a productivity checker that tries to guarantee that your functions always produce a result | 02/09 00:17 |
| copumpkin | for example, you could write concat on an infinite colist, but you'd need the inner lists to be non-empty | 02/09 00:17 |
| copumpkin | otherwise it has no guarantee that you aren't doing concat ([[1],[2],[3]] ++ repeat []) | 02/09 00:17 |
| copumpkin | or you could write a much more complicated concat on an infinite colist of colists, as long as you can supply a proof that you'll eventually hit a non-empty list at any given point | 02/09 00:18 |
| Mathnerd314 | couldn't you optimize to (concat [[1],[2],[3]]) ++ (concat (repeat [])), do loop fusion, and end up happy? | 02/09 00:19 |
| copumpkin | it has no knowledge of the value you're passing in | 02/09 00:20 |
| copumpkin | unless you give it some proofs too | 02/09 00:20 |
| copumpkin | if it just takes a Colist (Colist a) | 02/09 00:20 |
| copumpkin | that's all it knows, that it has a possibly infinite list of possibly infinite (but also empty) lists | 02/09 00:20 |
| Saizan | type inference works well when the system has principal types (schemes), because otherwise there are cases where you've to decide between multiple incompatible alternatives, and in the cases where your heurstics fail you'll probably get a spurious type error, though i guess with good reporting of the choice points and interactivity it could be a nice system | 02/09 00:21 |
| Saizan | Mathnerd314: a Colist has to be able to fully produce arbitrary length prefixes in a finite number of steps | 02/09 00:24 |
| applicative | larrytheliquid, you awake? | 02/09 01:11 |
| larrytheliquid | applicative: thats debatable | 02/09 01:12 |
| applicative | oh hey | 02/09 01:15 |
| applicative | i read some slides you put up for ruby folks about the advantages agda over the usual ruby type correctness controls | 02/09 01:16 |
| applicative | cant find them though I thought I would link them in the reddit.com/r/haskell discussion dons has triggered | 02/09 01:17 |
| larrytheliquid | ah cool yeah http://github.com/larrytheliquid/scotrubyconf | 02/09 01:17 |
| applicative | i see, so it was on github, my memory had me hunting the doc directory in the lemmachine source | 02/09 01:18 |
| larrytheliquid | applicative: the video is here too http://video2010.scottishrubyconference.com/show_video/11/1 | 02/09 01:19 |
| applicative | lemmachine is very interesting, but i can't praise it properly; i'll get back to you when i learn more agda! | 02/09 01:19 |
| applicative | oh cool, ill link that too. | 02/09 01:19 |
| larrytheliquid | applicative: nice, ya as i mentioned earlier the master branch of lemmachine isnt as interesting as the rfc1945 branch (for dependently typed programmers) | 02/09 01:20 |
| larrytheliquid | itll eventually make its way back into master as a lower-level verified core though | 02/09 01:21 |
| larrytheliquid | in other words, master might be easier to read through if youre new to agda, but rfc1945 uses agda more effectively | 02/09 01:23 |
| applicative | i see. | 02/09 01:24 |
| applicative | as I say, i'm still with the abc's e.g. figuring out how the connection with Hack is made. | 02/09 01:24 |
| applicative | and that sort of thing | 02/09 01:25 |
| larrytheliquid | applicative: gotcha | 02/09 01:25 |
| applicative | i'll see if i can compose a couple of worthwhile sentences. | 02/09 01:26 |
| Saizan | copumpkin: not sure if you'd like this but i like that the recursion over term is only in _>>=_ http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29658#a29658 | 02/09 01:53 |
| copumpkin | wow :) | 02/09 01:56 |
| copumpkin | thanks :) I'll try to figure out what's going on | 02/09 01:57 |
| Saizan | np, i had that idea before, but instead of implementing it i lost myself trying to use something more general than (\Delta ++), it feels nice to have it written down at last :) | 02/09 02:01 |
| applicative | ah, larrytheliquid is gone. I posted a few more links in comments to dons' link to the Lemmachine source. I hope not too incompetently.... | 02/09 02:24 |
| applicative | i mean http://www.reddit.com/r/haskell/comments/d8dck/lemmachine_a_web_framework_in_agda/ | 02/09 02:25 |
| * lispy is watching larry's talk now | 02/09 02:33 | |
| lispy | Hm...I don't see agda listed here: http://shootout.alioth.debian.org/ | 02/09 03:26 |
| lispy | I think that would be really interesting...I wonder what it would take to get agda there | 02/09 03:26 |
| lispy | heh, they must get that question a lot | 02/09 03:29 |
| lispy | from their FAQ: | 02/09 03:29 |
| lispy | Why don't you include language X? | 02/09 03:29 |
| lispy | Why don't you use our measurement scripts and publish measurements for language X? | 02/09 03:29 |
| copumpkin | lispy: he talks a lot about specifying properties but not so much about proving them, which is the hairier part :) | 02/09 03:29 |
| lispy | copumpkin: it's true | 02/09 03:29 |
| lispy | copumpkin: but all the more reason to reuse proofs :) | 02/09 03:30 |
| Saizan | not only compiling agda, but actually running the executable? madness. | 02/09 03:30 |
| copumpkin | *typechecking | 02/09 03:30 |
| copumpkin | :P | 02/09 03:30 |
| * copumpkin doesn't even know the key binding for compilation | 02/09 03:30 | |
| copumpkin | I need an "instance DecTotalOrder a => DecTotalOrder (Maybe a)" :P | 02/09 03:31 |
| lispy | Actually, it would be pretty sweet to setup a site like the shootout, but it only allows you to compare esoteric languages | 02/09 03:31 |
| Saizan | have they released the scripts? | 02/09 03:33 |
| lispy | Saizan: indeed | 02/09 03:33 |
| lispy | http://shootout.alioth.debian.org/help.php#languagex | 02/09 03:33 |
| lispy | Saizan: another idea I had would be to use their scripts to setup a version control shootout. | 02/09 03:34 |
| lispy | alas, the round tuits, I have none | 02/09 03:34 |
| copumpkin | what's a good way of representing a binary tree with empty leaves, data in the nodes, and preserving ordering? | 02/09 03:39 |
| copumpkin | I wanted to index the node by the value in it, so I have access to it in the parent | 02/09 03:39 |
| copumpkin | but then the empty leaves contain nothing and make it ugly | 02/09 03:39 |
| copumpkin | I don't want a Maybe | 02/09 03:40 |
| djahandarie | By idling in this channel I will suck all knowledge through proximity | 02/09 04:42 |
| lispy | copumpkin: why do you need Maybe? | 02/09 04:51 |
| lispy | copumpkin: (using Haskell syntax) you have something like data Tree a = Leaf | Branch a (Tree a) (Tree a) ? | 02/09 04:51 |
| lispy | copumpkin: oh! | 02/09 04:52 |
| lispy | copumpkin: I see. Because Leafs are indexed by their value too, you needed a Nothing there? | 02/09 04:53 |
| leo | hello | 02/09 15:29 |
| copumpkin | hi! | 02/09 15:30 |
| leo | hi, is my first time here :D. I'm looking for help, i'm learning monads | 02/09 15:31 |
| leo | (of stdlib) | 02/09 15:31 |
| copumpkin | what in particular? do you understand the abstract concept? cause there's two dozen people eagerly waiting to explain them in #haskell :) | 02/09 15:32 |
| copumpkin | or is it the agda presentation of them that confuses you? | 02/09 15:33 |
| leo | yes, the adga presentation. | 02/09 15:34 |
| leo | Do you know if there is some Agda library for Monads more simply than sdlib ? | 02/09 15:34 |
| leo | or may be a tutorial of the stdlib presentation | 02/09 15:35 |
| leo | (i'm sorry for my english) | 02/09 15:35 |
| copumpkin | hmm, no, I don't think so. http://web.student.chalmers.se/~stevan/ctfp/html/README.html has various CT structures but no monads yet | 02/09 15:36 |
| copumpkin | and they're also a lot more general than the standard library approach | 02/09 15:36 |
| copumpkin | there are some other links in there though | 02/09 15:38 |
| copumpkin | that might point you to simpler monads | 02/09 15:38 |
| Saizan | leo: is the indexing that confuses you? i.e. that return's type is "return : ∀ {i A} → A → M i i A" instead of "∀ {A} → A → M A" ? | 02/09 15:39 |
| Saizan | or the use of record types to group methods? | 02/09 15:39 |
| leo | both :D I'm reading Indexed.agda now. | 02/09 15:49 |
| leo | in Category/Monad/State.agda | 02/09 16:04 |
| leo | What is the equivalent to the haskell State monad ? I mean State s a = State { runState :: s -> (a,s) } | 02/09 16:04 |
| leo | (State s is really the monad) | 02/09 16:05 |
| Saizan | near the bottom there's a State, that's it | 02/09 16:06 |
| Saizan | and StateMonad is the equivalent of haskell's "instance Monad (State s) where .." | 02/09 16:06 |
| danbrown | help with rewrite? http://acandystore.org/agda/M.Type.html | 02/09 16:59 |
| danbrown | (sorry for the mess) | 02/09 17:00 |
| danbrown | at the bottom i have a few attempts at defining the (s ⇒ t) clause in the function μt | 02/09 17:01 |
| danbrown | i can force it through with the postulate simp!, but i can't get it through with either of the rewrites simp or simp′ | 02/09 17:01 |
| danbrown | what i really want is to use the simpler rewrite op∘op=1, but the x it needs to apply to isn't in my scope | 02/09 17:03 |
| danbrown | (that is, the scope of the (s ⇒ t) clause) | 02/09 17:04 |
| danbrown | at a high level what i'm trying to do is model a simple λ-calculus with free type vars and inductive types. i'm using PHOAS to represent binding at both levels (terms are in http://acandystore.org/agda/M.All.Syntax.html), which seems to work fine. the tricky bit is tracking co- and contravariance on type vars so you can ensure that inductive types μα.t are well-formed. | 02/09 17:33 |
| Saizan | heh, if you've to substitute under a lambda you're screwed :) | 02/09 17:37 |
| danbrown | why so? λ̵ (λ x → λ̵ (λ y → η x)) works fine | 02/09 18:35 |
| Saizan | oh, by substitute there i meant using PropositionalEquality.subst | 02/09 18:36 |
| danbrown | oh, meta lambda | 02/09 18:41 |
| danbrown | right, that's exactly the problem! | 02/09 18:41 |
| danbrown | how do i unscrew myself? :P | 02/09 18:42 |
| danbrown | is there really no way to tell agda that these are the same? | 02/09 18:43 |
| Saizan | you either postulate extensionality or try to see if you can write a conversion by exploiting the specific context where this lambda appears | 02/09 18:44 |
| danbrown | is extensionality known to be unsound? | 02/09 18:44 |
| Saizan | i don't think so | 02/09 18:46 |
| danbrown | i did try exploiting the context: the simp! function forces the conversion, but I couldn't get it to work with the simp′ rewrite | 02/09 19:02 |
| danbrown | i'll see what I can do with extensionality | 02/09 19:02 |
| Saizan | well, simp! works no? can you implement rather than postulate it? | 02/09 19:24 |
| Saizan | ah, maybe it doesn't | 02/09 19:29 |
| copumpkin | anyone have any ideas about my question from yesterday? about the binary tree order preservingness | 02/09 19:39 |
| Saizan | what do you mean by order preservingness? | 02/09 19:40 |
| copumpkin | :P | 02/09 19:41 |
| copumpkin | well, my tree has no data in leaves, and data in the inner nodes, and I want to ensure that left branches are always less than node data which is less than right branch | 02/09 19:42 |
| copumpkin | I was thinking of indexing my nodes by the max value in them | 02/09 19:42 |
| copumpkin | but then I'm not sure what to do about te empty leaves, besides wrapping said max value in a Maybe | 02/09 19:42 |
| copumpkin | which feels ugly :) | 02/09 19:42 |
| Saizan | you'd need min too | 02/09 19:42 |
| copumpkin | yeah | 02/09 19:45 |
| Saizan | data Tree (a : Set) (p : a -> Set) : Set where Leaf : Tree p a; Node : (x : a) -> p x -> Tree (\y -> y < x) a -> Tree (\y -> x < y) a -> Tree p a ? | 02/09 19:45 |
| Saizan | i think i remember something similar in one of pigworker's colorful slides | 02/09 19:46 |
| copumpkin | mmm, does he still make those? I haven't seen any in a while | 02/09 19:46 |
| copumpkin | that looks like it could work nicely | 02/09 19:46 |
| copumpkin | I'll give it a go, thanks! | 02/09 19:47 |
| pigworker | Yeah, my scanning rate is slow... | 02/09 19:47 |
| copumpkin | (mmm, functions in indices :P) | 02/09 19:47 |
| copumpkin | pigworker: you should get an ipad and draw on it! ;) | 02/09 19:47 |
| copumpkin | it's actually not very pleasant | 02/09 19:47 |
| copumpkin | it also doesn't smell like markers | 02/09 19:47 |
| pigworker | The medium is the message. | 02/09 19:47 |
| Saizan | copumpkin: it's a parameter, not an index :P | 02/09 19:48 |
| copumpkin | oh yeah | 02/09 19:48 |
| * copumpkin hides in a hole | 02/09 19:48 | |
| pigworker | Saizan: I beg to differ. It isn't parametric. | 02/09 19:49 |
| copumpkin | oh by the way, what is the point of having relations in higher universes? | 02/09 19:50 |
| Saizan | pigworker: it's not a regular type, but all the constructors produce a "Tree p a" | 02/09 19:50 |
| copumpkin | I see a lot of complexity in the standard library arising from things like orders giving you one universe level for the carrier, then another one for the equality relation and another for the order relation | 02/09 19:51 |
| pigworker | Saizan: which makes it a particularly well-behaved index, but not a parameter | 02/09 19:51 |
| pigworker | You'd see the difference if you coded this in IDesc. You'd make (a : Set) a parameter to the code and (p : a -> Set) the index. | 02/09 19:52 |
| Saizan | ah, true | 02/09 19:53 |
| Saizan | i've always took index to mean that pattern matching could refine it to something else, i've never seen a formal definition of these terms though | 02/09 19:54 |
| pigworker | There's a shortage of terminology here. The "well-behaved" indices are described in Hancock-McBride jargon as "Presbyterian", whilst the ones which get instantiated are "Catholic". | 02/09 19:55 |
| copumpkin | lol | 02/09 19:55 |
| pigworker | Catholicism enables an equality with transubstantiation. | 02/09 19:56 |
| copumpkin | I feel that being in rome, I should only use the latter | 02/09 19:56 |
| pigworker | Agda's data declaration thus has Blah <parameters and Presbyterians> : <Catholics> -> Set | 02/09 19:59 |
| pigworker | Meanwhile, I recommend indexing ordered trees with loose intervals: the indices need to live in the key set extended with bot and top. | 02/09 20:02 |
| copumpkin | hm, that makes sense | 02/09 20:04 |
| copumpkin | one other concern I have is that many of these balanced tree structures temporarily break the invariants during operations | 02/09 20:05 |
| copumpkin | I was wondering if there was a standard way of dealing with that, or if you just have to figure out the details | 02/09 20:05 |
| Saizan | oh, i guess my definition wasn't quite right because it didn't propagate p so you'd lose bounds along the way | 02/09 20:05 |
| copumpkin | (considering that the invariants would be encoded in the indices) | 02/09 20:05 |
| pigworker | copumpkin: what breaks do you have in mind? | 02/09 20:13 |
| pigworker | sometimes you can deal effectively with a local invariant break by storing a (zipper, anomaly) pair, where an anomaly is something you're trying to stuff in the hole of the zipper | 02/09 20:15 |
| copumpkin | I was thinking of something like red-black trees | 02/09 20:16 |
| copumpkin | even in okasaki's presentation of them, the invariant is temporarily broken, where you have red nodes under red nodes | 02/09 20:17 |
| pigworker | no need for that | 02/09 20:17 |
| pigworker | McKinna and I invented the (zipper, anomaly) method to do red-black trees! | 02/09 20:18 |
| copumpkin | :O | 02/09 20:18 |
| pigworker | A program so old, it's in EPIGRAM! http://personal.cis.strath.ac.uk/~conor/epigram1/durham/examples/ctm/redblack.epi | 02/09 20:19 |
| copumpkin | great, thanks :) | 02/09 20:20 |
| pigworker | That just does the balancing, not the ordering, however. | 02/09 20:20 |
| copumpkin | yeah, the ordering is straightforward (I think?) | 02/09 20:21 |
| pigworker | There are lots of infuriating little choices with ordering. Some take a while to bite. | 02/09 20:22 |
| copumpkin | ah, okay | 02/09 20:22 |
| copumpkin | I'll play around with it a bit, anyway | 02/09 20:22 |
| copumpkin | this looks helpful | 02/09 20:22 |
| pigworker | Here's one I prepared earlier: http://personal.cis.strath.ac.uk/~conor/fooling/Sorted.agda | 02/09 20:25 |
| --- Day changed Fri Sep 03 2010 | ||
| danbrown | Saizan: i didn't understand your suggestion earlier—how can i use extensionality to substitute under a lambda? | 03/09 03:32 |
| danbrown | i see it in the abstract—(λx.M)a = M[a/x] = N[a/x] = (λx.N)a ⇒ λx.M = λx.N—but how can i use that to convince agda to do the rewrites i want? | 03/09 03:35 |
| Saizan | as a type: {A B : Set ℓ} {f g : A → B} → (∀ x → f x ≡ g x) → f ≡ g | 03/09 03:51 |
| Saizan | so, when you've to fill the (∀ x → f x ≡ g x) argument, there you have access to that 'x' that was out of scope earlier | 03/09 03:52 |
| lispy | weird, so I'm trying to get started with agda. I followed the instructions to install agda mode in emacs, fired up emacs, and then tried to created ~/tmp/Basics.agda and now emacs is using 100% of my CPU without doing anything that I can descern | 03/09 06:56 |
| lispy | I was able to make emacs abort and now I can switch to Basics.agda and see that it is in agda mode...not sure what this means | 03/09 06:57 |
| lispy | I hit C-c C-l and now emacs is using 100% CPU again | 03/09 06:58 |
| copumpkin | hmm, are you using the standard library? | 03/09 07:00 |
| copumpkin | cause it might be typechecking all your dependencies for the first time | 03/09 07:00 |
| copumpkin | which often takes a while | 03/09 07:00 |
| lispy | Can't exec program: /opt/local/bin/ghci | 03/09 07:00 |
| lispy | Process ghci exited abnormally with code 1 | 03/09 07:00 |
| copumpkin | I've found that in the cases when I do kill the underlying ghci process, emacs will peg my CPU and I have to kill it too | 03/09 07:00 |
| copumpkin | so try to avoid that | 03/09 07:01 |
| copumpkin | oh so ghci doesn't work at all? | 03/09 07:01 |
| lispy | So, I have no idea at all why it would look in opt for ghci | 03/09 07:01 |
| lispy | Who would install ghci to opt? | 03/09 07:01 |
| lispy | and how do I make it look in my path | 03/09 07:01 |
| copumpkin | sounds like macports if you're on a mac | 03/09 07:02 |
| lispy | ls: /opt/local/bin/ghci: No such file or directory | 03/09 07:02 |
| lispy | as near as I can tell, agda-mode dreamed up that path arbitrarily | 03/09 07:02 |
| copumpkin | hm | 03/09 07:03 |
| lispy | I have an idea | 03/09 07:03 |
| lispy | I never use ghci integration with emacs, but once up on a time I did | 03/09 07:03 |
| lispy | I'll comment out the stuff for that | 03/09 07:03 |
| lispy | I actually think making tools run inside emacs is retarded (I say this as a heavy emacs user) | 03/09 07:04 |
| lispy | (rant provided later upon request) | 03/09 07:04 |
| lispy | Okay, now it finds the module and loads it | 03/09 07:04 |
| lispy | yay | 03/09 07:04 |
| lispy | Interesting, it's not highlighting my agda code yet... | 03/09 07:05 |
| lispy | ah, there it goes | 03/09 07:08 |
| lispy | I have to load it before I get coloring | 03/09 07:08 |
| lispy | (by load I mean C-c C-l) | 03/09 07:08 |
| lispy | I wonder how hard it would be to port agda mode to ghci for Haskell stuff | 03/09 07:11 |
| lispy | (I know, ironic after my last statement about retarded to run things in emacs. I'm more interested for new Haskell users than myself.) | 03/09 07:11 |
| stevan | copumpkin: more red-black trees: http://web.student.chalmers.se/groups/datx02-dtp/html/LLRB2.html , http://bitbucket.org/anyfoo/agda-std-trees/src/tip/RBTree/LLRBTree.agda | 03/09 14:12 |
| ski | hm .. "presbyterian index" being one's which you actually pattern-match on ? | 03/09 14:20 |
| ski | (like `Vector (A : Set) (n : Nat) : Set = case n of Zero -> data {}; Succ n -> data {Nil , Cons A (Vector A n)}' in Agda1) | 03/09 14:22 |
| ski | pigworker : ^ | 03/09 14:23 |
| Saizan | that'd be catholic, afaiu | 03/09 14:24 |
| ski | i thought the catholic ones would correspond more to the indices of GADTs in GHC | 03/09 14:24 |
| Saizan | in fact if you define Vector as a data-family it'd have that role | 03/09 14:25 |
| Saizan | s/data-family/GADT/ | 03/09 14:25 |
| Saizan | 'n', i mean | 03/09 14:25 |
| ski | yeah, but the above was actually `Vector' being a function that gives a different type for each natural number | 03/09 14:26 |
| Saizan | pattern matching like in your snippet seems just another encoding of the same thing | 03/09 14:26 |
| ski | well, if you define `Foo : Set -> Set', with constructors like `Blah : ... -> Foo (X -> Y)', then that `X -> Y' isn't really something you pattern-match on (you can't match on elements of `Set') | 03/09 14:27 |
| ski | it's just a bunch of constructors, each having their own pecular arguments given to `Foo' | 03/09 14:28 |
| ski | .. at least, afaiu .. i could easily be confused on the details | 03/09 14:29 |
| Saizan | i wonder if allowing Set as an index is really justified, actually | 03/09 14:31 |
| ski | i don't see why not | 03/09 14:32 |
| Saizan | anyhow, presbyterian seems to be one you _don't_ pattern match, but that doesn't get simply passed to the recursive occurrences like a parameter would | 03/09 14:32 |
| ski | afaiui, the type of the indices, when use that way, shouldn't matter (probably restricted by some stratification scheme, though) | 03/09 14:33 |
| Saizan | i guess it makes sense if you desugar it to constructors holding equalities | 03/09 14:34 |
| ski | Saizan : yes, that's the part i doubted, and wanted confirmation or otherwise on :) | 03/09 14:34 |
| ski | i was thinking that presbyterian indices might be ones which you pattern-match on, while parameters are just constant in the recursive calls, and catholic indices can do "strange" things | 03/09 14:35 |
| ski | i.e. basically, for each combination of possible patterns for presbyterian indices, you'd define a *separate* type | 03/09 14:36 |
| * ski is just speculating here, though .. | 03/09 14:36 | |
| Saizan | what suggested that? | 03/09 14:36 |
| ski | the separation between presbyterian and catholic | 03/09 14:37 |
| ski | i.e. i don't see why "non-constant parameters" couldn't be arbitrary patterns | 03/09 14:38 |
| ski | (.. anyway, it's probably better to wait for pigworker to give an explanation or reference) | 03/09 14:39 |
| Saizan | i think it's just that presbyterians don't introduce refinements so they don't have some of the catholic's issues with pattern matching | 03/09 14:39 |
| Saizan | hence Agda putting them on the same side of the colon as parameters | 03/09 14:40 |
| Saizan | but if you describe data families as fixed points of some indexed functor they'd go in the index | 03/09 14:41 |
| ski | hm | 03/09 14:43 |
| ski | btw, what does `codata' give exactly ? | 03/09 14:44 |
| ski | (probably foolishly) i was thinking it'd give be a coninductive record type .. but that appeared not to be the case | 03/09 14:44 |
| ski | speficially, i tried | 03/09 14:44 |
| ski | codata _#_ {A : Set} (a : A) : A -> Set | 03/09 14:45 |
| ski | where | 03/09 14:45 |
| ski | #Irrefl : a # a -> False | 03/09 14:45 |
| ski | data False : Set | 03/09 14:45 |
| ski | where | 03/09 14:45 |
| ski | i.e. i thought `x # y' would then be a record type, where the `#Irrefl' field existed precisely when `x' and `y' was identical | 03/09 14:46 |
| Saizan | no, you define constructors like for data | 03/09 14:47 |
| ski | yeah .. :/ | 03/09 14:49 |
| Saizan | but you can use the Coinduction module to have coinductive records | 03/09 14:49 |
| pigworker | hi! (was conspiring with agundry) | 03/09 15:43 |
| pigworker | the catholic indices are the ones constrained GADT-style, and it's interesting to consider pattern matching on the presbyterians | 03/09 15:44 |
| pigworker | Inevitably, Hancock refers to presbyterians which admit matching as episcopalians. | 03/09 15:45 |
| ski | ok | 03/09 15:46 |
| pigworker | Episcopalians do sort-of Catholic stuff (as in Vec) but there's still no transubstantiation. | 03/09 15:46 |
| ski | example ? | 03/09 15:47 |
| pigworker | So, things like the numerical indices for Vec and Fin are fine Episcopalian examples | 03/09 15:48 |
| pigworker | But you can't define Martin-Löf's equality in an Episcopalian style. | 03/09 15:48 |
| ski | so must episcopalians be data, or could they be in `Set' ? | 03/09 15:48 |
| pigworker | The size question is open. | 03/09 15:49 |
| ski | hm .. i suppose i really meant to ask whether *non-trivial* episcopalians (i.e. non-variable patterns) must be data, or could be in `Set' | 03/09 15:50 |
| ski | (and i'm asking about the occurances in the result type of the constructors) | 03/09 15:50 |
| pigworker | It's known that parameters can be large. It's known that small indices (of all denominations) are ok. It's not known whether large indices are ok or not, but lots of people guess that they're ok. | 03/09 15:51 |
| ski | ok | 03/09 15:51 |
| ski | i guess i'm treating indices differently from things you pattern-match on, in my head | 03/09 15:52 |
| pigworker | Things you patttern match on are indices. An index is anything treated in a non-parametric way. | 03/09 15:52 |
| ski | afaiu, in the original Agda1, you could define a recursive function, which returned a different data type (with different sets of constructors) in each case | 03/09 15:52 |
| pigworker | Yes, Agda 1 supported Episcopalianism but not Catholicism. | 03/09 15:53 |
| ski | .. this being opposed to having a single datatype, but where the constructors have indices which restrict so that only a couple of them must be considered in each specific case | 03/09 15:53 |
| ski | ok | 03/09 15:54 |
| * ski likes the way Alfa can propagate instantiations, when filling a hole .. | 03/09 15:55 | |
| pigworker | Constructors with restricted return types can sometimes be turned into pattern matching, but may sometimes require equality. | 03/09 15:55 |
| ski | *nod* | 03/09 15:55 |
| ski | how about fields/selectors/deconstructors for record types, where the record type is restricted in each case ? | 03/09 15:56 |
| ski | (like my hypothetical `_#_' above) | 03/09 15:56 |
| ski | is there any system with direct support for something like that | 03/09 15:56 |
| ski | ? | 03/09 15:56 |
| pigworker | so, isn't your codata type the one with Catholic "coconstructor" yuk : False -> a # a ? | 03/09 16:00 |
| pigworker | It's quite reasonable to have indexed record types which offer different fields for different indices (and indeed, structure variance depending on values of internal fields). | 03/09 16:02 |
| ski | no, that lets me prove | 03/09 16:02 |
| ski | #OopsB : {A : Set} {a0 a1 : A} -> Not (a0 # a1) | 03/09 16:02 |
| ski | #OopsB (#Irrefl ()) | 03/09 16:02 |
| ski | (i for some reason called your `yuk' there `#Irrefl', still) | 03/09 16:03 |
| pigworker | I thought #Irrefl was the destructor. But I think I see. | 03/09 16:05 |
| ski | when i fooled around before, trying a constructor for the `codata' just like the `yuk' you suggested, i apparently didn't bother to invent a better name for the deconstructor-now-turned-into-constructor | 03/09 16:06 |
| ski | btw | 03/09 16:07 |
| ski | #OopsA : {A : Set} {a0 a1 : A} -> (a0 # a1) -> (a0 === a1) | 03/09 16:07 |
| ski | #OopsA (#Irrefl _) = ===Refl | 03/09 16:07 |
| pigworker | Using equality to mark explicit Catholicism, I had yuk : False -> a = a' -> a # a', but what you want is yuk : (a = a' -> False) -> a # a' | 03/09 16:07 |
| ski | (i.e. if the match on `#Irrefl' succeeds, it knows that `a0' is `a1') | 03/09 16:07 |
| ski | pigworker : yes, something like that .. except i was wanting to *avoid* going through `.. -> False', hoping to get a more direct encoding | 03/09 16:09 |
| ski | (btw, is there some sane analogue of leibniz-equality for inequality/apartness ?) | 03/09 16:10 |
| danbrown | Saizan: extensionality indeed does the trick: http://acandystore.org/agda/M.Type.html | 03/09 16:10 |
| danbrown | Saizan: thanks :) | 03/09 16:10 |
| pigworker | ski: do you mean intensional apartness (mergeSort # bubbleSort) or a more extensional notion? | 03/09 16:11 |
| ski | for the above `_#_', i was going for something "corresponding" to `data _===_ {A : Set} (a : Set) : A -> Set where ===Refl : a === a' | 03/09 16:12 |
| * ski always mixes up which is which of intensional vs. extensional equality/apartness | 03/09 16:13 | |
| pigworker | intensional is "same from inside" mergeSort is not intensionally equal to bubbleSort | 03/09 16:14 |
| pigworker | if you add intensional apartness, you can't have extensional equality | 03/09 16:15 |
| ski | hm, well i suppose i want to be able to prove functions that give the same outputs for same inputs equal | 03/09 16:15 |
| ski | i definitely don't want to be able to prove `mergeSort' is distinct from `bubbleSort' | 03/09 16:16 |
| pigworker | phew! | 03/09 16:16 |
| ski | whether i would want `mergeSort' to definitely be provably equal to `bubbleSort' is another question | 03/09 16:16 |
| ski | (ideally, i'd like that, but it might be that the system is too weak to prove such things, generally) | 03/09 16:17 |
| pigworker | I think mergeSort is equal to bubbleSort, but 'mergeSort' is different from 'bubbleSort'. | 03/09 16:17 |
| ski | sorry, i'm just using quotes to refer to formal objects from english .. i wasn't referring to the *code* of those | 03/09 16:18 |
| pigworker | I know, but the point rather is about levels of quotation. | 03/09 16:18 |
| pigworker | One can imagine wanting to distinguish implementations, in which case a deep embedding is called for. One might want to distinguish complexity, in which case an instrumented semantics is called for. | 03/09 16:20 |
| ski | hm, yes | 03/09 16:28 |
| ski | the former seems more like a meta vs. object language thing to me | 03/09 16:29 |
| ski | maybe one could build some kind of type system keeping track of complexities (with approximations) .. i don't know | 03/09 16:29 |
| Saizan | danbrown: np | 03/09 16:37 |
| ski | (btw, i'm not really happy with having to manually talk about setoids, and functions which respect those, instead of having some kind of real quotient types in the system .. but then i don't really know very much about the obstacles .. would you happen to know any good reference ?) | 03/09 16:46 |
| pigworker | hmmm, there's some work by Milly Maietti that tells some of the story; meanwhile, team Epigram has most of a plan and some of an implementation, but we haven't written it up except on the blog | 03/09 16:48 |
| Saizan | pigworker: i've heard there was a way to make the representative sneak out through a sigma in the current epigram impl.? | 03/09 17:00 |
| pigworker | you can only get the representative if you can prove you respect the equivalence | 03/09 17:01 |
| ski | "Quotients over Minimal Type Theory" <http://www.math.unipd.it/~maietti/papers/exin.pdf>. "About effective quotients in constructive type theory" <http://www.math.unipd.it/~maietti/papers/equ.ps.gz> | 03/09 17:03 |
| pigworker | what I haven't figured out is a nice way to define "choice functions" | 03/09 17:03 |
| ski | (from the titles, those appear like they could be relevant) | 03/09 17:03 |
| ski | choice functions, in which sense ? | 03/09 17:03 |
| pigworker | ski: that looks like the sort of thing, starting from a basis of extensional TT; so the question is if we can OTT-ify it. | 03/09 17:05 |
| * ski has pondered a little a connective `Forgotten' such that constant functions from `A' to `B' are (naturally) isomorphic to functions from `Forgotten A' to `B' (where `f' being constant here means that `forall x0 x1. f x0 = f x1') | 03/09 17:05 | |
| ski | .. so `Forgotten' is a monad and `forget : A -> Forgotten A' is constant, while if you have `Forgotten A' and a *constant* function from `A' to `B', you can get a `B' | 03/09 17:07 |
| pigworker | given a function f : (A / S) -> (B / R), you might hope there was an actual function g : A -> B, which, moreover, respected the equivalence (like a setoid morphism), but it ain't always so; | 03/09 17:07 |
| pigworker | ski: Forgotten acts like quotienting with the always-true relation. | 03/09 17:09 |
| ski | (one could also ponder adding a modified Markov principle, replacing the double negation with `Forgotten') | 03/09 17:09 |
| ski | pigworker : yeah, i think so, semantically. operationally, the idea was that instead of computing representatives, which we aren't allowed to depend on, we just omit creating the representative (we only know that in principle we could have done so, up to being given representatives for `Forgotten' inputs) | 03/09 17:11 |
| ski | (so `exists x : A. Forgotten (P x)' would be more like `{x : A | P x}' than `Sigma \x : A -> P x') | 03/09 17:12 |
| pigworker | yes, but there are subtle issues of strictness here | 03/09 17:13 |
| ski | mhm ? | 03/09 17:14 |
| pigworker | you need to take care that you don't give the liars room to break your definitional equality | 03/09 17:14 |
| pigworker | all functions are provably constant | 03/09 17:15 |
| pigworker | (in certain contexts) | 03/09 17:15 |
| ski | you mean in inconsistent contexts ? | 03/09 17:15 |
| pigworker | yes | 03/09 17:15 |
| ski | yeah .. so i suppose one needs to make sure such things are only evaluated if a proof of the context is given (which should be impossible for the inconsistent ones) .. and that there's no way for things to "escape" that | 03/09 17:17 |
| * ski idly wonders how Agda2 handles inconsistent contexts .. GHC apparently gives a type error when trying to match an input of type `Equal Int Bool' with `Refl' | 03/09 17:18 | |
| pigworker | Agda won't let you make that match either. | 03/09 17:19 |
| ski | pigworker : btw, do you know roughly at what time i should look at <http://www.e-pig.org/epilogue/> for info on plan on quotients in Epigram ? | 03/09 17:19 |
| pigworker | One can work in inconsistent contexts as long as one is strict in potential lies. But cutting corners can be fatal. | 03/09 17:19 |
| ski | .. yeah | 03/09 17:20 |
| ski | (the "same" problem appears in typed logic programming, if you allow empty types) | 03/09 17:20 |
| pigworker | http://www.e-pig.org/epilogue/?p=319 | 03/09 17:21 |
| ski | ty | 03/09 17:21 |
| edwinb | So, we (by which I mean Ulf) have been implementing forcing for datatypes in Agda | 03/09 17:22 |
| edwinb | so far it has had absolutely no effect except in contrived examples, where it's really good | 03/09 17:22 |
| ski | ("forcing" being ?) | 03/09 17:23 |
| edwinb | marking duplicated arguments in data types so that they don't get normalised, checked for equality, etc | 03/09 17:23 |
| edwinb | we briefly made the type checker twice as fast, but only by ignoring when it broke | 03/09 17:24 |
| copumpkin | does it affect memory usage? :) | 03/09 17:25 |
| copumpkin | wait, is the AIM already in session? | 03/09 17:25 |
| edwinb | yes, this is day 3 | 03/09 17:25 |
| copumpkin | oh! | 03/09 17:25 |
| copumpkin | exciting :) | 03/09 17:26 |
| pigworker | edwinb: for the win, don't you also want to get rid of those arguments (so you never do stuff like substituting in them) | 03/09 17:26 |
| pigworker | ? | 03/09 17:26 |
| edwinb | pigworker: so far, we've aimed to avoid doing any work under markings | 03/09 17:30 |
| edwinb | apparently there are some problems with completely getting rid of them which I don't fully understand | 03/09 17:30 |
| pigworker | pity, 'cos you want to stop all that ghastly whoops-not-sharing-any-more | 03/09 17:31 |
| edwinb | we have some thoughts about being more aggressive | 03/09 17:32 |
| pigworker | Faster Agda! Kill! Kill! | 03/09 17:34 |
| copumpkin | I'd be happy if it stayed same speed and just ate less memory :) I'd really like to be able to typecheck the monoidal category module :P | 03/09 17:35 |
| ski | pigworker : hehe ;) | 03/09 17:35 |
| pigworker | copumpkin: I'd worry if it ate less memory but somehow found more ways to spend time on the memory it did use. | 03/09 17:36 |
| copumpkin | :P | 03/09 17:36 |
| ski | (btw .. i was hoping `A : Prop' could be simulated by `A : Set', and then using `Forgotten A' instead of `A' (with some way to speak about the forgotten element of type `A' inside)) | 03/09 17:36 |
| edwinb | In any case, the analysis we do will be usable at run-time | 03/09 17:38 |
| edwinb | so it's not completely wasted effort | 03/09 17:38 |
| pigworker | ski: I think you can do something like that, but you can't have definitional proof-irrelevance, just propositionally equal proofs. | 03/09 17:38 |
| pigworker | edwinb: it does sound like progress | 03/09 17:38 |
| ski | mhm | 03/09 17:39 |
| ski | by | 03/09 17:39 |
| ski | (P:Prop) <-> (Q:Prop) = (P => Q) /\ (Q => P) | 03/09 17:39 |
| Laney | copumpkin: Apparently this isn't going to help for records. :( | 03/09 17:39 |
| ski | i assume you mean that `P <-> Q' is equal to the latter, when `P : Prop' and `Q : Prop' ? | 03/09 17:39 |
| copumpkin | Laney: aw | 03/09 17:39 |
| pigworker | ski: that's what happens | 03/09 17:40 |
| ski | well, first i was thinking you wanted to express something like a "dependent equivalence" | 03/09 17:41 |
| pigworker | too many = signs | 03/09 17:41 |
| pigworker | <-> computes by recursion on the structure of types | 03/09 17:42 |
| ski | like `(x : A) <-{R x y}-> (y : B)' meaning `((x : A) -> (y : B) * R x y) * ((y : B) -> (x : A) * R x y)' (possibly also including proofs of isomorphism, not only biimplication) | 03/09 17:42 |
| ski | .. anyway, then i get confused on what you mean to express by | 03/09 17:45 |
| ski | (p:-P) <-> (q:-Q) = TT | 03/09 17:45 |
| pigworker | The Epigram 2 <-> is bad notation: it's biimplication for things in Prop, but it's other kinds of equality at other types. It means "equals" | 03/09 17:45 |
| ski | yeah, but afaiu, `p :- P' is not a term, so how can it be claimed to be equal to some other term ? | 03/09 17:46 |
| pigworker | So (p:-P) <-> (q:-Q) = TT means "the proposition that 'proofs p and q are equal' computes to the proposition 'true'". | 03/09 17:46 |
| ski | "We abbreviate p : (:- P) by p :- P when we talk about proof objects at all." | 03/09 17:46 |
| pigworker | :- P is the set of proofs of P. Propositions are *not* types. | 03/09 17:47 |
| ski | ok, so then it means `p <-> q = TT, whenever `p :- P' and `q :- Q' | 03/09 17:47 |
| ski | (yes ?) | 03/09 17:47 |
| pigworker | yes | 03/09 17:47 |
| ski | (i was first reading it like you were wanting to express an equality between `P' and `Q', there, only that it was to be dependent on the proofs of the propositions `P' and `Q', somehow .. which didn't seem to make sense, here) | 03/09 17:48 |
| pigworker | proofs (regardless of proposition) are provable equal; proofs of definitionally equal propositions are definitionally equal | 03/09 17:49 |
| ski | ok (sounds sensible) | 03/09 17:49 |
| pigworker | propositions themselves are provably equal if they imply each other | 03/09 17:50 |
| ski | yeah (since i think you can prove the compositions are identity, in such a case) | 03/09 17:50 |
| pigworker | by proof irrelevance! | 03/09 17:51 |
| ski | *nod* | 03/09 17:51 |
| pigworker | we can get away with that, because proofs are deleted at run-time anyway | 03/09 17:52 |
| pigworker | (by which I mean closed-term-only run-time) | 03/09 17:52 |
| ski | do you think something like `(P : Nat -> Bool) -> Forgotten (exists n : Nat. P n == true) -> exists n : Nat. P n == true' might be sensible ? | 03/09 17:54 |
| pigworker | Ha ha, perhaps, if strict. | 03/09 17:56 |
| copumpkin | is there a running commentary on what's going on at AIM by the way? I saw a talk schedule, but couldn't see what was being worked on in the hacking sessions | 03/09 17:56 |
| ski | (under the operational interpretation of `Forgotten' as identity (i.e. actually construct every "forgotten" value), i think this would be valid .. which might then be admissable, if we don't add anything which would make it impossible to construct the `Forgotten' representatives, if we really wanted to) | 03/09 17:57 |
| ski | (s/admissable/admissable even when not constructing them/) | 03/09 17:58 |
| pigworker | copumpkin: at least this http://wiki.portal.chalmers.se/agda/pmwiki.php?n=AIMXII.Notes | 03/09 17:58 |
| edwinb | it's being edited as we speak... | 03/09 17:59 |
| copumpkin | aha! | 03/09 17:59 |
| pigworker | ski: nasty dilemma... | 03/09 18:01 |
| ski | dilemma, how ? | 03/09 18:02 |
| pigworker | operationally, if you make that thing really get the witness by running the construction, you break the abstraction (you can observe the difference between forgotten things); | 03/09 18:03 |
| ski | not if i only allow to eliminate `Forgotten A' by constant functions from `A' to any `B', i think | 03/09 18:03 |
| pigworker | meanwhile, if you rather make the thing retry all the possibilities starting from 0, the liars will make you spin | 03/09 18:04 |
| ski | the "actually construct representants" operational semantics would be to keep the system "honest", so that since we actually *could* have constructed representants (given they have been constructed for assumptions), we don't actually need to do it | 03/09 18:05 |
| ski | and the "markov-principle" above should of course not return the same natural number witness .. it would typically return the smallest witness (and "doing induction" on the `Forgotten' input, to ensure termination) | 03/09 18:07 |
| pigworker | ski: I don't expect to be able to implement the Markov thing just by respects-equivalence elimination. | 03/09 18:07 |
| ski | the idea being that we could define the above, barring the `Forgotten', and then, after proving that it returns the same witness regardless of the input, we could left-introduce the `Forgotten' there | 03/09 18:09 |
| pigworker | ski: ok, so what might work is to compute the "forgotten" number, check it strictly down to 0, then compute the smallest witness. | 03/09 18:09 |
| ski | s/define the above/define the above by induction on the natural number input/ | 03/09 18:09 |
| ski | pigworker : yeah, except i hoped that the actual operational semantics would not need to compute any of the "forgotten" things .. doing "blind" induction on the forgotten number, so to speak | 03/09 18:10 |
| ski | (i.e., operationally, just loop until you find an example) | 03/09 18:11 |
| pigworker | ski: you can make that the closed-term semantics, but if you do that for open terms, the liars kill you | 03/09 18:11 |
| ski | hm .. that could be so | 03/09 18:12 |
| * ski doesn't know very much of the details of the open-term-reduction used in Agda2 (or Epigram) | 03/09 18:12 | |
| pigworker | The point is that open-term-reduction often needs to be stricter than closed-term-reduction to ensure that lie-dependent computations don't compute to anything usable. | 03/09 18:16 |
| ski | yeah .. i think that makes sense, since you're working with unknown skolems which you can't operationally check what they actually are | 03/09 18:17 |
| pigworker | Like when you do a termination proof by an accessibility argument: on open-terms, you need to be strict in the termination proof to let computation unfold. 'cos you can prove that f x = f x terminates! | 03/09 18:18 |
| ski | hm. what is "termination proof by an accessibility argument" ? | 03/09 18:19 |
| pigworker | As in "Terminating General Recursion" by Bengt Nordström, or as in the "Bove-Capretta method". | 03/09 18:20 |
| ski | "Terminating General Recursion" <http://www.cse.chalmers.se/~bengt/papers/genrec.p(s|df)> 1998 | 03/09 18:22 |
| ski | ty | 03/09 18:22 |
| pigworker | If you define the domain of a function inductively, you can define the function-restricted-to-its-domain by recursion on the proof of domain-inhabitation; show that all inputs live in the domain, and you're done. | 03/09 18:24 |
| pigworker | On open terms, however, you really need to be strict in the proof of domain-inhabitation, even though the regular inputs are enough to determine the control flow. Or the liars kill you. Fortunately, for closed terms, you can dump the proof. | 03/09 18:26 |
| pigworker | And the latter is indeed what happens if you let edwinb compile your program... | 03/09 18:27 |
| ski | (er, s/1998/1988/ :) | 03/09 18:28 |
| ski | ok | 03/09 18:28 |
| pigworker | yeah, it's stood the test of time | 03/09 18:29 |
| ski | "Modelling General Recursion in Type Theory" at <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.57.6947> by Ana Bove,Ana Bove in 2002 | 03/09 18:30 |
| ski | (argh, stupid paste, s/Ana Bove,Ana Bove/Ana Bove,Venanzio Capretta/) | 03/09 18:31 |
| ski | pigworker : anyway, ty for the info | 03/09 18:31 |
| pigworker | yep; and it goes back to Ana's Licentiate thesis in 1999, with unification as the example | 03/09 18:31 |
| pigworker | ski: ok, yes, I see that you can define the Markov operator you want, and it is strict in the sense I suggested. | 03/09 18:36 |
| ski | lic. th. "Programming in Martin-Löf Type Theory: Unification - A non-trivial Example" at <http://www.cse.chalmers.se/~bove/Papers/lic_thesis.pdf> by Ana Bove in 1999-11 | 03/09 18:36 |
| ski | pigworker : can define it in what system ? | 03/09 18:37 |
| pigworker | yep, that's the thesis I mean | 03/09 18:37 |
| pigworker | with the quotient encoding | 03/09 18:37 |
| ski | (yeah, i figured. i just wanted to give the direct link, for completeness) | 03/09 18:38 |
| pigworker | so you get elimForgotten : (X : Set)(P : Forgotten X -> Set)(p : (x : X) -> P (forget x))(r : (x x' : X) -> p x == p x') -> (f : Forget X) -> P f | 03/09 18:39 |
| pigworker | and elimForgotten X P p r (forget x) = p x | 03/09 18:40 |
| pigworker | you do *not* get an eta-rule for (Forget X) | 03/09 18:41 |
| ski | yeah, that sounds more or less like it | 03/09 18:41 |
| ski | though i guess that in that, `x' will actually need to be constructed (unless you specifically avoid it in cases like this, for closed terms, as you said) | 03/09 18:42 |
| ski | pigworker : yeah, i already figured that one out :) | 03/09 18:43 |
| pigworker | ski: took me a while to notice; I really wanted that eta-rule. | 03/09 18:44 |
| ski | yeah, it feels nice to have equality "distribute" over the connectives .. but apparently that isn't compatible with the constantness of `forget' (iirc) | 03/09 18:46 |
| pigworker | you can write expose : Forgotten X -> X by expose = elimForgotten X (\_ -> X) (\x -> x) bullshit | 03/09 18:46 |
| pigworker | operationally, expose (forget true) = true, expose (forget false) = false | 03/09 18:47 |
| pigworker | it's harmless to prove true == false this way, because you already have bullshit | 03/09 18:48 |
| pigworker | but it's fatal to take (forget true = forget false) definitionally, because that makes true = false definitionally, too | 03/09 18:48 |
| ski | operationally, i was thinking of `forget E' to reduce to `forget -' (where `-' stands for a nice "bullet"), where that would be a value | 03/09 18:50 |
| ski | and, since we have a monad structure, we'd then have `forget - >>= _' reduce to `forget -' (without even considering the right-hand-argument) | 03/09 18:51 |
| pigworker | ski: same deal | 03/09 18:51 |
| ski | hm, what do you mean by "take (forget true = forget false) definitionally" ? | 03/09 18:51 |
| pigworker | If P : Forget X -> Set, are P (forget true) and P (forget false) equal sets (as in the conversion rule)? | 03/09 18:53 |
| pigworker | if you make forget blah compute to forget -, then yes they are! | 03/09 18:53 |
| pigworker | now if P = \f -> if (expose f) then Nat else Nat -> Nat, I have that Nat is the same type as Nat -> Nat, and I can typecheck (\x -> x x)(\x -> x x). | 03/09 18:56 |
| pigworker | So, has AIM decanted to the pub yet? | 03/09 19:03 |
| ski | yes, i was thinking `forget' should be constant, so those two sets should probably be equal, then | 03/09 19:03 |
| ski | ok | 03/09 19:03 |
| ski | so i suppose either we need to not treat the sets as equal, or we need to be careful with `expose (forget blah)', somehow | 03/09 19:04 |
| ski | pigworker : anyway, ty for the info | 03/09 19:04 |
| * ski should probably go to sleep soon | 03/09 19:05 | |
| pigworker | delicate stuff; I should go to the shops... | 03/09 19:05 |
| danbrown | Laney: i have a one-line css patch for the irc logs | 03/09 20:47 |
| danbrown | Laney: add "white-space: nowrap" under "a.time" | 03/09 20:48 |
| Laney | ok | 03/09 20:48 |
| danbrown | Laney: keeps the table row heights under control | 03/09 20:49 |
| danbrown | when a.time wraps the rows get excessively tall | 03/09 20:49 |
| danbrown | thanks :) | 03/09 20:49 |
| * copumpkin was creeped out when he saw orangesquash.co.uk | 03/09 20:50 | |
| copumpkin | thought it was my cousin | 03/09 20:50 |
| copumpkin | but turned out not to be | 03/09 20:50 |
| djahandarie | "Watch the Jesus film live in over forty languages." lol | 03/09 20:51 |
| Laney | danbrown: there, much better | 03/09 20:51 |
| danbrown | Laney: beautiful, ty :) | 03/09 20:52 |
| --- Day changed Sat Sep 04 2010 | ||
| lispy | in agda, what is analogous to haskell's Prelude? | 04/09 04:34 |
| lispy | I feel like I want to start there for understanding agda | 04/09 04:34 |
| copumpkin | hmm, the standard library :) you don't really get anything by default, and there's no "catchall module" unlike Prelude in haskell | 04/09 04:35 |
| copumpkin | unless you consider Everything | 04/09 04:35 |
| copumpkin | which gives you everything in the entire standard library | 04/09 04:35 |
| copumpkin | most people just redefine their own datatypes for simple proofs or import the specific modules they need from the standard library | 04/09 04:36 |
| lispy | interesting | 04/09 04:36 |
| lispy | The reason I wanted it was because learning the Prelude was a good "exercise" to learn Haskell | 04/09 04:37 |
| lispy | I thought I would repeat that strategy | 04/09 04:37 |
| lispy | There is an agda type I don't understand, maybe I should start there | 04/09 04:37 |
| copumpkin | well, reading things like Data.List and Data.Vec | 04/09 04:37 |
| lispy | But, that question might be better on the mailing list | 04/09 04:37 |
| copumpkin | you on a mac? you can also navigate the source in the editor | 04/09 04:37 |
| lispy | (the type I'm struggling with is the type of function composition) | 04/09 04:38 |
| copumpkin | for me right command + click jumps to the definition of any identifier | 04/09 04:38 |
| copumpkin | lispy: oh, the fully dependent one? | 04/09 04:38 |
| lispy | copumpkin: yes | 04/09 04:38 |
| copumpkin | just the fact that it's big and ugly? | 04/09 04:38 |
| copumpkin | ∀ {a b c} | 04/09 04:39 |
| copumpkin | {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} → | 04/09 04:39 |
| copumpkin | (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → | 04/09 04:39 |
| copumpkin | ((x : A) → C (g x)) | 04/09 04:39 |
| lispy | page 6 of the Ulf's tutorial | 04/09 04:39 |
| copumpkin | oh, hmm | 04/09 04:39 |
| copumpkin | that'll be something like the one I wrote above, minus the little a, b, c | 04/09 04:39 |
| lispy | yeah | 04/09 04:39 |
| lispy | looks close | 04/09 04:39 |
| lispy | _?_ : {A : Set}{B : A -> Set}{C : (x : A) -> B x -> Set} | 04/09 04:40 |
| lispy | (f : {x : A}(y : B x) -> C x y)(g : (x : A) -> B x) | 04/09 04:40 |
| lispy | (x : A) -> C x (g x) | 04/09 04:40 |
| lispy | (f ? g) x = f (g x) | 04/09 04:40 |
| copumpkin | so ignoring the implicit values | 04/09 04:40 |
| copumpkin | (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → ((x : A) → C (g x)) | 04/09 04:40 |
| lispy | (quick bio break, keep explaining and I'll ask questions when I get back, thanks!) | 04/09 04:40 |
| copumpkin | (f : ∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → ((x : A) → C (g x)) | 04/09 04:41 |
| copumpkin | so there are two parameters there, f and g | 04/09 04:42 |
| copumpkin | g is the simpler one, and it's a dependent function from A to B x, where x is the value of type A that was passed in | 04/09 04:42 |
| lispy | back | 04/09 04:44 |
| lispy | isn't x also a parameter? Or am I misreading the parens? | 04/09 04:45 |
| copumpkin | just looking at (g : (x : A) → B x) | 04/09 04:45 |
| copumpkin | it means that g is a dependent function that takes an A as input | 04/09 04:45 |
| copumpkin | but the return type depends on the input value | 04/09 04:45 |
| copumpkin | so you need to name it x, and pass it into B | 04/09 04:45 |
| copumpkin | so B is a function from A to types | 04/09 04:45 |
| lispy | okay, so unlike haskell you don't have to put arrows between parameters when the delimiters are obvious? | 04/09 04:45 |
| lispy | I shouldn't say parameters | 04/09 04:46 |
| copumpkin | yeah, you don't | 04/09 04:46 |
| copumpkin | you can also write (x y z : List A) or something | 04/09 04:46 |
| lispy | in haskell it would have been like, g :: A -> B, but in agda you can write g : A B | 04/09 04:46 |
| copumpkin | and that's the same as List A -> List A -> List A | 04/09 04:46 |
| copumpkin | oh, not like that | 04/09 04:47 |
| copumpkin | in agda you'd still have to write g : A -> B | 04/09 04:47 |
| lispy | so how is it that here we can write g : ( x : A) B x, and have it mean (abusing notation) g : A -> B | 04/09 04:47 |
| copumpkin | oh, maybe that is possible, but I've never seen it that way on the last arrow | 04/09 04:48 |
| copumpkin | that's just a syntactic thing though | 04/09 04:48 |
| copumpkin | I'd leave the arrows in for now | 04/09 04:48 |
| lispy | so we could have written g : (x : A) -> B x ? | 04/09 04:48 |
| copumpkin | g : (x : A) -> B x | 04/09 04:48 |
| copumpkin | that's what is up there | 04/09 04:48 |
| copumpkin | oh | 04/09 04:48 |
| copumpkin | I see | 04/09 04:48 |
| copumpkin | you don't see my unicode | 04/09 04:49 |
| copumpkin | :P | 04/09 04:49 |
| lispy | ohh | 04/09 04:49 |
| copumpkin | there are unicode arrows in there | 04/09 04:49 |
| lispy | Yeah, lame | 04/09 04:49 |
| lispy | I'm using xchat aqua | 04/09 04:49 |
| lispy | Any idea how we can resolve this? | 04/09 04:49 |
| copumpkin | but anyway, yeah, there are some syntactic cases where you can leave arrows out, but don't worry about them for now | 04/09 04:49 |
| copumpkin | I use textual on mac os :) | 04/09 04:49 |
| copumpkin | but for now, we can just write ascii arrows | 04/09 04:49 |
| copumpkin | g : (x : A) -> B x | 04/09 04:49 |
| copumpkin | so A is of type Set (the type of types) and B is of type (A -> Set) | 04/09 04:49 |
| copumpkin | that is, a function that takes an A and gives you a type | 04/09 04:50 |
| lispy | So, why is it incorrect to say, g : A -> B ? | 04/09 04:50 |
| copumpkin | it isn't, but that's a different type | 04/09 04:50 |
| lispy | (I get what g : (x : A) -> B x means) | 04/09 04:50 |
| copumpkin | okay | 04/09 04:50 |
| copumpkin | it's just a more restricted type | 04/09 04:50 |
| lispy | Actually. the B x part is a bit fuzzy in my brain | 04/09 04:50 |
| lispy | I think of B x as B is some how indexed by x | 04/09 04:50 |
| copumpkin | A -> B === (x : A) -> ((const B) x) | 04/09 04:50 |
| copumpkin | so A -> B is just sugar for a dependent function that ignores the dependent value, let's say | 04/09 04:51 |
| lispy | where would you write the foralls in that? | 04/09 04:51 |
| copumpkin | you don't need them unless you want it to try to infer the type | 04/09 04:51 |
| copumpkin | you could write forall x -> B x | 04/09 04:51 |
| copumpkin | (so it'll see that B takes an A as input, and figure out that x needs to be of type A) | 04/09 04:52 |
| lispy | forall x such that x in A, const B x | 04/09 04:52 |
| lispy | Sorry, I didn't meant to use a language feature, I meant the forall in terms of logic | 04/09 04:52 |
| copumpkin | oh, that's just any function | 04/09 04:53 |
| copumpkin | pf : (x : A) -> B x | 04/09 04:53 |
| copumpkin | means that for all values of x, we can prove B of x | 04/09 04:53 |
| lispy | Haskell signatures have taught me that the placement of the forall matters. So I want to make sure I understand where they (implicitly) are | 04/09 04:53 |
| copumpkin | A might be naturals, and B might be a proposition saying the natural is even | 04/09 04:53 |
| copumpkin | so pf : (x : Nat) -> even x | 04/09 04:53 |
| copumpkin | that's clearly not true, so you wouldn't be able to prove it | 04/09 04:54 |
| * lispy nods | 04/09 04:54 | |
| copumpkin | the foralls might even be easier to think about in agda, since they're fairly consistent | 04/09 04:54 |
| * copumpkin shrugs | 04/09 04:55 | |
| lispy | is it okay if I back up for a second? | 04/09 04:55 |
| copumpkin | sure | 04/09 04:55 |
| lispy | Supposed I defined compose the way it's defined in Haskell, and with that type. Would it be wrong in some way in Agda? | 04/09 04:55 |
| copumpkin | not at all | 04/09 04:55 |
| copumpkin | it's just not as flexible as it could be | 04/09 04:55 |
| lispy | because then it could only work on values instead of types too? | 04/09 04:56 |
| copumpkin | agda gives you more flexibility with the types, and as such the types can get more bloated | 04/09 04:56 |
| copumpkin | not so much working only on values | 04/09 04:56 |
| copumpkin | but the types are fixed | 04/09 04:56 |
| copumpkin | in agda, the type of the output can depend on the value of the input | 04/09 04:56 |
| copumpkin | so f 0 might give me a Bool | 04/09 04:56 |
| lispy | got it | 04/09 04:56 |
| lispy | thanks | 04/09 04:57 |
| copumpkin | and another input might give me another type as output | 04/09 04:57 |
| copumpkin | np | 04/09 04:57 |
| lispy | yeah, that's pretty cool | 04/09 04:57 |
| lispy | I guess that property would be really interesting in a parser? | 04/09 04:57 |
| copumpkin | yeah, it's pretty awesome | 04/09 04:57 |
| copumpkin | it's amazing everywhere, really | 04/09 04:57 |
| * lispy nods | 04/09 04:57 | |
| lispy | I've studied Isabelle a bit, have you ever used that? | 04/09 04:57 |
| copumpkin | for example, you could write a printf that actually parses the format string, and gives you a function that's only accepts the right types | 04/09 04:57 |
| copumpkin | nope :/ | 04/09 04:57 |
| copumpkin | (oh, going back to your question, about haskell composition, http://www.cs.nott.ac.uk/~nad/listings/lib/Function.html#894) | 04/09 04:58 |
| copumpkin | that's plain old haskell composition | 04/09 04:59 |
| lispy | isabelle's programming language is based on ML so the syntax is rubbish, but a cool thing about it is that you can state totally arbitrary theorems/properties about the code you wrote and then try to prove them (whereas you can do the equivalent thing here, the proofs are a bit more like programs than they are in agda) | 04/09 04:59 |
| copumpkin | the proofs are very much programs in agda too, in fact they look identical :) | 04/09 04:59 |
| lispy | no that's what I mean is different | 04/09 05:00 |
| lispy | In isabelle your theorems can be kind of separate | 04/09 05:00 |
| copumpkin | oh I see | 04/09 05:00 |
| copumpkin | yeah | 04/09 05:00 |
| lispy | Which can also be nice, but I <3 the agda syntax | 04/09 05:00 |
| lispy | Which is why I'm here instead of in #isabelle right now :) | 04/09 05:01 |
| copumpkin | well, in agda you can choose whether to keep them separate or not | 04/09 05:01 |
| copumpkin | they keep the same syntax though | 04/09 05:01 |
| lispy | thanks for the example file BTW | 04/09 05:01 |
| copumpkin | oh no problem | 04/09 05:01 |
| lispy | can you define _;_ in agda? | 04/09 05:01 |
| copumpkin | if you look at http://www.cs.nott.ac.uk/~nad/listings/lib/Function.html#894 for example, you'll see it's almost identical to haskell's equivalent thing | 04/09 05:01 |
| copumpkin | hmm, I think semicolon might be reserved | 04/09 05:02 |
| lispy | ah bummer, some math texts use _;_ as flip _o_ | 04/09 05:02 |
| copumpkin | ah :/ | 04/09 05:02 |
| lispy | at first I thought that was confusing but it's actually kind of nice to be able to write function composition in application order | 04/09 05:03 |
| lispy | Looking at _o_ these days, it's not as confusing as I once thought it was | 04/09 05:05 |
| lispy | it's a very long type signature, but it's logical | 04/09 05:05 |
| copumpkin | yeah, the stuff gets easier to read quickly :) | 04/09 05:06 |
| copumpkin | unless you go looking at that presburger arithmetic solver :) | 04/09 05:06 |
| lispy | does agda have anything analogous to type classes? | 04/09 05:07 |
| copumpkin | not really, but you can pretend you do with records, although you don't get the automatic lookup of instances | 04/09 05:07 |
| copumpkin | the records and modules are way more flexible than haskell's | 04/09 05:07 |
| lispy | does anyone work on performance opportunities in the code gen? It seems like agda programs would have a lot of information available to aid the compiler in generating very lean code | 04/09 05:08 |
| copumpkin | hardly anyone even uses agda's compiler(s) but even if they did, I don't think they do much in terms of optimization | 04/09 05:09 |
| copumpkin | they go through haskell with a lot of unsafeCoercing I think | 04/09 05:09 |
| copumpkin | but there have been papers on the additional opportunities presented by all the extra compile-time knowledge | 04/09 05:09 |
| lispy | riht | 04/09 05:10 |
| lispy | right* | 04/09 05:10 |
| lispy | I think performance is actually important, even for a language as niche as agda | 04/09 05:10 |
| copumpkin | I think most attempts are still trying to make the language itself more pleasant to use | 04/09 05:10 |
| * lispy wonders how open the agda compiler development is | 04/09 05:10 | |
| lispy | okay, essentially BSD license, that's good | 04/09 05:14 |
| lispy | oh, darcs repo, that's cool too | 04/09 05:15 |
| copumpkin | it's pretty actively developed, too | 04/09 05:15 |
| lispy | maybe I'll get involved at some point | 04/09 05:15 |
| lispy | Need to learn the language a bit :) | 04/09 05:15 |
| copumpkin | :) | 04/09 05:16 |
| copumpkin | I'd set simple things to prove first, just to get a feel for it | 04/09 05:16 |
| copumpkin | maybe even things that djinn could prove | 04/09 05:16 |
| lispy | one "project" that occurred to me was following the typing haskell in haskell paper but doing it in agda | 04/09 05:18 |
| lispy | I have no idea how daunting it would be, but I know I would learn a lot by the end about haskell, type checkers, agda, and proofs | 04/09 05:19 |
| copumpkin | oh | 04/09 05:20 |
| copumpkin | it'd be pretty hard :) | 04/09 05:20 |
| copumpkin | I'd start with trivial properties of natural numbers and stuff like that | 04/09 05:20 |
| copumpkin | maybe try to prove associativity or commutativity of addition | 04/09 05:20 |
| copumpkin | or stuff about even/odd numbers | 04/09 05:20 |
| lispy | okay, the agda devs need to learn the power of tagging in darcs :) | 04/09 05:21 |
| lispy | (better yet, we need to make darcs automatically do invisible tags (checkpoints?) for users) | 04/09 05:22 |
| copumpkin | yeah | 04/09 05:24 |
| lispy | I actually have a secret motive in having agda be high performance (and me learning agda)...what if we rewrote the core of darcs in agda?? | 04/09 05:25 |
| copumpkin | also, something to realize is that agda's inductive families (like haskell's GADTs) are ridiculously powerful, and if you can express your properties/proofs in terms of very expressive types defined that way, they tend to be easier to work with | 04/09 05:26 |
| copumpkin | I didn't realize that at first and wrote even uglier stuff than I do now | 04/09 05:26 |
| lispy | I think I learned that bit of advice from glguy's agda snippets | 04/09 05:26 |
| lispy | at least, assuming I understand you correctly (which I may not being I'm a n00b) | 04/09 05:27 |
| copumpkin | probably do | 04/09 05:27 |
| copumpkin | something like defining evenness for numbers, for example | 04/09 05:27 |
| lispy | The way I internalized his examples is that you cookup data types that are kind of like definitions you'll use in a proof. Then you write some functions over those data types to prove your lemmas then you can apply those lemmas to your "normal" code definitions | 04/09 05:28 |
| copumpkin | one way would be even : Nat -> Set; even 0 = \top; even (suc zero) = \bot; even (suc (suc n)) = even n | 04/09 05:28 |
| copumpkin | or a mutually recursive version with odd in there too | 04/09 05:28 |
| copumpkin | but it's a lot more pleasant to make a custom datatype for it | 04/09 05:29 |
| lispy | I think I've seen the mutually recursive variant of that, though possible in Isabelle | 04/09 05:29 |
| lispy | and how does the data type variant look? | 04/09 05:29 |
| copumpkin | there are a few ways of doing it, really | 04/09 05:30 |
| copumpkin | let me think of one | 04/09 05:30 |
| lispy | I would think that you define a data family where even is a constructor and so is odd | 04/09 05:30 |
| copumpkin | yeah | 04/09 05:31 |
| copumpkin | indexed by the Nat | 04/09 05:31 |
| lispy | right | 04/09 05:31 |
| copumpkin | well, that's not really giving you a statement about the evenness of the number though | 04/09 05:31 |
| copumpkin | but something like | 04/09 05:31 |
| copumpkin | data Even : Nat -> Set where zero : Even 0; sucsuc : forall n -> Even n -> Even (suc (suc n)) | 04/09 05:32 |
| copumpkin | you could even call the constructors something like 0# and 2+_ | 04/09 05:33 |
| copumpkin | so a proof of Even 4 would be 2+ 2+ 0# | 04/09 05:33 |
| lispy | oh actually, agda repo does have tags, even as recently as the last release | 04/09 05:33 |
| lispy | I wonder why lazy get was so slow | 04/09 05:33 |
| copumpkin | or you could have a pair of mutually recursive datatypes | 04/09 05:34 |
| copumpkin | which is very cute | 04/09 05:34 |
| copumpkin | :P | 04/09 05:34 |
| lispy | yes actually | 04/09 05:34 |
| lispy | That sounds nice now that you mention it | 04/09 05:34 |
| copumpkin | mutual; data Even : Nat -> Set where zero : Even 0; suc : forall n -> Odd n -> Even (suc n); data Odd : Nat -> Set where suc : forall n -> Even n -> Odd (suc n) | 04/09 05:35 |
| copumpkin | note the overlapping constructor names :P | 04/09 05:35 |
| copumpkin | (also, that unlike haskell, agda is linear unless you put it in a mutual block) | 04/09 05:36 |
| copumpkin | so if A appears below B in the file, B won't see A | 04/09 05:36 |
| lispy | Sadly, I don't know what that means | 04/09 05:36 |
| lispy | ah | 04/09 05:36 |
| copumpkin | lispy: here's a simple example: http://pastie.org/1137378 | 04/09 05:41 |
| lispy | copumpkin: yes, very pretty | 04/09 05:42 |
| copumpkin | one thing to try proving might be that the sum of two evens is even, and stuff like that | 04/09 05:42 |
| lispy | copumpkin: and I think this follows typical development of mathematics. Even and odd are your definitions, now you can state (and prove) propositions about them. Quite amazing considering I first learned programming in Visual Basic and it was nothing like maths! | 04/09 05:43 |
| copumpkin | yeah :) | 04/09 05:43 |
| copumpkin | anyway, this same technique can be used to express arbitrary relations | 04/09 05:44 |
| copumpkin | the <= in the standard library is defined inductively too | 04/09 05:44 |
| lispy | I should rewatch glguys agda talk this weekend while this is fresh, maybe i'll understand more this time around | 04/09 05:45 |
| copumpkin | is it online? | 04/09 05:46 |
| lispy | wait a sec, did we not post it?? | 04/09 05:46 |
| lispy | http://vimeo.com/channels/galois | 04/09 05:46 |
| copumpkin | beats me, I haven't ever seen a galois talk | 04/09 05:46 |
| copumpkin | aha | 04/09 05:46 |
| lispy | http://www.galois.com/blog/2010/08/10/galois-inc-wins-three-department-of-energy-small-business-research-awards/ I'm currently working on this project from that list: Collaboration and Sharing on the Grid | 04/09 05:48 |
| copumpkin | ah cool | 04/09 05:49 |
| lispy | copumpkin: http://www.galois.com/blog/2010/06/11/tech-talk-introducing-well-founded-recursion/ | 04/09 05:49 |
| lispy | copumpkin: I can't find it on vimeo, but I'm like 90% that we recorded it | 04/09 05:51 |
| copumpkin | ah, I'd like to see that if you can get someone to upload it :) | 04/09 05:51 |
| copumpkin | I'll watch the other talks in the mean time | 04/09 05:51 |
| copumpkin | how many people show up for these talks? | 04/09 05:52 |
| lispy | copumpkin: it really varies a lot | 04/09 05:52 |
| lispy | copumpkin: and not all talks are public | 04/09 05:52 |
| copumpkin | ah I see | 04/09 05:53 |
| lispy | copumpkin: but we regularly get PSU students (and sometimes profs), people from random companies around portland (from startups to Intel) and then usually about 10 galois folks. so ya know, like, 10-25 people? | 04/09 05:53 |
| copumpkin | that sounds really nice | 04/09 05:54 |
| copumpkin | lispy: oh, another quick note about agda which may not be obvious, is that all data is finite | 04/09 05:54 |
| lispy | oh and speaker notoriety matters. Don Stewart can bring a bigger crowd than me by far :) | 04/09 05:54 |
| copumpkin | lispy: so no infinite lists for you, unless you use the (slightly more esoteric) codata construct | 04/09 05:55 |
| lispy | that makes sense | 04/09 05:55 |
| lispy | I've familiar with codata from sigfpe's blog | 04/09 05:55 |
| copumpkin | ah ok | 04/09 05:55 |
| lispy | all hail sigfpe's blog! | 04/09 05:55 |
| copumpkin | yeah, it's pretty fun :) | 04/09 05:55 |
| Mathnerd314 | say, I did read that blog from beginning to end a few months ago :p | 04/09 05:56 |
| lispy | Mathnerd314: and your mind when from this big ( | | ), to this big? (| |) ? | 04/09 05:56 |
| Mathnerd314 | more like (| |) to (| |) | 04/09 05:57 |
| lispy | it's truly a high quality blog, that's for sure | 04/09 05:57 |
| lispy | I think ezyang's blog will rival it in time :) | 04/09 05:58 |
| Mathnerd314 | idea: codata is a monad, so Agda should get do-notation for it | 04/09 05:59 |
| Mathnerd314 | you can think it over while I sleep | 04/09 06:00 |
| Adamant | lispy: I was thinking the Grid bit was for the Smart Grid stuff. | 04/09 06:12 |
| Adamant | I was like, "yes, please give me verifiable code so haX0rs do not turn my thermostat up to 100" | 04/09 06:13 |
| lispy | Adamant: ah, more like open science grid | 04/09 06:15 |
| Adamant | yeah, still a worthy pursuit | 04/09 06:16 |
| lispy | http://www.opensciencegrid.org/ LHC runs on OSG :) | 04/09 06:16 |
| lispy | Adamant: IIRC, we have made proposals to help with Smart Grid stuff | 04/09 06:16 |
| lispy | I don't think we won any of those | 04/09 06:16 |
| Adamant | lispy: damn. | 04/09 06:17 |
| lispy | either that or we didn't hear back yet, I lost track :) | 04/09 06:17 |
| Adamant | lispy: good luck. | 04/09 06:17 |
| lispy | Someone really needs to be working on | 04/09 06:17 |
| Adamant | I would like a non-crappy language and good secure web libraries for anything that gets used | 04/09 06:17 |
| Adamant | and it sounds like Galois is all about that | 04/09 06:18 |
| lispy | sometimes the pipeline for working on an identified problem can be several years. so it could be that in say, 5 years time we've helped | 04/09 06:18 |
| Adamant | yeah. | 04/09 06:18 |
| Adamant | look at epub; we're finally all using or looking at ereaders now | 04/09 06:18 |
| Adamant | it was designed back in the 2000-2002 era IIRC | 04/09 06:18 |
| lispy | heh yeah | 04/09 06:19 |
| * Saizan is going to use an AVL tree to index his terms | 04/09 12:28 | |
| copumpkin | my emacs agda always opens up with the agda status on the right | 04/09 20:10 |
| copumpkin | and I can move it back under the text input by hand, but it never sticks | 04/09 20:10 |
| copumpkin | any idea how to force it to open underneath? | 04/09 20:10 |
| lispy | copumpkin: what is the agda status? Mine doesn't do that... | 04/09 20:15 |
| copumpkin | yeah, mine didn't in the past either | 04/09 20:15 |
| copumpkin | I just mean the little bit that tells you the types of holes and context | 04/09 20:16 |
| copumpkin | and normalized terms and the like | 04/09 20:16 |
| lispy | okay, it's a feature I haven't explored yet | 04/09 20:16 |
| lispy | Sounds handy though | 04/09 20:16 |
| copumpkin | yeah, it's invaluable | 04/09 20:17 |
| copumpkin | lispy: the top commands I use are C-c C-, inside a hole | 04/09 20:17 |
| copumpkin | tells you what's expected and what the context is | 04/09 20:17 |
| copumpkin | C-c C-a fills in easy holes for you | 04/09 20:18 |
| copumpkin | C-c C-r will fill in easy holes with additional holes if only one constructor (or lambda, or record) fits, or you can write what to fill in and it'll put in the right number of arguments for you | 04/09 20:18 |
| copumpkin | C-c C-n will normalize (sort of evaluate) any term you write in | 04/09 20:18 |
| lispy | http://www.cs.nott.ac.uk/~nad/listings/lib/Data.List.html | 04/09 22:13 |
| lispy | In that definition of List A, why is there an {a}? | 04/09 22:13 |
| copumpkin | it's universe polymorphism | 04/09 22:13 |
| copumpkin | not fundamental | 04/09 22:13 |
| lispy | why not, data List ( A : Set ) : Set where .. | 04/09 22:14 |
| copumpkin | means the list can contain regular types, or types of types, or types of types of types | 04/09 22:14 |
| copumpkin | and so on | 04/09 22:14 |
| copumpkin | that would work too, but this is more general | 04/09 22:14 |
| copumpkin | Set == Set zero | 04/09 22:14 |
| copumpkin | (just a syntactic shortcut) | 04/09 22:14 |
| lispy | so my definition would be lists of values only | 04/09 22:14 |
| copumpkin | yeah, values of any "small" type | 04/09 22:15 |
| copumpkin | so anything you can write in haskell, for example | 04/09 22:15 |
| lispy | how do you type this identifier? _??_ | 04/09 22:16 |
| copumpkin | but you could also conceivably do Nat :: Bool :: Fin 3 :: List Bool :: [] | 04/09 22:16 |
| lispy | _::^r_ ? | 04/09 22:16 |
| copumpkin | _\::_ | 04/09 22:16 |
| copumpkin | I'm assuming | 04/09 22:16 |
| copumpkin | your encoding was lost and it looks like question marks :) | 04/09 22:16 |
| lispy | stupid xchat | 04/09 22:16 |
| lispy | It has a super script r on the :: | 04/09 22:16 |
| copumpkin | http://www.codeux.com/textual/ I never looked back | 04/09 22:17 |
| copumpkin | oh | 04/09 22:17 |
| copumpkin | _\::\^r_ | 04/09 22:17 |
| lispy | I feel like I tried textual and it was missing some must have features for me | 04/09 22:17 |
| copumpkin | ah | 04/09 22:17 |
| lispy | I might need to do this: http://fileshar3.info/files/aha...utf8./Screen%20shot%202009-10-12%20at%203.28.35%20PM.JPG | 04/09 22:20 |
| * lispy relogs | 04/09 22:20 | |
| copumpkin | yep :) | 04/09 22:20 |
| lispy | hit me with some unicode | 04/09 22:23 |
| lispy | _∷ʳ_ | 04/09 22:23 |
| lispy | Can you see it now? | 04/09 22:23 |
| copumpkin | yep | 04/09 22:24 |
| * lispy wonders why you'd make an irc client in this day and age that doesn't default to utf8 | 04/09 22:27 | |
| --- Day changed Sun Sep 05 2010 | ||
| lispy | Am I right that, Agda is really intended for proving statements and not for (directly) providing implementations of anything? | 05/09 00:39 |
| benmachine | does agda-mode want haskell-mode installed? | 05/09 00:39 |
| lispy | Part of why I ask: Agda1 had Int but Agda2 does not | 05/09 00:39 |
| copumpkin | lispy: the question in the topic indicates that people haven't decided yet | 05/09 00:40 |
| copumpkin | lispy: well, you have Data.Integer | 05/09 00:40 |
| lispy | copumpkin: That's my next question. | 05/09 00:40 |
| copumpkin | which I believe has a compile-time binding to Haskell's Integer type | 05/09 00:40 |
| copumpkin | even though it's expressed as an algebraic type for ease of reasoning | 05/09 00:41 |
| lispy | copumpkin: it seems that Data.Integer is for arbitrarily sized integers. That could give me "incorrect" proofs if i translated code using Integer to code using a bounded int type in some other language | 05/09 00:41 |
| copumpkin | oh, machine words and the like? | 05/09 00:41 |
| lispy | copumpkin: http://www.cs.nott.ac.uk/~nad/listings/lib/Data.Integer.html | 05/09 00:42 |
| copumpkin | the other day I wrote SizedWord n = Fin (2 ^ n) :P | 05/09 00:42 |
| copumpkin | yeah, most of the time you want to talk about the general algorithm, and not deal with machine-level specifics | 05/09 00:42 |
| lispy | copumpkin: yes, I mean one possible use of Agda programs is for incorporation into a larger Haskell program. You could imagine implementing key core algorithms in Agda. But I'm concerned that you'd end up with slow algorithms. | 05/09 00:43 |
| lispy | copumpkin: well, talking about the general algorithm so generically means I could still have a buggy implementation | 05/09 00:43 |
| lispy | copumpkin: it would be at least nice if I could get the final proof to have some "proof obligations" related to assumptions I'll have to make when I port the algorithm (machine word size being one) | 05/09 00:44 |
| Saizan | benmachine: yes | 05/09 00:44 |
| benmachine | Saizan: do you know where I can get haskell-mode that isn't currently down? | 05/09 00:44 |
| copumpkin | lispy: yeah, not much work has been done on actually extracting stuff to haskell, as far as I know. The compilers don't seem to see much action in general | 05/09 00:45 |
| copumpkin | lispy: it's also harder than say coq, because it doesn't really have a prop/set separation | 05/09 00:45 |
| copumpkin | (even though I think Prop is reserved or actually available still) | 05/09 00:45 |
| lispy | copumpkin: I'm unfamiliar with that distinction or coq | 05/09 00:46 |
| Saizan | benmachine: you could use ssh instead of http, i guess :) | 05/09 00:46 |
| lispy | copumpkin: is it a logic vs. meta-logic distinction? | 05/09 00:46 |
| benmachine | Saizan: I don't have ssh :( | 05/09 00:46 |
| benmachine | I mean I do | 05/09 00:46 |
| benmachine | but I don't have an account | 05/09 00:46 |
| Saizan | benmachine: maybe your distro has it packaged? | 05/09 00:47 |
| lispy | copumpkin: is this what you meant about using Haskell under the hood? {-# BUILTIN NATURAL ℕ #-} | 05/09 00:48 |
| copumpkin | lispy: nah, it's just a distinction between "programming types" versus "propositions" | 05/09 00:48 |
| copumpkin | lispy: yeah, I think something like that | 05/09 00:48 |
| Saizan | benmachine: http://www.archlinux.org/packages/community/any/emacs-haskell-mode/ <- you could download arch's package | 05/09 00:48 |
| copumpkin | lispy: where programming types have an effect at runtime and propositions don't | 05/09 00:48 |
| benmachine | Saizan: oh, I'm on arch :) | 05/09 00:48 |
| copumpkin | so all propositions can get erased from the runtime representation | 05/09 00:48 |
| benmachine | I just tend to prefer getting haskell stuff from darcs or whatever than by pacman | 05/09 00:48 |
| Saizan | the pragma is {-# COMPILE | 05/09 00:48 |
| Saizan | benmachine: arch's one worked fine for me | 05/09 00:49 |
| lispy | copumpkin: gotcha | 05/09 00:50 |
| lispy | copumpkin: for me, being able to extract high performance code in an automated way would make things like agda/coq/isabelle significantly more accessible | 05/09 00:51 |
| lispy | copumpkin: hence my very pointed questions :) | 05/09 00:51 |
| benmachine | Saizan: yeah, apparently for me too, thanks | 05/09 00:51 |
| copumpkin | lispy: yeah, unfortunately that's still open research questions on how to do well :) | 05/09 00:51 |
| lispy | yeah, I guess I need to familiarize myself with that research or something | 05/09 00:52 |
| copumpkin | well a lot of it simply isn't there yet :P | 05/09 00:53 |
| copumpkin | closest you'll get to something sort of DTish but also "practical" is ATS | 05/09 00:53 |
| Saizan | just compile with cool optimizations and import via FFI :P | 05/09 00:53 |
| copumpkin | with its horrendous syntax :P | 05/09 00:53 |
| copumpkin | and buttloads of inline C | 05/09 00:53 |
| lispy | copumpkin: I'm pretty ignorant of the challenges though. | 05/09 00:56 |
| * benmachine immediately forgets his entire emacs tutorial, again | 05/09 00:56 | |
| lispy | copumpkin: like the challenges to using a machine Int | 05/09 00:57 |
| copumpkin | lispy: how much "ridiculous" type-level haskell have you written? it's possible to do a fair amount of type-level stuff that simulate common uses of DTs with GADTs and/or type families | 05/09 00:57 |
| copumpkin | like, my failed attempt at statically sized vectors :P | 05/09 00:57 |
| lispy | copumpkin: have you seen my MS thesis? | 05/09 00:57 |
| copumpkin | (with Saizan's generous contributions :) | 05/09 00:57 |
| copumpkin | lispy: nope, what's it on? | 05/09 00:57 |
| * lispy grumbles about his blog being ridiculously slow | 05/09 00:58 | |
| lispy | oh, I have files hosted on community.haskell.org, is that down again? | 05/09 00:58 |
| lispy | FFS | 05/09 00:58 |
| copumpkin | looks like it :P | 05/09 00:58 |
| * lispy stabs community.haskell.org | 05/09 00:58 | |
| lispy | copumpkin: files.codersbase.com/thesis.pdf | 05/09 00:59 |
| lispy | copumpkin: er, http://files.codersbase.com/thesis.pdf | 05/09 00:59 |
| copumpkin | ah, cool, I'll check it out | 05/09 00:59 |
| copumpkin | thanks | 05/09 00:59 |
| lispy | copumpkin: basically using gadts to help with invariants in Darcs | 05/09 01:00 |
| lispy | copumpkin: I'd love to do some proofs of darcs itself at some point. Igloo was doing that for Camp (a darcs clone) | 05/09 01:00 |
| copumpkin | yeah, I see him talking about it in #coq occasionally | 05/09 01:01 |
| lispy | which is down because community.haskell.org is down :( :( | 05/09 01:01 |
| * lispy is DEEPLY bothered by the communities inability to keep these servers running | 05/09 01:01 | |
| lispy | community's | 05/09 01:01 |
| lispy | I'd probably take a totally different approach than Igloo | 05/09 01:02 |
| lispy | I think I would actually model the repository "things" in the proofs | 05/09 01:02 |
| lispy | Come up with an abstract view of directory trees, for example | 05/09 01:03 |
| lispy | and make a notion of when they are equivalent | 05/09 01:03 |
| jmcarthur | MAlonzo expects BUILTIN STRING to be a linked list, i suppose? i can't have the builtin string be something like ByteString or Text, i'm guessing? | 05/09 03:02 |
| djahandarie | Aghh longer paper... I hate writing papers, and that's probably the reason I won't do anything beyond undergrad | 05/09 03:06 |
| jmcarthur | shapr: i didn't realize you were an #agda lurker | 05/09 03:35 |
| shapr | shh! I'm lurking! | 05/09 03:36 |
| lispy | heh, #agda is just another way to spell #haskell ;) | 05/09 03:43 |
| lispy | Should this module: http://www.cse.chalmers.se/~ulfn/code/tphols09/Basics.html#283 cleanly type check in agda 2.2.6 with 0.3 of the standard lib? | 05/09 09:15 |
| lispy | I get a bunch of things in yellow | 05/09 09:15 |
| lispy | and then when I try to import it elsewhere, I'm told, "Unsolved metas at the following locations:" | 05/09 09:16 |
| Saizan | lispy: it could be universe polymorphism's fault | 05/09 12:15 |
| Saizan | it's amazing how simpler proofs can get when using the right representations | 05/09 17:37 |
| benmachine | ok, I'm still doing my first exercises from Dependently Typed Programming in Agda, and I've introduced a second datatype using the _::_ constructor, and this has given me 'Unsolved metas' in locations using the first data type, what's up with that? | 05/09 17:50 |
| kosmikus | you might need more type signatures once the constructor is overloaded | 05/09 17:51 |
| benmachine | how do I give an implicit argument to an infix function? | 05/09 17:53 |
| benmachine | (i.e. the A in data _==_ {A : Set}(x : A) : A -> Set where) | 05/09 17:54 |
| TheOnionKnight | you have to write it in the non-infix form, "_==_ {A} x y", for example. | 05/09 17:55 |
| benmachine | ah, okay | 05/09 17:55 |
| benmachine | thanks | 05/09 17:56 |
| lispy | Saizan: But, that code is from the introduction to agda, shouldn't it be correct? | 05/09 19:15 |
| lispy | Saizan: I can't get it to work and that's sort of blocking me | 05/09 19:16 |
| copumpkin | what's the code? | 05/09 19:16 |
| benmachine | 09:15:13 < lispy> Should this module: http://www.cse.chalmers.se/~ulfn/code/tphols09/Basics.html#283 cleanly type check in agda 2.2.6 with 0.3 of the standard lib? | 05/09 19:19 |
| benmachine | copumpkin: ^ that I assume | 05/09 19:20 |
| lispy | copumpkin: yes, that code | 05/09 19:20 |
| lispy | copumpkin: I'm told that I have unsolved metas, and quite a few of them at that | 05/09 19:20 |
| lispy | I tried to google or unsolved metas but I didn't find much to get me unstuck either | 05/09 19:21 |
| copumpkin | oh the issue is that they've since added universe polymorphism to most things (like Vec) | 05/09 19:22 |
| copumpkin | and that means your forall A (where you'd expect A to be Set) could be Set zero, Set (suc zero) and so on | 05/09 19:23 |
| lispy | Wow. I got that stuff from the most recent tutorial I could find :( Something in 2009 | 05/09 19:26 |
| lispy | copumpkin: I'm glad you understand the problem, but I don't understand how to fix it. Any ideas? | 05/09 19:31 |
| copumpkin | just write forall {a} {A : Set a} | 05/09 19:33 |
| copumpkin | or just write {A : Set} | 05/09 19:33 |
| lispy | thanks, I think I'll use the latter on to keep the original meaning | 05/09 19:34 |
| lispy | that way it shouldn't require modifying the proofs | 05/09 19:34 |
| lispy | right? | 05/09 19:34 |
| copumpkin | yeah | 05/09 19:34 |
| lispy | thanks | 05/09 19:35 |
| lispy | tis working! yay | 05/09 19:39 |
| copumpkin | :) | 05/09 19:40 |
| lispy | NF : ℕ → Set | 05/09 19:57 |
| lispy | NF n = Vec ℕ n | 05/09 19:57 |
| lispy | the description of that says: | 05/09 19:57 |
| lispy | The values in NF n are vectors recording the number of occurrences of each | 05/09 19:57 |
| lispy | variable: | 05/09 19:57 |
| lispy | NF n = Vec N n | 05/09 19:57 |
| lispy | So then Vec N n is a list of length n with entries from N, right? | 05/09 19:58 |
| Saizan | yes | 05/09 19:58 |
| lispy | So, how does that record the number of occurences of each variable? | 05/09 19:58 |
| lispy | Wouldn't Vec N n be a type? | 05/09 19:58 |
| lispy | an element of Set zero in this case | 05/09 19:58 |
| Saizan | "the values in NF n" | 05/09 19:58 |
| copumpkin | yeah, it is | 05/09 19:58 |
| copumpkin | there's presumably a counting function somewhere | 05/09 19:58 |
| copumpkin | that returns a value of NF n | 05/09 19:58 |
| lispy | you mean like this: eval : ∀ {n} → Expr n → NF n | 05/09 19:59 |
| Saizan | "the values in NF n" means those x such that "x : NF n" holds | 05/09 19:59 |
| Saizan | eval seems an odd name, but that's the type one'd expect | 05/09 20:00 |
| jmcarthur | with --universe-polymorphism, is {A : Set A} the same as {A : Set 0} or is it the same as forall {a} {A : Set a}? | 05/09 20:01 |
| jmcarthur | oops | 05/09 20:01 |
| jmcarthur | the first one should be {A : Set} | 05/09 20:01 |
| jmcarthur | instead of {A : Set A} | 05/09 20:02 |
| copumpkin | it's same as Set zero | 05/09 20:02 |
| copumpkin | (don't think you can use number literals as levels, unless you stop using them as naturals too) | 05/09 20:02 |
| jmcarthur | okay, that's what i figured, but i was confused by your earlier suggestion of either forall {a} {A : Set a} or {A : Set} | 05/09 20:02 |
| jmcarthur | yeah i was just doing shorthand | 05/09 20:02 |
| lispy | is \forall {a} ... treated the same by agda as forall {a] ... ? | 05/09 20:03 |
| lispy | That is, can you use "forall" in place of the unicode version? | 05/09 20:03 |
| lispy | do you guys know the key strokes for the blackboard bold [ ? | 05/09 20:20 |
| lispy | I tried \b[ but I get something weird when I dot hat | 05/09 20:21 |
| TheOnionKnight | Don't know, but if you have it in a a file you can put the cursor over it and do C-u C-x = to find out. | 05/09 20:22 |
| lispy | oh, the pdf I'm looking at cheated | 05/09 20:25 |
| lispy | It's not a symbol I can enter | 05/09 20:25 |
| lispy | in the source it's [\| | 05/09 20:25 |
| * Saizan wishes Agda had an eta-rule for \bot | 05/09 22:20 | |
| benmachine | how do fixity declarations interact with overloaded operators? | 05/09 23:22 |
| benmachine | one for all? | 05/09 23:23 |
| Saizan | good question | 05/09 23:30 |
| copumpkin | benmachine: I think so | 05/09 23:42 |
| benmachine | that's what I would expect but this paper seems to have given _::_ a second fixity declaration | 05/09 23:44 |
| benmachine | which wouldn't be that surprising except it's supposed to be a literate agda file | 05/09 23:44 |
| --- Day changed Mon Sep 06 2010 | ||
| benmachine | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29750#a29750 I'm fairly sure eqsuc is redundant here but I don't know how to get rid of it, I suspect it involves a 'with' but I can't make that work, any pointers? | 06/09 01:17 |
| copumpkin | cong suc | 06/09 01:19 |
| benmachine | cong wat | 06/09 01:19 |
| copumpkin | cong is x == y -> f x == f y | 06/09 01:19 |
| benmachine | oh | 06/09 01:19 |
| * benmachine fiddles | 06/09 01:20 | |
| copumpkin | cong is in Relation.Binary.PropositionalEquality(.Core) I think | 06/09 01:20 |
| benmachine | copumpkin: but can I pattern-match on +-right-identity directly? | 06/09 01:26 |
| copumpkin | you could with it, but then the type inference won't figure out the implicit cor you | 06/09 01:27 |
| copumpkin | for you | 06/09 01:27 |
| copumpkin | +-right-identity {suc n} with +-right-identity {n} | 06/09 01:28 |
| copumpkin | ... | refl = ? | 06/09 01:28 |
| copumpkin | or you could use rewrite on it | 06/09 01:28 |
| benmachine | ...sometimes I get the feeling that this tutorial skipped over half the language >_> | 06/09 01:29 |
| benmachine | but that with thing goes, n + zero != n of type Nat | 06/09 01:29 |
| benmachine | when checking that the pattern refl has type n + zero == n | 06/09 01:29 |
| copumpkin | ah yeah | 06/09 01:30 |
| copumpkin | you need to bring more things into scope and use dotted patterns on them | 06/09 01:30 |
| copumpkin | pattern matching can be ridiculously difficult in agda :) | 06/09 01:31 |
| benmachine | ho hum | 06/09 01:31 |
| benmachine | should I just stick to cong then? | 06/09 01:31 |
| copumpkin | yes, that's how I think most people would write that | 06/09 01:31 |
| benmachine | ok, thanks | 06/09 01:32 |
| copumpkin | although the basic idea behind that error is that some of your parameters or metas are "too free | 06/09 01:32 |
| copumpkin | so say for example you had a function like | 06/09 01:32 |
| benmachine | yeah, but what parameters? I can't see any that aren't forced | 06/09 01:32 |
| benmachine | ok go on | 06/09 01:32 |
| copumpkin | f : Nat -> Nat -> | 06/09 01:33 |
| copumpkin | f : (x : Nat) -> (y : Nat) -> x == y -> ... | 06/09 01:33 |
| copumpkin | and you wrote | 06/09 01:33 |
| copumpkin | f x y refl = ... | 06/09 01:33 |
| copumpkin | it would complain that x != y | 06/09 01:33 |
| copumpkin | because in a sense you're letting them be different in your pattern | 06/09 01:33 |
| copumpkin | the solution is to write f x .x refl or f .x x refl | 06/09 01:34 |
| benmachine | oh, this is where dot-patterns come in? | 06/09 01:34 |
| copumpkin | yeah | 06/09 01:34 |
| copumpkin | the dot means that the value is determined elsewhere | 06/09 01:34 |
| copumpkin | so in your case, it isn't a parameter | 06/09 01:34 |
| benmachine | so I'd heard, but I've not actually used them yet | 06/09 01:34 |
| copumpkin | but you still need to bring the unfree thing into your pattern to reveal that you know it isn't free, by putting a dot in it. So you'd have to add another with clause for probably, and stick a dotted pattern in it | 06/09 01:35 |
| benmachine | for what? | 06/09 01:36 |
| copumpkin | hm, don't remember the details :P but whatever was equal | 06/09 01:36 |
| copumpkin | bring the two sides of the equality into scope and dot one of them in terms of the other | 06/09 01:37 |
| copumpkin | the rewrite clause takes care of that for you | 06/09 01:37 |
| benmachine | hmm ok | 06/09 01:37 |
| copumpkin | so that might work fro you | 06/09 01:37 |
| benmachine | ah | 06/09 01:38 |
| benmachine | now I have, +-right-identity {suc m} with m + zero | +-right-identity {m} | 06/09 01:38 |
| benmachine | ... | .m | refl = refl | 06/09 01:38 |
| benmachine | and that compiles | 06/09 01:39 |
| copumpkin | now try | 06/09 01:39 |
| copumpkin | +-right-identity {suc m} rewrite +-right-identity {m} = refl | 06/09 01:39 |
| benmachine | No binding for builtin thing EQUALITY, use {-# BUILTIN EQUALITY | 06/09 01:40 |
| benmachine | name #-} to bind it to 'name' | 06/09 01:40 |
| copumpkin | oh, you're not using the standard library | 06/09 01:40 |
| benmachine | no, I'm not even sure I have it | 06/09 01:40 |
| copumpkin | ah :) | 06/09 01:40 |
| benmachine | :P | 06/09 01:40 |
| copumpkin | anyway, you can use that pragma to tell agda about your equality | 06/09 01:40 |
| copumpkin | and then rewrite makes things like this a lot more pleasant | 06/09 01:40 |
| benmachine | ok | 06/09 01:41 |
| * benmachine decides to come back to rewrite later | 06/09 01:41 | |
| * benmachine hugs copumpkin | 06/09 01:41 | |
| copumpkin | :) | 06/09 01:41 |
| benmachine | after doing so much haskell it's weird being a noob again :P | 06/09 01:41 |
| benmachine | kinda cool actually! | 06/09 01:41 |
| copumpkin | if you want to play with rewrite: | 06/09 01:44 |
| copumpkin | {-# BUILTIN EQUALITY _≡_ #-} | 06/09 01:44 |
| copumpkin | {-# BUILTIN REFL refl #-} | 06/09 01:44 |
| benmachine | it took me about 40 loc but I proved + is commutative :O | 06/09 02:41 |
| copumpkin | :) | 06/09 02:41 |
| copumpkin | yeah, it's not trivial | 06/09 02:41 |
| copumpkin | using rewrites and convenient lemmas can make it a bit shorter | 06/09 02:41 |
| benmachine | I did it on a blackboard afterwards to check, you actually do need quite a few auxiliary results | 06/09 02:42 |
| benmachine | which surprised me btyg | 06/09 02:42 |
| copumpkin | have you done associativity yet? | 06/09 02:42 |
| benmachine | nooope | 06/09 02:42 |
| benmachine | one thing at a time eh :P | 06/09 02:42 |
| copumpkin | :) | 06/09 02:42 |
| benmachine | and the next thing is sleep, because it's quarter to three | 06/09 02:42 |
| copumpkin | isn't it fun though! | 06/09 02:42 |
| benmachine | hee hee | 06/09 02:42 |
| benmachine | I'm still getting used to it I think :P | 06/09 02:43 |
| benmachine | not very good at telling what agda can and can't work out for me yet | 06/09 02:43 |
| benmachine | what should be explicit or implicit | 06/09 02:43 |
| benmachine | so it just goes unsolved metas and I throw a bunch of {n}s and {m}s in | 06/09 02:44 |
| benmachine | and it works >_> | 06/09 02:44 |
| copumpkin | :) | 06/09 02:44 |
| benmachine | thank you much for your help :) | 06/09 02:44 |
| copumpkin | no problem1 | 06/09 02:45 |
| copumpkin | ! | 06/09 02:45 |
| djahandarie | Aw, I missed larrythesquid | 06/09 05:12 |
| copumpkin | he's too slick for you | 06/09 05:12 |
| lispy | http://www.cse.chalmers.se/~ulfn/code/tphols09/Semantics.html <-- I can't get the first equation of sound to type check | 06/09 05:49 |
| lispy | If I change the type to: sound : ∀ {n} (e : Expr n) ρ → [ e ] ρ ≈ [ norm e ] ρ | 06/09 05:49 |
| lispy | then it does type check | 06/09 05:49 |
| lispy | oh! | 06/09 05:50 |
| lispy | I see it now | 06/09 05:50 |
| lispy | The damn unicode is so hard to read in emacs :( | 06/09 05:50 |
| lispy | I used the wrong comparison | 06/09 05:50 |
| lispy | no wait, still doesn't type check but it's closer | 06/09 05:50 |
| lispy | sound : ∀ {n} (e : Expr n) ρ → e ≈ norm e | 06/09 05:50 |
| lispy | Expr n !=< C of type Set | 06/09 05:51 |
| lispy | when checking that the expression e has type C | 06/09 05:51 |
| lispy | heh, okay that was a waste of time. It should be ≅ that and that doesn't type check | 06/09 05:54 |
| lispy | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29757#a29757 | 06/09 05:56 |
| Peaker | Does Agda support partiality through a monad? | 06/09 07:52 |
| Peaker | or is it total everywhere? If latter, how does FFI to Haskell/etc work? | 06/09 07:52 |
| Peaker | from a tutorial "In Haskell and ML the type of not can be inferred from the defining clauses and so in these languages the type signature is not required. How-ever, in the presence of dependent types this is no longer the case and we are forced to write down the type signature of not. This is not a bad thing, since by writing down the type signature we allow the type checker, not only to tell us when we make mistakes, but also to guide us in the construction | 06/09 07:54 |
| Peaker | of the program." | 06/09 07:54 |
| Peaker | a bit disingenuous to say it is always a good thing, isn't it? :) | 06/09 07:55 |
| copumpkin | it just said it's not a bad thing | 06/09 07:59 |
| copumpkin | and it's not true, you can omit type signatures on non-functions | 06/09 07:59 |
| copumpkin | agda will just believe you when you FFI out | 06/09 08:00 |
| Peaker | There's no way to escape totality like in Epigram? | 06/09 08:00 |
| copumpkin | well, IO for example is coinductive | 06/09 08:00 |
| copumpkin | not sure you ever want to escape totality | 06/09 08:00 |
| copumpkin | productive coinduction is good enough for most real infinite programs | 06/09 08:00 |
| copumpkin | (corecursion, I mean) | 06/09 08:01 |
| Peaker | well, you might want to escape totality in the same sense you sometimes escape to imperative progrmaming | 06/09 08:01 |
| Peaker | You don't yet know how to do it the "right way" | 06/09 08:02 |
| Peaker | Or maybe you're writing a Turing machine interpreter :) | 06/09 08:02 |
| copumpkin | you can turn off the termination checker :) | 06/09 08:02 |
| copumpkin | but then you can't really trust your proofs anymore | 06/09 08:03 |
| Peaker | if partiality was a monad, you could just allow proofs only when they're not wrapped in it | 06/09 08:04 |
| Peaker | no? | 06/09 08:04 |
| Peaker | but you could still have parts of your program in it | 06/09 08:05 |
| Peaker | (not proofs) | 06/09 08:05 |
| copumpkin | that would require a lot of introspection of the typechecker behvaior into language terms, wouldn't it? | 06/09 08:05 |
| copumpkin | the language would need to be aware of this monad, and considering we don't have typeclasses or even a terribly satisfying monad record | 06/09 08:05 |
| Peaker | Maybe when you take a proof you just take it as a strict argument | 06/09 08:07 |
| Peaker | And then if you're given a partial proof in a Partial monad -- it will make the entire Partial computation not terminate | 06/09 08:07 |
| Peaker | but if you're in a pure computation, your proofs are fine.. | 06/09 08:07 |
| Peaker | Maybe the kinds of proposition types should be different, and a constraint on prop. types made them impossible to store in the partial monad | 06/09 08:08 |
| copumpkin | we don't have a separation currently | 06/09 08:09 |
| Peaker | how does Epigram deal with it? It has general recursion.. what happens in Epigram if you construct a proof in a non-terminating function? | 06/09 08:10 |
| copumpkin | never used epigram 1 | 06/09 08:11 |
| copumpkin | does epigram 2 still do that? | 06/09 08:11 |
| copumpkin | (I sort of doubt it since it doesn't have a language yet) | 06/09 08:11 |
| lispy | copumpkin: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29757#a29757 | 06/09 08:36 |
| lispy | copumpkin: I'm stumped again | 06/09 08:36 |
| copumpkin | lispy: I'd guess you didn't apply a function completely | 06/09 08:38 |
| copumpkin | (ρ' : Vec C .n) → [ var i ] ρ' ≈ [ Expr.Σ (zipWith _⊗_ (eval (var i)) (tabulate var)) ] ρ' | 06/09 08:39 |
| copumpkin | vs. | 06/09 08:39 |
| copumpkin | _391 CM i ρ ! i ≈ [ Expr.Σ (zipWith _⊗_ (unit i) (tabulate var)) ] (_422 CM i ρ) | 06/09 08:39 |
| lispy | copumpkin: http://www.cse.chalmers.se/~ulfn/code/tphols09/Semantics.html | 06/09 08:39 |
| Saizan | copumpkin, Peaker: you can define your own partiality monad with coinduction, which also let you prove separately that your function is total of that's the case, no language support though, so it might be a bit clunky, especially if you want lazyness since you've to put the monad inside your datatypes too | 06/09 11:14 |
| Saizan | (in that case) | 06/09 11:14 |
| Saizan | http://wiki.portal.chalmers.se/agda/pmwiki.php?n=AIMXII.FutureOfAgda <- sounds quite cool | 06/09 17:48 |
| edwinb | you mean the "make other people know how Agda works" bit? | 06/09 17:50 |
| edwinb | That would probably be good, yes... | 06/09 17:50 |
| Saizan | yep | 06/09 17:51 |
| edwinb | Ulf seemed quite keen on the "complete ban on Ulf implementing Agda" bit ;) | 06/09 17:52 |
| Saizan | hehe, i can imagine :) | 06/09 17:52 |
| Saizan | meanwhile it seems a lot of interesting things are already being implemented in the current AIM, so maybe there isn't such a severe lack of manpower :) | 06/09 18:03 |
| edwinb | well, yes, but an awful lot is dependent on Ulf | 06/09 18:17 |
| pumpkin | oh that's what you guys mean by dependent types | 06/09 18:18 |
| edwinb | yes, we're all very dependent | 06/09 18:18 |
| kosmikus | :) | 06/09 18:25 |
| mind123123 | good evening | 06/09 22:43 |
| --- Day changed Tue Sep 07 2010 | ||
| Saizan | what does it mean when the lines where the case alternatives of a with get yellow? | 07/09 13:55 |
| Saizan | s/the lines where// | 07/09 13:56 |
| copumpkin | remind me not to use Fin (2 ^ 32) as an approximation of machine words | 07/09 21:15 |
| kosmikus | hehe | 07/09 21:26 |
| copumpkin | for some things it works fine | 07/09 21:27 |
| copumpkin | but just now the typechecker ran wild | 07/09 21:28 |
| kosmikus | yes, I guess as soon as the typechecker feels the need to evaluate the argument to Fin ... | 07/09 21:30 |
| copumpkin | yeah | 07/09 21:32 |
| jonrafkind | I need some basica agda help. I have this type 'mine : {A : Set} → Time → SF [ E A ] [ E A ] dec' where Time is defined in a file as Time = ℕ, but I get this error when I run agda: Set != (suc _3). when checking that the expression Time has type _3 | 07/09 23:03 |
| jonrafkind | im not sure what (suc _3) means here | 07/09 23:04 |
| Saizan | _3 looks like a metavariable | 07/09 23:37 |
| Saizan | and suc is probably ℕ's constructor there | 07/09 23:37 |
| jonrafkind | so (suc ...) is not a set, thats what its saying? | 07/09 23:37 |
| jonrafkind | yes | 07/09 23:37 |
| Saizan | yeah | 07/09 23:37 |
| jonrafkind | mine : ℕ -> ℕ | 07/09 23:38 |
| jonrafkind | mine x = x + 0 | 07/09 23:38 |
| jonrafkind | even this doesnt work, i get the same error but its (suc _1) isntead of _3 | 07/09 23:38 |
| jonrafkind | but strangely, if I copy the definition for N out of the file it comes from into my local file then it works | 07/09 23:39 |
| Saizan | weird | 07/09 23:39 |
| Saizan | jonrafkind: how are you importing the module? | 07/09 23:40 |
| jonrafkind | open import NeilPrelude | 07/09 23:40 |
| Saizan | that should work, assuming _+_ : ℕ -> ℕ -> ℕ and the right builtin declarations | 07/09 23:43 |
| jonrafkind | yea its all there, i literally copy the definitions into my local file and it works | 07/09 23:44 |
| jonrafkind | but if they come from an import then it doesnt work | 07/09 23:44 |
| copumpkin | maybe the .agdai file is broken? | 07/09 23:45 |
| copumpkin | I had strange issues once when I upgraded agda | 07/09 23:45 |
| jonrafkind | ok rm *.agdai, agda blah.. lets see | 07/09 23:46 |
| jonrafkind | same error | 07/09 23:47 |
| jonrafkind | oh my lord.. i typed -> instead of the unicode -> | 07/09 23:48 |
| jonrafkind | i mean i typed '-' and '>' | 07/09 23:48 |
| Saizan | -> works too | 07/09 23:50 |
| jonrafkind | oh yea you're right | 07/09 23:51 |
| jonrafkind | so what else could be wrong.. | 07/09 23:53 |
| jonrafkind | ok it seems to be this, the file im importing from has {-# OPTIONS --type-in-type #-}. what does that mean? | 07/09 23:59 |
| --- Day changed Wed Sep 08 2010 | ||
| danbrown | that's impredicativity: Set : Set instead of Set = Set0 : Set1 : Set2 : ... | 08/09 00:01 |
| danbrown | lets you encode paradoxes like Russell's and makes the type theory unsound | 08/09 00:02 |
| danbrown | also, try "open import NeilPrelude using (_+_)" to see if you can narrow down the problem. that will import only the name _+_ from the module | 08/09 00:03 |
| danbrown | err, or "using (N; zero; suc)", or whatever it was you were copying back and forth | 08/09 00:04 |
| Saizan | suppose you've a type like "T = nu X. A -> B x X" (a sort of automaton), would you consider a value of T which will make the evaluator loop if it normalizes under that lambda but will always be able to produce B when applied productive? | 08/09 02:03 |
| danbrown | Saizan: seems like if you simplify the question to streams (T = νX. B × X) then the answer is clearly 'yes', even though there aren't any lambdas left | 08/09 04:25 |
| Saizan | yeah, lambdas were a crucial part of the doubt | 08/09 04:33 |
| Saizan | not so much i guess, since in my case i actually require lazy eval to avoid a loop | 08/09 04:35 |
| Saizan | even after it's applied | 08/09 04:35 |
| Saizan | (if a subterm looped before it continues to loop, i guess :) | 08/09 04:36 |
| Saizan | anyhow, with codata at least the typechecker doesn't seem to loop anymore.. | 08/09 04:39 |
| Saizan | it did with data X : Set where x : (A -> B x \inf X) : X; but not with data X : Set where x : \inf (A -> B x X) : X | 08/09 04:41 |
| stevan | kosmikus: hi, is the prototype agda code of the multirec stuff available somewhere? thanks. | 08/09 13:01 |
| Saizan | is there a normalization by evaluation agda example that also proves soundness? | 08/09 21:42 |
| lispy | Saizan: there is in the agda overview from 2009, but it doesn't compile on the latest agda | 08/09 22:04 |
| lispy | Saizan: in the Semantics.agda module | 08/09 22:04 |
| --- Day changed Thu Sep 09 2010 | ||
| dolio | Woo, one more proof of false patched out. | 09/09 03:57 |
| copumpkin | oh nice | 09/09 03:58 |
| copumpkin | how's it work? | 09/09 03:58 |
| dolio | Records were allowed to be recursive, but weren't checked for positivity. | 09/09 03:58 |
| dolio | I'm not sure which part they fixed. | 09/09 03:59 |
| copumpkin | oh | 09/09 03:59 |
| dolio | But I got an email saying "fixed". | 09/09 04:00 |
| copumpkin | that's pretty terse :) | 09/09 04:00 |
| dolio | Oh, they enabled positivity checking. | 09/09 04:00 |
| dolio | I just skipped that line. | 09/09 04:00 |
| copumpkin | ah | 09/09 04:01 |
| dolio | I think NAD wants recursive records, so that isn't surprising. | 09/09 04:03 |
| jonrafkind | what does this error mean? 'ℕ != .A of type Set' | 09/09 16:32 |
| stevan | that you are giving the hole something of type N while it wants to be plugged with something of the implicit type A? | 09/09 16:35 |
| jonrafkind | ok i forced A = N, now I get 'ℕ !=< ℕ of type Set'. is that "not equal or subset" ? | 09/09 16:43 |
| stevan | can you paste the code perhaps? | 09/09 16:47 |
| jonrafkind | http://pastebin.com/tAfH3DjU | 09/09 16:49 |
| stevan | what you are doing there, {A = N}, is saying let N be the implicit type A and then you pass this to pureE, i think what you want to do is replace A with N in the type declaration of mine | 09/09 16:52 |
| jonrafkind | {N = A} ? | 09/09 16:53 |
| jonrafkind | or SF [E N] ? | 09/09 16:53 |
| stevan | yes, SF [ E N ] | 09/09 16:53 |
| jonrafkind | so I cant have a polymorphic function? | 09/09 16:53 |
| stevan | you can, but "+ 1" only makes sense for N? | 09/09 16:54 |
| jonrafkind | yea but I thought it could figure out that A = N | 09/09 16:56 |
| stevan | well that's not a polymorphic function anymore. | 09/09 16:57 |
| jonrafkind | seems the {A : Set} is irrelevant | 09/09 16:57 |
| jonrafkind | ok so when a polymorphic type is instantiated with some concrete type T, I have to mention T in the signature rather than tell the polymorphic type to try to use T for implicit types | 09/09 16:58 |
| leo | hi | 09/09 17:58 |
| leo | when working with products, how i can do pattern matching inside a lambda, i mean, as the haskell notation \ (x,y) -> . It is possible ? | 09/09 18:01 |
| stevan | not possible. | 09/09 18:01 |
| leo | Buu! :'(. Thanks ;D | 09/09 18:02 |
| dolio | Oh man, codata is gone? | 09/09 19:53 |
| dolio | (The keyword.) | 09/09 19:53 |
| copumpkin | :O | 09/09 19:54 |
| copumpkin | is the sharp and flat stuff primitive now? | 09/09 19:54 |
| dolio | Dunno. | 09/09 19:54 |
| dolio | You heard about this irrelevance stuff? | 09/09 19:54 |
| copumpkin | nope? | 09/09 19:55 |
| copumpkin | in agda? | 09/09 19:55 |
| copumpkin | http://www.cs.nott.ac.uk/~nad/listings/lib/Coinduction.html#234 | 09/09 19:55 |
| copumpkin | wow | 09/09 19:55 |
| dolio | Yeah. I just pulled from darcs and there's patches about relevance, forcing analysis, and such. | 09/09 19:55 |
| copumpkin | interesting | 09/09 19:55 |
| dolio | And there are non-dependent functions '.A -> B' where the A argument is checked for irrelevance. | 09/09 19:56 |
| dolio | Which, I'm not certain what good that does. | 09/09 19:56 |
| dolio | Other than that equality on such types is on erased values or something. | 09/09 19:56 |
| dolio | Oh, postulates. | 09/09 19:57 |
| copumpkin | well, it's better than "here's your codata keyword but please don't use it kthx" | 09/09 19:57 |
| copumpkin | I guess | 09/09 19:57 |
| dolio | Yes. | 09/09 19:58 |
| dolio | It'd probably be good to not call it 'coinduction' either. | 09/09 19:59 |
| dolio | Anyhow, if the irrelevance stuff is the kind I think it is... | 09/09 20:03 |
| dolio | The dependent case is one of the major points. | 09/09 20:03 |
| pedagand | it is irrelevance a la Andreas Abel | 09/09 20:04 |
| copumpkin | where did you read about this stuff? | 09/09 20:04 |
| copumpkin | I didn't see anything on the list | 09/09 20:04 |
| dolio | Because you can make the first argument of (A : Set) -> A -> A irrelevant. | 09/09 20:04 |
| dolio | And erase it for a speed boost. | 09/09 20:04 |
| stevan | http://wiki.portal.chalmers.se/agda/pmwiki.php?n=AIMXII.Notes | 09/09 20:04 |
| dolio | But that's a dependent function space. | 09/09 20:04 |
| dolio | Oh, is this for proof irrelevance? | 09/09 20:05 |
| dolio | Not parametricity? | 09/09 20:06 |
| pedagand | I think (don't quote me on that) that it's computational irrelevance | 09/09 20:10 |
| dolio | Is it like the Mishra-Linger/Sheard stuff? | 09/09 20:10 |
| dolio | Erasure Pure Type Systems? | 09/09 20:10 |
| pedagand | he checks that you do not mark something as irrelevant when it actually is computationally relevant | 09/09 20:10 |
| dolio | It sounds similar. | 09/09 20:10 |
| dolio | Ooo, mixfix with binders. | 09/09 20:11 |
| dolio | That's one of my few remaining gripes. | 09/09 20:11 |
| pedagand | if the check passes, then it could not evaluate the things (I don't know if they had the time to actually implement that) | 09/09 20:11 |
| dolio | Is there a paper or slides on it? | 09/09 20:12 |
| dolio | The Abel stuff, that is. | 09/09 20:13 |
| dolio | The AIM notes aren't very specific. | 09/09 20:13 |
| dolio | And they give the impression that their purpose is to be used with proofs. | 09/09 20:13 |
| pedagand | Andreas presented some code from MiniAgda | 09/09 20:13 |
| Saizan | on mini-agda it says "Erased arguments in the style of the Implicit Calculus of Constructions by Alexandre Miquel and Bruno Barras / Bruno Bernardo" | 09/09 20:13 |
| dolio | But I don't think the EPTS stuff really works for proof irrelevance in general. | 09/09 20:14 |
| pedagand | Andreas gave a talk at DTP on a very similar topic | 09/09 20:14 |
| dolio | Sometimes you might need to match on a proof to get refinement, so it's not strictly speaking computationally irrelevant in the EPTS sense (and it isn't safe to make it so). But it's still proof irrelevant in that it only has one canonical value. | 09/09 20:15 |
| pedagand | I can't find the slides for DTP either.. | 09/09 20:16 |
| pedagand | your best bet is to ask Andreas directly I think, or look at MiniAgda | 09/09 20:16 |
| dolio | Well, in one of the EPTS papers, they mention that they're sort of extending the ICC to a family of languages, like pure type systems formalize typed lambda calculi as a parameterized family of languages. | 09/09 20:17 |
| dolio | So I guess that answers my question. | 09/09 20:17 |
| dolio | I'm skeptical that does what it wanted, though. | 09/09 20:18 |
| dolio | What is ... | 09/09 20:18 |
| dolio | pigworker understands this stuff better than I do, as well. | 09/09 20:21 |
| dolio | I suppose that's no surprise. | 09/09 20:21 |
| pedagand | I wish I had the time to read Miquel's thesis: I believe that most of the story is there | 09/09 20:23 |
| pedagand | Andreas mentionned Miquel's work several times at DTP | 09/09 20:23 |
| dolio | Is it in French? | 09/09 20:24 |
| dolio | Looks like it. | 09/09 20:25 |
| dolio | I've read most of Mishra-Linger's thesis, which is about how to do their computational irrelevance stuff. | 09/09 20:26 |
| pedagand | yeah | 09/09 20:26 |
| dolio | Extending it to inductive types. | 09/09 20:26 |
| dolio | And doing irrelevance analysis. | 09/09 20:26 |
| dolio | He has some good examples where it fails for proof irrelevance, though. | 09/09 20:27 |
| dolio | For instance, the eliminator for propositional equality can't safely be computationally irrelevant in the proof of equality. | 09/09 20:28 |
| dolio | I should say, the Agda-like intensional equality. | 09/09 20:31 |
| Saizan | btw, when talking about erasure pigworker says you can't erase "collapsible" during open terms evaluation otherwise you might be trusting a proof that implies A = A -> A and loop, but == lives in Prop in epigram.. | 09/09 20:31 |
| Saizan | yeah, that :) | 09/09 20:32 |
| Saizan | i guess "coe : (S T : Set) -> :- S == T -> S -> T" must be strict on something else then | 09/09 20:33 |
| dolio | coe is strict in S and T. | 09/09 20:34 |
| dolio | Also, it's weird to talk about strictness in a total language. | 09/09 20:34 |
| Saizan | eager? | 09/09 20:35 |
| dolio | Anyhow, my main concern is that EPTS and (I think) ICC-type computational irrelevance is about parametric definitions, not proof irrelevance. | 09/09 20:36 |
| dolio | And having the former won't necessarily make space usage problems that the latter would solve go away. | 09/09 20:37 |
| --- Day changed Fri Sep 10 2010 | ||
| copumpkin | what does == between Sets mean? | 10/09 16:07 |
| Saizan | where did you find that? | 10/09 16:08 |
| copumpkin | well, in one of the bugs, someone proved that Fin 2 /= Bool | 10/09 16:08 |
| copumpkin | http://code.google.com/p/agda/issues/detail?id=292 | 10/09 16:09 |
| Saizan | ah, yeah, it seems like the topologists don't like being able to tell apart two types if they are isomorphic, iirc it'll invalidate some models | 10/09 16:17 |
| Saizan | or a i guess you might imagine that they both desugar to 1 + 1, if you have a closed universe | 10/09 16:18 |
| jix | is the semiring solver known to take ages even for simple one variable stuff? | 10/09 16:21 |
| Saizan | it's not very fast | 10/09 16:21 |
| Saizan | copumpkin: i think the "Equivalence axiom => extensionality" thread is related to this, but it's over my head | 10/09 16:22 |
| copumpkin | ah | 10/09 16:23 |
| copumpkin | way over mine then :) | 10/09 16:24 |
| jix | but it shouldn't take over 10 minutes for (a * a) + ((a * (a * a)) * (a * (a * a))) = (a * a) * (a * (a * (a * a)) + 1) i guess | 10/09 16:28 |
| jix | killed it now, it even started to swap | 10/09 16:31 |
| jix | proving (x * x) * x = x * (x * x) also hangs | 10/09 16:42 |
| jix | lem3 from the wiki page works here tho | 10/09 16:42 |
| jix | ah (x * x) * x = x * (x * x) finished now, i guess the algorithm used just doesn't like such equations | 10/09 16:43 |
| Saizan | i wonder if anyone has written down the time complexity for it | 10/09 16:43 |
| djahandarie | O(long-as-hell) | 10/09 16:44 |
| Saizan | djahandarie: do you have the \theta too?:) | 10/09 16:44 |
| copumpkin | http://wiki.portal.chalmers.se/agda/pmwiki.php?n=MixFixBinders.MixFixBinders | 10/09 17:05 |
| copumpkin | mmm | 10/09 17:05 |
| dolio | That looks kind of like coq's notation. | 10/09 17:10 |
| dolio | I hope it's not totally in that direction. | 10/09 17:12 |
| dolio | One nice thing about Agda was being able to define things directly using the notation you want. | 10/09 17:12 |
| dolio | Instead of defining an ordinary function first, and then specifying a nicer notation for it. | 10/09 17:13 |
| dolio | Of course, having binders would probably be worth sacrificing that. | 10/09 17:13 |
| copumpkin | yeah | 10/09 17:13 |
| jix | if the ring solver implements the algorithm as described in the mentioned paper i can't see how it could take 2 minutes just to prove (x * x) * x = x * (x * x) :/ | 10/09 17:17 |
| copumpkin | it doesn't, it's slower | 10/09 17:25 |
| copumpkin | the one in the paper allows you to lift exponents by arbitrary amounts | 10/09 17:25 |
| copumpkin | whereas the ring solver lifts one at a time | 10/09 17:25 |
| jix | still that shouldn't be a problem for (x * x) * x = x * (x * x) | 10/09 17:27 |
| copumpkin | nope | 10/09 17:27 |
| dolio | Oh man. You can use the new mixfix stuff to make a 'x : T' annotation. | 10/09 17:49 |
| copumpkin | he did mention something for flipping arguments | 10/09 17:50 |
| copumpkin | agda's tagline should be what ulf just said today :P "Agda isn't Coq" | 10/09 18:52 |
| copumpkin | :P | 10/09 18:52 |
| Saizan | hah | 10/09 18:53 |
| Saizan | where? | 10/09 18:55 |
| TheOnionKnight | that was my first thought as well, most recent message on the mailing list | 10/09 18:55 |
| copumpkin | in response to dolio's email about being worried about not being able to use mixfix in patterns | 10/09 18:56 |
| * dolio is relieved. | 10/09 18:56 | |
| dschoepe | http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29862#a29862 -- why does agda tell me that line 6 is an unreachable clause? | 10/09 19:08 |
| dschoepe | (agda-2.2.6, stdlib-0.3) | 10/09 19:08 |
| Saizan | check the type of _<_ | 10/09 19:17 |
| Saizan | it probably doesn't return a Bool and those true/false are just variables | 10/09 19:18 |
| dschoepe | Saizan: oh, thanks | 10/09 19:19 |
| pigworker | g_cross: would that be your message on the list about finite types? | 10/09 23:54 |
| pigworker | It ought to be possible to build a brute force decision procedure for a language of predicates over finite domains, as in Martijn Oostdijk's masters thesis. | 10/09 23:58 |
| --- Day changed Sat Sep 11 2010 | ||
| pigworker | I remember Per Martin-Löf being a bit discombobulated by Henk Barendregt's presentation of Martijn's proof that 61 is prime: "we checked - it is". | 11/09 00:00 |
| pigworker | That was Types 1998, iirc. | 11/09 00:00 |
| edwinb | oh, I remember reading that. It was about the first types paper I actually understood... | 11/09 00:08 |
| edwinb | it is strangely disappointing though | 11/09 00:08 |
| pigworker | Given p : X -> Bool, P : X -> Set, with p x deciding P x for all x, and a list xs enumerating X, it should be pretty easy to show that all p xs decides (x : X) -> P x. | 11/09 00:13 |
| edwinb | I suppose that'd be the neater/more generic way to write +-comm | 11/09 00:15 |
| edwinb | Actually, now might be a good time to revisit the doing-crazy-things-with-numbers work | 11/09 00:17 |
| * edwinb files that thought away for a rainy Sunday | 11/09 00:17 | |
| pigworker | The killer way to prove +-comm is to extract + from an upper-triangular matrix in the first place. (If the point you want is in the lower triangle, then flip!) | 11/09 00:18 |
| g_cross | Yes, thanks pigworker! | 11/09 03:38 |
| g_cross | Yeah, what you've stated is exactly what I was thinking. | 11/09 03:42 |
| g_cross | It's the details of how to do that, though, that escapes me. :-0 | 11/09 03:42 |
| g_cross | :-), I mean | 11/09 03:42 |
| g_cross | I am stuck on seeing how to be able to prove that my list xs is everything that there is in the set, and so by deciding for every case in it I have decided the proposition. | 11/09 03:43 |
| Saizan | afaiu, that's where you can't really avoid some boilerplate mapping each element to a position in the list (or vector, in which case it'd be like mapping to Fin (<number of constructors>)) | 11/09 03:49 |
| g_cross | I'm find with that | 11/09 03:50 |
| g_cross | I mean, I'm fine with that | 11/09 03:50 |
| g_cross | I'm just not sure what exactly I'm supposed to be mapping them to | 11/09 03:50 |
| g_cross | it's easy to place an ordering on them and convert them to a list or something | 11/09 03:50 |
| g_cross | I'm just not sure what kind of list-thingy I should be mapping to | 11/09 03:50 |
| g_cross | in such a way that I can prove things about the original type | 11/09 03:51 |
| g_cross | based on enumeration through that list | 11/09 03:52 |
| Saizan | one option is simply to prove "(x : X) -> x \in xs" where xs is your list of all the elements and \in is from Data.List.Any | 11/09 04:00 |
| Saizan | there might be something better though | 11/09 04:01 |
| g_cross | Cool, I'll check that out. Thanks everyon1 | 11/09 04:21 |
| g_cross | e! :-) | 11/09 04:21 |
| dark | "In the same way as functions are not allowed to crash, they must also be terminating." | 11/09 11:43 |
| dark | so adga functions aren't turing-complete? | 11/09 11:43 |
| dark | (I wished to have the "type of terminating functions" at many languages, but retaining non-termination power) | 11/09 11:45 |
| pigworker | Agda is at least supposed to be total. You can still compute the execution trace of an arbitrary Turing machine as a coinductive structure. | 11/09 11:49 |
| dark | ? really? hmm.. | 11/09 11:50 |
| dark | i.e. an always-terminating function can be turing-complete? | 11/09 11:50 |
| dark | pigworker, I fail to see this, since there are non-terminating turing machines | 11/09 11:51 |
| pigworker | And there are infinite coinductive structures! | 11/09 11:51 |
| dark | what do you mean.. ._. | 11/09 11:52 |
| edwinb | there are also "always producing" functions... | 11/09 11:52 |
| dark | you mean, passing an infinite data structure to a "terminating" function? | 11/09 11:52 |
| dark | the function will be applied again to a "smaller" structure, that is also infinite | 11/09 11:53 |
| pigworker | A coinductive list is a potentially infinite structure, unfolded on demand. A total program may only inspect a finite prefix of such a thing, but we may (indeed must) explain how to generate however much is demanded. | 11/09 11:53 |
| pigworker | As we can explain the one-step evolution of a TM, we can specify the means to generate the trace a bit at a time, however much is demanded. | 11/09 11:55 |
| dark | but you can't actually run the entire machine at a time? | 11/09 11:55 |
| dark | when you say "supposed to be total" you mean "no valid agda program is non-terminating"? | 11/09 11:56 |
| pigworker | I mean that if a non-total program creeps in, that's a bug. | 11/09 11:56 |
| * dark goes to a dictionary(?) to check what's to creep in | 11/09 11:57 | |
| edwinb | I wonder if it's a bit confusing (that is, not entirely true) to say that functions must always be terminating | 11/09 11:57 |
| pigworker | to get in, not welcome, while nobody is looking | 11/09 11:58 |
| dark | edwinb, it's stated in a prominent way at the 'tutorial' | 11/09 11:58 |
| edwinb | oh ;) | 11/09 11:58 |
| dark | pages aren't numbered there, but it's on page 3, 5th paragraph | 11/09 11:59 |
| pigworker | edwinb: yes, recursion consuming inductive data must always be terminating; corecursion, delivering coinductive data must always be productive | 11/09 11:59 |
| edwinb | the tutorial may be pre-coinduction | 11/09 12:00 |
| pigworker | The impact of that for the partial evaluation machinery used in typechecking is that computation always terminates (infinite structures are unfolded on demand and demand is guaranteed to be finite). | 11/09 12:00 |
| dark | pigworker, isn't the type-check supposed to not terminate in some cases? | 11/09 12:00 |
| dark | non-termination at type-check would mean the program isn't valid? | 11/09 12:00 |
| pigworker | no, the typechecker is supposed to terminate | 11/09 12:00 |
| dark | but, but, isn't agda type system "too powerful" to guarantee termination? | 11/09 12:01 |
| dark | where's the catch then | 11/09 12:01 |
| dark | even some ghc type extensions doesn't guarantee termination | 11/09 12:01 |
| pigworker | ghc is much sloppier about the programs you can write at the type level, when you turn that stuff on (and much too tight when you don't) | 11/09 12:02 |
| dark | o.o | 11/09 12:03 |
| benmachine | pigworker: if demand is guaranteed to be finite, you can't demand the whole execution of an arbitrary turing machine? | 11/09 12:08 |
| pigworker | So the only catch is that, unlike in Haskell, pure means pure. If you want to express potentially nonterminating computations, use coinduction to define a delay monad. The typechecker won't run them (at least not forever) but perhaps the RTS might. | 11/09 12:08 |
| pigworker | benmachine: indeed, you can't demand the whole execution of a TM; you can, of course, construct other infinite processes which run a TM a bit at a time... | 11/09 12:10 |
| benmachine | so agda *isn't* turing-complete, which was the original question? | 11/09 12:11 |
| benmachine | as in you can't write an agda program that takes as input a turing machine and starting state and gives as output the finishing state | 11/09 12:12 |
| benmachine | if it finishes, that is | 11/09 12:12 |
| pigworker | Agda isn't Turing complete in the same sense that you can't do any IO in Haskell! | 11/09 12:12 |
| pigworker | you can't write halts : TM -> Bool you can write halts : TM -> Delay Bool | 11/09 12:16 |
| pigworker | if your run-time system is willing to run Delay computations, then good luck to you! | 11/09 12:16 |
| dark | <pigworker> Agda isn't Turing complete in the same sense that you can't do any IO in Haskell! | 11/09 12:24 |
| dark | what do you mean? one can do any i/o in haskell.... | 11/09 12:24 |
| dark | and one can get the description of a turing machine and its input, and generate its output, in haskell | 11/09 12:26 |
| dark | pigworker, suppose someone wants to write a verified interpreter for a turing-complete language. hence, this someone can't write it in agda. | 11/09 12:27 |
| dark | right? | 11/09 12:27 |
| dark | but he might be able to write a *compiler* | 11/09 12:27 |
| Saizan | it'll just be an interpreter into the Delay monad, like if you want to write an interpreter for an impure language in haskell you'll have to write one into the IO monad | 11/09 12:28 |
| dark | hm | 11/09 12:28 |
| dark | I can carry state through function parameters | 11/09 12:28 |
| dark | but I have to use the IO monad to read the input and write the output | 11/09 12:29 |
| pigworker | it's up to the RTS how to treat Delay, just as it's the Haskell RTS which interprets IO values as instructions to communicate | 11/09 12:29 |
| dark | hm | 11/09 12:29 |
| dark | Delay means "potentially non-terminating"? | 11/09 12:30 |
| pigworker | yeah, e.g., informally, codata Delay x = Done x | Wait (Delay x) | 11/09 12:31 |
| dark | (i.e. my step function can be something like state * input -> state * output, simulating an impure language) | 11/09 12:31 |
| pigworker | yes, and you could well write an interpreter as a function which uses that step to consume a stream of inputs and produce a stream of outputs | 11/09 12:32 |
| dark | exactly, but for a turing-complete language, the "step" of each input symbol might be non-terminating | 11/09 12:33 |
| dark | (or the interpreter might otherwise need to go back and see previous symbols) | 11/09 12:34 |
| pigworker | you confused me by calling it a "step function"; but if that's so, then you can add a Wait constructor to your output stream | 11/09 12:36 |
| pigworker | The point is that there are honest ways to model infinite processes. Agda merely excludes the dishonest ways to do it. | 11/09 12:37 |
| dark | (I confused myself too. "step" is supposed to be always terminating, but then there must be some other trick somewhere to achieve non-termination. consider this script while sleep 60; do cat /proc/acpi/battery/BAT0/state; done, any terminating interpreter would do the wrong thing) | 11/09 12:38 |
| dark | (maybe it's too much to expect to verify /bin/sh..) | 11/09 12:39 |
| pigworker | I was guessing that nontermination was to be achieved by stepping forever, hence producing an infinite trace, rather than nothing at all | 11/09 12:40 |
| dark | yes, stepping forever :) | 11/09 13:11 |
| dark | producing nothing at all isn't very useful.. | 11/09 13:12 |
| pigworker | quite; the stream model works here; you can write such an interpreter; you just can't make the *typechecker* run it *forever* | 11/09 13:15 |
| dark | <pigworker> quite; the stream model works here; you can write such an interpreter; you just can't make the *typechecker* run it *forever* | 11/09 15:16 |
| dark | by this you mean that type-checking will terminate, or that the type-checker will forbid it to run forever? | 11/09 15:17 |
| pigworker | Two things run programs: one is the typechecker, the other is the run-time system; to keep the type system decidable, we ensure that the typechecker does not run programs forever. The typechecker does not forbid the RTS to run programs forever. | 11/09 16:52 |
| leo_ | Hi! | 11/09 21:57 |
| copumpkin | hi! | 11/09 21:57 |
| leo_ | postulate | 11/09 21:57 |
| leo_ | Int : Set | 11/09 21:57 |
| leo_ | Real : Set | 11/09 21:57 |
| leo_ | int-to-real : Int -> Real | 11/09 21:57 |
| leo_ | {-# COMPILED_TYPE Int Int #-} | 11/09 21:57 |
| leo_ | {-# COMPILED_TYPE Real Float #-} | 11/09 21:57 |
| leo_ | {-# COMPILED int-to-real ?? #-} | 11/09 21:57 |
| copumpkin | fromIntegral? | 11/09 21:58 |
| leo_ | that is my question xD | 11/09 21:58 |
| leo_ | fromIntegral :: (Integral a, Num b) => a -> b | 11/09 21:59 |
| leo_ | {-# COMPILED int-to-real (fromIntegral :: Int -> Float) #-} ?? | 11/09 21:59 |
| Saizan | i'd guess so | 11/09 22:03 |
| leo_ | OK | 11/09 22:04 |
| leo_ | thanks | 11/09 22:04 |
| benmachine | people use Float in agda? | 11/09 22:04 |
| * benmachine melts | 11/09 22:04 | |
| copumpkin | leo_: keep in mind that your proofs about Real will be (possibly) wrong unless you account for Float's odd behavior | 11/09 22:05 |
| --- Day changed Sun Sep 12 2010 | ||
| lispy | or they could be wrong because agda is a moving target and the code examples/tutorials you find no longer compile | 12/09 03:25 |
| lispy | but i'm not bitter | 12/09 03:25 |
| * lispy is bitter | 12/09 03:25 | |
| copumpkin | just ask #agda, we have answers! | 12/09 03:26 |
| lispy | copumpkin: I did, but no one seemed to know | 12/09 03:27 |
| copumpkin | oh? | 12/09 03:27 |
| copumpkin | well if you post a large example that we'd need a lot of context to understand, it takes a lot more time to give help :P | 12/09 03:27 |
| lispy | http://www.cse.chalmers.se/~ulfn/code/tphols09/Semantics.html | 12/09 03:27 |
| lispy | that code doesn't compile on my machine | 12/09 03:28 |
| dolio | That website is unreachable on my machine. | 12/09 03:28 |
| copumpkin | same here, but I remember you linking to that before | 12/09 03:28 |
| lispy | 3rd tutorial in the list here: http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Othertutorials | 12/09 03:28 |
| lispy | Since then, I've learned that Coq has a feature similar to what I want (extraction to Haskell) | 12/09 03:29 |
| dolio | Anyhow, Agda is definitely a moving target. | 12/09 03:29 |
| lispy | But, there are somethings I still don't like (Coq syntax is ugly, call me shallow, and I really want to write my Haskell code and then prove theorems about it) | 12/09 03:30 |
| dolio | No argument here. | 12/09 03:30 |
| lispy | so some of us at work has banded together to write a haskell-verifier that goes from ghc core to HOLCF | 12/09 03:30 |
| dolio | People often say syntax doesn't matter. But they're wrong. | 12/09 03:30 |
| dolio | I don't see anything in the accompanying paper that would have stopped working. | 12/09 03:32 |
| dolio | Unless you're talking about compilation-to-haskell not working. I could believe that. | 12/09 03:32 |
| dark | lispy, the problem of verifying a production code is that people aren't interested, and will see this as a difficulty to change specifications, etc | 12/09 03:33 |
| copumpkin | from the error lispy gave last time, it looked like one of the functions simply hadn't been fully applied | 12/09 03:33 |
| lispy | dolio: the compilaton to haskell is a separate thing. | 12/09 03:33 |
| copumpkin | maybe just a typo in the commit to the repo | 12/09 03:33 |
| lispy | dark: no where I work :) | 12/09 03:34 |
| copumpkin | it was one of those x -> y != errors | 12/09 03:34 |
| dark | for example, in the haskell history paper, the guy attributes to the lack of specs (planned but never delivered) the great diversity and innovations that is happening in ghc right now | 12/09 03:34 |
| lispy | dark: we are actually actively looking for ways to incorporate more formal methonds | 12/09 03:34 |
| lispy | methods* | 12/09 03:34 |
| dark | lispy, hm | 12/09 03:34 |
| dark | will you fork ghc? | 12/09 03:34 |
| lispy | dark: I don't think so | 12/09 03:35 |
| dark | I mean, I would love to run a verified OS and toolchain and etc etc right now .-. | 12/09 03:35 |
| dark | .-. | 12/09 03:35 |
| lispy | dark: we're going to translate the output of ghc to holcf and then prove things about that | 12/09 03:35 |
| dark | 'output' you mean 'compiled code'? | 12/09 03:35 |
| lispy | at least, that's the current roadmap. Depending on wat works and what doesn't we may need to try different things | 12/09 03:35 |
| lispy | dark: are you familiar with the stages of ghc? | 12/09 03:36 |
| dark | ..but people perceive verified software as something more 'static' because verification is perceived as expensive)?_ | 12/09 03:36 |
| dark | lispy, no ^^ | 12/09 03:36 |
| copumpkin | lispy: anyway, I'd just stick a hole on the function in question and see what it wants | 12/09 03:36 |
| dark | but I know it compiles to an intermediate language | 12/09 03:36 |
| lispy | dark: ah, well one of the earlier steps is to translate to a 'core' language which is simpler than the haskell you normally work with. | 12/09 03:36 |
| lispy | dark: we want to experiment with proving things about that intermediate language | 12/09 03:36 |
| dark | hm | 12/09 03:36 |
| lispy | Initially we'll probably stick to unoptimized core | 12/09 03:37 |
| dark | is this language specified formally? | 12/09 03:37 |
| dark | or specified at all | 12/09 03:37 |
| lispy | There are other researchers working on formal semantics of haskell at the moment | 12/09 03:37 |
| dark | (as opposed to being a quick internal hack) | 12/09 03:37 |
| lispy | It's a stable format | 12/09 03:37 |
| lispy | I don't know off hand where the spec is | 12/09 03:37 |
| lispy | But, it's sometimes called "external core" | 12/09 03:38 |
| lispy | dark: http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/ext-core.html | 12/09 03:38 |
| dark | I found odd that haskell isn't formally specified while sml is | 12/09 03:38 |
| dark | since haskell had such initial goals | 12/09 03:39 |
| lispy | that will change in the next 2 years | 12/09 03:39 |
| dark | haha nice:) | 12/09 03:39 |
| dark | will be attempted to specify formally haskell 98? | 12/09 03:39 |
| dark | haskell 98 is somewhat detached from practice as it seems (i'm a newbie to haskell actually) | 12/09 03:40 |
| lispy | dark: http://www.haskell.org/haskell-symposium/2010/accepted.html | 12/09 03:40 |
| lispy | Maciej Pirog and Dariusz Biernacki. A Systematic Derivation of the STG Machine Verified in Coq | 12/09 03:40 |
| lispy | STG machine is what GHC uses | 12/09 03:40 |
| dark | would then this be a formal "operational semantics"? | 12/09 03:41 |
| lispy | dark: but yeah, haskell and ghc's rts will catchup eventually in the formal arena | 12/09 03:41 |
| dark | (I'm somewhat confused by those terms) | 12/09 03:41 |
| lispy | dark: I'm not sure to be honest. I know SPJ gave an operational semantics in his book about implementing haskell | 12/09 03:41 |
| dark | I ask myself: why specify a first "standard" for haskell in plain english? If there were no need for formalism, is a standard necessary at all? Due to this, verifying haskell looks very hard to me | 12/09 03:45 |
| dark | otherwise they would make some effort to verify it. (but maybe they weren't sure about the most adequate semantics. but this is also an argument against standardization at all) | 12/09 03:46 |
| dark | they = the committee, that disbanded after haskell 98 | 12/09 03:47 |
| dark | "Invertible syntax descriptions: Unifying parsing and pretty printing" - looks a lot interesting õ.o | 12/09 03:47 |
| * Saizan has seen optimized external core, he wouldn't ever try to prove anything about it | 12/09 10:39 | |
| dark | Saizan, that's the problem. I've saw too much times some gcc optimizations miscompiling without notice | 12/09 12:20 |
| dark | sometimes optimizations interact with each other in odd ways, and one has to be sure that any possible interaction will result in a correct compilation | 12/09 12:20 |
| Saizan | proving that would be easier than what i was thinking of | 12/09 12:59 |
| Saizan | since you are proving properties of a program written by a human :) | 12/09 12:59 |
| Saizan | even if that program is a translator between languages | 12/09 13:00 |
| Saizan | what i wouldn't attempt is to take the output of optimizations as the program i want to prove properties of | 12/09 13:00 |
| dschoepe | I'm reading Ulf Norell's agda tutorial and have a question about the suggested exercise of proving that all elements in the list returned by filter satisfy the predicate corresponding to the given function. That's what I got so far: http://agda.pastebin.com/y5sfWfUp -- I'm having trouble filling out that last hole though, could someone give me a hint? | 12/09 21:25 |
| copumpkin | you probably don't want true/false | 12/09 21:28 |
| copumpkin | as much as a decidable predicate | 12/09 21:28 |
| copumpkin | it's similar to yes/no | 12/09 21:28 |
| copumpkin | I mean, it's similar to true/false, but carries proof of the thing being satisfied or not | 12/09 21:28 |
| Saizan | i'd guess that you just have to put "_" in place of the ? and it'd work | 12/09 21:29 |
| Saizan | since T true = \top; T false = \bot | 12/09 21:30 |
| copumpkin | oh, yeah | 12/09 21:30 |
| Saizan | though maybe it doesn't interact so well with pattern matching in this case | 12/09 21:31 |
| dschoepe | Saizan: I tried that and agda acts as if there was still a hole(showing _78 : T (p x)). | 12/09 21:31 |
| copumpkin | ah, is it yellow? | 12/09 21:31 |
| dschoepe | yes | 12/09 21:31 |
| Saizan | yeah, since T (p x) wasn't in the context earlier it doesn't get refined by you matching on p x | 12/09 21:31 |
| dschoepe | In such a case, do I have to match on something different or is there some way to trigger that manually, like coq's simpl-tactic? | 12/09 21:33 |
| Saizan | you could use the Inspect idiom from Relation.Binary.PropositionalEquality | 12/09 21:36 |
| codolio | Try 'with p x | T (p x)' | 12/09 21:36 |
| Saizan | i'm afraid that using 'with p x | T (p x)' it won't then remember that the pattern for T (p x) is the same type the hole should have | 12/09 21:38 |
| codolio | Ah, yeah. | 12/09 21:39 |
| dolio | This is why decidable predicates are so much better. | 12/09 21:40 |
| Saizan | mh, i'm following darcs Agda too closely for my own good :) | 12/09 21:48 |
| copumpkin | how come? | 12/09 21:48 |
| Saizan | suffering from some bugs/incompatibility with the stdlib, they seem to get promptly fixed though :) | 12/09 21:50 |
| dschoepe | hmm, I still can't figure it out, I tried inspect and using an own type like this: http://agda.pastebin.com/NyXxdDWK | 12/09 21:51 |
| dschoepe | Am I going in the right direction? | 12/09 21:51 |
| Saizan | IsTrue? b = Dec (T b) -- fyi | 12/09 21:52 |
| Saizan | that would work, but you also need to pattern match on p x to make filter p (x :: xs) reduce | 12/09 21:52 |
| dolio | http://agda.pastebin.com/N6DzXpqD | 12/09 21:53 |
| dolio | How's that for outside the box? | 12/09 21:53 |
| Saizan | nice :) | 12/09 21:54 |
| dschoepe | http://agda.pastebin.com/05yaUeQX -- hmm, I think I'm close now(but still far away from understanding dolio's approach though) :) | 12/09 22:02 |
| copumpkin | don't think that's going to get you there | 12/09 22:03 |
| copumpkin | oh maybe it will | 12/09 22:03 |
| Saizan | heh, sigh, too much reduction there. | 12/09 22:04 |
| * copumpkin shakes his fist at bools | 12/09 22:04 | |
| copumpkin | they're so uninformative! :P | 12/09 22:04 |
| * dschoepe is starting to think that he should put this exercise aside for now :) | 12/09 22:05 | |
| dolio | dschoepe: I don't recommend my approach. :) | 12/09 22:05 |
| Saizan | i think it's quite doable with Inspect | 12/09 22:05 |
| Saizan | or if your filter used something like Dec | 12/09 22:05 |
| dolio | dschoepe: What I did was use 'with' to refine the type of _:all:_ along with the match on p x. | 12/09 22:05 |
| dschoepe | Saizan: It's the filter from the stdlib | 12/09 22:06 |
| dolio | So, when 'p x' got matched on, yielding 'true', the type of the '_::_ ...' I was matching on got refined from 'T (p x) -> ...' to 'Unit -> ...'. | 12/09 22:07 |
| dschoepe | ah, thanks for the explanation | 12/09 22:09 |
| Saizan | it seems filter changed in my stdlib | 12/09 22:12 |
| dschoepe | trying to solve this with inspect seems to prevent agda from reducing filter, since it generates identical types for both holes: http://agda.pastebin.com/yHLZBqyC | 12/09 22:15 |
| dschoepe | Shouldn't inspect save me the trouble of having to match against (p x) again? | 12/09 22:16 |
| copumpkin | Saizan: really? does it use Dec now? | 12/09 22:16 |
| Saizan | copumpkin: it goes through Maybe | 12/09 22:17 |
| Saizan | http://pastebin.com/ZkvZmQEU -- with inspect | 12/09 22:17 |
| Saizan | dschoepe: yeah, i was a bit surprised by that, luckily we've rewrite :) | 12/09 22:18 |
| dschoepe | Thanks, didn't know about that. | 12/09 22:19 |
| Saizan | when you've (foo | bar) and want to cast it to (foo | baz) using a proof of bar == baz, there's no way to do it with subst, right? | 12/09 22:29 |
| liyang | Rewrite? | 12/09 22:36 |
| Saizan | https://lists.chalmers.se/pipermail/agda/2009/001513.html <- new in Agda-2.2.6 | 12/09 22:37 |
| * copumpkin is a big fan of Rewrite | 12/09 22:40 | |
| * Saizan was going to make a facebook joke but it felt inappropriate. | 12/09 22:42 | |
| --- Day changed Mon Sep 13 2010 | ||
| leo | hi! | 13/09 02:50 |
| leo | there is a way to give arguments to main, like the getArgs of haskell ? | 13/09 02:52 |
| copumpkin | you can bind to haskell :) | 13/09 02:52 |
| leo | :D ok | 13/09 02:53 |
| leo | thanks | 13/09 02:53 |
| dreixel | hi | 13/09 07:26 |
| dreixel | I'm having a bit of trouble with syntax of parametrised modules | 13/09 07:26 |
| dreixel | how can I open a parametrised module? | 13/09 07:26 |
| dolio | open M x y z | 13/09 07:27 |
| dreixel | yeah, that doesn't seem to work | 13/09 07:27 |
| dreixel | I get parse errors | 13/09 07:28 |
| copumpkin | can we see? | 13/09 07:28 |
| dreixel | if I'm using operators as arguments | 13/09 07:28 |
| copumpkin | you imported it? | 13/09 07:28 |
| dreixel | do I need parentheses or anything? | 13/09 07:28 |
| copumpkin | you're putting them with the underscores? | 13/09 07:28 |
| dreixel | yeah | 13/09 07:28 |
| dreixel | open import IxFun2 IxCode _∔_ ⟪_⟫ ∔→+ ≡ix | 13/09 07:28 |
| copumpkin | I think you might need to import and open separately? | 13/09 07:28 |
| copumpkin | maybe not, but I usually do that | 13/09 07:28 |
| dreixel | no, I get the same parse error | 13/09 07:29 |
| dreixel | on \<< | 13/09 07:29 |
| dolio | Does it work with parentheses? | 13/09 07:29 |
| dreixel | where? | 13/09 07:30 |
| dreixel | on each one? | 13/09 07:30 |
| dreixel | on the offending one? | 13/09 07:30 |
| dolio | The ones that cause errors, at least. | 13/09 07:30 |
| dreixel | I tried a few combinations | 13/09 07:30 |
| dreixel | if I put parentheses on the _+_ the error moves there | 13/09 07:30 |
| dreixel | if I put it on the \<<_\>>, the error stays there | 13/09 07:30 |
| copumpkin | if you put a hole on the <<_>>, does it work? | 13/09 07:32 |
| copumpkin | like, is that one the only problem? | 13/09 07:32 |
| dreixel | how do I put holes there? | 13/09 07:33 |
| dreixel | both ? and _ give parse errors. | 13/09 07:33 |
| copumpkin | :O | 13/09 07:33 |
| dreixel | maybe I'm doing something terribly wrong... | 13/09 07:34 |
| dolio | I can't seem to reproduce your problem. | 13/09 07:34 |
| dreixel | no, this is weird | 13/09 07:35 |
| dolio | Are those two things after <<_>> not operators? | 13/09 07:35 |
| dreixel | even if I try to open it with all Zeros, say | 13/09 07:35 |
| dreixel | I still get an error on the third argument | 13/09 07:35 |
| dreixel | those after <<_>> are not operators, no | 13/09 07:36 |
| dreixel | oh ok, solved | 13/09 07:40 |
| dreixel | first I should import, without parameters | 13/09 07:40 |
| dreixel | and then open, with the parameters | 13/09 07:40 |
| copumpkin | yeah, that's what I meant earlier, sorry | 13/09 07:41 |
| dreixel | copumpkin was right all along | 13/09 07:41 |
| dreixel | another question regarding modules | 13/09 07:44 |
| dreixel | is there an easier way to have a couple of modules all parametrised over the same stuff, other than repeating the parameters everywhere? | 13/09 07:45 |
| dolio | Put them inside another module? | 13/09 07:45 |
| dreixel | uhm, yeah, but then they have to be on the same file | 13/09 07:48 |
| dolio | Oh. Then no. | 13/09 07:49 |
| dreixel | alright, thanks | 13/09 07:49 |
| lispy | anyone awake? | 13/09 08:03 |
| lispy | equal? : (n m : Nat) -> Equal? n m | 13/09 08:03 |
| lispy | equal? zero zero = eq refl | 13/09 08:03 |
| lispy | why eq refl instead of eq (zero == zero) ? | 13/09 08:03 |
| lispy | (this is from the agda tutorial pdf) | 13/09 08:04 |
| lispy | data Equal? (n m : Nat) : Set where | 13/09 08:04 |
| lispy | eq : n == m -> Equal? n m | 13/09 08:04 |
| lispy | neq : n | 13/09 08:04 |
| lispy | ̸= m -> Equal? n m | 13/09 08:04 |
| lispy | that did not paste well | 13/09 08:04 |
| TheOnionKnight | zero == zero is the type of proofs (aka proposition) that zero equals zero, refl {x} is the proof of the proposition x == x, eq takes a proof of the proposition n == m, hence the refl. | 13/09 09:37 |
| tsapi | is it allowed to use a semicolon in a mixfix binder declaration? | 13/09 14:12 |
| tsapi | when I try: syntax mbind e1 (\x -> e2) = x <- e1 ; e2 | 13/09 14:13 |
| tsapi | i get: The right-hand side can only be omitted if there is an absurd | 13/09 14:15 |
| tsapi | pattern, () or {}, in the left-hand side. | 13/09 14:15 |
| tsapi | when checking that the clause e2 has type _33 | 13/09 14:15 |
| tsapi | (or rather, is it supposed to be allowed) | 13/09 14:15 |
| Saizan | that's one of the examples used.. though maybe <- is the one causing trouble? | 13/09 14:22 |
| tsapi | Saizan: yes, funny if it doesn't work... I tried switching <- for something else but it didn't help | 13/09 14:24 |
| leo | sd-pointwise : { s d s′ d′ : ℕ } → (s , d) ≡ (s′ , d′) → s ≡ s′ × d ≡ d′ | 13/09 17:14 |
| leo | sd-pointwise refl = ? | 13/09 17:14 |
| leo | There is an error in refl | 13/09 17:15 |
| leo | how i can proof something like this (i'm sorry for my english xD) | 13/09 17:15 |
| Saizan | i'd probably go with "sd-pointwise eq = cong proj\_1 eq , cong proj\_2 eq" | 13/09 17:16 |
| leo | oh , where is cong ? | 13/09 17:17 |
| copumpkin | Relation.Binary.PropositionalEquality iirc | 13/09 17:17 |
| leo | thanks | 13/09 17:18 |
| copumpkin | we need an agda hoogle :) | 13/09 17:18 |
| leo | yes! | 13/09 17:18 |
| copumpkin | although I guess a type-based search is not a trivial problem | 13/09 17:18 |
| leo | egrep, grep | 13/09 17:18 |
| leo | xD | 13/09 17:19 |
| Saizan | epigram 2 can fill in proofs from the context for you, so they must have something like a type based search | 13/09 17:20 |
| Saizan | which doesn't guarantee it's efficient :) | 13/09 17:21 |
| jonrafkind | what exaclty does '!=<' mean? | 13/09 20:07 |
| copumpkin | not smaller than! | 13/09 20:09 |
| copumpkin | or equal to | 13/09 20:10 |
| copumpkin | :P | 13/09 20:10 |
| copumpkin | what's the context? | 13/09 20:10 |
| jonrafkind | hold on, im gonna paste it | 13/09 20:11 |
| jonrafkind | http://pastebin.com/AQtVmTaA | 13/09 20:12 |
| copumpkin | I've seen that before too, but not sure what the reasoning behind using that symbol is. You can see what they mean, though? | 13/09 20:15 |
| jonrafkind | well not really | 13/09 20:15 |
| jonrafkind | do you understand whats going wrong here? | 13/09 20:15 |
| copumpkin | well C Nat | 13/09 20:15 |
| copumpkin | is just a value of SigDesc | 13/09 20:16 |
| jonrafkind | right | 13/09 20:16 |
| copumpkin | you're saying the type of mine6 is a value of SigDesc | 13/09 20:16 |
| jonrafkind | i thought GADT's let me say that | 13/09 20:16 |
| jonrafkind | that i could narrow the SigDesc to a specific constructor | 13/09 20:16 |
| copumpkin | nope, it's gotta be Set at some level | 13/09 20:16 |
| copumpkin | any value | 13/09 20:16 |
| copumpkin | mine6 : SigDesc | 13/09 20:16 |
| jonrafkind | mine2 : {A : Set} -> Time -> SF [ C ℕ ] [ C String ] cau | 13/09 20:17 |
| jonrafkind | mine2 t = pure (λ x -> "a") | 13/09 20:17 |
| jonrafkind | this works | 13/09 20:17 |
| jonrafkind | where SF takes a List SigDesc | 13/09 20:17 |
| copumpkin | often if you see [ ] (by convention) it means interpret a custom universe into a Set | 13/09 20:17 |
| jonrafkind | if i change mine6 to SigDesc I get a different error | 13/09 20:17 |
| copumpkin | yeah, cause 4 isn't Set | 13/09 20:17 |
| copumpkin | mine6 : SigDesc; mine6 = C Nat | 13/09 20:17 |
| copumpkin | should work | 13/09 20:17 |
| jonrafkind | yea that works | 13/09 20:18 |
| copumpkin | you probably want some sort of interpreter for your universe | 13/09 20:18 |
| copumpkin | also, do you have --type-in-type turned on? :P | 13/09 20:18 |
| jonrafkind | yea | 13/09 20:18 |
| jonrafkind | that seems to be required | 13/09 20:18 |
| copumpkin | nah | 13/09 20:18 |
| jonrafkind | im using a library of some other code | 13/09 20:18 |
| copumpkin | ah | 13/09 20:19 |
| jonrafkind | and iwthout it his code wont typecheck | 13/09 20:19 |
| copumpkin | ick :P | 13/09 20:19 |
| jonrafkind | such is life | 13/09 20:19 |
| jonrafkind | what does an interpreter have to do with this | 13/09 20:19 |
| jonrafkind | i mean there is one.. but im not using it yet | 13/09 20:19 |
| copumpkin | well typically you create custom universes of things you care about using some form of inductive family | 13/09 20:20 |
| copumpkin | could be finite types or whatever | 13/09 20:20 |
| copumpkin | and then you have a function taking that custom universe into Set | 13/09 20:20 |
| copumpkin | to give you "agda types" | 13/09 20:20 |
| copumpkin | like maybe your function would be [[_]] : SigDesc -> Set | 13/09 20:20 |
| copumpkin | and then [[ E x ]] = ...; [[ C x ]] = ... | 13/09 20:21 |
| copumpkin | and mine6 : [[ C Nat ]] | 13/09 20:21 |
| copumpkin | not sure I'm being very clear :) | 13/09 20:21 |
| copumpkin | what is SigDesc for? | 13/09 20:21 |
| jonrafkind | to encode FRP values | 13/09 20:21 |
| jonrafkind | E = events, C = behaviors | 13/09 20:22 |
| copumpkin | ah | 13/09 20:22 |
| copumpkin | so just as a tiny example, you might have data Finite : Set where 0# 1# : Finite; _+_ _*_ : Finite -> Finite -> Finite | 13/09 20:24 |
| jonrafkind | ya | 13/09 20:25 |
| copumpkin | [[_]] : Finite -> Set; [[ 0# ]] = \bot; [[ 1# ]] = \top; [[ x + y ]] = [[ x ]] \u+ [[ y ]]; [[ x * y ]] = [[ x ]] \x [[ y ]] | 13/09 20:25 |
| jonrafkind | so the [[_]] is an injective function? | 13/09 20:25 |
| jonrafkind | whats \u+ and \x | 13/09 20:26 |
| jonrafkind | agda's + and agda's * ? | 13/09 20:26 |
| copumpkin | \u+ is basically Haskell's Either | 13/09 20:26 |
| copumpkin | and \x is (,) | 13/09 20:26 |
| copumpkin | they're just in the standard library, but yeah | 13/09 20:26 |
| jonrafkind | oh ok, set combinations or whatever | 13/09 20:26 |
| jonrafkind | im not a haskell pro, so i dont know (,) | 13/09 20:26 |
| copumpkin | simple sum and product | 13/09 20:26 |
| copumpkin | ah okay | 13/09 20:26 |
| copumpkin | yeah, just a disjoint sum and a pair | 13/09 20:27 |
| jonrafkind | ok | 13/09 20:27 |
| copumpkin | so if I understand your SigDesc correctly, you're making some sort of a universe representing the kinds of types you care about in FRP | 13/09 20:27 |
| copumpkin | and you want to carry that universe into plain old agda types | 13/09 20:28 |
| copumpkin | so you can make easy values for it | 13/09 20:28 |
| jonrafkind | yes I think so | 13/09 20:28 |
| copumpkin | so you'd basically need to figure out what your SigDesc -> Set would look like (note that your SigDesc -> Set could itself be another type, this time a family indexed by the type of elements it creates) | 13/09 20:29 |
| copumpkin | jonrafkind: so if you consider C <agda type> and E <agda type> to be types themselves, what would their values look like? | 13/09 20:32 |
| jonrafkind | just the agda type | 13/09 20:32 |
| jonrafkind | C and E are to pass them around | 13/09 20:32 |
| copumpkin | oh, so then that's simple | 13/09 20:33 |
| copumpkin | [[ E x ]] = x; [[ C x ]] = x | 13/09 20:33 |
| copumpkin | :) | 13/09 20:33 |
| jonrafkind | yea | 13/09 20:33 |
| jonrafkind | the intepreter is for pushing values through the FRP functions | 13/09 20:33 |
| jonrafkind | where time is a parameter to every function | 13/09 20:34 |
| copumpkin | ah | 13/09 20:34 |
| g_cross | Is there a function in the standard library that allows one to convert a Dec P to a Dec Q given maps (P -> Q) and (Q -> P)? | 13/09 20:43 |
| g_cross | Also, out of curiosity, what general structure is it where you can take a type F A and convert it to a type F B given maps (a -> B) and (B -> A)? It's not a functor or a cofunctor, but something that's both and probably has some sort of name. :-) | 13/09 20:44 |
| Saizan | invariant functor | 13/09 20:45 |
| g_cross | Yay! I knew it. :-) Can we put it in the standard library and make Dec an instance of it? | 13/09 20:45 |
| g_cross | I mean, I don't mind writing up patches for this, but I don't know what the policy is. | 13/09 20:45 |
| Saizan | (btw, "cofunctor" is quite an abuse of the co- prefix) | 13/09 20:46 |
| copumpkin | contrafunctor! | 13/09 20:46 |
| g_cross | OHHHH, thanks, I hadn't realized that. | 13/09 20:47 |
| g_cross | Why in retrospect should I have known to use contra- instead of co-? | 13/09 20:48 |
| Saizan | g_cross: dunno either, though even without a record type for invariant functors a map function in the module that defines Dec would make sense | 13/09 20:48 |
| Saizan | well, co- is when you interpret a definition in the dual category but still seeing it from the original one | 13/09 20:49 |
| Saizan | but if you do that to a covariant functor you still get the same covariant functor :) | 13/09 20:49 |
| Saizan | and instead covariance (contravariance) is used in various field to roughly mean "changing in the same (opposite) way" | 13/09 20:52 |
| g_cross | Oh, I see; so technically in general use when one sees a "functor" one is really seeing a "cofunctor" since the "co-" is implicit; thus, the dual to a functor is not a cofunctor but a *contra*functor. | 13/09 20:54 |
| Saizan | nono | 13/09 20:54 |
| g_cross | That is, a functor can be covariant or contravariant, but because people are lazy they say just "functor" when they mean covariant functor. | 13/09 20:54 |
| dolio | No. "Co" just isn't applied to functors. | 13/09 20:54 |
| Saizan | the fact that "covariant" starts with "co" is not related to the common use of co- as a prefix | 13/09 20:55 |
| g_cross | Ah, okay. | 13/09 20:55 |
| dolio | A lot of category theory doesn't talk about covariant vs. contravariant functors. | 13/09 20:55 |
| dolio | They just talk about functors, which means the first case, where f : A -> B => Ff : FA -> FB. | 13/09 20:55 |
| g_cross | Okay, so "co-" is never used as a prefix for functors, but "contra-" is? | 13/09 20:55 |
| dolio | And then a contravariant functor from C to D is a functor from C^op to D. | 13/09 20:56 |
| dolio | And an "invariant" functor above would be a functor from some other category related to C to D. | 13/09 20:57 |
| Saizan | same objects as C but arrows are isomorphisms? | 13/09 20:58 |
| dolio | It would have all the objects of C, but instead of C's arrows, it would have arrows f : A -> B being a pair of C-arrows (g : A -> B, h : B -> A). | 13/09 20:58 |
| dolio | I'm not sure it'd need to be isomorphisms. | 13/09 20:58 |
| dolio | I can't say I've seen that used before, though. | 13/09 20:59 |
| dolio | The only thing I know of that talks about them is (I think) Bananas in Space. | 13/09 21:00 |
| dolio | Where they're called expfunctors. | 13/09 21:00 |
| Saizan | heh | 13/09 21:00 |
| dolio | And they don't bother with the category theoretic definition of them. | 13/09 21:00 |
| dolio | They just go with expmap :: (a -> b) -> (b -> a) -> F a -> F b. | 13/09 21:00 |
| dolio | I think that's how they are in category-extras, too. | 13/09 21:01 |
| g_cross | So: | 13/09 21:02 |
| g_cross | http://pastebin.com/RiMn1Anr | 13/09 21:02 |
| Saizan | i'd call it "map" | 13/09 21:02 |
| g_cross | Fair enough | 13/09 21:02 |
| g_cross | I guess my thought in calling it something else is that it requires both a map from P to Q and a map from Q to P. | 13/09 21:03 |
| dolio | mapDec is a sensible name. | 13/09 21:03 |
| g_cross | Okidoke | 13/09 21:03 |
| g_cross | So how do I get this put in the standard library? | 13/09 21:03 |
| dolio | Not sure. Does the wiki have instructions for submitting changes? | 13/09 21:04 |
| Saizan | http://www.cs.nott.ac.uk/~nad/listings/lib/README.html <- last paragraph of the header | 13/09 21:05 |
| g_cross | Cool, just saw that | 13/09 21:06 |
| g_cross | To whom should I send the e-mail? | 13/09 21:06 |
| Saizan | the mailing list seems appropriate | 13/09 21:06 |
| g_cross | Excellent | 13/09 21:07 |
| g_cross | So, in order to do this I need to be running the development version of the library and of Agda. | 13/09 21:07 |
| g_cross | In your experience, how stable is the development version of agda? | 13/09 21:07 |
| g_cross | I was hesitant to use it because I was afraid of getting frustrated with running into lots of bugs. | 13/09 21:08 |
| dolio | Pretty stable. | 13/09 21:08 |
| Saizan | fairly stable in general, but somewhat less lately since they are implementing quite a few things | 13/09 21:08 |
| dolio | I don't think I've ever used a release version. | 13/09 21:08 |
| Saizan | i had to unpull a patch to make the stdlib typecheck | 13/09 21:09 |
| dolio | Yeah, they can get desynced there sometimes. | 13/09 21:09 |
| g_cross | So, any thoughts for how one might introduce an invariant functor class to the standard library? | 13/09 21:17 |
| g_cross | Presumably it would be done in a manner analagous to Functor, i.e. create a record RawSomething with fields. | 13/09 21:18 |
| g_cross | So really it's just a matter of figuring out what to call it and which module it should go into. | 13/09 21:18 |
| dolio | Agda doesn't have classes. | 13/09 21:18 |
| g_cross | Yes, sorry, I mispoke there. | 13/09 21:19 |
| g_cross | Too used to Haskell terminology :-) | 13/09 21:19 |
| g_cross | What is the term I should have used? | 13/09 21:19 |
| dolio | Don't know. :) | 13/09 21:21 |
| Saizan | we can bikeshed between ExpFunctor and InvariantFunctor (the former is probably more common overall), but it should probably go under Category | 13/09 21:21 |
| dolio | Does the standard library have functors? I forget. | 13/09 21:21 |
| g_cross | Yes. | 13/09 21:21 |
| g_cross | In Category.Functor | 13/09 21:21 |
| dolio | Well, it would go in a similar place. | 13/09 21:22 |
| g_cross | Agreed. | 13/09 21:22 |
| Saizan | a -> a could also be an "instance" | 13/09 21:22 |
| g_cross | However, should that be in Category.Functor, Category.ExpFunctor, Category.Functor.ExpFunctor? | 13/09 21:22 |
| Saizan | Category.Functor.Exp ? :) | 13/09 21:23 |
| g_cross | Works for me. | 13/09 21:23 |
| Saizan | easy to change anyway | 13/09 21:24 |
| g_cross | Heh, it's kinda nice working with such a young language because there are still easy, obvious ways in which one can contribute. :-) | 13/09 21:26 |
| g_cross | Why is there a convention of putting so much functionality into a submodule called "Core" and then importing that module publicly? | 13/09 21:34 |
| liyang | Mutual dependencies, I believe. | 13/09 21:42 |
| jonrafkind | if [ 1 ] is a list with one element, 1, then how do i write a list with two elements? | 13/09 23:07 |
| Saizan | with the stdlib list it'd be "1 \:: [ 1 ]" or "1 \:: 1 \:: []" | 13/09 23:11 |
| jonrafkind | yea.. i got that to work. thats pretty awful syntax | 13/09 23:16 |
| Saizan | maybe you can make something closer to haskell's notation with mixfixs :) | 13/09 23:39 |
| dolio | It'd be pretty evil. | 13/09 23:41 |
| dolio | I think I've done it. | 13/09 23:41 |
| Saizan | istr that too | 13/09 23:41 |
| dolio | [ = id, _,_ = cons, ] = nil probably works. | 13/09 23:41 |
| dolio | Oh wait, no, that's got a , ]. | 13/09 23:42 |
| dolio | You need _] = singleton. | 13/09 23:43 |
| * dolio disappears. | 13/09 23:43 | |
| benmachine | that syntax never bothered me, though | 13/09 23:43 |
| benmachine | how often to you construct big list literals in agda anyway? | 13/09 23:44 |
| jonrafkind | my inner-scheme child is crying :p | 13/09 23:45 |
| --- Day changed Wed Sep 15 2010 | ||
| camio | hehe, love the topic. | 15/09 19:44 |
| Spockz | is it new? :) | 15/09 19:46 |
| camio | new to me :) | 15/09 19:46 |
| Spockz | I'm starting with Agda again with this course: http://www.cs.uu.nl/education/vak.php?stijl=2&vak=INFOMDTP&jaar=2010 :D | 15/09 19:51 |
| --- Day changed Thu Sep 16 2010 | ||
| * glguy gets his module to fully check for the first time: http://www.galois.com/~emertens/integer-properties/DataIntegerProperties.agda | 16/09 03:59 | |
| glguy | isCommutativeSemiring : IsCommutativeSemiring _≡_ _+_ _*_ (+ 0) (+ 1) | 16/09 03:59 |
| glguy | for Data.Integer | 16/09 03:59 |
| glguy | now its time to make it "clean" :) | 16/09 04:00 |
| dolio | (+ 0) (+ 1)? | 16/09 04:02 |
| dolio | Oh, positive 0 and positive1. | 16/09 04:02 |
| glguy | +_ is the Data.Integer cons. | 16/09 04:03 |
| glguy | yeah, that | 16/09 04:03 |
| glguy | The real joy is that now we can just use the RingSolver instead of mucking about with integers | 16/09 04:03 |
| copumpkin | very nice | 16/09 04:06 |
| copumpkin | submit a patch to the std lib :) | 16/09 04:06 |
| glguy | If you look at the link you'll notice that the module has a long way to go before it is good enough to submit | 16/09 04:07 |
| glguy | I've got a bunch of things I couldn't think of names for named case1,case2... | 16/09 04:08 |
| copumpkin | yeah | 16/09 04:08 |
| glguy | and I took no notice of line lengths | 16/09 04:08 |
| glguy | the chains of rewrite rules are ugly... | 16/09 04:09 |
| copumpkin | I dunno, I quite like using chains of rewrites :) but I guess they aren't very clear | 16/09 04:11 |
| glguy | they are great for when I was working through the proof | 16/09 04:11 |
| glguy | they are pretty opaque, however | 16/09 04:11 |
| glguy | The RingSolver kick's the agda executable's ass... | 16/09 05:13 |
| glguy | s/'// | 16/09 05:13 |
| copumpkin | how so? eats lots of resources? | 16/09 05:14 |
| glguy | files take *minutes* to load and use hundreds of MB of ram | 16/09 05:14 |
| copumpkin | yeah :/ | 16/09 05:14 |
| copumpkin | the paper it's based on gives a more efficient way of doing it | 16/09 05:15 |
| lispy_ | glguy: congrats | 16/09 05:15 |
| glguy | but it sure is convenient... | 16/09 05:15 |
| copumpkin | the ringsolver uses one constructor per exponent lift, if you know what I mean | 16/09 05:15 |
| copumpkin | whereas the paper it's based on allows you to lift by an arbitrary nat each time | 16/09 05:15 |
| * copumpkin would like to change it to the more efficient form, and possibly use the goal quoting stuff in conjunction with it | 16/09 05:17 | |
| copumpkin | but it's a lot of work :P | 16/09 05:17 |
| glguy | thanks, lispy | 16/09 05:17 |
| copumpkin | and I don't actually have a use for it | 16/09 05:17 |
| glguy | http://www.galois.com/~emertens/integer-properties/DataIntegerProperties.agda first round of clean ups... moved the Commutative Monoid proofs for + and * to their own files... | 16/09 05:19 |
| glguy | This might actually end up being readable | 16/09 05:19 |
| jonrafkind | does agda have printf or something? | 16/09 17:09 |
| copumpkin | you could write a fully typesafe one :) | 16/09 17:09 |
| copumpkin | in fact, I vaguely remember seeing one in an example somewhere | 16/09 17:10 |
| copumpkin | anyone have any idea why a simple case of quickcheck on a one-line non-recursive function (100 tests) in ghci would eat up 400+ MB of RAM (I kill it before it finishes)? | 16/09 18:03 |
| copumpkin | whoops, wrong channel | 16/09 18:06 |
| glguy | copumpkin: were you using some complicated Arbitrary instance? | 16/09 18:08 |
| copumpkin | no, just Int on all three parameters | 16/09 18:08 |
| copumpkin | mm, lots of yummy new things in the 2.2.8 notes | 16/09 18:16 |
| jonrafkind | types have types and values have types, but declaring types and values use the same syntax. how can you tell when some identifier is a type or if its a value? | 16/09 18:33 |
| jonrafkind | i guess a type declaration has 'foo : Set' ? | 16/09 18:34 |
| Saizan | yeah, the type of types end with Set n | 16/09 18:35 |
| Saizan | *ends | 16/09 18:35 |
| jonrafkind | are people happy with that syntax? I would prefer some clear separation between type declarations and value declarations | 16/09 18:35 |
| copumpkin | how about types of types? | 16/09 18:36 |
| copumpkin | and so on? | 16/09 18:36 |
| copumpkin | you'd need an infinite amount of syntax! | 16/09 18:36 |
| copumpkin | :P | 16/09 18:36 |
| jonrafkind | anything that can be used as a type should use one syntax | 16/09 18:36 |
| jonrafkind | foo : N. foo = 2. you cant use foo as a type in any other context | 16/09 18:36 |
| copumpkin | hmm | 16/09 18:37 |
| jonrafkind | foo : Set. foo := N. something like that | 16/09 18:37 |
| * Saizan doesn't follow | 16/09 18:38 | |
| * copumpkin neither | 16/09 18:38 | |
| copumpkin | you want some sort of syntactic indicator (case?) that a given variable is a member of Set n ? | 16/09 18:38 |
| jonrafkind | foo : N. foo = 2. bar : foo; thats an error | 16/09 18:38 |
| jonrafkind | yea i guess | 16/09 18:39 |
| Saizan | anyhow i like the lack of lexical distinctions because i often name values (or variables) after their type | 16/09 18:39 |
| copumpkin | jonrafkind: how about Set-valued functions? | 16/09 18:39 |
| jonrafkind | those are values, so what about them | 16/09 18:39 |
| copumpkin | jonrafkind: well, fun : (x : Nat) -> f x -> ... | 16/09 18:40 |
| copumpkin | jonrafkind: if f returns a Set, you're good | 16/09 18:40 |
| copumpkin | otherwise, you aren't | 16/09 18:40 |
| copumpkin | furthermore | 16/09 18:40 |
| copumpkin | the return type of f could vary | 16/09 18:41 |
| jonrafkind | ok ill think about it | 16/09 18:41 |
| Saizan | copumpkin: nice objection | 16/09 18:44 |
| copumpkin | although the varying return type would always be a sort | 16/09 18:47 |
| copumpkin | mm | 16/09 18:47 |
| copumpkin | actually | 16/09 18:48 |
| copumpkin | http://snapplr.com/7mye | 16/09 18:49 |
| Saizan | yeah | 16/09 18:50 |
| copumpkin | although I guess you couldn't write h : (x : Bool) → g x → Unit at all in that case | 16/09 18:51 |
| copumpkin | hm | 16/09 18:51 |
| Saizan | F x /= Set n | 16/09 18:51 |
| copumpkin | yeah | 16/09 18:51 |
| jonrafkind | in that example is F's real type Bool -> Set2 ? | 16/09 18:53 |
| Saizan | no, Bool -> Set1 | 16/09 19:00 |
| jonrafkind | ok so x : Set2, x = Set1 -> Set1, ? | 16/09 19:01 |
| jonrafkind | or I gues more generally, x : Set2, x = Set1 | 16/09 19:01 |
| copumpkin | the type of Set n is Set n + 1 | 16/09 19:01 |
| copumpkin | Set (n + 1) ,that is | 16/09 19:01 |
| jonrafkind | ok | 16/09 19:01 |
| jonrafkind | does haskell have a notion of Set N, or just agda? | 16/09 19:02 |
| copumpkin | and if x : Set n and y : Set m, then x -> y has type Set (max(n + 1, m)), I think | 16/09 19:02 |
| jonrafkind | hrm, that is wierd | 16/09 19:03 |
| copumpkin | haskell doesn't have arbitrary set levels, nope | 16/09 19:04 |
| copumpkin | it has kinds, which are the types of types, but they don't really behave like regular types much at all | 16/09 19:04 |
| jonrafkind | ok i was reading some haskell documentation to try to learn parts of agda, because there is so little documentation on agda | 16/09 19:04 |
| Saizan | Set 0 == haskell's *, but in haskell you never have to talk about the type of * | 16/09 19:05 |
| jonrafkind | oh I thought * was Set 1? | 16/09 19:05 |
| jonrafkind | type of values = Set 0, type of Set 0 is Set 1 | 16/09 19:05 |
| Saizan | Set 0 is the type of types of values | 16/09 19:06 |
| copumpkin | oh no, Set 0 (a.k.a., Set) is the type of smal ltypes | 16/09 19:06 |
| Saizan | just like * in haskell | 16/09 19:06 |
| jonrafkind | so whats the type of values? Set -1 ? | 16/09 19:06 |
| Saizan | there isn't a single type of values | 16/09 19:07 |
| jonrafkind | oh hm ok | 16/09 19:07 |
| copumpkin | you can ask agda-mode to tell you types with C-c C-d | 16/09 19:07 |
| copumpkin | if you did C-c C-d true | 16/09 19:07 |
| copumpkin | it would tell you Bool | 16/09 19:08 |
| Saizan | but yeah, in agda you can also have types of values that are of type Set n with n >= 0, so copumpkin's definition is more correct | 16/09 19:08 |
| jonrafkind | heh I use vim :p | 16/09 19:08 |
| copumpkin | jonrafkind: oh, I really wouldn't recommend not using agda-mode, especially when you're just getting started | 16/09 19:08 |
| copumpkin | I know there's a vim one but I think it's mostly neglected isn't it? | 16/09 19:08 |
| camio | Is Set1 the set of all types and Set0? | 16/09 19:10 |
| camio | Which doesn't include Set1. | 16/09 19:11 |
| copumpkin | they're not subtypes, if that's what you're asking | 16/09 19:11 |
| copumpkin | if I have something that wants a Set5, I can't pass in a Bool (which is Set) | 16/09 19:11 |
| camio | I haven't come across an explanation of the multiple Setn types. | 16/09 19:12 |
| camio | okay | 16/09 19:12 |
| copumpkin | you can declare a Bool that lives in Set5 though | 16/09 19:12 |
| copumpkin | like I did in that pic, for BigBool in Set1 | 16/09 19:12 |
| camio | pic? | 16/09 19:13 |
| * camio looks at prior conversation | 16/09 19:13 | |
| copumpkin | http://snapplr.com/7mye | 16/09 19:13 |
| camio | I think that answers my question. | 16/09 19:21 |
| camio | thanks | 16/09 19:21 |
| camio | g in that example is a bit mindblowing. I'm going to go scream now. | 16/09 19:22 |
| copumpkin | anyone tried building agda HEAD? | 16/09 19:29 |
| copumpkin | oh, I see | 16/09 19:30 |
| dolio | I built it yesterday or the day before. | 16/09 19:49 |
| dolio | So that I could try out the binding syntax. | 16/09 19:50 |
| dolio | There's really a dearth of good characters to make your own syntax in that regard, though. | 16/09 19:50 |
| dolio | Really, you probably want '\Sigma x : A . T' or something along those lines. | 16/09 19:51 |
| dolio | But both the : and the . are illegal. | 16/09 19:51 |
| copumpkin | you can use the pseudo : (\:) :P | 16/09 19:56 |
| copumpkin | but not sure about that dot | 16/09 19:56 |
| dolio | Yeah, I used \:. | 16/09 19:56 |
| copumpkin | it also feels like a hack | 16/09 19:56 |
| dolio | But it's blurry and wide. | 16/09 19:56 |
| dolio | And I think I used & instead of . | 16/09 19:56 |
| dolio | Anyhow, I think the : should be unambiguous, at least, so it'd be nice if it were usable. | 16/09 19:57 |
| copumpkin | yeah | 16/09 19:57 |
| dolio | Since : is exactly what's being declared there. | 16/09 19:57 |
| jonrafkind | so printf in agda? anyone know how to do it? | 16/09 21:26 |
| Saizan | it really depends on how you want the format string to look like, i'm not even sure there are string literals.. | 16/09 21:40 |
| jonrafkind | ok can I at least do assert? | 16/09 21:42 |
| Saizan | anyhow, you'd have to write a function f : FormatString -> Set that parses the string to tell which arguments to expect that constructs the right function type | 16/09 21:43 |
| Saizan | so then printf : (str : FormatString) -> f str | 16/09 21:43 |
| jonrafkind | yea I found http://code.haskell.org/Agda/test/succeed/Printf.agda but it didnt work | 16/09 21:43 |
| jonrafkind | just gave me some strange type errors | 16/09 21:43 |
| Saizan | works here | 16/09 21:44 |
| Saizan | maybe you need a more recent agda version | 16/09 21:45 |
| jonrafkind | is there assert? | 16/09 21:45 |
| jonrafkind | i just want to do assert(blah == "a") | 16/09 21:45 |
| Saizan | what should that do? | 16/09 21:46 |
| jonrafkind | raise an error of some sort if its false | 16/09 21:47 |
| jonrafkind | like what assert does in most languages | 16/09 21:47 |
| Saizan | i don't know of a way to do that | 16/09 21:48 |
| jonrafkind | ok what are you supposed to do with values in the agda language? | 16/09 21:48 |
| jonrafkind | if i cant inspect them, whats the point? | 16/09 21:49 |
| Saizan | you can inspect them.. | 16/09 21:49 |
| Saizan | e.g. by pattern matching | 16/09 21:49 |
| jonrafkind | and do what with the result? | 16/09 21:49 |
| jonrafkind | "a" -> true, _ -> false, ok now what? | 16/09 21:50 |
| Saizan | produce other values? | 16/09 21:50 |
| jonrafkind | how can I tell if it produced true or false? | 16/09 21:50 |
| Saizan | you can use C-c C-n to evaluate an expression to normal form | 16/09 21:50 |
| Saizan | or you could define foo : some_expr \== some_value; foo = refl | 16/09 21:51 |
| jonrafkind | oh alright, i guess thats reason enough to use agda mode | 16/09 21:51 |
| Saizan | and see if that passes the typechecker | 16/09 21:51 |
| Saizan | assuming "data _\==_ (A : Set) (x : A) : A -> Set where refl : x \== x" | 16/09 21:52 |
| Saizan | you can also write a complete program with a main, compile and run it | 16/09 21:53 |
| jonrafkind | and presumably print something from the main function? | 16/09 21:54 |
| Saizan | yes | 16/09 21:55 |
| jonrafkind | how can I tell if agda mode is working properly? i ran 'agda-mode setup' and it added some lines to my ~/.emacs. C c C n doesnt work though | 16/09 22:15 |
| Spockz | jonrafkind: isn't there some buffer that shows some errors/ | 16/09 22:19 |
| Spockz | jonrafkind: are you on zsh by any chance? | 16/09 22:19 |
| jonrafkind | bash | 16/09 22:19 |
| jonrafkind | no buffer with errors | 16/09 22:20 |
| jonrafkind | theres a "-UUU:**--F1' bar at the bottom of my emacs | 16/09 22:20 |
| Spockz | but with aggda-mode setup you don't need to add anything I remember? | 16/09 22:20 |
| Spockz | jonrafkind: no idea. I'm just a user… | 16/09 22:20 |
| jonrafkind | it automatically added some lines to my ~/.emacs | 16/09 22:20 |
| jonrafkind | i didnt do anything manual otehr than run agda-mode setup | 16/09 22:21 |
| Spockz | jonrafkind: are you on OS X? | 16/09 22:26 |
| jonrafkind | linux | 16/09 22:26 |
| jonrafkind | gnu emacs | 16/09 22:27 |
| Spockz | no idea than sorry, do you have an `Agda' menu item? | 16/09 22:28 |
| Spockz | o | 16/09 22:28 |
| Spockz | did you try C c C l first? | 16/09 22:28 |
| jonrafkind | undefined | 16/09 22:29 |
| jonrafkind | no agda menu item | 16/09 22:29 |
| Spockz | than it really didn't load agda | 16/09 22:29 |
| Spockz | do you have the haskell-mode? | 16/09 22:29 |
| jonrafkind | I guess not | 16/09 22:29 |
| Spockz | you need that too apparently don't know how to get it | 16/09 22:29 |
| Spockz | got it somehow last time | 16/09 22:29 |
| jonrafkind | gentoo has it, i can just emerge it | 16/09 22:30 |
| jonrafkind | ok agda mode works after installing haskell mode | 16/09 22:37 |
| Spockz | jonrafkind: but maybe you should look into getting some error messages | 16/09 22:37 |
| jonrafkind | i get error messages from agda now | 16/09 22:38 |
| Spockz | ok | 16/09 22:38 |
| jonrafkind | ugh, syntax highlighting makes some characters dissappear (like =) | 16/09 22:40 |
| Saizan | is there an agda encoding of the halting problem? | 16/09 23:24 |
| --- Day changed Fri Sep 17 2010 | ||
| Guest13799 | Hi, I'm an agda beginner trying to use it for dependently typed functional programming. I'm looking for a way to convert a natural number to a string, any pointers? | 17/09 11:19 |
| copumpkin | dolio: in your email you just referred to a datatype with a constructor with a dotted type. Is this already valid agda syntax? | 17/09 11:19 |
| copumpkin | domi2: I think there's a function for that in the standard library | 17/09 11:20 |
| copumpkin | domi2: but most of the time we just use C-c C-n in agda-mode to view the numeric result of evaluating something | 17/09 11:20 |
| domi2 | copumpkin: C-c C-n appears to be sufficient for what I'm trying to do, thx. I looked for a conversion function in the std lib but couldn't find one. | 17/09 11:21 |
| copumpkin | let me find it | 17/09 11:22 |
| copumpkin | http://www.cs.nott.ac.uk/~nad/listings/lib/Data.Nat.Show.html#191 | 17/09 11:22 |
| domi2 | copumpkin: damn, I looked only in Data.Nat and some others that were linked from http://www.cs.nott.ac.uk/~nad/listings/lib-0.3/README.html | 17/09 11:23 |
| domi2 | copumpkin: any better way to search for stuff in the std lib? | 17/09 11:23 |
| copumpkin | not really | 17/09 11:26 |
| copumpkin | :P | 17/09 11:26 |
| copumpkin | people want a hoogle-like thing for agda, but it seems hard to do well | 17/09 11:26 |
| copumpkin | of course, I'd settle for something that doesn't even work very well | 17/09 11:26 |
| domi2 | copumpkin: k, no prob, thanks for the help | 17/09 11:26 |
| domi2 | yeah, something hoogle-like would be great | 17/09 11:26 |
| domi2 | :) | 17/09 11:27 |
| domi2 | \quit\ | 17/09 12:44 |
| domi2 | \quit | 17/09 12:44 |
| Spockz | agda-cabal? :P | 17/09 12:45 |
| dolio | copumpkin: It is somewhere, but it might be in Andreas Abel's local repository. | 17/09 19:53 |
| dolio | Actually, maybe it's only MiniAgda right now. | 17/09 19:54 |
| dolio | Not sure. | 17/09 19:54 |
| --- Day changed Sat Sep 18 2010 | ||
| glguy | I started a module tonight for dealing with unsigned word arithmetic... finite numbers supporting bitwise operations, modular arithmetic. Is there already something like this that I'm just duplicating? http://www.galois.com/~emertens/modularfin.agda | 18/09 08:42 |
| copumpkin | nope, I started something like that (but operating directly on Fins, rather than bit-wise) but didn't put it up anywhere | 18/09 08:43 |
| copumpkin | this looks nice | 18/09 08:43 |
| glguy | I'm not sure if this is better or worse than operating on Fins | 18/09 08:43 |
| glguy | I started on Fins and then switched to bit vectors | 18/09 08:43 |
| copumpkin | doing modular arithmetic on fins was a pain | 18/09 08:43 |
| copumpkin | also | 18/09 08:43 |
| copumpkin | I was playing with machine words as Fin (2 ^ n) and if you do the wrong thing and accidentally make agda evaluate such a thing | 18/09 08:44 |
| copumpkin | you basically need to kill agda | 18/09 08:44 |
| copumpkin | before it runs off with all your RAM, so I think the binary approach may be better :) | 18/09 08:44 |
| glguy | I want to prove some properties about multiplication, but I haven't worked out an implementation that is amenable to such things. | 18/09 08:46 |
| copumpkin | I'd be interested in contributing if you wanted help with it | 18/09 08:57 |
| copumpkin | I do a lot of fairly low-level stuff that I'd like to model in agda | 18/09 08:58 |
| glguy | You are more than welcome to use that module in any way | 18/09 08:59 |
| copumpkin | thanks :) | 18/09 08:59 |
| glguy | I just don't know how much long term maintenance I'll do on it (probably depends on how things go) | 18/09 08:59 |
| copumpkin | it'd be nice to get something like this into the standard library one day, sometihng like Data.Word or Data.BinaryWord | 18/09 09:00 |
| copumpkin | or just BitVector actually :P | 18/09 09:01 |
| lispy | Clearly, agda needs Data.ByteString.Char8 | 18/09 09:01 |
| copumpkin | lol | 18/09 09:01 |
| copumpkin | but a usable binary numeric type with laws proved for it | 18/09 09:02 |
| lispy | (actually such a thing could be useful for modeling UTF-8 stuff) | 18/09 09:02 |
| copumpkin | (up to finite fieldness, maybe) | 18/09 09:02 |
| lispy | yes, modular types that much machine types would be nice | 18/09 09:02 |
| lispy | I don't budget much time to my adga odyssey, but I'd like to model a "generic" unix-inspired file system in agda | 18/09 09:03 |
| lispy | at least at the files/directories/simple attributes level | 18/09 09:03 |
| glguy | I sent the Data.Integer.commutativeRing to Nils the other day | 18/09 09:10 |
| glguy | I'm hoping he'll want to add it to the lib | 18/09 09:10 |
| copumpkin | nice | 18/09 09:10 |
| copumpkin | did you make sure it had lots of unicode in it?? | 18/09 09:11 |
| copumpkin | otherwise it's not eligible | 18/09 09:11 |
| lispy | hehe | 18/09 09:11 |
| lispy | glguy: is there a trick to making emacs display unicode on osx in a readable way? | 18/09 09:11 |
| lispy | I find things like \oplus and \otimes are indistinguishable in my emacs | 18/09 09:11 |
| copumpkin | the old version of aquamacs did it much better | 18/09 09:12 |
| glguy | make your font bigger? | 18/09 09:12 |
| lispy | I'm using emacs23 directly | 18/09 09:12 |
| lispy | font bigger makes me cry | 18/09 09:12 |
| glguy | I'm using Monoco 18 and those two are easy to distinguish | 18/09 09:12 |
| lispy | glguy: did you see that chrisdone rewrote hpaste from scratch? | 18/09 09:12 |
| glguy | nope | 18/09 09:12 |
| lispy | I could try Monoco | 18/09 09:13 |
| lispy | I don't actually know what font I'm using...I find out | 18/09 09:13 |
| lispy | glguy: yeah, he wanted to take over hpaste.org as mmorrow has fell of the internet | 18/09 09:13 |
| lispy | glguy: as part of it he rewrote hpaste | 18/09 09:13 |
| copumpkin | http://snapplr.com/mzgr | 18/09 09:14 |
| lispy | I'm using the default font | 18/09 09:14 |
| lispy | Monaco 2 | 18/09 09:15 |
| lispy | er 12 | 18/09 09:15 |
| glguy | Can he use the highlighting-kate library? | 18/09 09:15 |
| glguy | and still release as BSD3? | 18/09 09:15 |
| lispy | That I don't know | 18/09 09:16 |
| lispy | font size 18 is huge | 18/09 09:16 |
| glguy | at what resolution? | 18/09 09:17 |
| lispy | checking | 18/09 09:17 |
| lispy | 1440x900 on a 15in | 18/09 09:18 |
| glguy | I'm doing 1680x1050 on the same sized screen | 18/09 09:18 |
| glguy | I don't know if the fonts adjust for DPI or not | 18/09 09:18 |
| lispy | I don't either | 18/09 09:18 |
| copumpkin | they don't | 18/09 09:18 |
| lispy | But you're right that at this size you can see the difference between \oplus and \otimes | 18/09 09:18 |
| glguy | but getting more pixels on your display is a good way to help distinguish without it being huge :) | 18/09 09:18 |
| lispy | I'm at max res for my video card :( | 18/09 09:19 |
| lispy | oh, I need to reinstall agda because I had to reinstall ghc | 18/09 09:20 |
| copumpkin | glguy: might this code be more readable if you just made a data Bit : Set where 0# 1# : Bit, and replaced all your true/false with the bits? :P | 18/09 09:20 |
| glguy | yeah, that's probably true | 18/09 09:21 |
| copumpkin | by the way, is it possible to ask case-splitting to split on multiple parameters at once? | 18/09 09:22 |
| lispy | hmm | 18/09 09:22 |
| copumpkin | seems like it'd be useful | 18/09 09:22 |
| lispy | oh, what version of emacs do you guys use on osx? aqua, carbon or gnu emacs? | 18/09 09:22 |
| copumpkin | I use the latest aquamacs | 18/09 09:23 |
| lispy | hmm | 18/09 09:23 |
| copumpkin | although emacs purists look disapprovingly at me when I do | 18/09 09:23 |
| lispy | I seem to recall some versions of emacs on osx don't work correctly with modifier keys | 18/09 09:23 |
| lispy | and I thought it was aqua emacs that randomizes the bindnigs | 18/09 09:23 |
| copumpkin | maybe :) | 18/09 09:23 |
| copumpkin | I don't use emacs other than for agda | 18/09 09:24 |
| lispy | I used to use emacs for everything. Then I realized the folly of my ways. | 18/09 09:24 |
| copumpkin | so I wouldn't really notice | 18/09 09:24 |
| lispy | I even wrote an email client in emacs based on an existing one | 18/09 09:24 |
| copumpkin | you know what's annoying? that the builtin bindings for number literals have to be constructors | 18/09 09:24 |
| lispy | I wish I could have those hours back. | 18/09 09:25 |
| copumpkin | :) | 18/09 09:25 |
| lispy | glguy: I signed up for japanese 101 this term at PSU tonight | 18/09 09:26 |
| glguy | That ought to be fun | 18/09 09:26 |
| lispy | Yeah :) | 18/09 09:26 |
| glguy | how often will you have class? | 18/09 09:26 |
| lispy | I need to talk to the instructor, the entry in the course catalog is ambiguous | 18/09 09:27 |
| lispy | They list 4 times but I think it's actually 4 lectures during the week and you only need to attend one | 18/09 09:27 |
| lispy | it's an evening class | 18/09 09:27 |
| lispy | I way just try using emacs with this font size, or make my agda-mode hook change to this font size | 18/09 09:29 |
| lispy | I wish emacs supported per-buffer font sizes | 18/09 09:29 |
| lispy | it's a giant font, but the readability is a HUGE perk | 18/09 09:30 |
| glguy | copumpkin: I updated that link to use 1# and 0# :) | 18/09 09:37 |
| copumpkin | sweet :) | 18/09 09:38 |
| copumpkin | that'll definitely help you write your multiplication proofs! | 18/09 09:38 |
| copumpkin | :P | 18/09 09:38 |
| copumpkin | _⁻¹ : ∀ {n} → BitVector n → BitVector n | 18/09 09:39 |
| copumpkin | that seems like an odd name | 18/09 09:39 |
| glguy | _⁻¹ : ∀ {n} → Op₁ (BitVector n) | 18/09 09:39 |
| copumpkin | yeah, I like that more, but I mean | 18/09 09:39 |
| copumpkin | right under _*_ | 18/09 09:39 |
| copumpkin | one might think it's a (modular) inverse of multiplication | 18/09 09:39 |
| glguy | yeah, I did multiplication later | 18/09 09:40 |
| glguy | the -1 was because that was what the AbelianGroup had as its record field | 18/09 09:40 |
| copumpkin | yeah | 18/09 09:40 |
| copumpkin | I'll write the left- and right- identity proofs for multiplication for you if you don't want to deal with tedium :P | 18/09 09:40 |
| copumpkin | looks a lot easier than doing -comm or -assoc :P | 18/09 09:41 |
| glguy | -_ : ∀ {n} → Op₁ (BitVector n) | 18/09 09:41 |
| lispy | is that unary minus? | 18/09 09:42 |
| glguy | yes | 18/09 09:42 |
| lispy | oh I see: x ⁻¹ = one _ + bitwise-negation x | 18/09 09:42 |
| lispy | 2's complement? | 18/09 09:43 |
| copumpkin | the worst thing about mac os: downloading a file (such as your modularfin.agda) and having it append a .txt to it. Then, in finder, renaming the file to remove the .txt suffix, and having it interpret that as "hide extension" rather than renaming it | 18/09 09:43 |
| glguy | lispy: right | 18/09 09:44 |
| lispy | glguy: are you going to write a GHC Core to Agda translator for the haskell-verifier project? :) | 18/09 09:44 |
| glguy | copumpkin: I download files like that using curl :) | 18/09 09:44 |
| glguy | lispy: nope :) | 18/09 09:44 |
| copumpkin | lol | 18/09 09:44 |
| glguy | so much smiling | 18/09 09:44 |
| lispy | you totally should | 18/09 09:44 |
| copumpkin | lispy: how would you address the translation of non-terminating programs to agda? | 18/09 09:45 |
| copumpkin | (and how would you detect them? :P) | 18/09 09:45 |
| glguy | The same way that the stdlib does now | 18/09 09:45 |
| copumpkin | by lying? | 18/09 09:45 |
| glguy | make sequencing codata | 18/09 09:45 |
| copumpkin | or the coinductive IO | 18/09 09:45 |
| copumpkin | ah | 18/09 09:45 |
| glguy | or rather embed the IO operations in a coinductive data type | 18/09 09:45 |
| lispy | copumpkin: I'm not sure. The planned stuff for now is to translate to HOLCF which has support for reasoning about _|_ | 18/09 09:45 |
| copumpkin | that still assumes productivity though | 18/09 09:46 |
| copumpkin | you can write evil haskell | 18/09 09:46 |
| copumpkin | I guess the answer is to make a best effort and reject some things that are good but aren't obviously so | 18/09 09:46 |
| lispy | I thought non-termination was a form of bottom | 18/09 09:47 |
| lispy | So I'm not sure what you mean | 18/09 09:47 |
| lispy | I agree that you want to prove termination whenever you can | 18/09 09:47 |
| lispy | and the goal is to prove properties about programs not just arbitrarily encode in HOLCF, so we are definitely targetting "well-behaved" programs | 18/09 09:47 |
| lispy | copumpkin: http://community.galois.com/mailman/listinfo/haskell-verifier | 18/09 09:49 |
| copumpkin | yeah, I signed up when I saw someone mention it on twitter | 18/09 09:49 |
| copumpkin | haven't been following closely yet though | 18/09 09:49 |
| lispy | ah cool | 18/09 09:49 |
| copumpkin | looks like a fun project though | 18/09 09:49 |
| lispy | not much happening yet, still figuring out the roadmap | 18/09 09:49 |
| lispy | copumpkin: are you in Portland? | 18/09 09:50 |
| copumpkin | I wish :P rather far away from there unfortunately | 18/09 09:50 |
| copumpkin | feel rather detached from the haskellverse | 18/09 09:50 |
| lispy | copumpkin: This is the chunk I'm working on: http://community.galois.com/pipermail/haskell-verifier/2010-September/000017.html | 18/09 09:52 |
| lispy | I'm going to try learning the formal aspects, but I'm at a bit of a learning deficit relative to most of the people involved | 18/09 09:52 |
| copumpkin | yeah, some of this verification stuff is pretty hair-raising | 18/09 09:53 |
| copumpkin | wow, even writing the multiplicative identities is painful :P | 18/09 09:56 |
| glguy | copumpkin: just gotta find the right implementation, first | 18/09 10:00 |
| copumpkin | yeah :) | 18/09 10:00 |
| glguy | perhaps | 18/09 10:01 |
| glguy | _*_ : ∀ {n} → Op₂ (BitVector n) | 18/09 10:01 |
| glguy | [] * [] = [] | 18/09 10:01 |
| glguy | (0# ∷ xs) * yys = 0# ∷ xs * init yys | 18/09 10:01 |
| glguy | (1# ∷ xs) * yys = yys + (0# ∷ xs * init yys) | 18/09 10:01 |
| copumpkin | that seems a hell of a lot cleaner than what you have now | 18/09 10:02 |
| copumpkin | although the init is still a bit of a pain | 18/09 10:02 |
| copumpkin | I vaguely remember an older version of the std lib having an Init datatype | 18/09 10:03 |
| copumpkin | or something like that | 18/09 10:03 |
| glguy | still does, afaik | 18/09 10:03 |
| copumpkin | oh yeah, InitLast | 18/09 10:03 |
| lispy | hmm | 18/09 10:03 |
| lispy | I was thinking it could be a zipWith but I guess not due to carry bits | 18/09 10:04 |
| copumpkin | well, you'd want a fold over that too | 18/09 10:04 |
| copumpkin | (or it wouldn't be quadratic) | 18/09 10:04 |
| lispy | and I guess there is a repeated turm | 18/09 10:06 |
| lispy | term* | 18/09 10:06 |
| lispy | (1# ∷ xs) * yys = yys + (0# :: xs) * yys | 18/09 10:06 |
| copumpkin | clearly the best solution is to do the fourierish transform and multiply in n log n | 18/09 10:08 |
| copumpkin | that'll be super easy to prove things about :) | 18/09 10:08 |
| lispy | yeah.... | 18/09 10:08 |
| lispy | Don't you need rather large numbers before that wins even in optimized cases? | 18/09 10:09 |
| copumpkin | yeah | 18/09 10:09 |
| glguy | *-identityˡ : ∀ {n} (x : BitVector n) → one n * x ≡ x | 18/09 10:10 |
| glguy | (done / copied to previous link) | 18/09 10:10 |
| copumpkin | oh nice | 18/09 10:10 |
| copumpkin | oh that's much nicer than the monster that was emerging from my struggles with the previous _*_ | 18/09 10:11 |
| Saizan | i wonder if one could do these proofs with Data.Fin.Dec + induction on the size of the vector | 18/09 13:29 |
| copumpkin | gah, I keep forgetting the command to turn quail completions on and off | 18/09 13:33 |
| copumpkin | and then turn it off accidentally | 18/09 13:33 |
| copumpkin | Saizan: do you remember what it is? | 18/09 13:37 |
| Saizan | copumpkin: no | 18/09 13:38 |
| copumpkin | I want a quickcheck for agda | 18/09 16:55 |
| copumpkin | (again) | 18/09 16:55 |
| Spockz | copumpkin: is agda complete enough for that? | 18/09 17:06 |
| Saizan | if the predicate is decidable it should be just a matter of porting the code | 18/09 17:12 |
| pigworker | problem with qc for Agda is that the stronger your invariants, the harder it is to write good generators | 18/09 17:25 |
| copumpkin | yeah | 18/09 17:25 |
| pigworker | it's uncannily like writing an automated theorem prover | 18/09 17:25 |
| copumpkin | just sometimes I set out to prove something that's not obviously false, but I'm sure plain old quickcheck could find a counterexample | 18/09 17:25 |
| copumpkin | :P | 18/09 17:25 |
| copumpkin | and then I feel stupid | 18/09 17:26 |
| copumpkin | when I finally realize it's false | 18/09 17:26 |
| pigworker | I remember John Hughes had a go at porting quickcheck to Agda 1, back at AIM1. It was a tough ask. Then again, roll yourself a universe and have a go! | 18/09 17:28 |
| Saizan | so you'd use a universe for what Arbitrary does in haskell, rather than a record? | 18/09 17:31 |
| pigworker | reckon I'd take a universe (U, El) and try to write some sort of generate : Nat -> (T : U) -> List (El T), where the Nat is some sort of gasoline, used any time the type gets bigger | 18/09 17:34 |
| pigworker | probably need to generalise to provide a context of hypotheses; tricky part is deciding when you can use a hypothesis, as that involves testing type equality | 18/09 17:37 |
| pigworker | so, we need a model of type theory in type theory, plus ça change... | 18/09 17:38 |
| Saizan | heh | 18/09 17:39 |
| copumpkin | that semiring solver sure is hungry | 18/09 17:57 |
| Mathnerd314 | so how does proving stuff in Agda work? can you write a function in Agda that searches for and returns a proof? | 18/09 18:05 |
| dschoepe | Mathnerd314: you prove something by showing that the type corresponding to your theorem is inhabited | 18/09 18:07 |
| dschoepe | which is done by constructing a term with the appropriate type, so no real automatic proof search. | 18/09 18:07 |
| copumpkin | except agsy for tiny things :) | 18/09 18:08 |
| copumpkin | but sometimes agsy finds me f = f | 18/09 18:08 |
| Mathnerd314 | so let's say I want to prove that the sum of n odd integers is the nth square. Can I even do that in Agda? | 18/09 18:09 |
| copumpkin | sure | 18/09 18:09 |
| copumpkin | first figure out how to express your property | 18/09 18:10 |
| copumpkin | often the representation you use to express your property and the structure of the algorithms you use can greatly affect how elegant your proof is | 18/09 18:10 |
| * copumpkin just wrote a horrendous divMod by 2 | 18/09 18:11 | |
| copumpkin | divMod₂ : (n : ℕ) → ∃₂ (λ q r → 2 N* q N+ r ≡ n) | 18/09 18:11 |
| copumpkin | :P | 18/09 18:12 |
| copumpkin | Mathnerd314: I'd start by defining simpler things. Do you have a solid grasp of type-level haskell and GADTs in particular? | 18/09 18:14 |
| Mathnerd314 | I think so | 18/09 18:14 |
| copumpkin | http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf is a fairly accessible (if a bit outdated) tutorial | 18/09 18:16 |
| Adamant | copumpkin: go tactical again! | 18/09 18:20 |
| Adamant | I want to see a longcat crawling up on a proof with a Rambo knife | 18/09 18:21 |
| copumpkin | lol | 18/09 18:21 |
| copumpkin | Mathnerd314: let us know if you have any questions | 18/09 18:31 |
| Mathnerd314 | ok, so everything has exactly one type, yes? e.g. true : Bool : Set1 : Set2 : Set3 : ... | 18/09 18:32 |
| copumpkin | Bool : Set | 18/09 18:32 |
| copumpkin | (where Set == Set0) | 18/09 18:32 |
| Mathnerd314 | oh, missed one then. | 18/09 18:33 |
| copumpkin | but yeah, otherwise | 18/09 18:33 |
| Mathnerd314 | so, you can also have true : BigBool : Set1 | 18/09 18:34 |
| copumpkin | yeah, value constructor names are allowed to overlap | 18/09 18:34 |
| copumpkin | and you can stick new datatypes in any universe level you choose | 18/09 18:34 |
| Mathnerd314 | I'm guessing it distinguishes by the type signature? | 18/09 18:35 |
| copumpkin | yeah | 18/09 18:35 |
| Mathnerd314 | how does the universe level matter, other than what types it contains? | 18/09 18:36 |
| copumpkin | well, if you didn't have the tower of universe levels, you could prove false | 18/09 18:37 |
| Mathnerd314 | how? something to do with Russel's paradox? | 18/09 18:38 |
| copumpkin | yeah, I think it's usually Girard's in constructive logic, but a similar idea | 18/09 18:38 |
| * copumpkin hugs the new --termination-depth flag | 18/09 18:40 | |
| copumpkin | =2 fixed my problem without me resorting to hacks | 18/09 18:40 |
| * copumpkin just wrote the longest chain of rewrite he's ever done | 18/09 19:02 | |
| Saizan | Mathnerd314: the main point is that a type that contains a quantification over a something in Set n has to be at least in Set (suc n) | 18/09 19:05 |
| Mathnerd314 | but the actual value of n doesn't matter, so long as it's finite. | 18/09 19:08 |
| Mathnerd314 | so maybe there's some way to do just check that it terminates | 18/09 19:11 |
| copumpkin | glguy isn't going to like this :P | 18/09 19:15 |
| Saizan | Mathnerd314: yeah, it's possible to be more implicit about this stratification, i think i'd like a mix | 18/09 19:24 |
| Mathnerd314 | ok, I've made up my mind that Agda is a proof-assistant based on intuitionistic type theory, and *not* a dependently-typed programming language | 18/09 20:03 |
| copumpkin | why? | 18/09 20:09 |
| Mathnerd314 | because of that hierarchy of universes; nobody except a person trying very hard to ensure that only correct proofs type-check would put in such a thing | 18/09 20:13 |
| copumpkin | well, you want your underlying logic to work or your proofs are meaningless :P | 18/09 20:14 |
| copumpkin | you can write programs and completely forget about the hierarchy of universes | 18/09 20:14 |
| Mathnerd314 | bu the fact that it's there means that Agda is a proof assistant and not a language | 18/09 20:19 |
| copumpkin | "not a language" o.O | 18/09 20:19 |
| copumpkin | you can write programs and algorithms in it | 18/09 20:20 |
| camio | Mathnerd314: I think I see what you're saying. If agda has to be either a proof assitant or a programming langauge, considering this feature doesn't make sense for a programming language it must be a proof assistant. | 18/09 20:21 |
| copumpkin | not sure why having a design that is logically consistent precludes it from being "a real language" | 18/09 20:21 |
| copumpkin | it doesn't not make sense for a programming language | 18/09 20:21 |
| camio | I wouldn't know how to demonstrate if a language feature "makes sense" for a programming language. | 18/09 20:23 |
| copumpkin | I think we'd need to define "programming language" beforehand :) | 18/09 20:23 |
| copumpkin | and whether extra features that aren't strictly necessary for "programming" preclude it from being one | 18/09 20:23 |
| copumpkin | someone else might claim that haskell's type functions are unnecessary for real progrmaming | 18/09 20:24 |
| copumpkin | in agda, we get similar behavior by creating custom higher universes | 18/09 20:24 |
| camio | Right. Or even infix functions are unnecessary for real programming. | 18/09 20:25 |
| camio | I'm getting a sense that this whole line of thought is loquacious. | 18/09 20:25 |
| Saizan | from a programming perspective consistency makes sure you can erase values that are only there to witness some property | 18/09 20:41 |
| Saizan | and those are needed even if you're just programming once you want to be fancier | 18/09 20:43 |
| lispy | We should reduce Agda to brainfuck. Everything else is unnecessary in a programming language. | 18/09 20:47 |
| Saizan | is there an iff somewhere in the stdlib? | 18/09 20:57 |
| Saizan | with an associates equational reasoning :) | 18/09 20:57 |
| copumpkin | hmm, I haven't noticed one, but I'm sure there must be! | 18/09 20:59 |
| Saizan | there's Function.Equivalence but it doesn't have an "instance" | 18/09 21:04 |
| copumpkin | you playing with the idea you mentioned before of proving the binary number properties through Fin? | 18/09 21:27 |
| dolio | "=2 fixed my problem without me resorting to hacks" | 18/09 21:33 |
| dolio | Hacks other than --termination-depth, you mean. :) | 18/09 21:33 |
| copumpkin | :P | 18/09 21:34 |
| copumpkin | you consider that a hack? | 18/09 21:34 |
| dolio | I weakly consider the whole idea of a termination checker a hack. | 18/09 21:34 |
| dolio | --termination-depth just kind of illustrates why. | 18/09 21:37 |
| Saizan | i think i like the sized types idea, if it can be made to not get in the way most of the time | 18/09 21:38 |
| Saizan | which universe levels are not an example of :) | 18/09 21:39 |
| dolio | It may be getting better soon. | 18/09 21:39 |
| copumpkin | oh? | 18/09 21:40 |
| copumpkin | GAH | 18/09 21:40 |
| Saizan | ? | 18/09 21:40 |
| copumpkin | my buffer got itself into read-only mode | 18/09 21:40 |
| dolio | Andreas Abel said he had cumulativity of universes in MiniAgda, I think. | 18/09 21:40 |
| dolio | And I think he's working on getting that and the irrelevance stuff into ActualAgda. | 18/09 21:40 |
| Saizan | is the irrelevant stuff going to cover propositional equality? | 18/09 21:41 |
| dolio | What do you mean? | 18/09 21:42 |
| Saizan | so that e.g. two values of "Sigma A \\ x -> x == y" are equal without having to look at the second field | 18/09 21:43 |
| dolio | Well, that depends on other factors. But potentially. | 18/09 21:44 |
| dolio | Thus far, I think the irrelevance isn't tied to type. | 18/09 21:44 |
| dolio | So you can't say, 'equality is irrelevant.' | 18/09 21:45 |
| dolio | There may be places where you need to use equality in an ostensibly relevant way (even though the fact that there's a single proof of equality makes it in fact irrelevant). | 18/09 21:45 |
| Saizan | ah, yeah, you covered that in the thread | 18/09 21:46 |
| dolio | But, there would be a different Sigma that treated its second argument as irrelevant, and potentially two values of that would be definitionally equal based only on the first component. | 18/09 21:47 |
| Saizan | sigh, no associative functor composition then :) (without applying coercions at least, which require extensional equality..) | 18/09 21:48 |
| dolio | Actually, it might work all right for category theory. | 18/09 21:48 |
| dolio | Because you tend to have, using standard library terminology, RawFoo with the terms, and IsFoo with proofs. | 18/09 21:49 |
| dolio | The IsFoo stuff can be made irrelevant, because it's never used in the RawFoo stuff. | 18/09 21:49 |
| dolio | Then, when writing stuff over Foo, the IsFoo is ignored. | 18/09 21:50 |
| Saizan | i wonder if you don't sometimes have to use the IsFoo to build some other RawFoo | 18/09 21:51 |
| dolio | From what I've seen, there's a pretty clean divide in most category theory stuff (and algebra as well) between the terms you care about doing stuff, and sideline proofs about them. | 18/09 21:52 |
| dolio | So and EPTS-style erasure/irrelevance system would work all right there. | 18/09 21:53 |
| copumpkin | these binary number proofs are tedious | 18/09 22:01 |
| copumpkin | probably just cause I suck at proving things :) | 18/09 22:02 |
| --- Day changed Sun Sep 19 2010 | ||
| copumpkin | glguy: I have a commutativity proof and a couple of others | 19/09 05:03 |
| glguy | oh, cool! | 19/09 05:03 |
| copumpkin | it'll make your eyes bleed though, so if you have one of your own it's better for your health | 19/09 05:04 |
| glguy | I haven't played with it since Iwent to bed last night | 19/09 05:04 |
| copumpkin | ah ok | 19/09 05:04 |
| glguy | put it up somewhere | 19/09 05:04 |
| copumpkin | http://hpaste.org/30189/modularfin added a few helpers and other functions here and there, too. http://hpaste.org/30189/modularfin | 19/09 05:07 |
| copumpkin | main thing was writing my own init :P cause the Data.Vec.init is a nightmare to work with | 19/09 05:07 |
| glguy | That doesn't actually look so bad | 19/09 05:08 |
| copumpkin | I felt uncomfortable about the repeated rewrites of the same thing, and it felt like I was missing a cleaner way of doing the whole thing | 19/09 05:09 |
| copumpkin | also, I should probably be using that equational reasoning thing | 19/09 05:10 |
| glguy | BitVector will be a CommutativeRing in no time :) | 19/09 05:12 |
| copumpkin | hah | 19/09 05:12 |
| copumpkin | associativity was getting ugly when I tried it | 19/09 05:13 |
| copumpkin | distributivity might be nicer | 19/09 05:13 |
| glguy | I don't think that distrib will be | 19/09 05:13 |
| glguy | at least with Integers it was messier than assoc | 19/09 05:13 |
| copumpkin | I was also trying to think of how to write a bitwise modular multiplicative inverse | 19/09 05:13 |
| copumpkin | that wasn't impossible to prove things about | 19/09 05:13 |
| copumpkin | but then failed :) | 19/09 05:14 |
| glguy | yeah, I've almost given up on that one before I've started | 19/09 05:14 |
| copumpkin | ah well, with the commutative ring we can use the solver and who needs anything else! | 19/09 05:14 |
| glguy | copumpkin: I have a cleaner proof to share momentarily | 19/09 06:01 |
| copumpkin | oh, nice | 19/09 06:01 |
| glguy | http://www.galois.com/~emertens/modularfin.agda | 19/09 06:02 |
| glguy | inspired by yours | 19/09 06:02 |
| glguy | "cleaner" is subjective, of course | 19/09 06:02 |
| copumpkin | oh, definitely cleaner | 19/09 06:02 |
| copumpkin | aha, you moved away from init | 19/09 06:03 |
| glguy | yeah, it isn't good at being productive | 19/09 06:03 |
| copumpkin | yeah | 19/09 06:03 |
| copumpkin | that's much nicer | 19/09 06:03 |
| copumpkin | that'll probably make assoc easier too | 19/09 06:03 |
| glguy | the *-comm and *-comm1 split helped the termination checker see what was going on | 19/09 06:04 |
| copumpkin | ah | 19/09 06:04 |
| copumpkin | the --termination-depth couldn't see through it? | 19/09 06:04 |
| glguy | Oh, I don't know about that flag | 19/09 06:04 |
| copumpkin | they just added it, I think I had it in my file | 19/09 06:04 |
| copumpkin | but it only works on the darcs version from a few days ago | 19/09 06:05 |
| glguy | I have darcs version from last night | 19/09 06:05 |
| copumpkin | ah okay | 19/09 06:05 |
| glguy | so... I'm sure I have it | 19/09 06:05 |
| copumpkin | yeah, I needed to turn it on at some point in my proof | 19/09 06:05 |
| copumpkin | well, set it to 2 | 19/09 06:05 |
| glguy | you end up (without the split) matching the size parameter as suc (suc n) | 19/09 06:06 |
| glguy | and then doing recursion on suc n | 19/09 06:06 |
| copumpkin | yeah | 19/09 06:06 |
| copumpkin | I like your approach a lot better | 19/09 06:06 |
| copumpkin | none of that double-deep matching I was doing | 19/09 06:06 |
| glguy | OK, now you have to figure out how to do assoc so I can look at that | 19/09 06:06 |
| glguy | ;) | 19/09 06:06 |
| copumpkin | lol | 19/09 06:06 |
| copumpkin | I'll give it a go :P I also wanted to write fromNat | 19/09 06:07 |
| copumpkin | or even to/fromFin | 19/09 06:07 |
| glguy | Didn't you have some of that in your file already? | 19/09 06:07 |
| copumpkin | you may have seen a seemingly unrelated divMod by 2 function in there | 19/09 06:07 |
| copumpkin | yeah | 19/09 06:07 |
| copumpkin | I have toNat | 19/09 06:07 |
| copumpkin | but not fromNat, cause either it'd be exists BitVector or BitVector (ceillog_2 n) | 19/09 06:08 |
| copumpkin | or I guess I could just happily truncate | 19/09 06:08 |
| copumpkin | anyway yeah, my proof doesn't pass the termination checker without the --termination-depth=2 | 19/09 06:08 |
| copumpkin | for comm | 19/09 06:08 |
| copumpkin | anyway, I'll be happy to get rid of it and replace it with yours :P | 19/09 06:08 |
| glguy | I'm rather amazed that the proof looks like it does | 19/09 06:10 |
| glguy | I was trying to visualize why this implementation was commutative | 19/09 06:10 |
| glguy | and having a hell of a time | 19/09 06:10 |
| copumpkin | yeah, I gave up trying to figure it out abstractly in mine and just did an iterative "look at the expression and try to figure out how I'd rewrite it" until it reduced to something manageable :P | 19/09 06:11 |
| copumpkin | oh by the way, you have a typo in your rename of _+_ from Nat that left me quite confused with parse precedence errors for a while | 19/09 06:12 |
| copumpkin | _+_ to _N+ | 19/09 06:12 |
| copumpkin | :P | 19/09 06:12 |
| glguy | typo? | 19/09 06:12 |
| copumpkin | missing the other _ | 19/09 06:13 |
| glguy | because it wasn't \bn? | 19/09 06:13 |
| glguy | oh! | 19/09 06:13 |
| copumpkin | oh by the way, my initial approach to this | 19/09 06:15 |
| glguy | to which | 19/09 06:16 |
| copumpkin | was trying to prove that init distributes over *, but then I stopped being convinced that was true | 19/09 06:16 |
| copumpkin | oh, any of these multiplication proofs | 19/09 06:16 |
| copumpkin | it would've come in handy in many places | 19/09 06:16 |
| glguy | Goal: 0# ∷ xs * (droplast y * droplast z) ≡ | 19/09 06:16 |
| glguy | 0# ∷ xs * droplast (y * z) | 19/09 06:16 |
| copumpkin | yeah, exactly | 19/09 06:16 |
| glguy | This is true | 19/09 06:16 |
| glguy | I don't know why yet, but it has to be if multiplication is actually associative | 19/09 06:17 |
| copumpkin | yeah, on one hand I convinced myself it had to be true, and on the other hand it didn't seem to make sense that taking off the last bit had that behavior | 19/09 06:18 |
| copumpkin | oh wait | 19/09 06:18 |
| copumpkin | the order is backwards, it does make sense | 19/09 06:18 |
| * copumpkin kicks himself | 19/09 06:18 | |
| copumpkin | okay, I might start by writing that helper then :P | 19/09 06:18 |
| glguy | Goal: add′ 0# y' (0# ∷ xs * droplast y') * z' ≡ | 19/09 06:18 |
| glguy | add′ 0# (y' * z') (0# ∷ xs * droplast (y' * z')) | 19/09 06:18 |
| glguy | that's my other boal | 19/09 06:18 |
| glguy | goal | 19/09 06:18 |
| glguy | I really hope I don't have to develop distrib in parallel | 19/09 06:19 |
| copumpkin | I'm gonna try the droplast (x * y) ≡ droplast x * droplast y first | 19/09 06:20 |
| copumpkin | mostly cause it has fewer parameters and looks less scary than assoc :P | 19/09 06:20 |
| glguy | OK, then I | 19/09 06:20 |
| glguy | will leave that goal unsolved | 19/09 06:21 |
| glguy | what are you calling that lemma? | 19/09 06:25 |
| copumpkin | hmm, I'm terrible with names, but have it down as droplast-distrib-* | 19/09 06:26 |
| copumpkin | :P | 19/09 06:26 |
| copumpkin | definitely not attached to it though, so I'll be happy to rename it to something else | 19/09 06:27 |
| glguy | OK, assoc is done (assume we can do *-distrib and droplast-distrib-*) | 19/09 06:28 |
| copumpkin | cool | 19/09 06:28 |
| glguy | I'm going to tip-toe thorugh distrib now | 19/09 06:29 |
| copumpkin | okay :) | 19/09 06:29 |
| copumpkin | sorry on phone, might be a while | 19/09 06:32 |
| copumpkin | looks like I'll need the same property for + :P | 19/09 07:21 |
| * copumpkin sighs | 19/09 07:21 | |
| glguy | I did that one | 19/09 07:21 |
| copumpkin | ah okay | 19/09 07:22 |
| copumpkin | did you already do the droplast distrib over * too? | 19/09 07:22 |
| copumpkin | can I borrow your + one? | 19/09 07:22 |
| copumpkin | oh | 19/09 07:22 |
| copumpkin | you did it :) | 19/09 07:22 |
| glguy | revised | 19/09 07:23 |
| copumpkin | just a couple of leftover holes in your distributivity proof | 19/09 07:23 |
| copumpkin | very nice | 19/09 07:23 |
| glguy | "just" | 19/09 07:23 |
| copumpkin | lol | 19/09 07:23 |
| glguy | I'm pretty sure that that hole is as big as the rst of that proof | 19/09 07:23 |
| * copumpkin trembles | 19/09 07:23 | |
| glguy | yeah, that emotion was why I jumped over to the distrib proof | 19/09 07:26 |
| glguy | I didn't know how long you'd be | 19/09 07:26 |
| copumpkin | no problem :P | 19/09 07:26 |
| copumpkin | I didn't either | 19/09 07:26 |
| * copumpkin tries | 19/09 07:29 | |
| copumpkin | seems like we might need to start with a generalized distrib over add\' instead of + | 19/09 07:32 |
| glguy | yeah... | 19/09 07:32 |
| glguy | but I think they need to be separate because * distributes differently over add 1# | 19/09 07:34 |
| copumpkin | yeah | 19/09 07:35 |
| copumpkin | are you sure distrib^r is easier than distrib^l ? | 19/09 07:35 |
| glguy | I have no idea if it is | 19/09 07:35 |
| copumpkin | with your definition of multiplication decomposing the first arg, I might try the other direction | 19/09 07:36 |
| copumpkin | I'll work through that and see if it looks any easier | 19/09 07:36 |
| copumpkin | gah, I hate it when case splitting insists on rewriting variable names it has no authority over | 19/09 07:56 |
| copumpkin | even when unnecessary | 19/09 07:56 |
| glguy | "but x' is a much better variable name than y"! | 19/09 07:57 |
| dolio | Yes. It'd be nice if it didn't rewrite the whole line. | 19/09 07:57 |
| copumpkin | like I have | 19/09 07:57 |
| copumpkin | pf (0# :: xs) (0# :: ys) (z :: zs) = ? | 19/09 07:58 |
| copumpkin | I ask it to split z | 19/09 07:58 |
| copumpkin | it gives me back pf (0# :: xs') (0# :: ys') (0# :: zs') = ? | 19/09 07:58 |
| copumpkin | with all the primes stuck in | 19/09 07:58 |
| copumpkin | not sure distrib^l is any easier than ^r :P | 19/09 07:59 |
| * copumpkin ponders | 19/09 07:59 | |
| glguy | I think that this is going to help | 19/09 08:12 |
| glguy | extract-carry : ∀ {n} (xs ys : BitVector n) → add′ 1# xs ys ≡ one _ + add′ 0# xs ys | 19/09 08:12 |
| copumpkin | oh, good point | 19/09 08:13 |
| copumpkin | did you already write it? | 19/09 08:13 |
| glguy | yes | 19/09 08:14 |
| glguy | http://hpaste.org/30195/extractcarry | 19/09 08:15 |
| copumpkin | thanks | 19/09 08:16 |
| lispy | is hpaste down? | 19/09 08:23 |
| copumpkin | it'd be funny if we could mutually define this on the semiring solver that would arise from us being able to define the properties | 19/09 08:23 |
| copumpkin | yay circular reasoning | 19/09 08:23 |
| copumpkin | seems to work for me | 19/09 08:24 |
| lispy | hmm...page not loading here | 19/09 08:24 |
| dschoepe | works fine here, too | 19/09 08:24 |
| copumpkin | maybe some routing issue | 19/09 08:25 |
| copumpkin | I've not been able to access it a few times when others have | 19/09 08:25 |
| copumpkin | I wish I could ask agda to not reduce something past a certain point, for display in goals | 19/09 08:25 |
| copumpkin | like, I really want to just see _+_ instead of add\' 0# | 19/09 08:25 |
| glguy | the end is in sight | 19/09 08:31 |
| copumpkin | same here, for the first hole :P | 19/09 08:31 |
| copumpkin | mine is ugly though | 19/09 08:32 |
| glguy | oh, I haven't started on the prettifying stage yet | 19/09 08:32 |
| copumpkin | :) | 19/09 08:32 |
| copumpkin | do you mean for both of the holes? | 19/09 08:33 |
| copumpkin | or just one? | 19/09 08:33 |
| glguy | I see the way forward on both | 19/09 08:33 |
| glguy | i just have to build up a few helpers | 19/09 08:33 |
| copumpkin | aha, I've been brute forcing the first one :P | 19/09 08:34 |
| copumpkin | and have almost finished it | 19/09 08:34 |
| lispy | when hpaste does load it loads really slowly | 19/09 08:35 |
| copumpkin | okay, now I just need my old helper | 19/09 08:35 |
| copumpkin | showing that shift x = x + x | 19/09 08:35 |
| copumpkin | and I'll be done with the first hole | 19/09 08:35 |
| * copumpkin realizes that this sounds really bad | 19/09 08:36 | |
| glguy | ha | 19/09 08:38 |
| glguy | shift-to-add : ∀ {n} (x : BitVector n) → droplast (0# ∷ x) ≡ (x + x) | 19/09 08:38 |
| copumpkin | awesome | 19/09 08:38 |
| copumpkin | then there's only one hole left! | 19/09 08:38 |
| glguy | revised the link to have that proof | 19/09 08:41 |
| copumpkin | http://snapplr.com/8we0 | 19/09 08:41 |
| glguy | but I plan to unify the two halves of it | 19/09 08:41 |
| copumpkin | :P | 19/09 08:41 |
| copumpkin | okay | 19/09 08:41 |
| glguy | done? | 19/09 08:42 |
| copumpkin | just the first of the holes | 19/09 08:42 |
| glguy | right on | 19/09 08:42 |
| copumpkin | probably way uglier than it needs to be | 19/09 08:43 |
| copumpkin | but I usually try to get something that works and then try to clean it up :P | 19/09 08:43 |
| copumpkin | I actually think the other half will be somewhat similar | 19/09 08:44 |
| glguy | shift-to-add : ∀ c {n} (x : BitVector n) → droplast (c ∷ x) ≡ add′ c x x | 19/09 08:44 |
| glguy | shift-to-add _ [] = refl | 19/09 08:44 |
| glguy | shift-to-add c (0# ∷ xs) rewrite shift-to-add 0# xs = refl | 19/09 08:44 |
| glguy | shift-to-add c (1# ∷ xs) rewrite shift-to-add 1# xs = refl | 19/09 08:44 |
| copumpkin | nice :) I had something even smaller with an auxiliary two function in that original paste | 19/09 08:44 |
| copumpkin | but it's probably simpler with that | 19/09 08:44 |
| copumpkin | and I don't really need 2 * x here | 19/09 08:44 |
| glguy | oh, if you don't need it you don't need it :) | 19/09 08:45 |
| copumpkin | noo, this was very useful | 19/09 08:45 |
| Adamant | you sound like you could do some hardware from this | 19/09 08:45 |
| copumpkin | glguy: should I bother pasting that ugly thing or will you try to figure a cleaner one out? | 19/09 08:46 |
| glguy | if you finished the proof you should definitely post it | 19/09 08:46 |
| glguy | you can collapse those last two holes into one goal | 19/09 08:46 |
| copumpkin | http://hpaste.org/30196/half_a_proof | 19/09 08:47 |
| copumpkin | I tried that, but it didn't seem to have enough information | 19/09 08:47 |
| copumpkin | not sure why I mutualized it | 19/09 08:47 |
| copumpkin | felt like a good idea at the time | 19/09 08:47 |
| copumpkin | collapsing the two goals doesn't seem to work here | 19/09 08:49 |
| copumpkin | (unless I was doing it wrong) | 19/09 08:49 |
| copumpkin | I'm gonna go get some breakfast then work on the other one | 19/09 08:50 |
| glguy | I just havea little + manipulation and I'll be done | 19/09 08:50 |
| glguy | and I can show my way of consolidating those two | 19/09 08:50 |
| copumpkin | awesome | 19/09 08:51 |
| copumpkin | now we just need to convince the agda people to let us bind to number literals more liberally | 19/09 08:52 |
| glguy | Adamant: That's basically my goal (being able to model algorithms using Word32, for example) | 19/09 08:56 |
| copumpkin | same here :) | 19/09 08:56 |
| Adamant | nice. | 19/09 08:57 |
| copumpkin | glguy: I might start writing a <= for it | 19/09 08:58 |
| copumpkin | or maybe just peano induction thing | 19/09 08:59 |
| copumpkin | hmm | 19/09 08:59 |
| glguy | good idea | 19/09 08:59 |
| copumpkin | peano induction seems more useful | 19/09 08:59 |
| * copumpkin gets back to his food | 19/09 09:00 | |
| glguy | (Agda:Checked) | 19/09 09:03 |
| glguy | uploaded | 19/09 09:03 |
| copumpkin | congratulations! | 19/09 09:04 |
| copumpkin | I wonder if the ring solver will be faster with this | 19/09 09:05 |
| glguy | The ring solver is symbolic, so I'm not sure that it matters | 19/09 09:05 |
| copumpkin | yeah, I know, but if you have constants in your equations | 19/09 09:07 |
| copumpkin | I actually ported the ringsolver to haskell a while back | 19/09 09:07 |
| glguy | was it faster? | 19/09 09:20 |
| copumpkin | didn't really play with it much afterwards :) | 19/09 09:21 |
| glguy | isCommutativeRing : IsCommutativeRing _≡_ _+_ _*_ -_ (zero n) (one n) | 19/09 09:21 |
| copumpkin | nice! | 19/09 09:22 |
| glguy | and on that note it is time for bed | 19/09 09:24 |
| glguy | let me know if you come up with any clever induction principals or nat conversion functions | 19/09 09:25 |
| glguy | principles* | 19/09 09:25 |
| copumpkin | okay, will do :) | 19/09 09:25 |
| copumpkin | night! | 19/09 09:25 |
| dschoepe | /join #xmonad | 19/09 09:39 |
| copumpkin | Panic: blocked by dot pattern | 19/09 10:05 |
| copumpkin | that's one I haven't seen before | 19/09 10:05 |
| copumpkin | man, it sure is hard pattern matching against types with functions in their indices | 19/09 11:47 |
| copumpkin | there we go, induction : ∀ {n} (P : BitVector n → Set) → P (zero n) → (∀ m → P m → P (suc m)) → ∀ x → P x | 19/09 12:36 |
| copumpkin | and now I can write toNat really elegantly | 19/09 12:40 |
| copumpkin | toℕ = induction _ 0 Nsuc | 19/09 12:40 |
| * copumpkin is confused | 19/09 13:41 | |
| copumpkin | I import Data.Nat hiding _<=_ | 19/09 13:42 |
| copumpkin | and then it bugs me that my _<=_ is a duplicate name of the one in Data.Nat | 19/09 13:42 |
| Saizan | maybe you've more than one import of Data.Nat? or some other module is exporting it? | 19/09 13:43 |
| copumpkin | nope :/ | 19/09 13:43 |
| copumpkin | looked for that | 19/09 13:43 |
| * copumpkin tries latest agda in case it was a bug | 19/09 13:44 | |
| copumpkin | gah! :P | 19/09 13:48 |
| copumpkin | renaming it to something else doesn't work either | 19/09 13:50 |
| copumpkin | if I do C-c C-d it says it isn't in scope o.O | 19/09 13:54 |
| copumpkin | http://snapplr.com/b41g | 19/09 13:56 |
| copumpkin | I'm not completely insane am I? | 19/09 13:56 |
| copumpkin | oh nice, they fixed agsy to not put the comment in every time | 19/09 14:15 |
| Saizan | duplicate definition of _module_ _\le_ | 19/09 14:25 |
| copumpkin | well, they recently changed data types to behave like modules | 19/09 14:25 |
| copumpkin | so you can do Type.constructor | 19/09 14:26 |
| Saizan | yeah | 19/09 14:26 |
| copumpkin | did I do something wrong though? | 19/09 14:26 |
| Saizan | i guess hiding doesn't hide the module | 19/09 14:26 |
| Saizan | i think it needs to be reported | 19/09 14:28 |
| Saizan | does one have the same problem with records? | 19/09 14:29 |
| copumpkin | not sure actually | 19/09 14:29 |
| copumpkin | I already reported it | 19/09 14:29 |
| Saizan | yep, same with records | 19/09 14:30 |
| Saizan | i'm surprised that it doesn't cause problems more often | 19/09 14:31 |
| copumpkin | might be new | 19/09 14:34 |
| copumpkin | almost done with the decidable total order on those binary numbers too :) | 19/09 14:40 |
| copumpkin | hmm, already one here, http://www.cs.nott.ac.uk/~nad/listings/lib/Data.Bin.html#206 | 19/09 14:41 |
| copumpkin | but doesn't have properties on it | 19/09 14:42 |
| copumpkin | also, it isn't of a fixed size | 19/09 14:44 |
| copumpkin | so both are probably useful | 19/09 14:44 |
| copumpkin | hmm, the total part is tricky | 19/09 15:35 |
| copumpkin | man, I kind of went crazy on this module | 19/09 17:15 |
| copumpkin | glguy: hey :P I went a little nuts | 19/09 18:59 |
| glguy | do tell | 19/09 19:00 |
| copumpkin | well, I added a) an (almost) decidable total order b) peano-like induction c) a boolean algebra "instance" for the bitwise operations | 19/09 19:00 |
| copumpkin | bored on sunday, pretty much everything I could think of, basically :) | 19/09 19:01 |
| glguy | We need to start some kind of directory structure for htis | 19/09 19:01 |
| copumpkin | yeah, it's a huge mess | 19/09 19:01 |
| glguy | and split out the properties from the operations | 19/09 19:01 |
| copumpkin | yeah, I've just been making inline modules | 19/09 19:01 |
| copumpkin | which is ugly | 19/09 19:01 |
| glguy | and "private" all of the details, only exposing the commutativeRing module | 19/09 19:01 |
| glguy | (and itis slow not to) | 19/09 19:01 |
| copumpkin | yeah | 19/09 19:02 |
| copumpkin | toℕ = Peano.induction _ 0 Nsuc | 19/09 19:02 |
| copumpkin | :) | 19/09 19:02 |
| copumpkin | only thing I'm missing is a couple of holes in the total part of the decidable total order | 19/09 19:02 |
| glguy | Can you host your changes somewhere? | 19/09 19:04 |
| glguy | or split them into modules and then do it | 19/09 19:04 |
| glguy | (or should I split?) | 19/09 19:04 |
| copumpkin | sure, I can split it if you give me a little | 19/09 19:04 |
| copumpkin | meanwhile I stuck the mammoth up at http://hpaste.org/30215/huge_mess | 19/09 19:04 |
| glguy | isBooleanAlgebra : ∀ {n} → IsBooleanAlgebra _≡_ bitwise-or bitwise-and bitwise-negation (ones n) (zero n) | 19/09 19:05 |
| glguy | that's a fun addition | 19/09 19:05 |
| copumpkin | yeah, and was really easy too, as you can see in the proofs :P | 19/09 19:06 |
| glguy | you know, the other way we could have done that would be to import Data.Bool renaming true and false to 1# and 0# | 19/09 19:06 |
| copumpkin | yeah :P | 19/09 19:06 |
| copumpkin | that would've been smarter | 19/09 19:06 |
| * copumpkin takes the blame | 19/09 19:06 | |
| copumpkin | you have a github account, right? | 19/09 19:07 |
| * copumpkin vaguely remembers findingone | 19/09 19:07 | |
| copumpkin | do you prefer darcs or git? I'm pretty neutral | 19/09 19:07 |
| glguy | yeah, I use git where possible | 19/09 19:07 |
| glguy | hopefully it only stays in the git repo for a short time | 19/09 19:07 |
| glguy | and we get merged into stdlib | 19/09 19:07 |
| copumpkin | yeah :) | 19/09 19:07 |
| copumpkin | there's an unbounded one already in the std lib | 19/09 19:08 |
| copumpkin | but it doesn't have any properties proved about it | 19/09 19:08 |
| glguy | unbounded what? | 19/09 19:08 |
| copumpkin | binary natural | 19/09 19:08 |
| copumpkin | I only just noticed it | 19/09 19:08 |
| copumpkin | not sure how long it's been there | 19/09 19:08 |
| glguy | oh.. | 19/09 19:08 |
| copumpkin | but since it's unbounded, it doesn't have the wraparound properties we want | 19/09 19:08 |
| copumpkin | so it seems like there's room for both | 19/09 19:09 |
| copumpkin | (it's represented as a List of bits instead of a Vec of tem) | 19/09 19:09 |
| copumpkin | want me to get rid of the custom bit stuff and replace it with bool before pushing? | 19/09 19:15 |
| glguy | maybe | 19/09 19:16 |
| glguy | I think it will help us to reuse all of the properties | 19/09 19:16 |
| copumpkin | yeah | 19/09 19:17 |
| copumpkin | we can also make a commutative semiring out of the bitwise ops | 19/09 19:17 |
| copumpkin | but I didn't get around to that | 19/09 19:17 |
| copumpkin | anyway, will replace with Bool and then push to github | 19/09 19:17 |
| glguy | is there already such a semiring made from Data.Bool? | 19/09 19:18 |
| copumpkin | yeah | 19/09 19:18 |
| copumpkin | Data.Bool.Properties is full of nice stuff | 19/09 19:18 |
| copumpkin | with that, it might pay to actually abstract out the zipWith-preserves-properties | 19/09 19:18 |
| copumpkin | dammit, it ate up all my memory :P | 19/09 19:22 |
| copumpkin | brb | 19/09 19:23 |
| copumpkin | glguy: http://github.com/pumpkin/bitvector | 19/09 19:32 |
| copumpkin | just split it into two files for now | 19/09 19:33 |
| copumpkin | and the Bool transition was remarkably painless | 19/09 19:33 |
| copumpkin | oh, forgot to uncomment the original algebraic properties | 19/09 19:33 |
| copumpkin | pushed a fixed version | 19/09 19:35 |
| glguy | I'm playing EVE Online right now, if you are wondering why I'm a bit unresponsive | 19/09 19:36 |
| copumpkin | hah okay | 19/09 19:37 |
| copumpkin | I'm in no rush | 19/09 19:37 |
| copumpkin | have various other things I should be doing | 19/09 19:37 |
| glguy | copumpkin: I did a file reorg | 19/09 20:32 |
| glguy | http://github.com/glguy/bitvector | 19/09 20:32 |
| copumpkin | cool | 19/09 20:32 |
| copumpkin | by the way, have any ideas about that total order thing? | 19/09 20:34 |
| copumpkin | it'd be nice to make a DecTotalOrder | 19/09 20:35 |
| glguy | I haven't looked at it yet | 19/09 20:36 |
| copumpkin | ah okay | 19/09 20:36 |
| copumpkin | I might throw together the commutative semiring | 19/09 20:37 |
| glguy | on Bit? | 19/09 20:37 |
| copumpkin | the bitwise one on bitvector | 19/09 20:37 |
| glguy | commutativeRings are already commutativeSemirings, right? | 19/09 20:38 |
| copumpkin | yeah, but I mean the one over or/and/not instead of +/*/neg | 19/09 20:38 |
| glguy | ahhh | 19/09 20:39 |
| glguy | ok | 19/09 20:39 |
| llambda | Does that have a name | 19/09 20:39 |
| copumpkin | don't know of one | 19/09 20:40 |
| copumpkin | it's a dioid though | 19/09 20:41 |
| copumpkin | but Algebra doesn't have those | 19/09 20:41 |
| llambda | What is a dioid? I see "A set with two inner operations" on some random Google result but I'm not sure that is authoritive at all | 19/09 20:42 |
| copumpkin | a semiring where addition is idempotent (x or x = x) | 19/09 20:43 |
| llambda | Ah okay | 19/09 20:43 |
| glguy | proving that commutativesemiring property should be as easy as writting fmap | 19/09 20:47 |
| glguy | since the bits don't interact | 19/09 20:48 |
| copumpkin | yeah, exactly | 19/09 20:51 |
| copumpkin | it's the same with the lattice ones | 19/09 20:51 |
| copumpkin | all the proofs in that module have the exact same structure | 19/09 20:51 |
| copumpkin | I just didn't feel like figuring out how to express that generically | 19/09 20:52 |
| copumpkin | does the std lib have an n-ary zipWith/map ? | 19/09 20:58 |
| glguy | Data.Vec.N-ary has some helpers | 19/09 21:00 |
| glguy | I don't know if that is relevant | 19/09 21:00 |
| copumpkin | ah, I'll check it out | 19/09 21:00 |
| copumpkin | thanks | 19/09 21:00 |
| Mathnerd314 | anyone ever heard of/used Sage (http://sage.soe.ucsc.edu/) ? | 19/09 21:02 |
| Adamant | is that the mixed typing one? | 19/09 21:04 |
| Adamant | I have a paper on that, IIRC | 19/09 21:04 |
| Mathnerd314 | can I read it? | 19/09 21:04 |
| Adamant | listed on the frontpage, second DL provided | 19/09 21:18 |
| Mathnerd314 | Adamant: you mean "Compositional and Decidable Checking for Dependent Contract Types" ? | 19/09 21:21 |
| Adamant | http://sage.soe.ucsc.edu/sage-tr.pdfhttp://sage.soe.ucsc.edu/sage-tr.pdf | 19/09 21:21 |
| Adamant | bleh | 19/09 21:22 |
| Adamant | sorry | 19/09 21:22 |
| glguy | copumpkin: This is specific to Commutativity, but I'm hoping that I could further generalize it: | 19/09 21:29 |
| glguy | promote-comm : ∀ {a} {A : Set a} (op : Op₂ A) → Commutative _≡_ op → ∀ n → Commutative _≡_ (Data.Vec.zipWith {n = n} op) | 19/09 21:29 |
| glguy | promote-comm op p zero [] [] = refl | 19/09 21:29 |
| glguy | promote-comm op p (suc n) (x ∷ xs) (x' ∷ xs') rewrite promote-comm op p n xs xs' | p x x' = refl | 19/09 21:29 |
| copumpkin | ah yeah, I was trying to be too general and confusing myself | 19/09 21:36 |
| glguy | I'm working on getting more general, but I'm starting from something concrete | 19/09 21:37 |
| copumpkin | hmm, getting tired, will work on it more tomorrow :) | 19/09 21:37 |
| glguy | kk | 19/09 21:37 |
| copumpkin | feel free to implement anything I said I'd implement (and/or rewrite/dump anything I already have implemented) :P I won't be offended | 19/09 21:37 |
| glguy | still there? | 19/09 21:40 |
| copumpkin | yep | 19/09 21:44 |
| glguy | check this out then bfore you go | 19/09 21:44 |
| copumpkin | not going to sleep yet, just didn't feel like thinking hard anymore :) | 19/09 21:44 |
| glguy | http://hpaste.org/30218/lift_properties | 19/09 21:44 |
| copumpkin | ah, that looks nice | 19/09 21:45 |
| copumpkin | that'd cover several of the repetitive properties nicely :) | 19/09 21:45 |
| Mathnerd314 | that looks confusing :p | 19/09 21:46 |
| copumpkin | Mathnerd314: it's almost haskell! with more complicated types :P | 19/09 21:48 |
| copumpkin | and that strange rewrite construct that has no analog in haskell | 19/09 21:48 |
| copumpkin | ue | 19/09 21:49 |
| Mathnerd314 | yeah, what is rewrite? | 19/09 21:49 |
| copumpkin | it's takes an equality value (x == y) and rewrites your context by it | 19/09 21:50 |
| copumpkin | so if you have an x in your context, it'll turn into a y | 19/09 21:50 |
| copumpkin | it was love at first sight for me | 19/09 21:50 |
| copumpkin | sure beats miles of subst | 19/09 21:50 |
| Mathnerd314 | so what's it's type? | 19/09 21:52 |
| copumpkin | it doesn't have one, it's a syntactic construct | 19/09 21:53 |
| copumpkin | it's mostly syntactic sugar for a with, I think | 19/09 21:53 |
| glguy | I think that it is completely syntactic sugar for a with and a pattern match on a refl | 19/09 21:54 |
| copumpkin | well, it needs that builtin equality binding for some reason | 19/09 21:55 |
| copumpkin | I guess it just needs to know what constructor to stick in | 19/09 21:55 |
| glguy | so that it knows what "refl" is | 19/09 21:56 |
| copumpkin | yeah | 19/09 21:56 |
| copumpkin | either way, it's a hell of a lot prettier :) | 19/09 21:56 |
| glguy | certainly | 19/09 21:56 |
| Mathnerd314 | so... a with is like Haskell's guards or case-of? | 19/09 22:00 |
| copumpkin | more powerful | 19/09 22:00 |
| copumpkin | it gives you more stuff to pattern match on, basically | 19/09 22:01 |
| copumpkin | a bit like a haskell view pattern | 19/09 22:01 |
| glguy | copumpkin: By using this construct I can go back to naming all of my properties types, again | 19/09 22:02 |
| glguy | module P {n : ℕ} where | 19/09 22:02 |
| glguy | import Algebra.FunctionProperties as FP; open FP (_≡_ ∶ Rel (BitVector n) _) public | 19/09 22:02 |
| glguy | identityˡ : ∀ {n} → P.LeftIdentity (zero n) _+_ | 19/09 22:02 |
| copumpkin | great | 19/09 22:02 |
| glguy | Is there a simpler way to do that? | 19/09 22:03 |
| copumpkin | the implicit n getting passed everywhere? | 19/09 22:03 |
| glguy | You can't lock it down to one 'n' or you can't do your inductive case | 19/09 22:04 |
| copumpkin | yeah :/ I tried that at first | 19/09 22:04 |
| copumpkin | I don't know of anything better | 19/09 22:05 |
| glguy | it is interesting that we are defining families of properties (indexed over the vector size) | 19/09 22:07 |
| glguy | I want there to be a name for: f (op x y) == f x `op` f y | 19/09 22:10 |
| glguy | with binary operations we have DistributesOver | 19/09 22:10 |
| copumpkin | naming is always the worst part of programming | 19/09 22:15 |
| benmachine | glguy: it looks sort of like a homomorphism | 19/09 22:52 |
| benmachine | even though it isn't actually | 19/09 22:52 |
| copumpkin | sorry about all that | 19/09 22:55 |
| --- Day changed Mon Sep 20 2010 | ||
| glguy | copumpkin: ping | 20/09 04:10 |
| glguy | copumpkin: I think that the reason you can't figure out that last proof for "less than or equal to" is that the relation is wrong | 20/09 04:22 |
| glguy | shouldn't I be able to construct (1# ∷ 0# ∷ []) q≤ (0# ∷ 1# ∷ []) | 20/09 04:22 |
| glguy | The issue is that the most significant bit is on the right | 20/09 04:24 |
| lispy|dagit | glguy: what is q≤ ? | 20/09 04:50 |
| lispy|dagit | (I mean, why q?) | 20/09 04:50 |
| glguy | -- Silly agda bug is preventing me from using the _≤_ name even though it's not in scope :( | 20/09 04:51 |
| glguy | apparently | 20/09 04:51 |
| lispy|dagit | ah | 20/09 04:59 |
| lispy|dagit | I thought it was like quotient less than | 20/09 05:00 |
| copumpkin | glguy: lol, good point | 20/09 05:31 |
| * copumpkin looks ashamed | 20/09 05:31 | |
| copumpkin | I can't believe I was able to prove so much about it with it being wrong :P | 20/09 05:39 |
| copumpkin | ah well, I guess it's good that it got caught :P | 20/09 05:39 |
| * copumpkin tries to figure out a way to fix it | 20/09 06:18 | |
| copumpkin | okay, I think I fixed it | 20/09 07:43 |
| copumpkin | damn, he's gone | 20/09 07:43 |
| * copumpkin hugs agsy | 20/09 07:59 | |
| dolio | Which part is agsy? | 20/09 08:02 |
| dolio | Is that the one that handles refine? | 20/09 08:02 |
| copumpkin | C-c C-a | 20/09 08:02 |
| dolio | I've been getting some use out of that lately. | 20/09 08:02 |
| copumpkin | refine is nice too | 20/09 08:02 |
| copumpkin | agsy is the automatic proof finder | 20/09 08:02 |
| dolio | Ah. | 20/09 08:02 |
| copumpkin | it's nice to avoid writing tedious constant proofs and such | 20/09 08:03 |
| copumpkin | and bits that are painfully obvious but _ can't figure out | 20/09 08:03 |
| copumpkin | to avoid the fiasco from yesterday's broken inductive ordering on the binary naturals | 20/09 08:03 |
| copumpkin | I wrote a bunch of "Testcases" and asked agsy to prove them all | 20/09 08:04 |
| copumpkin | so now I won't have to waste my time proving a bunch of properties that are obviously false | 20/09 08:04 |
| dolio | Heh, does it always insert "by agsy" comments? | 20/09 08:05 |
| copumpkin | in the older builds it inserted them everywhere | 20/09 08:06 |
| copumpkin | now it only seems to do it if you pass -c | 20/09 08:06 |
| copumpkin | really annoying :P | 20/09 08:06 |
| dolio | I assume you do that by typing -c into the shed? | 20/09 08:09 |
| copumpkin | yeah | 20/09 08:09 |
| copumpkin | main options I use are -m, which gives it top-level signatures (iirc and lets it sometimes prove recursive properties), -c for case-splitting, and -t increases the timeout | 20/09 08:09 |
| copumpkin | although usually if it can't find something within the default 5s timeout, it won't find it at all | 20/09 08:10 |
| copumpkin | okay, my relation is reflexive and antisymmetric | 20/09 08:18 |
| * copumpkin crosses fingers | 20/09 08:18 | |
| copumpkin | it's transitive too! | 20/09 08:52 |
| copumpkin | :P | 20/09 08:52 |
| copumpkin | most horrifyingly repetitive mutual block I've written | 20/09 08:52 |
| * copumpkin will clean it up later | 20/09 08:52 | |
| copumpkin | I'll be so pissed if this doesn't wor | 20/09 10:20 |
| copumpkin | drum roll | 20/09 10:28 |
| copumpkin | my < is trichotomous | 20/09 10:28 |
| copumpkin | YAY | 20/09 10:38 |
| copumpkin | MY RELATION IS TOTAL | 20/09 10:38 |
| * copumpkin dances | 20/09 10:38 | |
| copumpkin | syntax type-signature A x = x ∶ A | 20/09 13:04 |
| copumpkin | <# | 20/09 13:04 |
| copumpkin | <3, even :) | 20/09 13:04 |
| * copumpkin feels accomplished | 20/09 14:26 | |
| copumpkin | glguy: I fixed it :) | 20/09 17:18 |
| copumpkin | way more complicated than the broken one, though | 20/09 17:18 |
| glguy | pushed to github? | 20/09 17:19 |
| copumpkin | yep | 20/09 17:20 |
| copumpkin | so we have three orders on it now | 20/09 17:20 |
| copumpkin | a strict total <, a dec total <=, and a bitwise containment dec partial order | 20/09 17:20 |
| copumpkin | the strict total < kind of arose as a consequence of how I defined the <= | 20/09 17:21 |
| glguy | yeah, I figured you'd need to do < first so you could detect when it didn't matter what the low bits were | 20/09 17:21 |
| copumpkin | yeah | 20/09 17:22 |
| copumpkin | so it's just mutual now | 20/09 17:22 |
| copumpkin | it can probably be simplified a bit more | 20/09 17:22 |
| copumpkin | but it's not too bad (I already cleaned up the initial version a bit) | 20/09 17:22 |
| copumpkin | as usual, I wasn't sure what to name things :) | 20/09 17:25 |
| copumpkin | I'm not sure that the way I've constructed the < and <= proofs, that proofs are unique | 20/09 17:26 |
| copumpkin | but I got tired of it and did something else | 20/09 17:27 |
| glguy | I was thinking that you could embed == into the < relation instead of <= | 20/09 17:33 |
| glguy | and then <= could just be the sum or < and == | 20/09 17:33 |
| copumpkin | hmm, that could work | 20/09 17:33 |
| copumpkin | I tried something with == before, but I didn't get very far | 20/09 17:33 |
| copumpkin | anyway, feel free to rewrite/elegantize it :P | 20/09 17:35 |
| copumpkin | btw, did you put up your efforts to make generic bool=>bitvector property transformers? | 20/09 17:36 |
| glguy | I expect I'll muck with it tonight | 20/09 17:36 |
| glguy | I had trouble with things like: zipWith (\ x y -> op y x) xs ys not being obviously equal to | 20/09 17:36 |
| glguy | zipWith op ys xs | 20/09 17:36 |
| glguy | I need to find a project at work that needs an agda implementation of Word32 :) | 20/09 17:37 |
| copumpkin | lol | 20/09 17:37 |
| copumpkin | we should write an implementation of haskell98 in agda and beat the haskell-verifier people to it :P | 20/09 17:38 |
| copumpkin | have you played with isabelle btw? | 20/09 17:38 |
| glguy | I have some (brb) | 20/09 17:39 |
| copumpkin | ah | 20/09 17:44 |
| glguy | John Matthews ran an "intro to isabelle" course at work | 20/09 17:47 |
| copumpkin | ah | 20/09 17:48 |
| glguy | which is my primary source of isabelle experience | 20/09 17:48 |
| glguy | I suspect that doing these proofs in Isabelle would have been pretty boring. | 20/09 17:48 |
| glguy | You don't seem to do a lot of manual specification of rewrite rules like we do. | 20/09 17:48 |
| copumpkin | ah | 20/09 17:49 |
| copumpkin | how does it figure such things out? | 20/09 17:49 |
| copumpkin | maybe I'll install it and take a look | 20/09 17:49 |
| glguy | You can install your simplification rules and run "auto" tactic | 20/09 17:51 |
| glguy | and then it thinks for a moment and your proof is done ;) | 20/09 17:51 |
| copumpkin | wow :P | 20/09 17:51 |
| copumpkin | oh wow, it even has a nice disk image for mac | 20/09 17:52 |
| copumpkin | I'd started specifying instruction encodings for ARM in agda a while back | 20/09 17:58 |
| copumpkin | might see if I can give myself a nice basis using this bitvector stuff and then automate generation of the agda code from the pdf spec | 20/09 17:59 |
| glguy | f x rewrite y = z | 20/09 18:47 |
| glguy | why is it that the "where" clause of this expression is in scope in z but not y? | 20/09 18:47 |
| glguy | Is there a theoretical issue or isthis an implementation choice? | 20/09 18:48 |
| copumpkin | I think the latter | 20/09 18:48 |
| copumpkin | a where is a with and a with is a helper function | 20/09 18:48 |
| copumpkin | I mean | 20/09 18:49 |
| copumpkin | a rewrite is a with and a with is a helper function :) | 20/09 18:49 |
| copumpkin | so I guess they just didn't carry the where context to the generated function | 20/09 18:49 |
| Saizan | so i guess that "rewrite y" also affects the where clause? | 20/09 18:51 |
| copumpkin | I think so, but it's hard to notice cause where-bound variables don't show up when you ask it to print context | 20/09 18:52 |
| Saizan | i use the infer type command from the shed for that | 20/09 18:53 |
| copumpkin | yeah | 20/09 18:53 |
| glguy | I don't think that rewrite affects where clauses | 20/09 18:53 |
| copumpkin | weird, I thought it did | 20/09 18:56 |
| glguy | I tried to construct an example where it did and failed. | 20/09 18:57 |
| glguy | Maybe give it a shot? | 20/09 18:57 |
| copumpkin | sure | 20/09 18:57 |
| copumpkin | it's not like I have any reason to think it does beyond a vague recollection that it did | 20/09 18:57 |
| Saizan | http://hpaste.org/30247/rewrite_where | 20/09 19:02 |
| glguy | Saizan: that didn't rewrite y | 20/09 19:03 |
| glguy | it rewrote your goal | 20/09 19:03 |
| glguy | y stayed teh same | 20/09 19:03 |
| Saizan | it rewrited the type of x | 20/09 19:04 |
| Saizan | otherwise i couldn't use it as the body of y | 20/09 19:04 |
| Saizan | *rewrote | 20/09 19:04 |
| copumpkin | in my experiment it didn't seem to rewrite it | 20/09 19:04 |
| glguy | yeah, it rewrote x and the change was in scope in teh where | 20/09 19:04 |
| glguy | but it didn't rewrite anything defined in the where | 20/09 19:05 |
| copumpkin | oh actually | 20/09 19:05 |
| Saizan | ok, i guess we meant different things by "affect" :) | 20/09 19:05 |
| copumpkin | yeah, it didn't rewrite it | 20/09 19:05 |
| copumpkin | (in mine) | 20/09 19:06 |
| Saizan | anyhow, if where lives in a context where other bound variables are already rewritten, then things defined in that where are reasonably out of scope in the rewrite clause | 20/09 19:06 |
| copumpkin | where clauses are a pain :P | 20/09 19:08 |
| copumpkin | (especially if you need to prove something about them) | 20/09 19:08 |
| copumpkin | they should make functions into modules too :P so you can pull out where-bound variables of it | 20/09 19:08 |
| Saizan | where clauses are fine if you don't pattern match in the definition :) (or if you can make the whole thing abstract anyhow) | 20/09 19:11 |
| copumpkin | it seems like if you want to use a where clause in a function you want to prove something about, it needs to return a proof of everything you want to specify about it in addition to whatever it would normally return | 20/09 19:13 |
| Saizan | the way i see it is that function names are more special than they should be | 20/09 19:16 |
| Saizan | because even if f and g are defined with the exact same code f x and g x are not convertible if those functions pattern match on their argument | 20/09 19:19 |
| pumpkin | I wonder how hard it'll be to actually prove things about haskell programs that weren't written with proofs in mind once there's an extractor to HOL | 20/09 21:33 |
| Saizan | pumpkin: how did one restart quail mode? | 20/09 22:07 |
| pumpkin | no clue :/ I gave up after a while and restarted all of emacs | 20/09 22:07 |
| glguy | pumpkin: I don't know that the point is to actually prove things about programs that weren't designed with verification in mind | 20/09 22:34 |
| glguy | It might be to be able to prove things about the actual haskell code that was written with verification in mind and was then executed | 20/09 22:34 |
| Saizan | or-elim? : ∀ {A B C1 C2 D E F G : Set}{f : D -> C1}{g : E -> C2}{x : D ⊎ E} -> (A ↔ F) -> (B ↔ G) -> [ (\_ -> A) , (\_ -> B) ]′ (Data.Sum.map f g x) ↔ [ (\_ -> F) , (\_ -> G) ]′ x <- very general combinator | 20/09 22:48 |
| glguy | can you paste that again, I just turned off emoticons | 20/09 22:52 |
| Saizan | hah | 20/09 22:54 |
| Saizan | or-elim? : ∀ {A B C1 C2 D E F G : Set}{f : D -> C1}{g : E -> C2}{x : D ⊎ E} -> (A ↔ F) -> (B ↔ G) -> [ (\_ -> A) , (\_ -> B) ]′ (Data.Sum.map f g x) ↔ [ (\_ -> F) , (\_ -> G) ]′ x | 20/09 22:54 |
| Saizan | "very general combinator" was a joke, btw | 20/09 22:55 |
| glguy | perhaps you could generalize the arrows? | 20/09 22:55 |
| Saizan | abstract over ↔ , you mean? | 20/09 22:56 |
| glguy | sure | 20/09 22:57 |
| Saizan | fun, that ends up requiring more type annotations where i use it | 20/09 22:59 |
| Saizan | which might be a sign of unification being over-zelous somewhere | 20/09 23:00 |
| --- Day changed Tue Sep 21 2010 | ||
| Saizan | when you use C-c C-r there's no way to get a more informative message than "can not refine"? | 21/09 02:40 |
| glguy_ | Saizan: What about using C-c C-. | 21/09 08:24 |
| glguy_ | so that you can see the type of the expression you have next to the type you need | 21/09 08:25 |
| Sean_McEligot | does anyone know of a good list of symbols I can use to get emacs keybinds? | 21/09 13:22 |
| Sean_McEligot | by keybinding I meant like \bn | 21/09 13:23 |
| Saizan | http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput <- says "Type M-x agda-input-show-translations RET RET to see all the characters you can type using this input method", is that what you want? | 21/09 13:31 |
| pumpkin | is there a nice idiom for supporting "open" type functions like type families in haskell? I can make a custom universe for closed ones | 21/09 13:44 |
| Sean_McEligot | thanks Saizan, I read that page, but didn't see that | 21/09 13:45 |
| pumpkin | Saizan: turns out my "bug" wasn't a bug, but PEBKAC :) | 21/09 13:48 |
| Saizan | pumpkin: oh, how should one deal with that situation then? | 21/09 13:48 |
| pumpkin | Saizan hiding (_<=_; module _<=_) | 21/09 13:49 |
| pumpkin | unintuitive, but apparently in the .8 release notes | 21/09 13:49 |
| pumpkin | that I didn't read carefully enough | 21/09 13:49 |
| Saizan | makes sense | 21/09 13:50 |
| pumpkin | anyway, fixed the order on githu | 21/09 13:50 |
| pumpkin | that package is coming together nicely! | 21/09 13:50 |
| pumpkin | maybe we can actually have somewhat efficient machine integers :) | 21/09 13:50 |
| Saizan | i've typed down the halting problem instead | 21/09 13:54 |
| pumpkin | oh yeah? | 21/09 13:55 |
| pumpkin | how's that look? | 21/09 13:55 |
| pumpkin | I've been working on universal algebra separately | 21/09 13:55 |
| pumpkin | I almost have something I like | 21/09 13:55 |
| Saizan | http://code.haskell.org/~Saizan/halting/CompModel.agda <- a bit weird because it's parameterized on the computational model, as i've found in an agda1 paper | 21/09 13:56 |
| pumpkin | oh, interesting | 21/09 13:57 |
| pumpkin | lol, {A B C1 C2 D E F G : Set} | 21/09 13:58 |
| Saizan | yeah, that's quite funny :) | 21/09 13:59 |
| * pumpkin is trying to come up with an elegant way to introduce consistent names across algebraic structures | 21/09 14:02 | |
| copumpkin | N-ary : ∀ {a b n} → Vec (Set a) n → Set b → Set (a ⊔ b) | 21/09 14:09 |
| copumpkin | anyone know how to write that? | 21/09 14:09 |
| copumpkin | might need to be suc (a lub b) | 21/09 14:09 |
| copumpkin | but still doesn't work | 21/09 14:09 |
| ccasin | has the promised cumulativity addition appeared yet? Otherwise you'll probably need to compare and lift explicitly | 21/09 14:13 |
| copumpkin | ick | 21/09 14:14 |
| ccasin | since, without it, neither "Set a"s nor "Set b"s are "Set (a ⊔ b)"s | 21/09 14:15 |
| copumpkin | yeah :/ | 21/09 14:15 |
| Guest47215 | Hi, is there an analogon for Haskell's Data.Set in Agda? | 21/09 14:16 |
| ccasin | but the mailing list they said they added cumulativity at the last AIM | 21/09 14:16 |
| ccasin | don't know if it made it to the public repo yet | 21/09 14:16 |
| copumpkin | ccasin: oh, maybe it has an option for it | 21/09 14:17 |
| copumpkin | or maybe that | 21/09 14:17 |
| copumpkin | domi2: Data.AVL.Sets | 21/09 14:17 |
| domi2 | copumpkin: k, thx! | 21/09 14:31 |
| * domi2 misses hoogle | 21/09 14:31 | |
| * Saizan is so sad that irrelevance doesn't work in records | 21/09 14:36 | |
| Saizan | http://hpaste.org/40013/squashing_laws <- is there a way to write dual so that dual∘dual≡id typechecks without pattern matching on squash? | 21/09 17:13 |
| copumpkin | lol, agsy doesn't know about irrelevance it seems | 21/09 17:17 |
| copumpkin | can I prove (∀ {A : Set} → .A → A) → ⊥? | 21/09 17:20 |
| napping | what is the ⊥? | 21/09 17:21 |
| copumpkin | the empty type | 21/09 17:21 |
| copumpkin | a.k.a. false | 21/09 17:22 |
| napping | Isn't (∀ {A : Set} → .A → A) inhabited by the identity? | 21/09 17:22 |
| copumpkin | except the first parameter is irrelevant, so it can't return it | 21/09 17:22 |
| Saizan | copumpkin: i don't think agda knows enough about parametricity to prove that | 21/09 17:23 |
| napping | I don't know what tools you have for working with irrelevance | 21/09 17:23 |
| Saizan | darcs agda | 21/09 17:23 |
| copumpkin | napping: me neither, trying to figure out how it works now :) | 21/09 17:24 |
| copumpkin | maybe I'll make my universal algebra work wonderfully irrelevant | 21/09 17:24 |
| napping | but I imagine you'd have something like \forall {A B} {f : .A -> B} {a b} -> f a = f b | 21/09 17:24 |
| Saizan | yep, that's provable | 21/09 17:26 |
| Saizan | test : ∀ {A B : Set} {f : .A -> B} {a b} -> f a ≡ f b | 21/09 17:26 |
| Saizan | test = refl | 21/09 17:26 |
| copumpkin | hah, I just wrote out the exact same thing, name and \forall => ∀ | 21/09 17:27 |
| Saizan | \forall => ∀ was included in the copy/paste here :) | 21/09 17:27 |
| copumpkin | :o | 21/09 17:28 |
| napping | that's proved by refl? | 21/09 17:28 |
| Saizan | yeah, i.e. they are convertible | 21/09 17:29 |
| napping | so, it seems the question is what convertability allows with the irrelevant arguments | 21/09 17:31 |
| napping | can you then prove ∀ {A B : Set} {f : .A -> B} -> exists x, forall y, f y == x? | 21/09 17:41 |
| Saizan | heh, i think i'd have to produce an A out of thin air to do that | 21/09 17:47 |
| copumpkin | what if B is \bot? | 21/09 17:48 |
| Saizan | yeah, B = \bot is quite a counter example | 21/09 17:49 |
| glguy | So what's this new irrelevance feature in the darcs verison of agda? | 21/09 17:55 |
| glguy | I just saw some mention in the comments, but I haven't read any details | 21/09 17:56 |
| copumpkin | you can specify that arbitrary parameters be irrelevant | 21/09 17:56 |
| copumpkin | so f : A -> .A -> A can only be f x y = x | 21/09 17:56 |
| copumpkin | I wonder if this makes agda more efficient :) | 21/09 17:57 |
| glguy | and you do that with the leading period on the type name? | 21/09 17:57 |
| copumpkin | yeah | 21/09 17:57 |
| napping | where else are irrelevant arguments used? | 21/09 17:57 |
| napping | I assume you can pass them into lemmas that take irrelevant arguments? | 21/09 17:58 |
| glguy | I would assume you could pass them to any lemma but that the result would be irrelevant | 21/09 18:01 |
| glguy | like the GPL | 21/09 18:02 |
| copumpkin | seems you can't declare that your output is irrelevant | 21/09 18:02 |
| napping | copumpkin: how would you prove (forall A, [A]) -> False ? | 21/09 18:02 |
| napping | wait, that one is easy | 21/09 18:02 |
| copumpkin | yep | 21/09 18:03 |
| copumpkin | actually | 21/09 18:03 |
| copumpkin | it isn't false | 21/09 18:03 |
| napping | well, what would be an example of parametriciy | 21/09 18:03 |
| napping | how about a positive example | 21/09 18:03 |
| napping | can you prove \all {A} {f : A -> A} {a} f a == a? | 21/09 18:04 |
| copumpkin | [] has type forall a. [a] | 21/09 18:04 |
| glguy | You could prove False with a: (forall A. [A] -> A) | 21/09 18:04 |
| napping | yeah, that's a bad example | 21/09 18:04 |
| copumpkin | napping: no | 21/09 18:05 |
| napping | so, you are expecting that irrelevant arguments might help to prove parametricity results? | 21/09 18:05 |
| napping | it seems like positive results from parametricity are quite hard | 21/09 18:06 |
| napping | I haven't thought of an example of something that is false for parametricity reasons, but can't be trivially instantiated to produce a False | 21/09 18:06 |
| pumpkin | glguy: oh by the way | 21/09 18:18 |
| pumpkin | glguy: the <= issue was pebkac on my part | 21/09 18:18 |
| pumpkin | glguy: so it's fixed on github now | 21/09 18:18 |
| pumpkin | damn | 21/09 18:20 |
| napping | is there any online library documentation? | 21/09 18:24 |
| pumpkin | the documentation is the source :) | 21/09 18:26 |
| pumpkin | and there are almost no comments :P | 21/09 18:26 |
| pumpkin | glguy: did you get my message? | 21/09 18:26 |
| pumpkin | I guess that's a dumb question | 21/09 18:27 |
| pumpkin | glguy: anyway, I fixed the <= naming issue for the numeric order | 21/09 18:27 |
| napping | I have a fresh install, so why is C-c C-x C-c trying to compile this MAlonzo thing? | 21/09 18:27 |
| copumpkin | MAlonzo is the compiler, I wouldn't use that | 21/09 18:27 |
| napping | I just want to typecheck a file with some functions using this irrelevant stuff | 21/09 18:27 |
| copumpkin | I just use C-c C-l | 21/09 18:27 |
| napping | ah, that's the one | 21/09 18:28 |
| glguy | pumpkin: I didn't see your message | 21/09 18:29 |
| copumpkin | glguy: turns out I just needed to hide both the _<=_ name and the _<=_ module | 21/09 18:29 |
| pumpkin | so the horrible q<= is gone | 21/09 18:31 |
| napping | how do you add a "with"? | 21/09 18:36 |
| napping | oh, it seems it doesn't work at all | 21/09 18:42 |
| napping | bar : ∀ (f : .Bool -> Bool) (H : (x : Bool) -> f x ≡ x) -> ⊥ | 21/09 18:42 |
| napping | then the after even bar f H with true | 21/09 18:42 |
| napping | anything I write produces an internal error! | 21/09 18:42 |
| pumpkin | that might be a bug, but it's just a hunch :) | 21/09 18:43 |
| napping | copumpkin: have seen https://lists.chalmers.se/pipermail/agda/2010/001809.html | 21/09 18:54 |
| pumpkin | I saw it but haven't played with it | 21/09 18:58 |
| pumpkin | dolio was doing some parametricity proofs a couple of weeks ago | 21/09 18:59 |
| * pumpkin is a member of the agda organization on github! | 21/09 19:09 | |
| pumpkin | y'all should join too :) | 21/09 19:09 |
| glguy | is proof irrelevance interesting if you aren't generating code? | 21/09 19:13 |
| Saizan | it should speed up typechecking, and also make more things obviously equal | 21/09 19:16 |
| Saizan | data Squash (A : Set) where squash : .A -> Squash A, implies forall {x y} -> squash x == squash y | 21/09 19:17 |
| napping | is the theory behind irrelevant arguments written up somewhere? | 21/09 20:04 |
| napping | this seems to be a different sort of thing from Prop always being irrelevant | 21/09 20:04 |
| napping | or at least rather more general | 21/09 20:04 |
| Saizan | there's a discussion on the mailing list about the theory and future design choices | 21/09 20:37 |
| napping | what is the title? | 21/09 20:39 |
| Saizan | "[Agda] Re: [Coq-Club] Re: Universe Polymorphism" so i guess it started elsewhere :) "[Agda] Records and irrelevant fields" is also relevant | 21/09 20:43 |
| napping | I saw the records one, I'll see about the other | 21/09 20:44 |
| napping | "EPTS" seems to be the thing to search for | 21/09 20:59 |
| napping | I think I read that paper a while back, but didn't realize it would be interesting in a programming language | 21/09 21:06 |
| ccasin | that discussion is really interesting - I had never thought about the difference between cumulativity and "full" cumulativity before | 21/09 21:08 |
| ccasin | In my naive agda-like prototypes I often add a cumulativity rule, but because they lack agda's sophisticated definitional equality one then loses principle types | 21/09 21:09 |
| ccasin | who knew! | 21/09 21:09 |
| napping | how does that go? | 21/09 21:10 |
| ccasin | the example in luo's book is the function: | 21/09 21:10 |
| napping | I can see a cumulativity rule that allows multiple paths could be a problem | 21/09 21:10 |
| ccasin | \x:Type 0 . x | 21/09 21:10 |
| ccasin | what is the type of this function? | 21/09 21:10 |
| ccasin | Type 0 -> Type 0, certainly | 21/09 21:10 |
| ccasin | but also Type 0 -> Type n for any n | 21/09 21:10 |
| napping | I don't see that things are forced to go wrong | 21/09 21:11 |
| ccasin | there is just no "most general" type for this function | 21/09 21:11 |
| ccasin | because (Type 0 -> Type 0) and (Type 0 -> Type 1) aren't comparable | 21/09 21:12 |
| napping | Couldn't you write your typing rules so it is only Type 0 -> Type 0, and do the subtyping in application? | 21/09 21:12 |
| ccasin | if one naively adds the cumulativity rule but not also a definitional equality that picks apart pis and applies it in various palces | 21/09 21:12 |
| ccasin | *places | 21/09 21:12 |
| ccasin | Sure, but then that function applied to some term won't have a most general type | 21/09 21:13 |
| ccasin | oh, no, sorry | 21/09 21:13 |
| ccasin | yes, that might work, but of course there are other compound types too and one would have to think about them | 21/09 21:13 |
| napping | it seems like it could be pretty tricky | 21/09 21:14 |
| ccasin | luo solves it with a complicated cumulativity relation, instead of just the one standard rule. It's kind of interesting | 21/09 21:14 |
| napping | Perhaps some sort of universe polymorphism would work as well | 21/09 21:14 |
| ccasin | anyway, my point was just that I learn a lot from reading the agda list :) | 21/09 21:14 |
| napping | I don't see where you get that from the post on universes | 21/09 21:15 |
| ccasin | napping: perhaps, although it came up because Randy Pollack mentioned that his universe polymorphism paper had cumulativity but not full cumulativity | 21/09 21:15 |
| ccasin | so it seems universe polymorphism is compatible with either | 21/09 21:15 |
| ccasin | alas, have to run to a meeting | 21/09 21:15 |
| ccasin | later | 21/09 21:15 |
| napping | I'm not too sharp today, but the sepecific thing Dan was pointing out was that he ended up with distinct unit types promoted form lower levels | 21/09 21:15 |
| napping | bye | 21/09 21:15 |
| dolio | glguy: On the Strength of Proof Irrelevant Type Theories is a paper about why programming in a theory with proof irrelevance can be nice, aside from optimization. | 21/09 21:44 |
| glguy | (for reference: http://arxiv.org/pdf/0808.3928) | 21/09 21:45 |
| ccasin | napping: yes, I agree, it was only mentioned in passing in the thread | 21/09 22:07 |
| glguy | I think taht it is a bug that I can't C-c C-c on an irrelevant parameter if that parameter is impossible | 21/09 22:10 |
| glguy | and the C-c C-c should have matched with () | 21/09 22:10 |
| --- Day changed Wed Sep 22 2010 | ||
| glguy | So at some point would it make sense to make the proofs contained in the fields of things like IsMonoid proof irrelevant? | 22/09 00:40 |
| Saizan | i think it depends on your use cases, since if they are marked irrelevant then you can't use them to coerce terms that are relevant, with the current rules at least | 22/09 00:41 |
| Saizan | s/that are relevant/that are used in a relevant position/ | 22/09 00:42 |
| copumpkin | what would be the problems with letting you use irrelevant proofs to coerce relevant terms? | 22/09 00:48 |
| Saizan | that you can make open term evaluation loop, i think | 22/09 00:51 |
| Saizan | (which is needed for typechecking) | 22/09 00:53 |
| * Saizan wishes you could link messages from gmail | 22/09 00:54 | |
| Saizan | https://lists.chalmers.se/pipermail/agda/2010/002044.html <- so i guess there's a detailed answer here http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.154.5619 | 22/09 00:58 |
| copumpkin | speaking of what he wrote in there, it feels weird that this is allowed: http://snapplr.com/j7ae | 22/09 01:05 |
| dolio | That weirdness is at least one motivation for the irrelevance stuff. | 22/09 01:22 |
| Sean_McEligot | from Nat.agda: | 22/09 20:31 |
| Sean_McEligot | _+_ : ℕ → ℕ → ℕ | 22/09 20:31 |
| Sean_McEligot | suc m + n = suc (m + n) | 22/09 20:32 |
| Sean_McEligot | what's going on on the right side n+m. is this like joining two lists? | 22/09 20:32 |
| jonrafkind | its defining + recursively | 22/09 20:42 |
| jonrafkind | suc (m + n) -> suc (suc (m' + n)) ...; until you get m' = 0 and then its just n | 22/09 20:42 |
| jonrafkind | so you get suc(suc(suc(n))), which is mathematically equal to m + n | 22/09 20:43 |
| jonrafkind | since suc appears m times | 22/09 20:43 |
| Sean_McEligot | thanks, I'm still pondering it... could the same thing be done in haskell> I'm used to x:xs style functions in haskel | 22/09 20:48 |
| Sean_McEligot | I guess it's pretty simple. thanks. I'll keep playing around | 22/09 20:50 |
| jonrafkind | its essentially the same thing, the function is defined by pattern matching on the input and destructuring it to reformulate the answer into some known quantity | 22/09 20:51 |
| jonrafkind | given + exists how can you compute suc m + n, well you can suc the result of +, and thats exactly what its doing | 22/09 20:51 |
| jonrafkind | x:xs style says, given some function f that operates on a list and a function g that operates on a single element of a list, take apart a list by getting its head and apply g to that, then apply f to the tail of the list | 22/09 20:53 |
| jonrafkind | where the function f is usually the one you are already defining | 22/09 20:53 |
| Sean_McEligot | nice, so no we have numbers without symbols (1,2) to compare, do we check the length? | 22/09 20:56 |
| Sean_McEligot | s/no/now | 22/09 20:56 |
| jonrafkind | you can compare the number of times suc has been applied | 22/09 20:58 |
| jonrafkind | suc(suc(suc(O))) = 3 | 22/09 20:58 |
| jonrafkind | suc x > O, so to check if x > y you can do | suc x > O -> true, | suc x > suc y -> x > y, | O > _ -> false | 22/09 20:59 |
| Sean_McEligot | zero is just a type not related to 0, so = would work, but what's > doing | 22/09 21:01 |
| jonrafkind | i think you still have define what = means | 22/09 21:05 |
| jonrafkind | unless agda comes with structural equality or something.. | 22/09 21:05 |
| Sean_McEligot | zero == zero is the only comparison that I can see working | 22/09 21:06 |
| jonrafkind | given x and y, and you match them both to zero then you can say they are equal. x > y | 0 > 0 = false | 22/09 21:06 |
| jonrafkind | you can only match a variable to either 0 or suc blah | 22/09 21:07 |
| Sean_McEligot | oh, so this is a pattern match by the compiler on suc(suc(suc(zero))) | 22/09 21:08 |
| jonrafkind | yea you can match a variable to any pattern | 22/09 21:09 |
| jonrafkind | x | suc(suc(suc(zero))) = ...; if it matches then thats what you got | 22/09 21:10 |
| Sean_McEligot | ok, my brain is rewired enough to continue, thanks | 22/09 21:12 |
| --- Day changed Thu Sep 23 2010 | ||
| jonrafkind | how do I pattern match on things inside a lambda? (λ x -> case x of ...) | 23/09 00:22 |
| Saizan | that's a quite annoying part, since there's no case expression | 23/09 00:25 |
| Saizan | so you've to define a named function, or use a fold-like operator | 23/09 00:26 |
| jonrafkind | ugh.. alright | 23/09 00:26 |
| jonrafkind | does agda use a GLR parser? | 23/09 00:49 |
| Spockz | how can I pass implicit arguments to a infix constructor/function? suppose (x , xs) (, for Product) How would I add the implicit variables? | 23/09 10:31 |
| dolio | _,_ {t} x xs | 23/09 10:33 |
| Spockz | ok, I get a yellow highlighting, but I'm not quite sure why. :( | 23/09 10:42 |
| g_cross | Does anyone have a reference I can check out to read about how the MAlonzo compiler works? | 23/09 20:28 |
| --- Day changed Fri Sep 24 2010 | ||
| commanace | Hey... i'm trying to install agda on my gentoo machine (using portage) however ghc fails to recognize the package afterwards and indeed ghc-pkg list doesn't show any agda packages... might be a gentoo related problem but more likely I simply forgot to do something obivous :P | 24/09 21:37 |
| commanace | any suggestions? | 24/09 21:37 |
| jonrafkind | i installed agda in gentoo.. | 24/09 21:42 |
| jonrafkind | did you emerge agda-mode ? | 24/09 21:43 |
| commanace | jonrafkind: there is no package called agda-mode, but i think agda installed the corresponding files for emacs... | 24/09 21:48 |
| jonrafkind | oh right, use cabal to install agda mode I think | 24/09 21:49 |
| jonrafkind | I think I installed agda itself from source | 24/09 21:49 |
| jonrafkind | seems 2.2.6 is in portage | 24/09 21:49 |
| jonrafkind | with ~x86 | 24/09 21:50 |
| commanace | wait, are you talking about the emacs agda-mode? | 24/09 21:50 |
| jonrafkind | yea | 24/09 21:50 |
| commanace | yes, i'm on ~x86 | 24/09 21:50 |
| commanace | agda-mode is installed and loaded | 24/09 21:50 |
| commanace | just ghci won't find the package | 24/09 21:50 |
| jonrafkind | do you have haskell-mode installed to? | 24/09 21:51 |
| jonrafkind | ghc-pkg list -- shows this for me: /home/jon/.ghc/i386-linux-6.12.3/package.conf.d | 24/09 21:51 |
| jonrafkind | Agda-2.2.6 | 24/09 21:51 |
| commanace | jonrafkind: yes, there's the problem... its not listed for me... do i have to run some kind of updater to update the package list? | 24/09 21:52 |
| commanace | i doubt it's an emacs-related problem | 24/09 21:52 |
| jonrafkind | how did you install agda? | 24/09 21:53 |
| commanace | emerge agda | 24/09 21:53 |
| commanace | :) | 24/09 21:53 |
| jonrafkind | hm im not sure whats wrong, do you have cabal? | 24/09 21:54 |
| commanace | maybe it's gentoo related and the cabal or source version works better... don't know | 24/09 21:54 |
| commanace | yes, i can try cabal | 24/09 21:54 |
| jonrafkind | im pretty sure all I did was 'make install' in the agda source tree | 24/09 21:54 |
| commanace | i'm always scared that using to many packaging system at the same time will lead to a huge chaos at some point :P | 24/09 21:55 |
| commanace | but i'll check the cabal version | 24/09 21:55 |
| --- Day changed Sat Sep 25 2010 | ||
| stevan | Saizan, pumpkin: hi, i just tried out the field irrelevance stuff on the ct library. managed to get rid of the whole functor extensionality bit :-) | 25/09 15:53 |
| Saizan | nice, i was going down that route yesterday but then i had to sleep :) | 25/09 15:54 |
| * Saizan pulls | 25/09 15:54 | |
| Saizan | stevan: now we can uncomment the adjuction laws :) | 25/09 16:04 |
| dolio | How's it affect the performance? Much faster? | 25/09 16:05 |
| stevan | still parts of the code which don't use irrelevance / haven't been updated since the use (i.e. broken), so it's hard to say yet... | 25/09 16:07 |
| dolio | Also, do you need an option to turn on the irrelevance stuff? And if so, what is it? | 25/09 16:08 |
| stevan | you dont | 25/09 16:09 |
| Saizan | i tried to cheat by just switching _\==_ to one wrapped in a record version of Squash but i get much more yellow | 25/09 16:11 |
| * dolio needs to start building agda without profiling. | 25/09 16:51 | |
| --- Day changed Sun Sep 26 2010 | ||
| napping | I wonder if it could work to implicitly quantify free names | 26/09 02:29 |
| napping | ah, I hadn't noticed named implicit parameters had to be supplied in order | 26/09 02:31 |
| stevan | hmmm, shouldn't mapFold pass the termination checker? http://hpaste.org/40134/term | 26/09 12:29 |
| dolio | stevan: The I case looks problematic. | 26/09 12:32 |
| dolio | Although it still looks decreasing in the last argument. | 26/09 12:34 |
| dolio | Oh, but it isn't inductive, which may be the issue. | 26/09 12:35 |
| dolio | The only thing to do induction on in that function is F, and in the I case, you arbitrarily replace it with G. | 26/09 12:36 |
| dolio | Which isn't a subcomponent of I. | 26/09 12:36 |
| stevan | this works: http://hpaste.org/40135/sa | 26/09 12:37 |
| stevan | what's the difference? | 26/09 12:38 |
| stevan | record vs datatype for product? | 26/09 12:39 |
| dolio | Oh... maybe. | 26/09 12:40 |
| dolio | Does Test2 still work? | 26/09 12:41 |
| stevan | test2 works. http://hpaste.org/40136/term3 doesn't work | 26/09 12:42 |
| stevan | so it seems to be something with product | 26/09 12:42 |
| dolio | Okay. | 26/09 12:43 |
| stevan | bug? | 26/09 12:43 |
| dolio | Not necessarily. | 26/09 12:43 |
| dolio | Matching on the product like that is justified by translation to projections. | 26/09 12:43 |
| dolio | So, you have to ask if you'd expect it to work with 'mapFold F1 G phi (proj_1 p) ...' | 26/09 12:44 |
| dolio | You probably would, because I think you can derive induction from eta equality, but I suppose the termination checker could be justified in not simply assuming it. | 26/09 12:47 |
| dolio | It's kind of weird even with the inductive product, though. | 26/09 12:48 |
| dolio | Since the termination checker is accepting it based on piece-wise induction, to coin a term. | 26/09 12:49 |
| dolio | Instead of induction on the Functor, which is the most obvious choice. | 26/09 12:49 |
| stevan | if the |Id| functor is removed, it passes | 26/09 12:50 |
| dolio | That's not to say that it'd be impossible to write that function without pattern matching+termination checker, but it seems like you'd have a bunch of stuff to prove beforehand. | 26/09 12:51 |
| dolio | So the termination checker seems to be enabling a non-trivial recursion scheme. | 26/09 12:51 |
| stevan | or if the |x| functor is removed, it also passes. | 26/09 12:52 |
| stevan | i don't know, but i think if the inductive product version passes then so i think the record version should. wasn't one of the reasons for the switch from the former to the latter in the std lib that they behaved the same? | 26/09 12:59 |
| Saizan | no, they don't behave the same | 26/09 13:02 |
| Saizan | the record version gets eta-expanded during type checking, so "p = proj1 p , proj2 p" but that's not true for the data version | 26/09 13:03 |
| dolio | This is the first example I've seen where the inductive version behaves better, though. | 26/09 13:04 |
| stevan | yeah | 26/09 13:04 |
| stevan | i just tried the same example using an older version, and it works... | 26/09 13:08 |
| Saizan | pattern matching on records wasn't rewritten to projections then | 26/09 13:09 |
| Saizan | anyhow, i don't know if eta rules should have this impact on termination checking, but it seems likely to me | 26/09 13:10 |
| stevan | what was the motivation behind rewriting pattern maching on records to projections? | 26/09 13:20 |
| dolio | Because projections are primitively defined for records, and pattern matching isn't. | 26/09 13:32 |
| Saizan | also because subject reduction was lost | 26/09 13:37 |
| dolio | stevan: So, I thought about it, and came to the conclusion that it probably should allow the function somehow, even with the record product. | 26/09 15:55 |
| dolio | The fact that it allows 'in : [[ F ]] (Mu F) -> Mu F' means that it recognizes that [[ F ]] is a strictly positive functor. | 26/09 15:56 |
| dolio | So the induction principle should be like '(F : Functor) (P : Mu F -> Set) ((m : [[ F ]] (Mu F)) -> All P m -> P (in m)) -> (x : Mu F) -> P x'. | 26/09 15:57 |
| dolio | Which is the eventual goal anyway. | 26/09 15:57 |
| dolio | So the termination checker and the datatype validator aren't really in sync. | 26/09 15:57 |
| stevan | ok, i guess we should report it then | 26/09 16:07 |
| dolio | Well, I'm still not surprised that it doesn't work. | 26/09 16:09 |
| dolio | But, there's kind of a mismatch. | 26/09 16:09 |
| dolio | I mean, I don't think the checker ever accepts that induction principle. | 26/09 16:09 |
| dolio | That's why you have to define mapFold or whatever as an auxiliary. | 26/09 16:10 |
| Saizan | don't they define something white similar for Desc in epigram's agda models? | 26/09 16:11 |
| stevan | they do | 26/09 16:12 |
| dolio | I also had an epiphany about why I can't define the Epigram desc stuff using just induction recursion: it's impredicative. | 26/09 16:21 |
| dolio | So you need to hijack the built-in impredicativity of large indices to make it work. | 26/09 16:22 |
| ccasin | built-in impredicativity of large indices? | 26/09 16:38 |
| ccasin | can you elaborate on what you mean by that? :) | 26/09 16:38 |
| dolio | Having a type T indexed by Set and inhabiting Set is impredicative in a sense. | 26/09 16:42 |
| ccasin | hmm, interesting | 26/09 16:44 |
| dolio | The index kind of ranges over the very set that the type inhabits. | 26/09 16:44 |
| ccasin | yes | 26/09 16:44 |
| ccasin | though, it seems to dependa bit on one's mental picture of inductive type definitions | 26/09 16:44 |
| ccasin | are they really building "new" types? | 26/09 16:44 |
| ccasin | picturing them as building new types runs into trouble, since then they'd naturally be injective | 26/09 16:45 |
| ccasin | and, if not - if they are just names for things already in Set - then there is not much impredicative here | 26/09 16:47 |
| ccasin | or maybe I'm just running my mouth about things I don't understand :) | 26/09 16:48 |
| dolio | Well, if you read about, say, Luo's UTT, he defines a system in a logical framework... | 26/09 16:49 |
| dolio | And the way he defines universes is something like... | 26/09 16:50 |
| dolio | "Here are a bunch of ways of building types." | 26/09 16:50 |
| dolio | "The first universe, U0, contains all the types capable of being built that way." | 26/09 16:50 |
| dolio | "Then, you can build types making use of U0." | 26/09 16:50 |
| dolio | "U1 contains all types buildable that way." | 26/09 16:51 |
| dolio | And so on. | 26/09 16:51 |
| ccasin | yes, but, I think even in UTT | 26/09 16:51 |
| ccasin | if I defined for example | 26/09 16:51 |
| ccasin | two unit types | 26/09 16:51 |
| ccasin | I couldn't prove them distinct | 26/09 16:51 |
| ccasin | He gives you ways to "build" types, and it's nice to think of them as being really new things, but the system can't show that | 26/09 16:52 |
| ccasin | you can actually show them distinct in agda right now, but I'm pretty sure it's a bug | 26/09 16:52 |
| dolio | Well, that wasn't really my point. You don't have to take type declarations as building new types. | 26/09 16:52 |
| dolio | You could view them as identifying types that already exist. | 26/09 16:53 |
| dolio | But, nevertheless, U0 doesn't contain types that require U0 to define. | 26/09 16:53 |
| dolio | But in Agda, Set does. | 26/09 16:53 |
| ccasin | OK, I see | 26/09 16:54 |
| ccasin | but I'm still not sure I entirely believe you :) | 26/09 16:54 |
| dolio | Or, if you look at the category theory underlying inductive families, I believe they're initial algebras in slice categories. | 26/09 16:54 |
| ccasin | if we think if an indexed datatype as some opaque function into the world of Set | 26/09 16:54 |
| dolio | Where an initial algebra in C/A is a family with an index A. | 26/09 16:54 |
| ccasin | then it doesn't really "define" types. It just names them | 26/09 16:55 |
| ccasin | I confess my category theory is weak | 26/09 16:55 |
| dolio | Indexing by Set would imply that you can slice over Set, but the category it's in is Set as well. | 26/09 16:55 |
| dolio | So it'd be Set/Set, and Set would be an object of itself, which is kind of bad. | 26/09 16:56 |
| dolio | I can believe that this isn't so viciously circular in Agda, though. | 26/09 16:57 |
| dolio | In reality, what Agda does may be closer to induction recursion. | 26/09 16:58 |
| dolio | You're indexing your datatype by Set, which hasn't been finished being defined yet. | 26/09 16:58 |
| dolio | But you can only refer to the previously named elements as indices. | 26/09 16:59 |
| dolio | I'm not sure if that stands up to scrutiny. | 26/09 16:59 |
| ccasin | I don't know either :) | 26/09 16:59 |
| ccasin | but calling indexed datatypes "definitions" of types makes me nervous | 26/09 17:00 |
| dolio | Anyhow, there's nothing necessarily bad about impredicativity. | 26/09 17:00 |
| ccasin | dolio: well, it's a trick you can pull once | 26/09 17:00 |
| ccasin | if every Set n is impredicative, then shouldn't there be some logical inconsistency? | 26/09 17:00 |
| dolio | But it explains why I can't get it to work using induction recursion. | 26/09 17:01 |
| dolio | Because impredicativity ends up as negativity there. | 26/09 17:01 |
| ccasin | yes | 26/09 17:01 |
| ccasin | it's a shame we don't have a good tool with an impredicative universe and induction recursion | 26/09 17:02 |
| ccasin | often I want both | 26/09 17:02 |
| ccasin | not that anyone has done the metatheory for such a language | 26/09 17:02 |
| dolio | Well, the impredicativity of large indices seems, to my eyes, weaker than the usual impredicativity that enables Girard's paradox if you have it at higher levels. | 26/09 17:03 |
| dolio | "Impredicativity" is kind of an overloaded term. | 26/09 17:03 |
| ccasin | yes | 26/09 17:04 |
| dolio | Some folks think induction is impredicative, after all (if I'm recalling correctly). | 26/09 17:05 |
| Saizan | edwinb: /win 20 | 26/09 19:09 |
| Saizan | edwinb: since i've pinged you anyhow, i've fixed a build problem for epic, and improved build errors reporting: http://github.com/Saizan/EpiVM/commit/615b6efc546a55c50de3d61990d6482ff475f77a | 26/09 19:43 |
| --- Day changed Mon Sep 27 2010 | ||
| stevan | hi, could someone with 2.2.6 test if this works: http://hpaste.org/40161/bug ? thanks. | 27/09 13:27 |
| stevan | found an old 2.2.6 version laying around, seems to have worked back then | 27/09 13:47 |
| edwinb | Saizan: thanks for the patch. | 27/09 21:21 |
| edwinb | Now I just need to remember how to drive git ;) | 27/09 21:22 |
| Saizan | yeah, that's always the hardest part :) | 27/09 21:24 |
| edwinb | I still haven't got the hang of this sort of thing since I switched | 27/09 21:25 |
| Saizan | btw, if you don't mind requiring Cabal 1.8 you could avoid building the library modules twice | 27/09 21:25 |
| edwinb | that'd be nice | 27/09 21:25 |
| edwinb | I don't really understand cabal ;) | 27/09 21:25 |
| Saizan | that seems to be common :) | 27/09 21:26 |
| * edwinb goes to poke avsm since he's in the same room and it was him who made me switch ;) | 27/09 21:32 | |
| Saizan | edwinb: http://github.com/Saizan/EpiVM/commit/e461fccd6045ae86d4b8840ae7d9c14b7d0c959e another patch :) | 27/09 21:41 |
| Saizan | anyhow i think most of the confusion wrt Cabal is that there isn't much documentation effort, it's a system that has a fair amount of detail to deal with all the various bits, but it's not fundamentally complex | 27/09 21:46 |
| Saizan | *is due to the fact that | 27/09 21:46 |
| copumpkin | does NAD ever hang out in here? | 27/09 23:26 |
| Saizan | i think he only reads the logs :) | 27/09 23:26 |
| copumpkin | ah damn | 27/09 23:26 |
| llambda | You can send messages to him through logs | 27/09 23:50 |
| llambda | Expect a response via e-mail a month down the road | 27/09 23:50 |
| copumpkin | :) | 27/09 23:50 |
| --- Day changed Tue Sep 28 2010 | ||
| stevan | so working with records with irrelevant fields: http://hpaste.org/40174/irr the only way to get this to work is to parametrise all functions on C rather than having it as a module parameter? | 28/09 00:26 |
| stevan | btw, 2.2.8 just got released :-) | 28/09 00:26 |
| pumpkin | stevan: oh you're still developing the CT stuff? | 28/09 00:26 |
| stevan | yeah the new irrelevance stuff makes somethings a lot nicer | 28/09 00:27 |
| pumpkin | oh nice | 28/09 00:27 |
| pumpkin | where was the readme again? to browse the modules | 28/09 00:27 |
| pumpkin | (I'm on a different computer from the one I have the bookmark on) | 28/09 00:27 |
| stevan | tinyurl.com/CTinAgda but i haven't updated the html yet | 28/09 00:28 |
| pumpkin | ah ok | 28/09 00:28 |
| Saizan | stevan: heh, pattern match on C in a with? | 28/09 00:32 |
| stevan | ! | 28/09 00:32 |
| Saizan | not much better. | 28/09 00:33 |
| stevan | hmm, i can't get it to work. how did you do? | 28/09 00:38 |
| Saizan | i've never tried it personally | 28/09 00:38 |
| stevan | pumpkin: op (op C) == C http://patch-tag.com/r/stevan/ctfp10/snapshot/current/content/pretty/src/Category/Opposite.agda and functor o-assoc and id and now be done without functor extensionality thing http://patch-tag.com/r/stevan/ctfp10/snapshot/current/content/pretty/src/Category/Categories/Cat.agda :-) i haven't gotten around updating the rest yet tho, the above problem with the irrelevant stuff not ... | 28/09 00:47 |
| stevan | ... being in scope unless you pattern match on it causes some rewriting... if atleast the with trick worked, not sure why it doesn't... have to try some more... | 28/09 00:47 |
| copumpkin | what's a good name for a heterogeneous vector indexed on a homogeneous vector of types? | 28/09 02:45 |
| dolio | HList? | 28/09 02:46 |
| copumpkin | List and not Vec? | 28/09 02:49 |
| dolio | That was sort of a joke. | 28/09 02:51 |
| llambda | Isn't it AList around these parts | 28/09 02:54 |
| dolio | The H stands for heterogeneous. | 28/09 02:54 |
| dolio | Not Haskell. | 28/09 02:54 |
| dolio | Then again, I guess that means HTrue is heterogeneous True. | 28/09 02:55 |
| llambda | AmorphusList | 28/09 02:55 |
| pumpkin | :) | 28/09 02:58 |
| edwinb | Saizan: avsm has told me the magic incantation, so I've got your patch now, thanks | 28/09 16:11 |
| stevan | hmm, i'm confused: why doesn't this work? http://hpaste.org/40188/irr | 28/09 16:15 |
| stevan | "variable idL is declared irrelevant, so it cannot be used here" | 28/09 16:15 |
| copumpkin | that's quite a constructor there! | 28/09 16:16 |
| stevan | :-) | 28/09 16:17 |
| copumpkin | it seems like maybe that ==-reasoning thing might need to be revised to accept irrelevant arguments in the < >, since it doesn't use them anyway? | 28/09 16:17 |
| stevan | this works: http://patch-tag.com/r/stevan/ctfp10/snapshot/current/content/raw/src/Category/Functors.agda | 28/09 16:19 |
| stevan | i can't see any difference? | 28/09 16:19 |
| Saizan | stevan: that in the paste left-identity is defined separately while in Functors you use the irrelevant fields to fill an irrelevant field directly | 28/09 17:06 |
| stevan | ok, can left-identity be proven? | 28/09 17:15 |
| Saizan | i'd say no, you've to wrap it in a Squash type | 28/09 17:21 |
| stevan | hmm :-/ | 28/09 17:22 |
| * copumpkin is trying to think of a good extensible notion of "identity" for operations/elements/sets/properties in a general algebra module in agda | 28/09 17:55 | |
| * copumpkin wants cumulative universes :( | 28/09 18:47 | |
| dolio | Go use MiniAgda. | 28/09 18:47 |
| copumpkin | :( | 28/09 18:47 |
| copumpkin | okay, it's that time of the night | 28/09 19:55 |
| copumpkin | anyone around remember how to turn quail completions on and off? | 28/09 19:55 |
| dolio | What do you mean? The stuff that makes \neg turn into unicode? | 28/09 20:03 |
| dolio | Why do you want to turn that off? | 28/09 20:03 |
| copumpkin | oh, I want to turn it on | 28/09 20:04 |
| copumpkin | sometimes I accidentally press the magic key combo that turns it off | 28/09 20:04 |
| dolio | Oh. | 28/09 20:04 |
| copumpkin | and can never remember how to turn it back on | 28/09 20:04 |
| copumpkin | without restarting the whole thing | 28/09 20:04 |
| copumpkin | poking around on the wiki on key combos doesn't seem to reveal anything | 28/09 20:04 |
| copumpkin | but next time I find it out I'm putting it on | 28/09 20:04 |
| stevan | set-input-method "Agda" ? | 28/09 20:04 |
| dolio | Try M-x, and then type in 'quail' and press tab to see what commands with that name are available? | 28/09 20:05 |
| dolio | Or 'agda' if the whole agda mode is off. | 28/09 20:05 |
| copumpkin | nah, it's just quail that turns off | 28/09 20:05 |
| copumpkin | hmm, there seems to be a quail-inactivate but not a corresponding activate | 28/09 20:07 |
| dolio | I think Agda might be in trouble with regard to GHC 7. | 28/09 20:09 |
| copumpkin | how come? | 28/09 20:10 |
| dolio | I think it has multiple dependencies that in turn depend on base 3. | 28/09 20:10 |
| copumpkin | oh | 28/09 20:10 |
| dolio | Which is gone. | 28/09 20:10 |
| dolio | haskell-src is one. Maybe that will change. | 28/09 20:17 |
| dolio | I guess that's it. syb requires base < 4.3, but that's an easy fix. | 28/09 20:19 |
| dolio | I had thought that haskeline also depended on base 3. | 28/09 20:20 |
| copumpkin | http://hpaste.org/40192/algebra_with_identity_issues thoughts anyone? | 28/09 20:24 |
| copumpkin | I've come up with a horrible (but extensible) way to give sets/operations/properties identities so you can actually compare structures, but was wondering if anyone else had any ideas | 28/09 20:31 |
| dolio | What does "compare structures" mean? | 28/09 20:33 |
| copumpkin | check if a structure claims to support a named operation, and if that operation satisfies named properties | 28/09 20:34 |
| copumpkin | if that makes sense | 28/09 20:36 |
| dolio | Is it like extensible records? | 28/09 20:37 |
| dolio | And row polymorphism? | 28/09 20:37 |
| copumpkin | I guess it's sort of an attempt to do algebra that way, yeah | 28/09 20:37 |
| dolio | Then I'm not surprised it's unwieldy trying to implement it in a system without support for it. | 28/09 20:38 |
| copumpkin | yeah :/ | 28/09 20:38 |
| dolio | Extensible dependent records would be a nice feature. | 28/09 20:40 |
| dolio | They're a little more complicated than the non-dependent version, though. | 28/09 20:40 |
| dolio | Maybe a lot more complicated. | 28/09 20:42 |
| pumpkin | hm, haven't really thought it through in those terms | 28/09 20:49 |
| copumpkin | what's the syntax for an irrelevant implicit argument? | 28/09 23:02 |
| jonrafkind | {_} ? | 28/09 23:02 |
| copumpkin | I mean irrelevant in the sense that you couldn't use it if you tried | 28/09 23:02 |
| copumpkin | thinking of unamb : ∀ {a} {A : Set a} → (x y : A) → {pf : (x ≡ y)} → A | 28/09 23:03 |
| copumpkin | I can write unamb : ∀ {a} {A : Set a} → (x y : A) → .(x ≡ y) → A | 28/09 23:04 |
| dolio | It's probably not an option. | 28/09 23:33 |
| dolio | You can't write irrelevant arguments without a name, right? | 28/09 23:33 |
| dolio | I mean, implicit arguments. | 28/09 23:34 |
| dolio | And irrelevant arguments with names isn't valid syntax yet, from my experiments. | 28/09 23:34 |
| dolio | Even though it will print types that way. | 28/09 23:34 |
| pumpkin | yeah :/ | 28/09 23:41 |
| pumpkin | damn, so close to actually being able to write a safe unamb! | 28/09 23:42 |
| Saizan | you can always wrap it in a squash | 28/09 23:44 |
| copumpkin | squash is my cousin | 28/09 23:45 |
| stevan | grrr, cabal installed the latest darcs version, now i get: "Loading package Agda-2.2.9 ... linking ... ghc: /home/stevan/.cabal/lib/Agda-2.2.9/ghc-6.12.3/HSAgda-2.2.9.o: unknown symbol `__stginit_Agdazm2zi2zi9_AgdaziSyntaxziTranslationziConcreteToAbstract_' | 28/09 23:56 |
| stevan | ghc: unable to load package `Agda-2.2.9'" | 28/09 23:56 |
| stevan | inside the *ghci* buffer | 28/09 23:56 |
| stevan | any ideas? | 28/09 23:57 |
| --- Day changed Wed Sep 29 2010 | ||
| Saizan | no, it seems to link fine here | 29/09 00:11 |
| Saizan | maybe "cabal clean && cabal install"? and then restart ghci | 29/09 00:12 |
| stevan | magic, now it works :-). thanks | 29/09 00:28 |
| copumpkin | stevan: how's CT going? | 29/09 01:09 |
| dolio | copumpkin: You could bug Andreas Abel to get it in. The printing of types at least seems to suggest that some of the machinery is already there. | 29/09 01:10 |
| dolio | And I think MiniAgda already has it. | 29/09 01:10 |
| copumpkin | was he notabel on IRC a few days ago? | 29/09 01:10 |
| dolio | I don't know. | 29/09 01:10 |
| dolio | I guess that would make sense. | 29/09 01:10 |
| stevan | copumpkin: didn't get far today. been trying to define Func (the category of functors), but something is wrong with NT or NT composition i think -- can't get it to work. ran into an irrelevance bug also, spent some time minimising the code causing it, etc. | 29/09 01:19 |
| stevan | copumpkin: file a bug report/ feature request regarding the irrelevant implicit stuff, perhaps? | 29/09 01:24 |
| danbrown | did the termination check get dumber in the last month or so? | 29/09 17:08 |
| danbrown | *checker | 29/09 17:08 |
| danbrown | also a new bug with MAlonzo | 29/09 17:11 |
| danbrown | hrmf. i'll file a bug after lunch | 29/09 17:12 |
| pumpkin | danbrown: I thought it got smarter, if you ask it to look deeper than one level | 29/09 17:14 |
| danbrown | pumpkin: i tried --termination-depth=5, but no luck | 29/09 18:41 |
| danbrown | ok, good. not a MAlonzo bug. probably just a stale interface file somewhere | 29/09 19:44 |
| danbrown | does `agda --vim' not support the new syntax-with-binders yet? | 29/09 20:18 |
| danbrown | is the wiki not publicly editable? | 29/09 21:18 |
| danbrown | yay, i'm finally pushing all of my agda+vim workflow hacks out to the wiki | 29/09 21:42 |
| danbrown | been hoarding those for too long | 29/09 21:42 |
| pumpkin | :o | 29/09 22:01 |
| danbrown | grr at wiki markup... | 29/09 22:03 |
| danbrown | can't seem to get unicode into a preformatted [@ ... @] block | 29/09 22:03 |
| pumpkin | surely there are other examples of it fitting? | 29/09 22:03 |
| danbrown | aaaand the wiki's down... | 29/09 22:26 |
| danbrown | so close! | 29/09 22:26 |
| danbrown | done | 29/09 22:44 |
| danbrown | more vim goodness is now up on the wiki: syntax highlighting and unicode entry | 29/09 22:45 |
| * benmachine hugs | 29/09 22:47 | |
| danbrown | also better tokenizing for `agda --vim`, whenever someone gets a chance to add it: http://code.google.com/p/agda/issues/detail?id=339 | 29/09 23:00 |
| danbrown | can't pattern match on ♯ anymore? bummer. | 29/09 23:19 |
| danbrown | that used to be a constructor | 29/09 23:19 |
| danbrown | ah, it used to be a codata, which is now banished | 29/09 23:21 |
| pumpkin | yeah, it's just a primitive now | 29/09 23:21 |
| pumpkin | you weren't supposed to match on it before, either :P | 29/09 23:22 |
| benmachine | aww but codata is a cool word :( | 29/09 23:22 |
| benmachine | my decisions on which language features I like are based largely on the aesthetics of the keywords, yes | 29/09 23:23 |
| --- Day changed Thu Sep 30 2010 | ||
| stevan | hmm: "* added projections for irrelevant record fields (with --irrelevant-projections)" | 30/09 15:56 |
| wires | hi I'm super new to emacs & agda. A tutorial tells me to use the "Case" command when i'm at a goal, this should try to expand all the cases. Where do I find this "Case" command? | 30/09 16:33 |
| wires | also, any hints on a nice tutorial somewhere that explains interactive agda? | 30/09 16:33 |
| stevan | hi, C-c C-c | 30/09 16:34 |
| stevan | i'm afraid there is no such tutorial, would be nice if someone made a video explaining it | 30/09 16:35 |
| wires | Cool, thanks... where do I go to get documentation on this? | 30/09 16:35 |
| wires | Ok... Well i don't mind making a video once I know this a bit... | 30/09 16:36 |
| stevan | there is this: http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.QuickGuideToEditingTypeCheckingAndCompilingAgdaCode | 30/09 16:36 |
| wires | Ah I see.. saw that one, but I missed the case command. thanks | 30/09 16:37 |
| stevan | what tutorial are you following btw? | 30/09 16:41 |
| wires | stevan: I've decided to do a masterclass DTP at utrecht, just found out yesterday. I'm using anything I can find on http://wiki.portal.chalmers.se/agda/agda.php?n=Main.Othertutorials | 30/09 16:47 |
| wires | Went through "Ana Bove and Peter Dybjer. Dependent Types at Work" | 30/09 16:47 |
| stevan | ok :-) | 30/09 16:48 |
| wires | hmm parted room.. weird | 30/09 17:04 |
| wires | What's the easiest way to test some code in one of the files you are editing? Is there something like a lisp repl? I'm completely new to agda & emacs... | 30/09 17:04 |
| Saizan | if you want to evaluate something there's C-c C-n | 30/09 17:04 |
| wires | Let me try that, thanks | 30/09 17:05 |
| stevan | you could also do something like: test : 1 + 2 == 3; test = refl | 30/09 17:05 |
| stevan | btw Saizan , one can prove left-identity now :-) | 30/09 17:11 |
| Saizan | yeah, just saw the commits :) | 30/09 17:19 |
| pumpkin | left-identity where? | 30/09 17:19 |
| pumpkin | for the CT? | 30/09 17:19 |
| stevan | yea | 30/09 17:19 |
| * pumpkin pulls | 30/09 17:20 | |
| pumpkin | oh some of the old stuff doesn't work anymore, right? you're mid-refactor? | 30/09 17:21 |
| stevan | yea | 30/09 17:21 |
| pumpkin | ah okay | 30/09 17:22 |
| stevan | but a feature that got implemented a few hours ago fixes alot of things | 30/09 17:22 |
| pumpkin | oh which one? | 30/09 17:22 |
| stevan | see test/succeed/IrrelevantProjections.agda | 30/09 17:23 |
| pumpkin | I was wondering if there was a nice way to define universality that worked for all things | 30/09 17:23 |
| stevan | dunno... | 30/09 17:26 |
| pumpkin | we need a universal universality law! | 30/09 17:27 |
| stevan | :-) | 30/09 17:28 |
| pumpkin | it actually seems fairly simple | 30/09 17:28 |
| stevan | perhaps we could use a universe :-p | 30/09 17:28 |
| stevan | can you explain how you are thinking? i can't see the simplicity of it | 30/09 17:29 |
| pumpkin | well, in general it's saying "you have an X with a few properties, and if you had any other Y with properties of the same shape, then there is a unique morphism from Y to X" | 30/09 17:30 |
| pumpkin | as far as I can see | 30/09 17:30 |
| pumpkin | not sure if that covers all uses of it, as I'm still very much a beginner :) | 30/09 17:31 |
| pumpkin | properties generally meaning some morphisms to other objects | 30/09 17:32 |
| stevan | how would you capture that typewise? | 30/09 17:34 |
| pumpkin | not sure how to deal with the sets | 30/09 17:36 |
| Saizan | "Universal (X : | C |) (P : | C | -> Set) = (Y : | C |) -> P Y -> exists_unique (C [ Y , X ])" ? | 30/09 17:51 |
| pumpkin | I was thinking of the | C | -> Set thing | 30/09 17:52 |
| pumpkin | but it wouldn't let you enumerate them | 30/09 17:52 |
| pumpkin | but maybe you don't need to | 30/09 17:52 |
| wires | is there a way to "putStrLn" some random value to the console? or should I write my own "toString" fn ? | 30/09 18:59 |
| stevan | some datatypes in the standard library have show functions, but generally you would have to write your own. but why would you like to print stuff? :-) | 30/09 19:12 |
| wires | stevan: thanks.. i've dropped to vim + cli and running a script and then printing values to console, this emacs stuff is a bit to much to learn right now... | 30/09 19:21 |
| stevan | :-/, tried viper-mode? | 30/09 19:22 |
| wires | nope.. isn't that mainly keybindings? I'm completely n00b with emac. | 30/09 19:23 |
| wires | +s | 30/09 19:23 |
| stevan | it emulates vi keybindings in emacs yes, modulo buffer switching i find little difference between emacs and vi using it | 30/09 19:27 |
| stevan | Saizan: pumpkin : http://web.student.chalmers.se/~stevan/ctfp/html/README.html | 30/09 19:29 |
| pumpkin | what's new? | 30/09 19:29 |
| stevan | irrelevance where possible | 30/09 19:29 |
| pumpkin | ah cool | 30/09 19:29 |
| wires | Hi, after importing Data.Nat, how does one check for nr equality, like p : ℕ → Bool; p x = x == 0 | 30/09 20:43 |
| wires | Do I need to use propositional equality? ie. the "is defined as" symbol (http://www.cs.nott.ac.uk/~nad/listings/lib/Relation.Binary.Core.html#4612). I'm sorry, still a bit confused as to how all this is build up... | 30/09 20:44 |
| stevan | there is _\==?_ in Data.Nat that will give you a Dec, which you can turn into a bool if you like using a function from Relation.Nullary.Decidable. | 30/09 20:51 |
| wires | this one? http://www.cs.nott.ac.uk/~nad/listings/lib/Data.Nat.html#2914 | 30/09 20:58 |
| stevan | yea | 30/09 21:00 |
| wires | stevan: thanks | 30/09 21:01 |
| stevan | are you back in emacs? :-) | 30/09 21:07 |
| wires | I am actually :) | 30/09 21:11 |
| wires | I just had first thing running.. *yay* a "filter" fn... | 30/09 21:11 |
| wires | btw. thanks for your help | 30/09 21:12 |
| stevan | :-), btw if you wanna try viper-mode out there is a sample config towards the bottom of: http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.VIMEditing | 30/09 21:13 |
| wires | let me try that | 30/09 21:16 |
| stevan | does it work? | 30/09 21:34 |
| wires | stevan: it's does, but it's extremely weird, haha | 30/09 21:34 |
| stevan | :-) | 30/09 21:35 |
| wires | stevan: I tried all modes, but ... weird :) | 30/09 21:35 |
| wires | I guess I'll stick to plain emacs for a while... | 30/09 21:35 |
| stevan | one gets used to it after a while :-) | 30/09 21:36 |
| wires | actually.. at mode 2 it is indeed not that bad an even quite natural | 30/09 21:39 |
| stevan | mode 2? | 30/09 21:39 |
| wires | "level 2" | 30/09 21:39 |
| stevan | ah ok, that's more restricted i guess? | 30/09 21:40 |
| wires | How much of a "guru" (5) or "nab" you are (1) | 30/09 21:40 |
| wires | yes, 2 = less emacs, more vim | 30/09 21:40 |
| wires | 5 = less vim, most emacs | 30/09 21:40 |
| stevan | btw, if you are into programming languages there are some nice exercises here: http://www.cse.chalmers.se/edu/course/DAT140_Types/ | 30/09 21:42 |
| wires | hey thanks, I have that book next to me actually :) | 30/09 21:43 |
| stevan | :-) | 30/09 21:46 |
| copumpkin | stevan: do you have slice categories in there anywhere? | 30/09 22:01 |
| stevan | nope | 30/09 22:03 |
| stevan | running some benchmarks now, to see how much irrelevance has speeded things up | 30/09 22:07 |
| pumpkin | ooh | 30/09 22:12 |
| pumpkin | I'm curious | 30/09 22:12 |
| pumpkin | might monoidal categories one day be possible to typecheck?! :P | 30/09 22:12 |
| dolio | Why weren't they possible before? | 30/09 22:13 |
| pumpkin | well, I don't think anyone who tried had enough memory to | 30/09 22:13 |
| dolio | Really? I guess it depends on how much background you expect them to depend on. | 30/09 22:13 |
| pumpkin | oh I just mean the ones in that library | 30/09 22:14 |
| pumpkin | there's some properties commented out | 30/09 22:14 |
| pumpkin | because typechecking them takes too much memory | 30/09 22:14 |
| copumpkin | the whole Category.Categories.* thing seems a little odd | 30/09 22:25 |
| stevan | with irr: 2m 17s without: 6m 15s (ran out of memory on monoidal (last module)) | 30/09 22:26 |
| stevan | how so copumpkin ? | 30/09 22:27 |
| copumpkin | just naming-wise | 30/09 22:27 |
| copumpkin | oh wow, that's a great improvement | 30/09 22:27 |
| stevan | thinking of product and monoidal? | 30/09 22:28 |
| copumpkin | well I was going to stick Slice under there | 30/09 22:28 |
| copumpkin | would that make sense? | 30/09 22:28 |
| copumpkin | it just seems like a repetitive module name :) | 30/09 22:28 |
| stevan | it used to be only category instances there, but then product and monidal came along... | 30/09 22:29 |
| copumpkin | also, do you plan to eventually get rid of the plurals for things like Category.Functors? | 30/09 22:30 |
| copumpkin | or will this always coexist with the existing standard library definitions? | 30/09 22:30 |
| stevan | Functor/ Monad clases with std lib | 30/09 22:30 |
| copumpkin | yeah | 30/09 22:30 |
| copumpkin | I mean, do you think this will one day replace those? | 30/09 22:31 |
| copumpkin | maybe I'll do an Arrow category too while I'm at it | 30/09 22:31 |
| stevan | the ones in the std lib are more haskell-like; useful for programming, while ours are not? | 30/09 22:32 |
| copumpkin | fair enough :) | 30/09 22:32 |
| copumpkin | I'm getting a syntax error on some of your stuff | 30/09 22:33 |
| copumpkin | oh maybe I don't have the latest agda | 30/09 22:34 |
| stevan | you need todays darcs version i think | 30/09 22:34 |
| copumpkin | yeah that seems to have fixed it | 30/09 22:34 |
| copumpkin | sorry :) | 30/09 22:34 |
| copumpkin | hmm | 30/09 22:45 |
| copumpkin | how would I represent the slice category actually? | 30/09 22:45 |
| copumpkin | like, it takes a category C, an object of C, but what are its objects? ∀ y → C [ x , y ] | 30/09 22:46 |
| copumpkin | ? | 30/09 22:46 |
| copumpkin | that doesn't feel right | 30/09 22:46 |
| copumpkin | oh | 30/09 22:48 |
| copumpkin | it's an existential | 30/09 22:48 |
| Saizan | seems so | 30/09 22:49 |
| stevan | does anyone know what happend to the rest of the icfp videos? | 30/09 23:05 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!