--- Log opened Thu Sep 01 00:00:54 2011
xplatthere are lots of intuitionistic toposes that justify 2^2^S ~ S, i think01/09 01:53
xplatbut if you want to work over conventional math foundations, you can't use the obvious semantics01/09 01:55
augurxplat: who are you talking to :|01/09 02:06
copumpkin[02:42:37 PM] <dolio> Having a set S that is isomorphic to 2^2^S is problematic.01/09 02:08
augurgosh that was a while ago01/09 02:11
xplat#agda doesn't exactly scroll like #haskell01/09 02:12
ski@tell dolio if we take `S = A * S', then an element looks like `(a_0,(a_1,(a_2,...)))', and given the usual Kuratowski-pairs, this would contradict foundation (infinitely deeply nested sets)01/09 10:37
lambdabotConsider it noted.01/09 10:37
ski@tell Eduard_Munteanu `data Santa (A : Set) : Set where WithSanta : (Santa A -> A) -> Santa A', using this you can prove `{A : Set} -> (A -> A) -> A' and `{A : Set} -> A'01/09 10:43
lambdabotConsider it noted.01/09 10:43
dolioski: So, you've found one erroneous interpretation of type theory into set theory, therefore there can be no such interpretation?01/09 16:23
ppavelV6_hi01/09 17:22
ppavelV6_i'm thinking about reasoning about values 'in' monads01/09 17:22
ppavelV6_say i have something like m ℕ01/09 17:22
ppavelV6_what is the best way to say that n  > k ?01/09 17:23
Saizanhave "m (Sigma ℕ \ n -> n > k)" instead01/09 17:24
ppavelV6_the obvious way is to redefine > in terms of m ℕ and to use monadic laws. Are there better approaches?01/09 17:24
ppavelV6_Saizan: what will be the sort of  (Sigma ℕ \ n -> n > k)?01/09 17:25
Saizan(Sigma ℕ \ n -> n > k) : Set01/09 17:25
ppavelV6_hm....01/09 17:26
ppavelV6_hm….it's Set!01/09 17:26
ppavelV6_%)))))01/09 17:26
ppavelV6_ok, i'm probably too tired at the end of the workday to overlook this :)))01/09 17:27
ppavelV6_thanks :)01/09 17:27
ppavelV6_ops… not exactly…. have to think more about this...01/09 17:29
ppavelV6_at the risk of being stupid…. suppose i already have something like01/09 17:37
ppavelV6_prog : m ℕ01/09 17:37
ppavelV6_should i rewrite it for every possible predicate on ℕ i want to prove holds for prog?01/09 17:37
Saizanif you want to prove stuff about prog : m ℕ after the fact then how you do it will depend on what m is01/09 17:41
Saizanfrom the monad interface you can't do much, unless prog = return n01/09 17:42
copumpkinppavelV6_: think about common monads01/09 17:42
copumpkinppavelV6_: they don't necessarily "contain" values at all01/09 17:43
ppavelV6_copumpkin: i know %)01/09 17:43
ppavelV6_but something like prog >>= (\k -> k < 5)  would be nice :)01/09 17:44
ppavelV6_ prog >>= (\k -> return ( k < 5))01/09 17:44
copumpkinfmap (< 5)01/09 17:44
ppavelV6_copumpkin: not gonna work i believe. or will it?01/09 17:44
copumpkinwell, you want to be universe-polymorphic01/09 17:45
copumpkinbut what does that mean?01/09 17:45
copumpkinyou could lift a decision procedure into the monad01/09 17:46
ppavelV6_i want to have argument-universe-polymorphic monads :)01/09 17:47
ppavelV6_but it seem like Setω or something. I can lift a decision procedure but can't specify the decision01/09 17:47
mokusseems like to reason about values in M, you need prodicates in the comonad dual to M, and then you 'zap' them together... or something01/09 17:48
copumpkinare prodicates fancier than predicates?01/09 17:48
mokusi have nothing other than intuition behind that idea though, so take it with a few thousand grains of salt01/09 17:48
mokusprobably01/09 17:48
mokusbut i meant predicates of course ;)01/09 17:49
copumpkinwell, if profunctors are like fancier relations01/09 17:50
copumpkinand predicates are unary relations01/09 17:50
copumpkinthe a prodicate would be like a fancier predicate01/09 17:50
copumpkinthen01/09 17:50
ppavelV6_ok the use case: I'd like to postulate the existence of a monad (think IO) and a function in it that does something with a number (N -> IO N). I also want to specify some properties about the function's input and output01/09 17:51
copumpkinalthough a prodicate would probably be a presheaf or something like that01/09 17:51
mokusa prodicate is what you get when 'e' is next to 'o' on your keyboard ;)01/09 17:51
Saizannot a fancier dicate?01/09 17:52
ppavelV6_probably i can postulate that function returns something like irrelevantSigma N (\n -> pred n)01/09 17:52
mokusppavelV6_: seems like simple equational reasoning with the monad laws and your assumptions should be sufficient01/09 17:54
mokusdo you have an example of where that breaks down?01/09 17:55
ppavelV6_ok, let see…01/09 17:58
ppavelV6_prog : (Monad m) -> (Monad.M m Bool) -> Monad.M m N01/09 17:58
ppavelV6_prog m mb = mb >>= \b -> if b then (return 5) else (return 7)01/09 17:58
* copumpkin screams at Bool01/09 17:58
ppavelV6_i should to prove things about prog' b = if b then 5 else 7 and then re-construct prog from prog' using monadic laws and equational reasoning?01/09 17:58
ppavelV6_copumpkin: what wrong with Bool? :)01/09 17:59
copumpkinppavelV6_: it's close to useless if you ever want to prove things about your programs01/09 17:59
ppavelV6_copumpkin: oh :)))01/09 18:00
ppavelV6_It's hard to read proves from the network :)01/09 18:00
ppavelV6_the question is: how to reason about the programs that are initially written in monadic style01/09 18:01
copumpkinnot really that hard01/09 18:01
mokusppavelV6_: one approach would be to express your 'prog' as a composition of morphisms and manipulate them using known equivalences in the category01/09 18:01
copumpkinyou use decision procedures instead of boolean predicates01/09 18:01
copumpkinthey're harder to write01/09 18:01
copumpkinbut definitely not impossible01/09 18:01
copumpkinthen your bool says something01/09 18:01
ppavelV6_copumpkin: i'm ok with this if the decision procedures return irrelevant proves01/09 18:02
ppavelV6_think that i want to specify the external library (C-library!) behavior.01/09 18:02
copumpkinsure, they could :P01/09 18:02
ppavelV6_translating comments into postulates :)01/09 18:02
copumpkinalthough you don't always want that01/09 18:02
copumpkinexcept for maybe the negation01/09 18:03
copumpkinthat could be irrelevant probably01/09 18:03
ppavelV6_the question01/09 18:03
ppavelV6_ok. I want a "user" to write "programs". She wants to write them in monadic style. I want to prove things about programs :) or at least specify the requirements to them.01/09 18:04
ppavelV6_forget bools :) the program reads integers from a file, stores them in an IO array and sorts the array. I want to specify that array is sorted.01/09 18:06
mokusproving things about a program specified at runtime sounds impossible to me, unless you have some pretty strong restrictions on the language the program is defined in01/09 18:07
mokusso it sounds like specifying the requirements would be the bigger part01/09 18:08
ppavelV6_mokus: what do you mean "at runtime"?01/09 18:09
mokuswell, you're talking about "user" defining a "program", so that sounds like the program is arbitrary data01/09 18:10
ppavelV6_and user work time is runtime :) ok :)01/09 18:10
mokusyea01/09 18:10
mokusso maybe you want your program to be specified as having the type 'IO (SortedArray x)', where SortedArray is a type of arrays which contain proofs that they are sorted01/09 18:11
mokusbut it doesn't sound like your user language is agda, so maybe not01/09 18:11
ppavelV6_mokus: you may think of my user language as a stack of monads in agda :)01/09 18:12
mokusit might be helpful to think of the whole stack as one "abstract monad" along the lines of the MonadPrompt in Haskell, and then prove that 'for all implementations', the program reduces to 'return xs' where xs is sorted01/09 18:13
mokusor at least make the type of such proofs be your user's proof obligation01/09 18:13
ppavelV6_mokus i think i got it01/09 18:13
ppavelV6_ok, have to think more about what i really want :)))01/09 18:18
xplatmokus: logically, a monad is a lax modality01/09 19:19
xplatSaizan: a dicate is already a fancier predicate, probably one with more laws01/09 19:20
xplatSaizan: so a prodicate is transitively a fancier predicate01/09 19:21
xplathm, ppavelV6_ has left01/09 19:24
mokusxplat: is the AbstractBinaryProducts thing a way of using less RAM when checking the proofs in Categories.Monoidal.Cartesian or does it serve some other purpose?01/09 19:37
copumpkinit also makes the goals a lot easier to look at :P01/09 19:38
copumpkinfor humans01/09 19:38
copumpkinsince we don't really want them to reduce down to normal form01/09 19:38
copumpkinkeeping them abstract and having an explicit rewrite to a simpler form is nice01/09 19:38
mokushow do I actually get the goals to normal form when I want to use it with my chosen products?01/09 19:38
copumpkineach of the abstract things comes with a proof that it's equal to its definition, iirc01/09 19:39
mokusI found a proof relating *** to <>, but <> is abstract too.  I guess I can probably use the abstract eta and beta rules to define my own conversion to the non-abstract <> though01/09 19:41
mokusor I could just do more of the reasoning in the abstract language01/09 19:42
mokusI need to stop trying to reshape the tools to my workflow and shape my workflow to the tools a bit more, I think01/09 19:43
copumpkinit doesn't matter if the proof is abstract01/09 19:44
copumpkinif it's an equality, you can rewrite by it01/09 19:44
mokusexcept that if it's an equality in the abstract operations, those symbols don't appear in the things i'm wanting to rewrite01/09 19:44
copumpkinhmm01/09 19:45
mokusactually i think i could just use the isomorphism-of-products to go between them without too much work though01/09 19:46
mokuswell, maybe not - doesn't change the fact that the abstract version of *** isn't an instance of the Categories.Object.BinaryProducts one01/09 19:46
mokusbut it would allow me to convert between expressions involving the projections and <_,_> , at least01/09 19:47
mokuswhich is convenient enough, I think01/09 19:48
copumpkinhmm01/09 19:48
copumpkinnot sure :/ can't really look now though01/09 19:48
augurcopumpkin!01/09 19:49
augurhey01/09 19:49
mokusno problem, I think you gave me enough of a hint to get me moving again - thanks01/09 19:49
copumpkinhi augur01/09 19:49
mokuswell, moving again as soon as my laptop finishes recompiling the monoidal stuff for no apparent reason :(01/09 19:50
augurcopumpkin: do you know of any nice little tutorials for writing and/or using pseudotactics in agda? besides just "read the bit in the standard library that has one"?01/09 19:50
copumpkinaugur: nope :P it's almost completely undocumented01/09 19:55
mokusoh! I bet the only real problem I'm having is that i'm trying to claim that the abstract products _are_ my chosen products when they're not; if I just open them as if they were any other normal product i bet I can use all the non-abstract operators with them01/09 19:55
augurcopumpkin: you should document it!01/09 19:55
copumpkinaugur: your best bet might be to bug xplat for his tactic code (or poke around on hpaste for it, since it's still there)01/09 19:55
copumpkinno u01/09 19:55
auguri cant document what i dont know! D:01/09 19:55
copumpkinguess how I know ;)01/09 19:55
augurcopumpkin: youre mister smarty pants01/09 19:56
copumpkinlol01/09 19:56
copumpkinno, I sat down and figured it out01/09 19:56
copumpkinhttp://code.google.com/p/agda/issues/detail?id=444&start=10001/09 19:56
copumpkinproving false isn't critical!01/09 19:56
copumpkinaugur: anyway, I'll be more helpful later, but got an annoying bug at work with a time limit on it and need to get back to it :P01/09 19:57
augurbug in agda, or bug because its not in agda?01/09 19:57
augur:x01/09 19:57
copumpkinbug at my job ;)01/09 19:57
augurlike01/09 19:57
auguran insect?01/09 19:58
augurcopumpkin, which city are you in again? boston/nyc?01/09 20:01
copumpkinboston01/09 20:10
augurlame01/09 20:11
augurboston is pretty nice01/09 20:11
auguri bet there are lots of cafes within walking distance01/09 20:12
copumpkinyep01/09 20:17
auguri hate you :(01/09 20:17
* mokus wishes they'd open some Peet's stores in or around NYC01/09 20:18
mokusi've driven out to Boston once or twice just to go there01/09 20:18
mokusthey're by far the best coffee/tea chain in the US, in my opinion01/09 20:19
mokusand there are about 5 of them in Boston01/09 20:19
xplatdoes anybody know if there's a paper or other source presenting the version of OTT with quotients?01/09 20:28
cayleexplat: you mean other than the one blog post pigworker did awhile back?01/09 21:05
copumpkinyay, caught the bug01/09 21:14
copumpkinmucho subtle01/09 21:14
copumpkinthe fix should be simple01/09 21:14
copumpkinxplat: you see the nice proof of false?01/09 21:17
copumpkinI love it when that happens01/09 21:17
copumpkinmakes my proofs so much easier01/09 21:17
mokusI'm glad false is true, that makes my proofs a lot easier ;)01/09 21:17
* copumpkin high-fives mokus 01/09 21:17
mokuslol01/09 21:17
augurcopumpkin! i had an idea for a multitouch display :o01/09 21:19
copumpkinoh?01/09 21:19
augurhave you seen jeff hans TED talk?01/09 21:19
copumpkinnope01/09 21:19
augurwell, in it he demos a display that uses a projector that projects onto a frosted plexiglass sheet01/09 21:20
augurthe sheet has only the bottom frosted01/09 21:20
augurand it has LEDs in the edge, so that when you touch the glossy front, bright spots show up on the back where your fingers are pressing01/09 21:20
augurso you use a camera to track these dots, and shazam, multitouch01/09 21:21
augurbut it requires a projector, right01/09 21:21
augurthats a problem01/09 21:21
augurbut heres an idea:01/09 21:21
augurTOLED screen with a glass front, and behind the toled, you have a grid of photosensitive cells01/09 21:22
auguryou flicker the TOLED on and off01/09 21:22
augurand during the off cycles, your light detecting grid reads where the bright spots on01/09 21:23
augurfrom your fingers touching the screen01/09 21:23
copumpkinyay, a legit proof of false: http://code.google.com/p/agda/issues/detail?id=44401/09 21:44
augurcopumpkin: this is bad, no?01/09 21:53
augurthis is a curious thing, copumpkin01/09 21:54
augurthat you can have inconsistent logics01/09 21:55
augurand modify them in this way or that, and in doing so, get a consistent logic01/09 21:55
augurbut the consistentification doesnt require a rewrite of everything written previously01/09 21:55
augurjust some of it01/09 21:55
auguras if certain aspects of the pre-existing logic are consistency-independent01/09 21:55
xplati was thinking about that before, myself01/09 22:20
xplatand i wonder, do some of these inconsistent logics have the property that all proofs of falsum have cuts?01/09 22:21
xplatso that the cut-free fragment is actually still consistent?01/09 22:21
xplatthat would be the same as saying that none of the terms inhabiting _|_ beta-normalize01/09 22:25
xplatwhich seems like it's a common form of inconsistency in type theories01/09 22:25
mokuscopumpkin: your proof can be made even shorter: false = relevant false01/09 23:06
copumpkinoh, wonderful01/09 23:07
copumpkinyou should add to the ticket01/09 23:07
copumpkinI'd feel like I was spamming if I added anything else01/09 23:08
Eduard_Munteanucopumpkin: does this bug depend on irrelevance?01/09 23:08
copumpkinmokus: or I'll do it if it's a pain for you :P01/09 23:09
Eduard_MunteanuI wonder where things start breaking.01/09 23:09
copumpkinit's the termination checker01/09 23:09
copumpkinand its bad interaction with irrelevance01/09 23:09
mokuscopumpkin: nah, i already have a google account - just added it01/09 23:10
copumpkinsweet :)01/09 23:10
Eduard_MunteanuAh, so even if I'm not using irrelevance it could still be a problem?01/09 23:10
copumpkinEduard_Munteanu: no01/09 23:10
copumpkinor shouldn't be01/09 23:10
Eduard_MunteanuI see.01/09 23:10
copumpkinit's just that the irrelevance discards information about who's recursing01/09 23:10
copumpkinso the termination checker doesn't notice it's an infinite loop01/09 23:10
mokuscopumpkin: i missed another opportunity to make it shorter - don't need a type signature for false ;)01/09 23:24
copumpkinnice01/09 23:26
copumpkinI like how you can ask it to normalize that term01/09 23:26
copumpkinand it gives you relevant _01/09 23:26
mokusyea, i was just playing with that01/09 23:26
--- Day changed Fri Sep 02 2011
xplatso just relevant : ._|_ -> _|_; relevant (); false = relevant false?02/09 00:18
copumpkinyeah02/09 00:18
copumpkinpretty clean!02/09 00:19
xplattermination schmermination02/09 00:19
copumpkintry normalizing false!02/09 00:19
copumpkinfalse = relevant _ :)02/09 00:19
xplati guess the termination checker is actually being accurate, in a way ...02/09 00:20
xplatrelevant _ is stuck, but it doesn't spin02/09 00:21
mokusi compiled and ran 'bang : _|_ -> IO unit; bang (); main = bang false'02/09 00:57
mokusit gave me: {-# OPTIONS --universe-polymorphism #-}02/09 00:57
mokusoops02/09 00:57
mokusgoodbye: MAlonzo Runtime Error: Impossible Clause Body02/09 00:57
mokusdidn't have what i thought on the pasteboard02/09 00:57
mokusi was surprised, i expected a segfault02/09 00:58
augurcopumpkin: i have to ask you a question02/09 02:55
copumpkinI don't have to answer, but I probably will02/09 02:56
augura really really big question02/09 02:56
augurthe biggest question i will ever ask anyone02/09 02:56
copumpkin:o02/09 02:56
augurshould i buy deus ex now or wait for the price to drop02/09 02:56
copumpkinI hear it's pretty good02/09 02:56
copumpkinif you enjoy games, I say buy it now02/09 02:56
auguri wonder if its possible to simulate linear types in agda's type system02/09 02:58
auguror would that have to be built in02/09 02:58
augurcopumpkin! whats the most exotic type system you know of? :o02/09 02:58
copumpkinhmm02/09 03:02
copumpkinnot much :)02/09 03:02
copumpkinI'm definitely no expert02/09 03:02
djahandarieaugur, should be possible to 'simulate' it in the sense of building a type that only allows for linear typing02/09 03:02
dolioYou should buy the original Deus Ex and play that instead.02/09 03:06
augurdolio: i have it actually02/09 03:07
augurit just runs really slowly for some unknown reason02/09 03:07
dolioHuh.02/09 03:07
auguryeah02/09 03:09
augurits annoying02/09 03:09
joe6does agda have a testsuite similar to Test.HUnit?02/09 05:23
copumpkinno02/09 05:25
joe6copumpkin: any plans to add something like that?02/09 05:38
copumpkinjoe6: not by anyone I know02/09 05:38
copumpkintests aren't really the first thing people think of when using a proof language02/09 05:39
joe6copumpkin: yes, that's true. I was looking at agda from a general purpose language too..02/09 05:39
joe6copumpkin: yes, that's true. I was looking at agda from a general purpose language perspective..02/09 05:39
copumpkinit still is a general-purpose language :P it just gives you facilities to prove things about your code so tests feel kind of weak by comparison02/09 05:40
copumpkinyou can write lame tests in agda by just asking it to compute at compile-time02/09 05:40
copumpkintestPlus : 5 + 6 == 1102/09 05:40
copumpkintestPlus = refl02/09 05:40
copumpkinif that doesn't typecheck, you've failed your test02/09 05:41
joe6copumpkin: i am testing some C code, and I use test.hunit as a wrapper to test that code. (i am not generating that code). haskell is giving me the ambiguous type variable errors and I am thinking of agda (given the implicit variables)02/09 05:42
joe6maybe, I sholud generate the C code from agda? but, that would be a lot of work though..02/09 05:43
copumpkinif things were ambiguous in haskell, it means you're doing something wrong, not a shortcoming of haskell02/09 05:43
copumpkinagda's typeclass-like things would be no better (and probably worse) than haskell's typeclasses02/09 05:44
joe6ok, thanks.02/09 05:44
joe6source: http://codepad.org/h6g1sng7 , error: http://codepad.org/iKNKZSAa02/09 05:47
joe6it is a "Ptr a", and a can be any of the Foreign.C.Types (such as CUInt or CInt) or such that.02/09 05:47
joe6but, I will not know that until I start writing the instance.02/09 05:47
joe6or, should I make the typeclass have 2 variables, one for the type?02/09 05:47
joe6and fill it in while writing the instance?02/09 05:47
joe6but, maybe I should stick to the #haskell channel.02/09 05:48
Saizanis there a stream of primes somewhere?02/09 10:35
Eduard_Munteanu@oeis [1,3,5,7,11,13,17]02/09 11:18
lambdabot Sequence not found.02/09 11:18
Eduard_Munteanu@oeis 1,3,5,7,11,13,1702/09 11:18
lambdabot The odd prime numbers together with 1.02/09 11:18
lambdabot [1,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,...02/09 11:18
Eduard_Munteanuerm, discard 1 :)02/09 11:19
Eduard_Munteanu@oeis 2,3,5,7,11,13,1702/09 11:19
lambdabot The prime numbers.02/09 11:19
lambdabot [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,...02/09 11:19
Saizani meant implemented in agda :)02/09 11:19
Eduard_MunteanuAh.02/09 11:19
* Eduard_Munteanu should get some sleep02/09 11:20
raichooHi, whenever I try to compile a simple main = putStrLn "foo" I get: String !=< (Colist .Data.Char.Char) of type Set02/09 16:46
raichooAny ideas what's going wrong? I'm just tinkering.02/09 16:46
dolioString is not a colist of characters.02/09 16:49
dolioI'm not sure which of those "foo" is.02/09 16:50
dolioAnd which putStrLn takes.02/09 16:50
dolioHowever, you'll need a conversion of some sort.02/09 16:50
raichoodolio: I just followed the instructions in the tutorial. I'm making my first steps in Agda so I have actually no idea what you are talking about ^^02/09 16:51
dolioColist is a potentially infinite list.02/09 16:52
raichoook02/09 16:52
dolioColist Char is one of those with characters in it.02/09 16:52
raichooAnd a costring is potential infinite string?02/09 16:52
dolioI don't remember what String is defined to be, but it must be something else.02/09 16:52
dolioOh, String is just imported from Haskell.02/09 16:53
raichooYeah, but putStrLn really expects a costring02/09 16:54
raichooAh there is a toCostring02/09 16:54
dolioHow old is your standard library checkout?02/09 16:55
dolioTo me, it looks like putStrLn takes a String, and putStrLn∞ takes a Costring.02/09 16:56
dolioCostring = Colist Char02/09 16:56
raichooI downloaded 0.5 from the agda wiki02/09 16:56
dolioLooks like the same situation there.02/09 16:57
dolioSo you might want putStrLn∞02/09 16:57
dolioI'm not sure.02/09 16:57
raichoodolio: That didn't solve it but at least it's starting to push me into the right direction ^^02/09 17:04
mokusraichoo: I recently spent some time looking through that stuff too, you can check out what I came up with if you like02/09 17:12
mokushttps://github.com/mokus0/junkbox/blob/master/Agda/hello.agda02/09 17:12
mokusit may not be all that enlightening, but you can at least see some of the operators I had to look for, and use them as clues in your search02/09 17:14
raichoomokus: Yay thanks :302/09 17:21
raichooThat compiled ^^02/09 17:21
mokuscool, wasn't actually sure it would with the latest stdlib, but I was using lib 0.5 when I wrote that so I figured there'd be a good chance it'd work for you02/09 17:24
raichoomokus: Are you using agda to write real programs or just as a proof assistant?02/09 18:57
mokusas a proof assistant02/09 18:58
mokusI don't really think it's suitable for programming at this time02/09 18:58
mokusthough if someone were to put a lot of work into libraries and such, it could be a pretty nice language for general purpose programming I think02/09 18:59
raichoo^^02/09 18:59
mokusthat's just my opinion though, others here may not agree02/09 18:59
raichooI've been tinkering with omega lately but it does not have real dependent types so I decided to take a look at agda.02/09 19:00
raichoomokus: Do you know of another language with dependent types that is mature enough to write programs in?02/09 19:06
raichooI took a look at epigram2 and coq already.02/09 19:06
mokusI know of a lot of others that I haven't looked that closely at02/09 19:07
mokusI've used coq as well, though I also probably wouldn't use it for general programming02/09 19:07
mokusidris sounds appealing but I've never actually looked at it02/09 19:07
raichooYeah, heard of idris02/09 19:07
mokusI think the complexity of dependent types has yet to really be tamed to the point that a general programmer could pick it up and spend more time getting  things done than building infrastructure02/09 19:08
copumpkinidris seems the most suited to plain old programming02/09 19:08
mokusthere's just too many ways to do any given task02/09 19:08
mokusand no agreement yet about the best way02/09 19:08
raichooIt's still an exciting topic.02/09 19:10
mokusdefinitely02/09 19:10
mokusand I think in time it'll become more tractable too02/09 19:11
dolioThere's cayenne from back in the day, too.02/09 19:15
dolioAlthough I don't know how good the compiler was for building stuff to run.02/09 19:16
mokusthere's also ur/web if you're into web programming, though i don't know much about it other than that I hear it's dependently typed02/09 19:17
augurur/web is dependently typed?02/09 19:59
augurdependent javascript!02/09 19:59
copumpkinnot really02/09 20:26
augurcopumpkin: lets make a dependent JS02/09 20:55
augur:D02/09 20:55
mokuswhere the types themselves are JS expressions?02/09 21:17
mokusthat could lead to some pretty spectacular weirdness, I think02/09 21:17
raichoodependent PHP… the horror the horror O_O02/09 21:51
--- Day changed Sat Sep 03 2011
skidolio : nah, just that the obvious (arguably sensible) interpretation doesn't work03/09 00:14
dolioI don't know why it's sensible.03/09 00:14
dolioIt's not even defined as an actual equation in most type theories.03/09 00:14
dolioMerely an isomorphism.03/09 00:15
joe6how hard would it be to do this in agda. I am getting a type error with ghci/haskell.03/09 01:28
joe6error: http://codepad.org/Ow4qMfmv, U1IR.hs (template haskell used file): http://codepad.org/dEFIZmhJ, CType.hs (template haskell defined file): http://codepad.org/nMpiA3Ze03/09 01:28
joe6it appears that reify does not work with associated type synonym definitions.03/09 01:28
joe6I want Haskell's associated type but to read the type from a function return type03/09 01:29
joe6any thoughts, please?03/09 01:29
joe6this is the associated type class: http://codepad.org/o12EL0Nh03/09 01:30
joe6i am using Template Haskell because there is no way I could read the type of p'U1IR into the type of the associated type03/09 01:31
joe6is there some mechanism to do this in agda?03/09 01:31
joe6i guess in agda the value level and the type level can intermix? can I read a function type into a type definition?03/09 01:32
Eduard_Munteanujoe6: read how? Through FFI? Nah.03/09 02:31
Eduard_MunteanuFFI stuff stays opaque during typechecking so even if you can write such a type, you won't be able to depend on the exact value you get.03/09 02:32
Eduard_MunteanuThere's some reflection thingy in Agda but it might not work at the moment. Not sure if that helps either.03/09 02:34
joe6Eduard_Munteanu: ok, thanks.03/09 02:44
glguyWhen I read about Intuitionists or "Ultra-finitists" how can I think about that label as it applies to that person? Is it in like calling someone a Haskell Programmer? Protestant? Outfielder? What I'm trying to understand is how much does it describe the person and how much a role at a particular point?03/09 05:56
copumpkinI'm a nazi03/09 05:57
augurlol03/09 06:01
augurintuitionism is not the same as ultrafinitism03/09 06:01
glguyOf course03/09 06:02
augurintuitionism is just not using excluded middle03/09 06:02
glguyI'm talking about a category of labels03/09 06:02
augurie, some things are true, some are false, and some go into infinite loops03/09 06:02
augurthats intuitionism in a nutshell03/09 06:03
glguyI'm asking about the label for the person, not the logic03/09 06:03
augurultrafinitists, on the other hand, deny the existence of things you havent constructed03/09 06:03
glguyI understand the distinction03/09 06:03
augurwell what does that mean then :|03/09 06:03
glguyThe word "intuitionist", not "intuitionistic logic"03/09 06:04
augurwhat about it tho03/09 06:04
glguyAre there people who *are* intuitionists03/09 06:05
glguyor is it more of a position you take for a given argument or statement?03/09 06:06
augurofcourse there are intuitionists03/09 06:06
copumpkinI'm occasionally an intuitionist03/09 06:07
augurim intuitionistically occasional03/09 06:07
glguyDo you see the distinction I'm looking for? Someone can be a "haskell programmer" at the moment, it doesn't describe their world view03/09 06:07
copumpkinI guess I have different standards for proof depending on what the statement is03/09 06:07
augurglguy: some people are intuitionists and think that non-intuitionistic logic is bs03/09 06:08
kmcit does sometimes describe their world view03/09 06:09
auguri would say im preferentially intuitionistic in that im not sure i think classical logic is bs, but i'd certainly prefer constructions03/09 06:09
Eduard_MunteanuFunny how intuitionism sometimes defies intuition, I mean look at Not (Not a) -> a. :)03/09 06:25
Eduard_MunteanuTho' I guess that's a small WTF in comparison with Banach-Tarski.03/09 06:28
Eduard_Munteanus/with/to/03/09 06:28
copumpkinI think a bigger wtf03/09 06:29
copumpkinis A -> A x A03/09 06:29
copumpkinhow the fuck did you just make two things out of one03/09 06:29
copumpkinthat shit is fucked03/09 06:30
copumpkinI'm a linearist03/09 06:30
kmcyeah, if you dig too deep into intuitions you'll find everyone has their own ;)03/09 06:30
copumpkinor any other substructural logic that prevents you from using shit twice03/09 06:30
kmcto me rejecting LEM is intuitive, if you understand proofs to be concrete evidence03/09 06:30
glguycopumpkin: Are Clean's uniqueness types the closest thing to linear logic in programming?03/09 06:38
copumpkinATS supposedly has them too, but then you'd have to use ATS03/09 06:38
copumpkinso probably, yeah03/09 06:38
copumpkinapparently (before my time) GHC used to have linearish types as an extension, too03/09 06:38
Eduard_MunteanuOh, kmc is here too.03/09 06:38
copumpkinkmc is omnipresent03/09 06:38
copumpkinhttp://www.haskell.org/ghc/docs/6.4/html/users_guide/type-extensions.html03/09 06:39
copumpkinlinear implicit parameters03/09 06:39
copumpkinsadly gone now03/09 06:39
copumpkinseem like they'd be fun to play with03/09 06:39
Saizanis (∃ \(x : ₂ℕ) → x ∈ ℕ∞) supposed to be isomorphic to "CoNaturals" ? http://www.cs.bham.ac.uk/~mhe/papers/omniscient/GenericConvergentSequence.html#18603/09 10:56
Saizanyeah, you just have to take the first natural for which x returns 0, or infinity otherwise03/09 11:08
xplatintuitionist describing a person generally refers to their worldview, except if they are a fulltime logician, then they might just be concentrating on intuitionist logics because they find them interesting03/09 14:52
xplatbut even then nobody would probably say 'intuitionist' if they were trying to be precise03/09 14:53
xplatand 'ultrafinitist' is pretty much worldview period.03/09 14:53
xplati don't think the ultrafinitists have ever come up with an expression of their views that much of anyone finds mathematically, as opposed to philosophically, interesting03/09 14:54
Boxohttp://www.scottaaronson.com/blog/?p=10303/09 15:08
dolio2^100 is way too small a number to not exist.03/09 16:23
dolioSo is 2^1000.03/09 16:23
Saizanwhere do you draw the line?:)03/09 16:24
dolioIf I were going to draw it, it'd be way higher than two machine words.03/09 16:25
dolioEr, wait.03/09 16:25
dolioI guess 1000 is around 16 machine words.03/09 16:26
dolioWhich is still way too small.03/09 16:26
Saizanthen you can gain some order of magnitudes by storing programs rather than normal forms03/09 16:29
Saizan*orders of magnitude03/09 16:30
Saizannot even philosophers care about "platonic existence" though03/09 16:31
dolioSome do.03/09 16:32
dolioThere was a post on the n-category cafe not long ago trying to 'save' Platonism in set theory, or something, by proposing the idea that every model (of every axiom system) of set theory Platonically exists, or something.03/09 16:33
dolioEr, it was on some guy's paper on the topic or something.03/09 16:34
dolioAnyhow, that was supposed to be better than trying to commit to one.03/09 16:35
Saizani guess it depends on where you draw the line on "philosopher"03/09 16:36
dolioThat concern certainly seems to fall into the philosophy camp to me. I can't imagine someone having a mathematical interest in whether there really are sets floating 'out there'.03/09 16:41
dolioI don't see how it could have an impact on your theorems.03/09 16:41
mokusi could imagine someone arguing that a number doesn't exist unless there are actually that many of some physical thing, so that things like a base-10 representation of the number are only "schemes" by which one can attempt to identify a number which may or may not actually exist03/09 16:44
mokusin such a world view, 2^100 might be 'big' enough to question its existence03/09 16:45
dolioNo, even then it isn't big enough.03/09 16:45
Saizantrue, but the strong connection between mathematical constructs and general onthology that was there in the past seems to be gone from philosophical discourse, so you've to be much more of a mathematicians to bring them together at this point in time03/09 16:45
mokuswhy not? just because someone says there are that many atoms in the universe doesn't mean a person believes it03/09 16:45
dolioBecause there are around that many atoms in your body.03/09 16:46
mokuswell, 2^1000 then03/09 16:47
mokusbut even at 2^100, such a person might say "you've only claimed that the body has that many atoms, not proved it"03/09 16:49
mokusand by way of proof, they may want you to sit and count them03/09 16:49
dolioThen that person can go to hell.03/09 16:49
Saizanthey have bigger problems than the existence of numbers then03/09 16:49
dolioI've never counted to 1,000,000.03/09 16:49
mokusi really don't know if that's what this guy believes, but it seems like it about has to be03/09 16:50
dolioSo it doesn't exist.03/09 16:50
mokusi tried once... don't remember how far i got ;)03/09 16:50
mokusi think i quit around 150k03/09 16:50
dolioLet's see you count all the people in New York city before I believe there are more than a million.03/09 16:50
copumpkin3 doesn't exist03/09 16:51
Saizancopumpkin: NO U03/09 16:51
mokusi'm not saying it's a sane way to think, but if a serious mathematician is claiming that 2^100 doesn't exist they must have _some_ underlying logic to it, no matter how bizarre03/09 16:51
copumpkinit's called a brain tumor03/09 16:52
copumpkinI mean, um03/09 16:53
dolioAnyhow, that line of thinking has the same defect as Platonism, to me.03/09 16:53
dolioThey're committed to the idea that everything in mathematics must have some actual realization 'out there.'03/09 16:53
mokusyea, and ultimately it doesn't diminish the fact that logic works independently of the existence of the things it's manipulating03/09 16:53
dolioThe Platonist just says, "since we have the axioms, the sets must really exist."03/09 16:54
mokusit really don't matter at all whether pi exists03/09 16:54
mokusor what you say the word "exist" means, which is really what it's about IMO03/09 16:54
mokusif you don't like me saying 2^100 "exists" you can just make up a word for what I call "exists" and do a mental translation whenever you'r etalking to me03/09 16:55
mokusand write off all my proofs as irrelevant because i'm not talking about things that "exist"03/09 16:55
dolioYeah. Like, "I used 2^100 in a calculation yesterday and it worked."03/09 16:55
mokusyup03/09 16:56
mokussame thing with sqrt(-1)03/09 16:56
copumpkin> let exists n = length (replicate n ()) `seq` True in exists 1003/09 16:56
lambdabot  True03/09 16:56
copumpkin> let exists n = length (replicate n ()) `seq` True in exists 100003/09 16:56
lambdabot  True03/09 16:56
mokuswho cares if it's a number or not?  calculations using it work03/09 16:56
dolioIf you refuse to use, say, 2^1000, you're probably going to have trouble explaining how RSA cryptography works.03/09 16:58
dolioAt the levels people use it at today.03/09 16:58
dolioThe key space is larger than that.03/09 16:58
mokusyea, it seems like a pretty useless world view03/09 16:58
mokusyou pretty much have to consider everything a computer does to be magic03/09 16:58
mokusbut then there are probably also serious nihilists and solipsists out there too03/09 16:59
mokusi think absurdity is mostly unrelated to believability, when it comes to real people's views03/09 17:01
mokusor i guess i should weaken that and say usefulness... absurdity is more of a relative concept in that context probably03/09 17:02
mokusnobody would consider their own views absurd, but they might be willing to concede they aren't useful, but still believe them anyway03/09 17:03
mokusdolio: I wonder whether someone claiming 2^1000 doesn't exist would necessarily decline to use it - they may use it just like you or I would, but think of it as something other than a number.  A logical sentence devoid of numerical meaning, perhaps.03/09 17:05
Saizanat some level you believe by doing things that have a meaning only if that belief holds03/09 17:05
doliomokus: That just sounds like wanking about the definition of "number".03/09 17:13
mokusyes, it does03/09 17:13
mokusthat's what i mean when i was talking about arguing over definitions of "exists" above too03/09 17:13
mokusi think most philosophical differences come down to namespace collisions03/09 17:14
dolioHeh.03/09 17:14
dolioCan't say those thrill me.03/09 17:14
mokusme either, but keeping that in the back of my mind helps me keep calm more often than I probably would otherwise ;)03/09 17:14
dolioAnyhow, for instance, I recall hearing a story about this group of people working on a digital circuit....03/09 17:14
dolioThey were working using some discrete model of how the circuit actually worked.03/09 17:15
dolioThen Feynmann came in and used some model using calculus and the real numbers, which wasn't really how the circuit worked.03/09 17:15
dolioAnd his solution to whatever problem they were working on was better, and actually worked with the circuit.03/09 17:16
dolioBetter than was possible to get with the accurate, discrete model, or something.03/09 17:16
Saizanheh, that story can be used against contructivism, unless we show the model could work with just computable reals03/09 17:17
mokusyea, it's amazing how often a kludge can get the job done better than a perfect solution, in any domain03/09 17:17
dolioI think you can do calculus with computable reals.03/09 17:18
dolioSome, anyway.03/09 17:18
mokusi suspect a lot more than people think03/09 17:19
dolioYes.03/09 17:20
mokusabstract stone duality seems like a promising foundation to rebuild an awful lot of existing theory on03/09 17:20
dolioA lot of classical vs. constructive differences seem, to me, to end up being on the wrong side of the 'I can use this' gap, too.03/09 17:21
dolioLike, "2^100 doesn't exist" "But I just used it and it worked."03/09 17:21
mokusyea, i think constructive logic is in a really sweet spot in that regard03/09 17:22
mokuseven classical logic is usable as a modality within it03/09 17:22
mokusso you don't have to "give up" classical logic, really03/09 17:22
mokusjustlike in Haskell you don't "give up" IO to gain purity03/09 17:22
dolioWhereas with classical you often get, "in classical mathematics, all Foos have this useful property Bar." "But, your proof of that doesn't show how to calculate or determine the Bar for any particular Foo, so how useful is it that they all 'have' that property?"03/09 17:23
dolioI mean, it's useful if you want a fuzzy feeling that all Foos are nice.03/09 17:24
mokusor a fuzzy feeling that one sphere is isomorphic to two spheres ;)03/09 17:24
mokusnot sure why anyone actually wants that though03/09 17:25
Saizanin some cases it might work as a bound on a search algorithm03/09 17:25
mokusmaybe03/09 17:25
Saizanthouhg i guess complexity considerations are going to get in the way03/09 17:25
mokusyea, if you're searching over the classical set of points in a sphere, you're gonna have a hard time making your algorithm practical03/09 17:26
mokusand if you're searching over neighborhoods then that isomorphism doesn't apply03/09 17:27
Saizani was talking about "all Foo have this udeful property Bar" in general, not Banach-Tarski :)03/09 17:28
mokusoh, sorry ;)03/09 17:28
dolioAs I understand it, in constructive mathematics, that situation often leads to one where you can prove a similar theorem that takes a little more structure on the inputs.03/09 17:29
dolioAnd then all the things you actually care about have that extra structure.03/09 17:29
mokusseems like if you're limiting search spaces, you can probably use the same properties, because you're aiming to prove something that's already a negation, and "not not not P x" is as good as "not P x" in most logics03/09 17:30
dolioAll shiny foos are constructively bar, and all the foos we've come up with are shiny.03/09 17:30
dolioOf course, there's also work on what you can add to constructive systems to leave them still constructive, but prove more nice things.03/09 17:31
mokusalthough it would be a bit more useful if you could also prove "all foos are shiny", as that removes the proof obligation of shininess whenever you discover a new foo03/09 17:32
dolioSearch principles.03/09 17:32
dolioStuff like that.03/09 17:32
mokusbut i imagine the idea of such a translation is that you're confining all the classical assumptions to shininess, so 'shiny' will generally be a simpler property but still not constructively provable03/09 17:33
mokus(when quantified over all foos that is)03/09 17:33
dolioWell, you can't prove that all foos are shiny, of course.03/09 17:34
Saizani guess Foo = decision procedure; shiny = works on conats too; in escardo's last message to the mailing list03/09 17:37
dolioI imagine it's usually when you'd use, say, the axiom of choice to go, "give me a function for this purpose by magic," you instead have to provide an appropriate function.03/09 17:37
dolioBut there's a sensible constructive definition of such a function for any particular foo you care about.03/09 17:38
dolioSaizan: Yeah, I didn't look into that too much. Was he using conat? Or something else?03/09 17:38
dolioConat isn't exactly the natural numbers extended with a point at infinity, because you lose induction.03/09 17:39
dolioBut then, I don't know what "extended" means exactly.03/09 17:40
Saizan it's using "convergent sequences" which are isomorphic to conat03/09 17:40
Saizan(i guess they are more closely related to predicates characterizing open sets of conat)03/09 17:42
Eduard_MunteanuDamn, how do I indent nested ... | in with-patterns?03/09 18:08
Eduard_MunteanuIt seems it will only take them starting at the first column03/09 18:08
Eduard_MunteanuBut it's ugly :)03/09 18:08
Eduard_MunteanuAh, I have to indent just the '|'03/09 18:10
Eduard_MunteanuDoes Peirce's law follow from LEM? I'm trying to prove the former.03/09 18:34
Saizanyes03/09 18:35
glguyis how I did the classical laws (LEM, Peirce, Double Negation Elim) http://www.galois.com/~emertens/Classical.html03/09 18:35
glguy(I guess they aren't all "laws")03/09 18:36
Eduard_MunteanuAh, my approach seems a bit different... http://paste.pocoo.org/show/469603/03/09 18:37
glguyI see03/09 18:37
glguyI remember that there is a hierarchy to those three propositions but I don't remember what it was :)03/09 18:38
glguyIf you can prove double negation elimination from LEM03/09 18:38
glguythen you can use that to use my Peirce proof03/09 18:39
Eduard_MunteanuYeah, I have DNE from LEM.03/09 18:39
glguySo you could copy what I wrote and then say: dne₂ PeircesLaw03/09 18:39
Eduard_MunteanuI see.03/09 18:41
copumpkinxplat: you know if I can pattern match in a term I generate through reflection?03/09 18:41
copumpkinor glguy ?03/09 18:41
glguyI suspect you'd rather do it on your own, but this at least shows that you can :)03/09 18:41
Eduard_MunteanuThat classical embedding is nice, it also isolates the classical parts from the others, no?03/09 18:41
glguyEduard_Menteanu: yeah, I like to think of it like Haskell's IO03/09 18:41
glguykeep your constructive parts pure and only push what you have to into "Classical"03/09 18:41
Eduard_MunteanuYeah, this seems nice.03/09 18:43
glguyand then dne₂ becomes "unsafePerformIO" :)03/09 18:43
Eduard_MunteanuHeh, indeed.03/09 18:44
Eduard_MunteanuStill, I'm a bit puzzled this doesn't need any postulate.03/09 18:45
glguyYou can import Relation.Nullary.Negation to get its RawMonad implementation for Classical03/09 18:45
Eduard_MunteanuIs there a limitation to decidable predicates?03/09 18:45
glguyEduard_Munteanu: my file doesn't prove ((P → Q) → P) → P, It proves ¬ ¬ (((P → Q) → P) → P)03/09 18:45
glguyEduard_Munteanu: I don't understand your question about limitations03/09 18:46
Eduard_MunteanuExcludedMiddle : ∀ {A} → Classical (Decidable A)03/09 18:47
Eduard_MunteanuI wonder if this could work for any A : Set \ell instead of a decidable A03/09 18:48
glguy(A : Set) -> Classical A ?03/09 18:48
Eduard_MunteanuYeah, for instance.03/09 18:48
glguyWell, what happens if A were chosen to be ⊥03/09 18:50
Eduard_MunteanuI handle that with a match like   with lem P ... | inj₂ f with p f ... | ()03/09 18:51
Eduard_MunteanuI'm not sure something like that works in that case though.03/09 18:52
SaizanExcludedMiddle isn't requiring A to be decidable, it's showing that classically every A is decidable03/09 18:52
glguyTry to write a proof of [Classical ⊥],    [(⊥ → ⊥) → ⊥]03/09 18:52
Eduard_MunteanuAh, hrm... (⊥ → ⊥) is inhabited so that won't do.03/09 18:53
Eduard_MunteanuI find it a bit non-obvious how proving ¬ ¬ (a ∨ ¬a) is doable without a postulate :)03/09 18:54
glguybad : ((A : Set) → Classical A) → ⊥03/09 18:54
glguybad f = f ⊥ (λ ())03/09 18:54
Eduard_Munteanusince that's just dne1 + lem03/09 18:55
glguyEduard_Munteanu: In English it works like this: First you say that there is no "A" because if there was one you'd give it to me and I'd tell you that there was one :)03/09 18:55
glguyExcludedMiddle f = f (no (λ a → f (yes a)))03/09 18:56
Eduard_MunteanuAh, I see.03/09 18:58
Saizanit's more like "i'd go back in time and tell you .."03/09 18:58
glguyI love the structure of that implementation03/09 18:59
Eduard_MunteanuI wonder if such an approach can be generalized to eliminate other postulates as well.03/09 18:59
copumpkinanyone have any idea how I can get the names of existing types in reflection?03/09 19:00
glguyYou can \=?-Name (quote SomethingElse)03/09 19:00
copumpkinoh I see03/09 19:00
copumpkinthanks03/09 19:00
copumpkinno pattern matches though :/03/09 19:01
glguyI discovered "quote" though experimentation03/09 19:01
copumpkinI'd hate to see the ADT representing pattern matches though03/09 19:01
glguy"Ugh, I need a way to quote names, like [quote]03/09 19:01
copumpkinlol03/09 19:01
* Eduard_Munteanu guesses the monad is T = Classical, return = dne\_1, join = T dne\_203/09 19:05
Eduard_MunteanuAs for the adjoints, maybe F = U = ¬, F -| U for some functorial interpretation of ¬ ?03/09 19:08
copumpkinwhat's up with the weird coloring on this function? http://snapplr.com/jk7p03/09 19:20
glguyis getArg a record accessor somewhere?03/09 19:20
copumpkinit should be, but Arg is a data type, not a record03/09 19:21
doliocopumpkin: When did you last compile?03/09 19:32
dolioThey made a bunch of changes about 'projector-like functions.'03/09 19:33
copumpkinI just pulled half an hour ago03/09 19:34
dolioWell, that might explain it.03/09 19:34
copumpkinI guess they're recognizing it as a projector-like function03/09 19:34
copumpkininteresting03/09 19:34
dolioYou were able to build half an hour ago?03/09 19:34
copumpkinyeah03/09 19:35
dolioI can't get alex 2.3.5 to build.03/09 19:35
dolioAnd the latest one that does build it too new for Agda, I guess.03/09 19:35
copumpkinhmm03/09 19:36
copumpkinnot sure, I didn't do anything crazy03/09 19:36
dolioWas your alex built prior to 7.2?03/09 19:39
copumpkinprobably03/09 19:39
dolioYeah....03/09 19:39
dolioIt probably doesn't even matter, because I don't think there have been any agda-mode changes.03/09 19:40
copumpkinyeah03/09 19:41
copumpkingah, so I guess I still can't write "deriving Eq" for simple types with reflection03/09 19:41
augurcopumpkin: itd be nice if there was a language that had a conveniently extensible type system03/09 20:00
augurnot a serious language to do serious stuff in, just one to toy around with various ideas in03/09 20:00
glguydolio: is the idea to recognize projector-like functions so that you can see that the result got smaller?03/09 20:18
glguyand use that in termination checking?03/09 20:19
glguyoh, he left :)03/09 20:20
augurglguy: what timing!03/09 20:44
copumpkinthe def constructor in Term is kind of a weird way to do application03/09 23:34
copumpkinwhoops, got agda into a loop by unquoting fix03/09 23:38
copumpkinit seems like unquote could have a type03/09 23:43
copumpkinif they had a function that interpreted types into agda types03/09 23:43
--- Day changed Sun Sep 04 2011
joe6if I use agda, would I still need the type constructor F04/09 01:32
joe6haskell source : http://codepad.org/Sm3glEFq04/09 01:32
joe6in agda equivalent of type classes, can I inherit characterstics?04/09 01:32
Eduard_Munteanujoe6: do you mean stuff like   class (Foo a) => Bar a?04/09 01:57
joe6has anyone tried curry?04/09 04:12
joe6uri: http://www-ps.informatik.uni-kiel.de/currywiki/documentation/tutorial04/09 04:12
joe6any thoughts/experiences?04/09 04:12
augurive tried it04/09 04:23
joe6did you like it? it seems interesting.04/09 04:24
auguri prefer vindaloo tho04/09 04:24
joe6are you kidding?04/09 04:24
auguryou need papadums tho crucially04/09 04:25
auguror puri04/09 04:25
auguroh god puri04/09 04:25
copumpkinkulcha ftw04/09 04:27
augurpuri > kulcha04/09 04:28
augursorry04/09 04:28
joe6how about epigram2? any thoughts?04/09 04:29
copumpkinoh puris04/09 04:29
augurjoe6: ask pigworker!04/09 04:30
joe6i am getting back to agda after a long break. Any good tutorials to get me back into the groove.04/09 04:37
Eduard_MunteanuI'd suggest finding something to prove/code in Agda first.04/09 04:39
Eduard_MunteanuThen you can look around the stdlib.04/09 04:39
joe6ok, thanks. will do.04/09 04:39
joe6just found this article:04/09 04:42
joe6uri: http://people.cs.kuleuven.be/~dominique.devriese/agda-non-canonical-implicits/04/09 04:42
Eduard_Munteanujoe6: that looks a lot like the release notes I pointed you to04/09 04:49
glguyjoe6: Did you figure out that Agda doesn't have typeclasses? There is a feature called "instance arguments" in the development branch, but it isn't released yet and is a bit different04/09 04:49
joe6the non-canonical-implicits seem to be a lot powerful than the haskell typeclasses.04/09 04:49
joe6Eduard_Munteanu: yes, thanks.04/09 04:49
joe6glguy, it has not been released yet?04/09 04:49
copumpkinthey're different04/09 04:49
copumpkinagda is a lot weaker at finding valid "instances" than haskell is04/09 04:49
copumpkinit also allows you to pass custom instances that haskell does not do04/09 04:50
joe6oh, ok.04/09 04:50
Eduard_MunteanuYou can't even write a recursive show AFAIK04/09 04:50
copumpkinit's closer to scala in that regard, but at least agda lets you require specific instances04/09 04:50
copumpkinsince it has value unification04/09 04:50
glguyYou can write one, but it doesn't recursively search for you.04/09 04:50
joe6copumpkin: what is a custom instance?04/09 04:50
copumpkinyou need to bring the special instantiation into scope if you want it04/09 04:50
copumpkinso if you have Show a => Show [a]04/09 04:50
copumpkinyou need to apply that to your existing show instance04/09 04:51
copumpkinto get the one for lists04/09 04:51
copumpkin(explicitly)04/09 04:51
copumpkinjoe6: say you have two orderings on naturals04/09 04:51
copumpkinin haskell you couldn't write two instances04/09 04:51
glguyshowyThing = showLists showChars04/09 04:51
copumpkinyou'd wrap one or both of them in a newtype to write custom instances04/09 04:51
joe6will something like this in haskell be better(easier/simpler/smaller) in agda? http://codepad.org/JEdSikMn04/09 04:52
joe6copumpkin: yes, that is what I find. You need a newtype in haskell.04/09 04:53
copumpkinit wouldn't be all that different04/09 04:53
joe6oh, ok.04/09 04:53
glguyIt probably makes sense in your local context, but that Gettable class looks like a mess at first glance /:-)04/09 04:54
joe6glguy, I am just playing around with it.04/09 04:55
joe6i wanted to figure out if I could create a super-type-class that can define an instance for a smaller type-class automatically?04/09 04:56
glguyYou should finish it off and parameterize it on the monad instead of only supporting IO :-P04/09 04:56
joe6I wish I could do the instance (Flags a) => Gettable (F a) where04/09 04:56
joe6without the need for the newtype04/09 04:56
copumpkinthat you can do in agda04/09 04:57
copumpkinbut agda doesn't have a C FFI, so you'd have to use Haskell's04/09 04:57
joe6i got the idea from copumpkin. Thanks to you,  i learned associated types.04/09 04:57
copumpkinand Haskell's would probably want you to use typeclasses04/09 04:57
joe6in haskell, I meant.04/09 04:57
copumpkinthat agda can't FFI to as far as I know04/09 04:57
copumpkin:)04/09 04:57
glguycopumpkin: what about that Agda FFI web browser thingy from months ago?04/09 04:57
glguyHow did it do the FFI that actually did anything? via Haskell?04/09 04:58
copumpkinnot sure04/09 04:58
joe6copumpkin: is there any way you can think of (using different mechanisms/gadt/or any such) that "instance (Flags a) => Gettable (F a) where" can be made to work without the need for a newtype?04/09 04:58
joe6not for now, sometime in the future04/09 04:58
copumpkinyou can write it, but you shouldn't write it04/09 04:59
copumpkinyou just need undecidable and overlapping instances, iirc04/09 04:59
joe6any future stuff, in agda, that can make it possible?04/09 04:59
joe6oh, really, I can.04/09 04:59
glguyjoe6: What is your actual goal?04/09 04:59
copumpkinas I said, an instance like that is already possible in agda, but since agda won't go looking for instances like that automatically, you don't get the benefits04/09 04:59
glguyI don't understand your question so it is making it hard to contribute04/09 04:59
joe6glguy, I have a class Gettable and then I have another class Flag. All the types in Flag have a certain implementation of Gettable.04/09 05:00
joe6I do not have to define a Gettable instance for every type in Flag, as they all have a similar interface.04/09 05:01
joe6I was wondering if there was a way to define the Gettable instances for all types that are part of the Flag class, without having to list each Gettable instance for each Flag type.04/09 05:02
joe6glguy, does that make sense?04/09 05:02
glguyyeah. Like copumpkin said you do it with overlapping and undecidable instances. (That's a bit error prone but it does what you are asking for)04/09 05:02
glguyThere is nothing to stop someone from adding another instance for something that also has a Flags instance04/09 05:03
glguyand with different imports in different modules you can get funky behavior04/09 05:03
glguyThe safe way to do it is to define functions as the default implementation for the instance04/09 05:03
glguyhttp://hackage.haskell.org/packages/archive/base/ 05:03
glguyis an example of this04/09 05:04
glguyso you still have to add all the instances but you don't have to reimplement the logic every time04/09 05:04
joe6makes sense. Thanks04/09 05:05
xplatcopumpkin: you could at least reduce Eq to using eliminators instead, and you could even generate the correct type signature for the eliminator, which is the most complicated part of writing it usually04/09 05:21
copumpkintrue04/09 05:21
copumpkinit'd be nice to autodefine eliminators in general, too04/09 05:22
copumpkinthen we can have coq04/09 05:22
xplatcopumpkin: reflection has unquote now?04/09 05:22
copumpkinyeah04/09 05:22
copumpkinit's very finicky though04/09 05:22
copumpkinyou can't give it anything that contains a hole04/09 05:22
copumpkinanywhere in its normalized form04/09 05:23
xplatit makes a lot of things easier, though, i bet04/09 05:27
xplati mean, i can think of things that can't be done without it without kludges04/09 05:28
xplatwell, kludges or a much more extensive set of apis04/09 05:28
xplatone of the drives in my raid array seems about to fail, guess what i'm doing tomorrow ...04/09 05:29
copumpkin:/04/09 05:46
Eduard_Munteanucopumpkin: btw, does reflection work now?04/09 05:49
copumpkinit doesn't have the Nat bug it had before04/09 05:50
Eduard_MunteanuI was under the impression it was totally broken at some point.04/09 05:50
copumpkinI don't think so04/09 06:09
copumpkinunless you wanted naturals in it04/09 06:09
Eduard_MunteanuHrm, I remember something about the ring solver not using it.04/09 06:13
copumpkinthat's because it's a pain to make it use it04/09 06:14
copumpkinxplat wrote a wrapper around it so that you could use reflection for it04/09 06:14
copumpkinbut ran into the nat bug I mentioned04/09 06:14
Eduard_MunteanuAh, that explains it.04/09 06:14
copumpkinso he could only solve expressions that reduced to things that don't involve nats04/09 06:14
glguyI mentioned knowing how to work around it04/09 06:28
glguyand my binding worked with them04/09 06:28
glguyerr04/09 06:28
glguyxplat mentioned*04/09 06:28
glguyI'm sure it gets better with practice and understanding, but using reflection felt like a big hack to me04/09 06:31
copumpkinit does :P04/09 06:32
glguy In order to limit derivations to intuitionistic ones, the additional constraint that every succedent may have not more one formula is added. -- http://mathworld.wolfram.com/SequentCalculus.html04/09 06:46
glguyWhat does this sentence mean?04/09 06:46
glguyoh "more than one"04/09 06:47
glguyxs |- x04/09 06:47
qasnhello04/09 15:40
qasni'd like to use a proof assistant in order to write proofs about basic set theory04/09 15:40
qasnis it possible/easy to do that with agda?04/09 15:40
qasnby "basic set theory" i mean things such as "inclusion is transitive" or "intersection is commutative"04/09 15:43
Saizanif you are ok with using Agda's (maybe decidable) predicates as sets then those should be simple04/09 15:45
qasni wrote a few theorems with coq, but it seems to be too much complex for me04/09 15:45
qasni'm used to first order logic and natural deduction04/09 15:46
wieczykI am newbie in type theory, but I think problems can occur when you will encode sets as predicates (sometype -> Set) and try to encode infinite sums.04/09 15:47
Saizancoming from natural deduction you might have a lot to learn04/09 15:47
Saizanwieczyk: it sounds like Data.Product.\Sigma should work for that04/09 15:48
qasnsorry but i don't understand why natural deduction is wrong04/09 15:50
Saizani'm not saying it's wrong, just that it's quite different from how stuff looks in agda04/09 15:50
qasnok04/09 15:50
Saizan(even if they are sort of isomorphic)04/09 15:51
qasnmy main problem is i can't find a proof checker that is easy to use for me04/09 15:52
qasnit seems people use them for entirely different goals than me04/09 15:53
qasnor different backgrounds04/09 15:53
wieczykSaizan: if I understand whole stuff correctly, (\Sigma A B) is in higher universe than A and B. I think it could do some complications. Hm, I will do some tests today.04/09 15:53
Saizan(A : Set) (B : A -> Set) |- Sigma A B : Set04/09 15:54
wieczykOk.04/09 15:54
qasnbesides coq i also looked at isabelle04/09 15:55
qasnbut its manual is way too complex04/09 15:55
Saizanqasn: i guess you've to be comfortable with how proofs look like in type theory to use Agda or Coq, Coq also adds another layer of "tactics" on top of it though04/09 15:56
qasni don't know type theory. i guess this is the problem04/09 15:57
Saizanmost agda tutorials will teach you type theory as you go, though04/09 15:58
qasndo you know any good tutorial?04/09 16:00
Saizanhttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Documentation <- see "Introductions to Agda" here04/09 16:02
qasnok thank you04/09 16:02
qasnbye04/09 16:09
xplati wonder if i should build a darcs agda today or if it will be totally broken04/09 22:29
dolioWhat version of ghc?04/09 22:32
xplat7.0.304/09 22:33
dolioOh. It will probably compile, at least.04/09 22:33
xplati'm not completely sure how encouraging that is04/09 22:34
dolioMore encouraging than it not compiling?04/09 22:34
xplatmore encouraging than 'it probably won't compile'04/09 22:34
xplatbut really you were just reaffirming my initial assumption04/09 22:35
xplati.e. 'probably compiles, but who knows how many interesting ways there will be to prove false?'04/09 22:36
dolioI haven't been able to use Agda in months, so I can't tell you how broken or not it is once it compiles.04/09 22:36
xplatstill haven't gotten that fixed?  :(04/09 22:36
dolioOh, well, proofs of false are nothing new, really.04/09 22:36
xplatwell, or make the typechecker loop, or the emacs mode rewrite things into gibberish04/09 22:37
dolioYeah, I was going to post to the mailing list, but then I decided I should try the latest first, but then I discovered I couldn't compile it on 7.2.04/09 22:37
bxc-paellap04/09 22:37
xplatwhat i'd suggest is rip every mention of agda out of your emacs directories and reinstall agda-mode from scratch, and do the same with haskell too if it doesn't work04/09 22:38
dolioIt's been broken from scratch on this machine.04/09 22:39
xplat!04/09 22:39
dolioFresh emacs file with agda-mode install run on it.04/09 22:39
xplatno wonder you haven't fixed it :(04/09 22:39
xplatwhat does it actually do?04/09 22:39
dolioIt locks up emacs as soon as I open anything with a .agda extension.04/09 22:40
dolioIncluding if I just do something like 'emacs Foo.agda' where the file doesn't exist.04/09 22:41
Saizandarcs Agda built fine here with ghc-7.2.104/09 22:43
dolioI went back home recently and noticed that I have an older version of emacs at home.04/09 22:43
dolioDid you have alex built already from a previous version?04/09 22:43
Saizanprobably04/09 22:43
dolioOkay.04/09 22:43
dolioAgda complains about alex 3.x, and 2.x doesn't build on 7.2.1 anymore due to misused bang patterns or something.04/09 22:44
Saizanah, true, had to use --ghc-options=-XBangPatterns04/09 22:46
dolioOh, I see.04/09 22:47
xplathow long has it been since pigworker was here anyway?04/09 23:06
xplathm, in OTT heterogenous equality is conditional?04/09 23:51
xplatso there's no reason to assume you can't prove something like 'true : Bool == zero : Nat'04/09 23:51
xplat?04/09 23:51
--- Day changed Mon Sep 05 2011
Saizanxplat: that type reduces to the empty one though05/09 08:30
Saizanxplat: but e.g. (p : (:- P) == q : (:- Q)) reduces to unit, so it's trivially provable, afaiu05/09 08:33
Saizan(forall p P q Q)05/09 08:33
Saizanxplat: where :- is the injection from Prop to Set05/09 08:58
* bxc-paella wonders what fun stuff to implement in agdabot irc bot05/09 17:25
Saizanthere's one already?05/09 17:37
bxc-paellathere is05/09 17:38
bxc-paellai'm playing with it05/09 17:38
bxc-paellaits on #agdabot but it only knows 'hi'05/09 17:42
xplathah, kreisel showed that there is no admissible Pi_1 axiom we can add to PA that will let us show even a single additional function is recursive05/09 20:10
augurxplat: what05/09 20:12
xplatof course, this is Pi_1 where the body being quantified over is already a provably recursive predicate05/09 20:13
xplatrather than the stronger one where it can be any quantifier-free definable predicate05/09 20:13
augurwat05/09 20:46
--- Day changed Tue Sep 06 2011
ppavelV6hi06/09 08:48
ppavelV6i'm trying to play with something like "monad of proof-carrying values". The final goal is to get Hoare state. Is it possible at all in this direction? http://hpaste.org/5100206/09 08:49
SaizanppavelV6: seen this one? http://lambda-the-ultimate.org/node/427306/09 09:08
ppavelV6Saizan: no, but i'm trying to do something in this direction - using kleisli arrows instead :) thanks for the reference :)06/09 09:08
ppavelV6Saizan: talking about original problem - is this indeed a problem?06/09 09:08
ppavelV6ok, is this something more than a limitation of ppavelV6 or agda's type-checking algorithm?06/09 09:10
SaizanppavelV6: the type you give to f in the signature of bind is too restrictive06/09 09:14
Saizanand so you've to modify the type of P2 too06/09 09:15
ppavelV6Saizan: hmm… to me it seems to except any "existential" :) any examples how to weaken it?06/09 09:16
Saizan... {P2 : r1 -> r2 -> Set} -> ... (f : (x : r1) -> ∃ (P2 r1)) -> ..06/09 09:16
Saizansorry06/09 09:16
Saizan... {P2 : r1 -> r2 -> Set} -> ... (f : (x : r1) -> ∃ (P2 x)) -> ..06/09 09:16
ppavelV6makes sense06/09 09:18
ppavelV6it somehow exposes the metavar i believe?06/09 09:22
Saizanit allows the result type of f to be dependent on its argument06/09 09:23
ppavelV6yes06/09 09:26
Saizanthe metavar _453 is probably the one agda tries to use to fill the P2 argument of bind06/09 09:27
ppavelV6i think so. just didn't come out with the solution of how to allow agda to depend on a var06/09 09:28
xarchhi06/09 09:32
Saizanhi06/09 09:32
ppavelV6Saizan: thanks very much. It actually solved all of problems :)06/09 09:32
Saizannp06/09 09:32
ppavelV6my mood goes up :)06/09 09:32
ppavelV6man, it was so simple :(06/09 09:33
* ppavelV6 feels stupid06/09 09:33
xarchI'm learning Agda and there's one thing I don't understand: why does the type Desc in, for example, Conor McBride's ornament draft has to have type Set1 ?06/09 09:33
Saizani guess because some of its constructors take an argument of type Set06/09 09:34
xarchhmm ok06/09 09:36
Saizanthis stratification is to avoid stuff like russel paradox that would make agda inconsistent06/09 09:36
xarchactually I thought it has type Set1 for some "semantic" reason, not because Agda obliged it06/09 09:37
Saizanone could say that wanting to avoid impredicativity is more "semantic"06/09 09:39
Saizanif you had T : Set; T = (A : Set) -> Foo; then that A in the definition of T would quantify over a set that contains T too06/09 09:40
Saizanmaking T definition self-referential, even if indirectly06/09 09:40
xarchhm ok06/09 09:41
liyangSo are we going to get live updates from AIM?06/09 12:10
xplatin agda, is there any way to do induction-recursion over Set\omega?06/09 18:30
xplati'd like to make a universe that is stratified, but i don't currently see a way to do that06/09 18:31
Saizanxplat: like this? http://code.haskell.org/~Saizan/bisim/ObsEq.agda06/09 18:42
Saizanxplat: though it won't build with an agda that requires Level to be made of postulates06/09 18:42
Saizan(not sure if it's easy to port)06/09 18:43
xplatSaizan: ah, thanks.  but can you lift things from one universe level to another with that?  that was the main problem i was having with my attempt06/09 19:43
Saizanxplat: i'd have to try, where did you get stuck?06/09 19:49
xplatSaizan: i'm not really sure whether i actually got stuck or if it was just far harder than i'd imagined06/09 20:09
Saizani guess the Pi case is going to be the harder one since it's contravariant too06/09 20:20
xplatSaizan: is your example the same as http://www.e-pig.org/epilogue/?p=418 ?06/09 21:02
xplatexcept, of course, with levels added?06/09 21:03
Saizanyeah, and with a Desc version of IMu/INu rather than a Comm/Resp/next one06/09 21:07
Saizanmostly because you couldn't complete the proof with the latter in a decent amount of memory06/09 21:08
mokusxplat: you may (or may not ;)) be interested to know I've got Categories.Monoidal.Cartesian compiling in <1 min now, using only 2 GB RAM06/09 21:21
mokusbut I dropped AbstractBinaryProducts to get there, I'm not sure whether that's something you needed for other purposes06/09 21:21
mokusjust switching it off AbstractBinaryProducts dropped agda's peak memory usage from 6.5 GB to 4.2GB06/09 21:22
xplatmokus: hm, that's the opposite effect from when i put it on AbstractBinaryProducts in the first place06/09 21:26
xplatmokus: what did you end up doing?06/09 21:26
mokusjust made that switch and then spent some time "filing" the other proofs into more general places06/09 21:27
xplatmokus: ?06/09 21:27
mokusI just changed the imports of AbstractBinaryProducts to BinaryProducts and fixed all the missing sybols, most of which were 'convert' functions from AbstractBinaryProducts06/09 21:28
mokusthen i took a lot of the simpler proofs from Categories.Monoidal.Cartesian and moved them out of that module, mostly into a new Categories.Object.Products.Properties module06/09 21:28
mokusmostly related to the top-is-unit isomorphisms06/09 21:29
mokushttps://github.com/mokus0/categories/commit/60bce0e9f5f11e6ab33de38d708506571926cba706/09 21:29
xplatmokus: did it get a lot slower when you took out the AbstractBinaryProducts but before you started moving things, or did the new 2.2.12 optimizations help a lot there?06/09 21:30
mokusi think the new optimizations made it faster to not use AbstractBinaryProducts06/09 21:30
mokusjust removing them sped it up about 70%06/09 21:30
mokusmostly because it cut it down to where it was hardly using any swap06/09 21:30
xplatah.  2.2.10 is a *lot* slower without AbstractBinaryProducts.06/09 21:31
mokussounds like the agda optimizations reversed that06/09 21:31
mokusit went from 14 min to 5 min just by changing that06/09 21:32
mokusand after moving some proofs out, it got down to about 50 sec06/09 21:32
xplatwhat happened to all the outer bracket layers?06/09 21:39
mokusyou mean with the ⟩,⟨'s?06/09 21:42
xplatyeah06/09 21:42
xplati had it like that because the operator being conged is <_,_>, not _,_06/09 21:42
mokusi'm not sure why i changed it, it seemed to make sense at the time... probably because i had used _⟩,⟨_ in something else before06/09 21:42
mokusI can change it back, though I was actually planning on either replacing it with explicit ⟨⟩-cong's06/09 21:43
mokusor asking where would be a good place to put it for more general use06/09 21:44
xplataside from that, what do you think about the Categories-specific version of equational reasoning (with the arrows)?06/09 21:44
mokusi like it, and i think it would make more sense in other places too06/09 21:44
copumpkinooh categories talk06/09 21:44
copumpkinyay06/09 21:44
copumpkinxplat: did you see my feature request for local abstraction barriers?06/09 21:45
xplatcopumpkin: yep06/09 21:45
copumpkinfeel free to chime in on that if you have ideas of how to make it work06/09 21:45
mokusxplat: gave ⟨_⟩,⟨_⟩ its braces back ;)06/09 21:49
xplatmaybe with such a drastic performance flip between abstracted/unabstracted on the two versions it could be time to drop 2.2.1006/09 22:01
xplatit was already starting to be painful to keep things building on both06/09 22:02
copumpkinI'm amazed you've lasted this long06/09 22:07
xplatwell, i kind of meant for the library, not just me06/09 22:19
copumpkinoh :)06/09 22:21
copumpkinyeah, compatibility has never been a big concern of mine, if you hadn't noticed06/09 22:21
xplatgah, how do i undo a git commit?  (i want to keep the change, just forget the actual commit)06/09 22:50
copumpkincan't remember, but maybe you just want to amend the last one?06/09 22:51
copumpkinthere's a git commit --amend06/09 22:51
xplatunfortunately there were two06/09 22:57
xplatbasically a while ago i had forgot i was in a branch and started committing stuff06/09 22:59
xplatafter 2 commits in i was all 'd'oh i am in the wrong branch'06/09 22:59
xplatso even amend wouldn't actually work06/09 23:00
xplati need to recommit stuff in a branch of the branch, then rebase that to master and merge it06/09 23:00
xplatbut i don't know how to kill those 2 commits from the old branch tip so i can take them with me06/09 23:02
Saizanprobably with git reset, but i wouldn't know the right flags06/09 23:04
copumpkinwhen in doubt, rewrite history06/09 23:10
Saizancall the doctor06/09 23:12
mokusmaybe merge to the new branch, rebase out the merge commit, and rebase the merged commits out of the old branch?06/09 23:26
--- Day changed Wed Sep 07 2011
Eduard_MunteanuYes, you want a mixed git reset07/09 00:07
Eduard_MunteanuWait, you don't... you could just switch to the other branch and cherry-pick your commit on top07/09 00:08
Eduard_Munteanugit cherry-pick <sha1>07/09 00:09
xplati was thinking i'll probably reset the branch to an earlier commit, then create a new branch with the old tip07/09 02:29
xplatand then rebase it to the place i want07/09 02:30
xplatagh, i upgraded debian, and mplayer started segfaulting.  tried to upgrade through it, and i have to bring libc, gtk, and perl up to testing07/09 02:44
xplatoh, and gcc-4.407/09 02:45
xplatand incidentally irssi07/09 02:46
xplatif i were on nix i could have just reversed the upgrade07/09 02:46
xplatand now i'm getting internal errors from apt, brilliant!07/09 02:48
xplatoh, and now perl made me upgrade elinks, which is making me upgrade ruby07/09 02:55
xplatoh, shit.  can't upgrade perl, because there's no new version of postgresql-plperl-8.307/09 02:58
xplatwtf.  carefully matched all the versions of everything to use the stable packages from christian mariallat where available, still segfaulting :(07/09 03:36
Eduard_Munteanuxplat: you might want to get xine or something else in the meanwhile07/09 03:45
Eduard_Munteanuor vlc07/09 03:45
Eduard_MunteanuMaybe it'll just get fixed.07/09 03:46
xplatin the meantime, i used vlc, but unfortunately it's a piece of crap07/09 04:23
xplatwhat kind of video player comes with default keybindings for cycling through aspect ratio and crop, and speeding up and slowing down, but not adjusting volume or advance/rewind?07/09 04:24
xplator if it has them i haven't found them yet07/09 04:25
Saizanhttp://hpaste.org/51051 <- anyone knows if there's already an open issue about this with darcs agda?07/09 17:13
xplatSaizan: is it specific to coinduction?07/09 17:48
xplatbtw, http://hpaste.org/5105307/09 17:48
Saizani couldn't trigger it without07/09 17:48
xplatalso a bug from today noon agda, seems related to projections07/09 17:49
Saizanwhere's the projection there?07/09 17:51
xplatSaizan: yours seems to be the well-known 'too much generativity' bug07/09 17:51
Saizanthe flat should be squashing the generativity07/09 17:51
Saizani think the problem is that it doesn't get computed all the time07/09 17:52
Saizani've reported it as new anyhow07/09 17:53
xplatoic07/09 17:56
xplatwhile you're at it could you report mine too?  i haven't a google account07/09 17:57
xplatthe error message is '.n<m != s .n<m of type GlobeHom .A .B'07/09 17:58
Saizanok07/09 17:59
xplatthe relation to projections is it seems to be another case of agda losing count of how many unneeded projector arguments it squashed and getting the actual arguments misaligned during normalization07/09 18:00
xplatthanks!07/09 18:00
Saizanwhat would you put as summary?07/09 18:00
xplatoh, hey, in yours the con from inn gets dropped07/09 18:03
Saizanare you sure? it seemed just hidden behind the generativity to me07/09 18:04
xplatsummary -- is that the bug title?  i'd say 'constructor arguments garbled during normalization' i guess07/09 18:07
Saizanhttp://code.google.com/p/agda/issues/detail?id=451 <- here it is anyhow07/09 18:07
Saizanheh, too late, i went for something more wordy :)07/09 18:07
xplatwell, it's probably a little more clear i guess07/09 18:08
xplatif less specific07/09 18:08
xplatthanks for reporting it07/09 18:09
xplatit keeps some stuff in categories from building :(07/09 18:09
Saizannp07/09 18:11
xplatafter seeing the frenzy of bugfixes and enhancements earlier this week i'm now reloading the issues page every 5 minutes seeing if something will happen :)07/09 18:56
Eduard_MunteanuHow's mplayer treating you? :)07/09 18:56
xplatstill badly :-/07/09 18:57
xplatcouldn't find a recent bug report on it, i'm probably going to have to debug for real ...07/09 18:58
xplata pain in the neck, but easier than getting used to vlc or ffplay or something07/09 18:58
copumpkinxplat: we need you!07/09 19:13
xplat!07/09 19:26
xplatSaizan: i just came up with a simplification of the bug07/09 19:27
Saizanxplat: i guess i could post it to the issue if you want07/09 19:30
xplatwell i annotated the other hpaste07/09 19:48
xplatthe real bonus is it marks a single-line change that breaks/fixes the code07/09 19:48
Saizanposted, weird stuff07/09 19:58
Saizanthey'd really need a dependently typed language to implement agda :)07/09 19:59
copumpkinlol07/09 20:00
copumpkinagda in agda07/09 20:00
copumpkinthat's the future07/09 20:00
copumpkinwe don't need a proof of consisteny07/09 20:00
copumpkin:P07/09 20:00
Saizanjust postulate some large cardinal :P07/09 20:01
Ken`who developed Instant Generics in Agda?07/09 20:56
xplatcopumpkin: you know, we don't have a proof of consistency for haskell either :)07/09 21:22
Saizanxplat: moving stuff up one level ends up requiring extensionality :) http://code.haskell.org/~Saizan/bisim/Up.agda07/09 22:14
Saizan(remaining holes left as an exercise)07/09 22:22
--- Day changed Thu Sep 08 2011
drdoIs it normal for agda to start taking a long time and loads of memory when loading a file? (The problem goes away if i just restart agda)08/09 01:43
dolioIn my experience the memory usage grows over time.08/09 01:52
dolioAnd restarting can make it better.08/09 01:52
drdodolio: It's not just memory, at some point trying to reload the file would sit on 100% cu for a long time08/09 01:53
drdo*cpu08/09 01:53
dolioCould be doing lots of swapping, or garbage collection.08/09 01:53
dolioAnd maybe it's just doing more work over time, too.08/09 01:54
dolioDue to the extra stuff floating around.08/09 01:54
drdowhat extra stuff?08/09 01:55
dolioWhatever is taking up all the extra memory.08/09 01:56
dolioFor all I know, it's carrying around a big list of things, and each time you load the file, it inserts stuff at the end.08/09 01:57
dolioSo it has to walk an increasingly large list every time you load.08/09 01:57
dolioThat probably isn't what's happening, but it's an example.08/09 01:57
drdoI see08/09 01:58
xplatSaizan: cool, i will take a look at that tomorrow.  needing ext doesn't sound good though08/09 02:31
liyangAnyone at AIM?08/09 04:42
glguyI'd be interested in feedback on how I've structure my module for Linear Logic http://www.galois.com/~emertens/linearlogic/LinearLogic.html08/09 06:48
glguyI wanted something to play around with small proofs as I read about this topic08/09 06:49
glguyhttp://www.galois.com/~emertens/linearlogic/LinearLogic.html#3916 is my thought about how to make things more readable (using preorder reasoning)08/09 06:50
djahandarieNice08/09 06:51
djahandarieMy inclination to make things more readable is by not directly proving everything :P08/09 06:52
djahandarieBut I don't quite understand the alternative yet so I'll get back to you on that...08/09 06:53
glguysomething about using  _∼⟨_⟩_ tricks agda-mode for me08/09 07:11
glguyinstead of showing goals when I leave a ? in the first parameter of that operator08/09 07:11
glguyit just decides that the file is "checked"08/09 07:11
glguyah, it was the lines of {--------------} I added08/09 07:31
glguywhich broke goals08/09 07:31
xplatEduard_Munteanu: i got mplayer fixed.  leftover stuff from when i had an nvidia card metastatized during an upgrade and replaced my libGL1.so with one that dies if there's no nvidia card08/09 12:21
* Saizan wonders if there are equivalent formulations of linear logic with less connectives08/09 12:29
Eduard_Munteanuxplat: ouch08/09 12:35
Eduard_MunteanuI can see how that could be a pain to figure out08/09 12:35
xplatSaizan: you can eliminate some of them via de morgan duality, but it destroys a lot of that lovely symmetry08/09 12:37
xplatand getting rid of any connective along with its de morgan dual gives a proper subsystem, iirc08/09 12:38
xplatso if you wanted to do much more you'd have to come up with some kind of nonstandard connective08/09 12:40
xplatlike with the 'nothing but nand' classical logic08/09 12:41
* Eduard_Munteanu is glad at least his Gentoo handles switching between xorg/ati/nvidia GL libs properly through a command08/09 12:42
Eduard_Munteanu(so I don't have to mess with it)08/09 12:42
xplatthat sounds handy08/09 12:44
Saizani guess i'd like a presentation built around -o and whatever needs to be added to that08/09 13:03
--- Log closed Thu Sep 08 14:08:50 2011
--- Log opened Thu Sep 08 14:10:56 2011
-!- Irssi: #agda: Total of 58 nicks [0 ops, 0 halfops, 0 voices, 58 normal]08/09 14:10
-!- Irssi: Join to #agda was synced in 67 secs08/09 14:11
--- Log closed Thu Sep 08 16:11:08 2011
--- Log opened Thu Sep 08 16:11:15 2011
-!- Irssi: #agda: Total of 61 nicks [0 ops, 0 halfops, 0 voices, 61 normal]08/09 16:11
-!- Irssi: Join to #agda was synced in 92 secs08/09 16:12
--- Day changed Fri Sep 09 2011
dolioMan, ulf is on a roll.09/09 05:33
copumpkinhow so?09/09 05:34
copumpkinholy shit09/09 05:34
copumpkinoh nevermind09/09 05:34
dolioLike beef on weck.09/09 05:48
copumpkinaha, Bool is not not equal to Fin 2 now09/09 05:57
djahandarie:o09/09 06:00
glguycopumpkin: "equal to"?09/09 06:24
copumpkinthere used to be a way to prove that Bool /= Fin 209/09 06:24
glguytreat \x -> x sugar for \(x : _) -> x09/09 06:26
glguyWhat's this about?09/09 06:26
copumpkinnot sure09/09 06:30
copumpkinSaizan: you working on globes? :o09/09 06:30
dolioglguy: \x -> x and \(x : _) -> x used to work subtly differently.09/09 06:31
glguyWas one dependently typed and the other not, perhaps?09/09 06:31
dolioI don't think so.09/09 06:31
glguyI asked this last night, but I don't know if the same people were active at that time. Any suggestions for betters ways to encode this logic system? http://www.galois.com/~emertens/linearlogic/LinearLogic.html09/09 06:33
glguy(or is this basically how you would do it)09/09 06:34
dolioThe odd thing was that you might expect one of \x -> ... and \(x : _) -> ... to subsume the other, but that wasn't the case.09/09 06:37
dolioThere were cases for each where they did the right thing, and the other didn't.09/09 06:37
dolioSo presumably they've fixed the cases where \x -> ... was working to work with \(x : _) -> ....09/09 06:37
glguyI don't think I ever knew there was a \ (x : _) -> syntax09/09 06:38
glguyWhat is it for?09/09 06:38
dolioFor annotating your arguments with their types.09/09 06:38
dolio\(A : Set) (x : A) -> x09/09 06:39
dolioAnd _ is 'figure it out for me,' as usual.09/09 06:39
glguyCan you use that as a substitute for providing type-signatures for named functions?09/09 06:40
dolioDoubtful.09/09 06:41
dolioWell...09/09 06:42
dolioYou could write all your functions as 'f = \...'09/09 06:42
dolioSince it doesn't force you to put signatures for nullary definitions like that, as I recall.09/09 06:43
Saizancopumpkin: nope, just posting xplat's bugs09/09 10:25
mokusi think it's pretty hilarious sometimes how much longer a type signature can be in Agda than the code it describes09/09 14:29
mokusI'm working on a 'thrist' implementation and its foldr has 5 lines of type signature for 2 lines of function09/09 14:30
Saizanheh, yeah, the main example is the fully-dependent composition operator09/09 14:35
mokusyea, and this one basically has a slightly simpler type as one of its arguments09/09 14:36
* glguy_ needs some kind of automated permutation solver...09/09 20:56
glguy_There must be a way to do this linear logic stuff where I can show that I didn't lose any of my propositions between calls without manually showing how ++ works all over the place09/09 20:57
glguy_Just as an arbitrary commutative semiring forms an "almost" semiring using id as negation09/09 21:18
glguy_perhaps I can use the semiring solver with a similarly trivial *09/09 21:18
--- Day changed Sat Sep 10 2011
xplatSaizan: looks life both of our bugs got critical priority and are already fixed10/09 00:24
Saizanxplat: yep, since yesterday10/09 00:24
copumpkinyeah, looks like lots of bugs getting fixed10/09 00:27
copumpkinoh wow, was that andreas abel on IRC?10/09 00:27
guerrillanice10/09 00:36
guerrillapeople are showin' up10/09 00:36
guerrillabut why would he be in .jp? i tought he was munich-based. there a conference there?10/09 00:37
SaizanAIM there, since ICFP is coming next10/09 00:37
guerrillaaha10/09 00:37
* guerrilla not paying attention to cons. no money to travel :\10/09 00:38
djahandarieWhich issues were the ones that got fixed?10/09 00:47
copumpkinall of them10/09 00:48
augurcopumpkin! \o/10/09 00:48
copumpkinthe bugtracker is empty10/09 00:48
* augur tracks copumpkin's bugs10/09 00:49
copumpkin:O10/09 00:49
copumpkinI have no bugs10/09 00:49
augurthen it'll be easy to track them all!10/09 00:49
copumpkinfair enough10/09 00:49
copumpkinman, I'm so tired10/09 00:49
* djahandarie gets copumpkin a pillow10/09 01:01
copumpkinthanks!10/09 01:01
djahandarieSurprise, it actually has needles in it!!10/09 01:02
copumpkin:(10/09 01:12
augurcopumpkin!10/09 01:15
augurcategory theory is awesome. :D10/09 01:15
* augur dances10/09 01:15
* augur categorically10/09 01:15
copumpkinyep :)10/09 01:15
augurmake representables make sense :O10/09 01:16
* djahandarie notes down augur on the list of people to go to if he's ever hiring a jester10/09 01:16
augur:(10/09 01:16
augurwhy would i be hiring a jester, and why would you come to me if i were?!10/09 01:16
djahandarieDamn you English...10/09 01:16
augur:D10/09 01:17
augurisn't it interesting that some languages make that distinguishable?10/09 01:17
ian__dunno lol10/09 01:44
xplati'm a little worried about the fix for 25210/09 02:26
xplatsince the note says 'heterogeneous equality will be harder to use since agda is stricter' or something like that10/09 02:27
copumpkinyou sure it's 252?10/09 02:28
copumpkin45210/09 02:28
xplater, yeah10/09 02:28
xplati guess i was being very optimistic in my recall10/09 02:29
xplatoh, and we still don't have irrelevant modules i think :-/10/09 02:30
djahandarieWas one of the fixed things the irrelevance thing?10/09 02:31
xplatthe one that lets you prove false by general recursion, yeah10/09 02:31
Eduard_MunteanuDamn Agda devels removing features :P10/09 02:32
xplatthat wasn't a feature, it was an undocumented bug10/09 02:33
Eduard_MunteanuNevermind, Falso joke :)10/09 02:34
copumpkinbut now I can prove fewer things! :(10/09 02:35
xplatbut the ones you can prove require longer proofs10/09 02:35
xplatgood for job security10/09 02:35
xplati mean, with that thing all your proofs could just say 'simonsays'10/09 02:36
xplatthey could probably teach a rhesus monkey to type that10/09 02:37
copumpkinyeah!10/09 02:37
copumpkinmore power!10/09 02:37
copumpkinI can prove things like (f : forall A. A => A) -> forall x -> f x == x10/09 02:37
xplatbut to maximize your proof output you would have to become a primate handler10/09 02:38
xplatit doesn't seem worth it10/09 02:38
djahandarieWould it be worth it for a primate handler to maximize their proof output?10/09 02:43
OlatheDo they get paid extra based on their proof output?10/09 02:45
Eduard_MunteanuThe monkey just get fed as a reward :P10/09 02:46
OlatheThat would seem to cost the primate handler more.10/09 02:48
augurO_O10/09 04:32
glguyI got my permutation solver going10/09 08:41
glguyexch : ∀ Γ {A B Δ} → ⟨ ⊢ Γ ++ A ∷ B ∷ Δ ⟩ → ⟨ ⊢ Γ ++ B ∷ A ∷ Δ ⟩10/09 08:42
glguyexch Γ {A} {B} {Δ} = perm (solve 4 (λ a b c d → app a (app b (app c d)) ⊜ app a (app c (app b d))) FI.id Γ [ A ] [ B ] Δ)10/09 08:42
glguybig-swap : ∀ Γ Δ Λ → ⟨ ⊢ Γ ++ Δ ++ Λ ⟩ → ⟨ ⊢ Γ ++ Λ ++ Δ ⟩10/09 08:42
glguybig-swap Γ Δ Λ = perm (solve 3 (λ a b c → app a (app b c) ⊜ app a (app c b)) FI.id Γ Δ Λ)10/09 08:42
glguyit works over an arbitrary commutative monoid (but I still need to implement abstract identity elements)10/09 08:44
glguyhttp://www.galois.com/~emertens/linearlogic/LinearLogic.html#2439 if anyone wants to see the actual implementation10/09 08:46
* glguy_ readvertises the CommutativeMonoid Solver http://www.galois.com/~emertens/linearlogic/LinearLogic.html#243910/09 17:17
Saizanpretty cool10/09 17:18
copumpkinoh10/09 17:18
copumpkinman10/09 17:18
glguy_It does a bucket sort to normalize10/09 17:19
copumpkindealing with that shit was what stopped me last time I played with linear logic10/09 17:19
copumpkingood idea :)10/09 17:19
glguy_next I'll just need to plug in reflection10/09 17:20
copumpkin:O10/09 17:20
glguy_and i can maybe stop writing this crap out by hand10/09 17:20
copumpkin:D10/09 17:20
Saizanan explicit perm construct still feels a bit wrong though10/09 17:22
glguy_I'd like to go back to an exchange rule10/09 17:22
glguy_and implement the permutations in terms of that10/09 17:22
glguy_but I didn't want to get held up10/09 17:22
glguy_and not actually play with any linear logic :)10/09 17:22
glguy_This is the rule from the paper on linear logic I started with exch : ∀ Γ {A B Δ} → ⟨ ⊢ Γ ++ A ∷ B ∷ Δ ⟩ → ⟨ ⊢ Γ ++ B ∷ A ∷ Δ ⟩10/09 17:23
Saizani was thinking of going the other way actually, using contexts more as bags than stacks10/09 17:24
glguy_yeah, that'd be neat, too10/09 17:24
glguy_Do you have any ideas for what that would look like?10/09 17:24
copumpkinI wonder how painful it'd be to build contexts on top of that AVL Map thing10/09 17:25
copumpkinusing it as a multiset10/09 17:25
copumpkinI guess you'd need an ordering10/09 17:25
copumpkinI guess a Set isn't ideal10/09 17:26
copumpkinyou'd need keys into a map10/09 17:26
glguy_You could name everything10/09 17:26
Saizanyou'd factor out a type for _\in_ : Expr -> Seq -> Set i imagine, though i'm not familiar enough with linear logic to see how it'd all work10/09 17:27
glguy_and put an ordering on the names10/09 17:27
copumpkinyeah, exactly10/09 17:27
glguy_if you name everything and put it all on the left-hand side instead of the right-hand side of the turnstile things start to look a like like programming10/09 17:27
copumpkina name could still just be a Fin or a fancier similar structure10/09 17:28
* copumpkin shrugs10/09 17:29
glguy_in the meantime there should be a number of places the commutative monied solver could be reused10/09 17:30
joe6is this paper relevant to agda? http://www.cse.unsw.edu.au/~chak/papers/modules-classes.pdf10/09 17:45
joe6i understand that agda borrows from ml module structure and not haskell type class. Just curious, if that paper is a good starting point from haskell world to agda world10/09 17:46
joe6wrt to the haskell typeclass stuff.10/09 17:46
glguyjoe6: I'd try to answer your question if I knew how similar ML modules were to Agda's or if I'd read that paper before :)10/09 17:51
glguyWhat font do window's users install when they want to read Agda code?10/09 19:27
Saizantry code200010/09 19:31
xplatthey should have had a code201010/09 19:34
* xplat builds newer agda10/09 19:35
xplatmay as well see what the damage is with heterogeneous equality being 'harder to use'10/09 19:35
copumpkinoh man, xplat is upgrading!10/09 19:38
xplati started upgrading *days* ago, get with the program!  :)10/09 19:38
xplatthat's like billions of years in internet time10/09 19:39
copumpkin:)10/09 19:40
Saizani wonder what * Keep track of names in the termination checker. implies10/09 19:45
xplati think it's something to improve error messages10/09 19:59
xplatugh, i hate when i can't open enough stuff to get a decently-printing goal without breaking the code10/09 20:03
xplati don't even see how this goal can make sense10/09 20:03
xplatthere's definitely something fucked-up about the way agda is printing terms in this version, although it seems to evaluate okay10/09 20:09
xplatidentifiers bound in a scope seem to get printed with the arguments they would need if you were accessing them in a module from top-level10/09 20:11
xplator rather, sometimes they do10/09 20:11
xplatit's confusing10/09 20:11
glguyThe goals are nonsensical when operators become involved10/09 20:22
xplatgah, these 'arrow-floating' operations on the category of cones seem like a bottomless pit10/09 21:35
glguyIt is (according to the course notes I'm looking at) an open question as to whether this is a true statement about linear logic10/09 23:15
glguy∀ {A} → ⟨ ⊢ [ A ⊸ I & (A ⊗ A) ] ⟩ → ⟨ ⊢ [ A ⊸ ! A ] ⟩10/09 23:15
glguyI've found that I can prove it if my proof type is coinductive10/09 23:15
glguyAre proofs ever coinductive?10/09 23:16
glguyI know "ever" is a big qualifier, but I'm really just interested in sequent calculus related things10/09 23:17
glguyI guessing that when proving things about consistency there might be assumptions about the proofs being finitely long10/09 23:18
copumpkina proof that two streams are equal is coinductive10/09 23:19
copumpkinnot sure about this though :P10/09 23:19
glguyAny ideas for a character which looks similar to a '?' but which Agda doesn't consider a goal?10/09 23:23
kosmikuswhat exactly do you mean here by "coinductive proof"?10/09 23:23
kosmikus(as opposed to coinductive datatype)10/09 23:23
copumpkinglguy: two ??10/09 23:23
copumpkin10/09 23:24
copumpkin10/09 23:24
glguyMy proof rules are constructors in a data type, if some of the constructor fields were coinductive the proof would pass the productivity checker10/09 23:24
copumpkin10/09 23:24
glguycopumpkin: you seem confused10/09 23:24
copumpkin:)10/09 23:24
kosmikusglguy: aha. ok, so that would then amount to an infinite proof. that's usually not allowed :)10/09 23:25
glguyWhere are you finding these, copumkin?10/09 23:25
kosmikusor, well, you can't then conclude from a proof in Agda that there's actually a proof10/09 23:26
copumpkinin the character viewer on my mac10/09 23:26
glguycopumpkin: neat, that is working for me10/09 23:26
glguyPresumably there are some proof systems where consistency was originally proven with infinitely large proofs in mind?10/09 23:28
Saizangiven that you can write (\x -> x) in linear lambda calculus if you allow infinite terms you can prove anything10/09 23:40
Saizanafaiu10/09 23:40
glguyA ⊢ A is an axiom of Linear Logic. Are you using that I should be able write a proof of "anything" using that axiom?10/09 23:43
glguyor is that not how (\x -> x) intersections with linear logic?10/09 23:43
glguy(I don't really know anything about linear lambda calculus)10/09 23:44
Saizan(\x -> x) would be a proof of |- A -> A, to be pedant, but yeah10/09 23:45
glguy⊢ A ⊸ A10/09 23:46
glguythis?10/09 23:46
Saizanyep10/09 23:46
Saizan⊢ (A ⊸ A)10/09 23:46
Saizanbasically you'd end up writing a fix id by exploiting corecursion in the meta-language, rather than general recursion within the language10/09 23:48
RotsorCan I show (n ≢ suc n) without deconstructing n down to zero?10/09 23:48
glguywhich is definitionally ⊢ A˔ ⅋ A , and then ⊢ A˔ , A and then A ⊢ A   (tad a!)10/09 23:48
SaizanRotsor: darcs agda will see that n == suc n is empty, otherwise no10/09 23:49
RotsorSaizan: Hmm, it does not. I wonder why.10/09 23:51
RotsorSaizan, or do you mean it is a new feature?10/09 23:51
SaizanRotsor: yeah, i mean no released version will have this feature10/09 23:51
RotsorAh, I see10/09 23:52
RotsorThank you!10/09 23:52
Saizannp10/09 23:52
glguyBut the released versions are so *old*10/09 23:52
Saizanthe last one is from february :)10/09 23:53
glguyrub it in!10/09 23:53
--- Day changed Sun Sep 11 2011
RotsorCan I show (n ≢ suc n) at all? Without the latest Agda that is.11/09 00:01
copumpkinRotsor: yeah11/09 00:02
Saizaninduction on n should suffice, there might be some complication in the induction step though11/09 00:02
RotsorI can't pattern match on (suc n == suc suc n). If I try refl, it says that n != suc n. If I try (), it says that the emptiness is not obvious.11/09 00:02
Saizanyeah, make a separate suc-inj : {n m : \bn} -> suc n == suc m -> n == m and use that instead11/09 00:03
RotsorI'll try that, thanks11/09 00:03
copumpkinhttp://snapplr.com/223011/09 00:04
Rotsorsuc-inj worked like a charm!11/09 00:05
copumpkinbut I'd just use the latest agda if I were you :P11/09 00:05
Rotsor"wtf" is a good name for that variable, will use that. :D11/09 00:06
copumpkinyeah, I usually call my absurdities that11/09 00:06
xplatthe longer i work on categories, the more i want to be working in something based on OTT11/09 00:06
copumpkinxplat: same :P11/09 00:07
glguyWas that the theory that had more support for defining custom equivalences / setoids?11/09 00:07
xplatcopumpkin: my latest thing is transporting cone morphisms along the 'proper' equalities for cones11/09 00:08
xplatso basically a single case of what you would need to have categories with a setoid of objects11/09 00:08
xplatand boy are there a lot of things you want to have11/09 00:08
xplatalso, it's still killing me that agda can't infer irrelevant arguments and even relevant arguments with irrelevant fields11/09 00:09
xplatit seems like more than half of the code is stuff i shouldn't be writing at all11/09 00:10
xplatglguy: yeah, among other things11/09 00:11
xplatyou can have observational equality of functions and of coinductive types11/09 00:12
xplatalso, encoding inductive types as W-types is only awkward and nasty, rather than impossible11/09 00:15
drdoWhat's the difference between "data (A : Set) : Set" and "data : Set → Set" ?11/09 00:28
drdomissing the name obviously, but you get the idea :)11/09 00:28
glguydrdo: In the first case the type is "parameterized" by A, in the second it is "indexed" by A11/09 00:29
drdoglguy: What's the difference?11/09 00:29
glguywhen it is parameterized you are saying that this type works for all Sets A11/09 00:29
glguywhen it is indexed each constructor can specify a certain index11/09 00:29
glguySo data List (A : Set) : Set where nil : List A   ; cons : A -> List A -> List A11/09 00:31
glguythis type works for any type A11/09 00:31
glguyand the constructors don't set any conditions on that A11/09 00:31
glguybut if you wanted to do a Vector (a list indexed by a natural number)11/09 00:32
drdoglguy: Why doesn't that list definition work if i write it the other way?11/09 00:32
drdodata List : Set → Set where11/09 00:32
drdo  nil : {A : Set} → List A11/09 00:32
glguydodo, that does work11/09 00:32
drdonot here11/09 00:32
drdoThe type of the constructor does not fit in the sort of the11/09 00:32
drdodatatype, since Set₁ is not less or equal than Set11/09 00:32
drdowhen checking the constructor nil in the declaration of List11/09 00:32
glguyOH, right11/09 00:33
glguyYou'll need it to be a Set111/09 00:33
glguyif you want to store Set0 as a field11/09 00:33
glguydata List : Set -> Set1 where nil : {A : Set} -> List A11/09 00:33
drdoWhere can i read more about the theory behind this? I have no idea what a Set1 is11/09 00:33
glguyNow see vectors: data Vec (A : Set) : Nat -> Set where  nil : Vec A zero ; cons : (n : Nat) -> A -> Vec A n -> Vec A (suc n)11/09 00:34
glguysee how the constructors are generic in A but can set conditions on 'n'?11/09 00:34
glguySomeone else will have to recommend good reading material11/09 00:34
drdoI see it, but i don't think i understand it11/09 00:34
glguyThe purpose behind not being able to stored things with-in themselves is to avoid Russel's paradox and the inconsistency it creates. So set theory is stratified into levels (I'm getting way outside my area of expertise here)11/09 00:38
glguywhen you make a new type it only contains types smaller than it11/09 00:38
glguyWith parameters you aren't storing values of that parameter inside the type are you just being generic in that type, it might as well be a parameter of the surrounding module11/09 00:39
glguyso it doesn't make your type "bigger"11/09 00:39
drdohmm11/09 00:41
drdoSo the issue there would be that Set → Set doesn't "fit" in Set?11/09 00:41
glguyThat is correct11/09 00:43
glguySet -> Set has type Set111/09 00:43
glguySet1 -> Set1 has type Set2, and so on11/09 00:43
glguyHaving to redefine everything at every level got tedious, so Agda has an option you can turn on called "universe polymorphism"11/09 00:44
glguyYou don't necessarily have to read about it right now, but keep the term in mind if you find yourself doing much in Set111/09 00:44
Eduard_MunteanuBasically, if something mentions Set k, it's in Set (k + 1)11/09 00:46
RotsorWhere does the one mentioning universe polymorphism lives then? :)11/09 00:48
Eduard_MunteanuGOD!11/09 00:48
glguyBut who polices the police police?11/09 00:48
drdoWhere does one find nice reading material?11/09 00:49
glguyHave you looked over http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.HomePage yet?11/09 00:50
Eduard_Munteanudrdo: you might want to read some of the stdlib code11/09 00:50
Eduard_MunteanuAnd ask questions.11/09 00:51
drdoEduard_Munteanu: The thing is that i don't really understand the theory very well11/09 00:52
Eduard_MunteanuThere's Ulf's original paper, but that's a bit old and confusing.11/09 00:52
Eduard_MunteanuBut I found the release notes to be helpful, maybe along with other docs in Agda's package.11/09 00:53
drdoI'm fairly acquainted with System F and similar systems, but not really dependent types11/09 00:53
Eduard_MunteanuAt least they describe features like universe polymorphism and such stuff.11/09 00:53
drdoBengt Nordström, Kent Petterson, Jan Smith. Martin-Löf’s Type Theory. Handbook of Logic in Computer Science, OUP, 2000.11/09 00:53
Eduard_MunteanuOh.11/09 00:53
drdoThere's this on the page11/09 00:53
Eduard_MunteanuYou could start with the Agda tutorials, or even the one on Epigram.11/09 00:54
Eduard_Munteanuhttp://wiki.portal.chalmers.se/agda/agda.php?n=Main.Othertutorials11/09 00:54
drdoThat's what i was doing, but this point that i asked about got me confused11/09 00:54
Eduard_MunteanuIf you want the actual typing rules, I'm not sure.11/09 00:55
Eduard_MunteanuUlf's stuff might be otherwise ok, but IIRC it assumes universes are cumulative.11/09 00:57
Eduard_Munteanu(erm, his thesis)11/09 00:57
drdoEduard_Munteanu: I don't even know what you mean by universe11/09 00:57
Eduard_MunteanuSet levels11/09 00:57
drdoI really seems to come back to the idea that i should read about modern set theory11/09 00:58
drdoWhat's the big deal with russel's paradox anyway?11/09 00:59
Eduard_MunteanuThe thing is this hierarchy has a point, otherwise you can derive a contradiction.11/09 00:59
glguyAnd then we'd be no better than Haskell!11/09 01:00
Eduard_MunteanuValues belong to types, types to sorts (the Sets), and sorts to other sorts.11/09 01:00
Eduard_MunteanuSo   true : Bool    Bool : Set   Set : Set 1    Set 1 : Set 2   ....11/09 01:01
drdoCoq seems to have Type → Type : Type11/09 01:01
* Eduard_Munteanu doesn't know much about Coq, except it's different from Agda in some respects.11/09 01:01
glguyCoq has Prop, Set, and Type and does some other trickery to avoid Russel (and this is the end of my knowledge)11/09 01:03
Eduard_MunteanuBesides, its universes are cumulative, so Set 2 contains all the stuff below it for example.11/09 01:05
Eduard_Munteanu(in a subtyping sense, Set k <: Set (k + 1))11/09 01:05
Eduard_MunteanuAgda doesn't have that.11/09 01:05
glguyYou can do that in Agda, but you have to be explicit about it (see Lift in the standard library) (for dodo)11/09 01:06
Eduard_Munteanudrdo, even :)11/09 01:06
Eduard_Munteanuglguy: I presume it'd be a much bigger pain to separate universes in Coq, though, right?11/09 01:10
Eduard_Munteanu(well, if you have a reason to, I'm not sure)11/09 01:11
glguyI don't know :)11/09 01:11
Eduard_MunteanuAh.11/09 01:15
* glguy wonders why Normal is pink11/09 04:32
glguyNormal = Vec ℕ11/09 04:32
glguybut Env is blue11/09 04:32
glguy  Env = Vec Carrier11/09 04:32
glguy(darcs agda)11/09 04:32
copumpkinthe pinkishness has to do with detecting projection-like functions11/09 04:34
copumpkinbut I have no idea why Vec Nat would be pink :P11/09 04:34
glguyOh, maybe Env is blue because   Env : (n : ℕ) → Set a11/09 04:35
glguybut Normal is just a "Set"11/09 04:35
glguyand not level polymorphic11/09 04:35
glguythis one is pink11/09 04:36
glguy  ε-NF = replicate 011/09 04:36
glguyI just need to expand my mental image of "projection"11/09 04:36
Eduard_MunteanuOh, I didn't know it did that.11/09 04:38
djahandarieYou need to project your mental image of projection to truly understand11/09 05:00
glguyman… records just beat the crap out of Agda11/09 05:37
copumpkinyou running on the latest agda?11/09 05:39
glguyyeah11/09 05:39
glguybut they always have11/09 05:39
copumpkinah :/11/09 05:39
copumpkinwell ulf recently made them a lot better11/09 05:39
copumpkinsupposedly11/09 05:39
glguyI won't say they got worse :)11/09 05:42
glguyThis is breaking my intuition for lollipop...11/09 06:49
glguy⊢ A ⊸ ⊤ / ⊢ A˔ ⅋ ⊤ / ⊢ A˔ , ⊤  by ⊤ introduction rule11/09 06:49
glguyI was thinking of lollipop as a way to turn A11/09 06:49
glguythe lhs into the rhs11/09 06:49
glguybut as you can start using the rhs before you've provided the lhs you don't always have to provide the lhs11/09 06:51
abel@copumpkin: I had a go on issue 392 "irrelevant modules". Pls check if that fix helps you.11/09 07:55
lambdabotUnknown command, try @list11/09 07:55
abelcopumpkin: I had a go on issue 392 "irrelevant modules". Pls check if that fix helps you.11/09 07:55
copumpkinabel: :O11/09 07:58
copumpkinthank you!11/09 07:58
abelyou are welcome.  This AIM is mostly a bug-fix session...11/09 07:59
copumpkinI've noticed huge piles of bugs being closed :)11/09 08:00
copumpkinit's like christmas!11/09 08:00
kosmikusabel: oh, hi11/09 08:47
kosmikushow's Japan?11/09 08:48
glguyI was just reading though the (unreleased) 2-2-12 release notes11/09 17:59
glguyI didn't know about [unquote]11/09 17:59
glguysounds interesting11/09 18:00
* ski wonders whether glguy was referring to linear logic ..11/09 20:44
Saizanunquote is about agda's reflection11/09 20:47
glguyski: I was referring to linear logic earlier,  but not about unquote11/09 20:58
skisorry, yes :11/09 20:58
ski<glguy> This is breaking my intuition for lollipop...11/09 20:58
glguyyeah, that was linear logic11/09 20:58
xplatthe thing i really want for christmas is 35111/09 21:00
xplatbut 392 is not bad either11/09 21:00
xplatoh!  alex 3.0 is supported now.11/09 21:06
xplatsomebody here was waiting for that11/09 21:06
xplathm, looks like 392 only partly solves things11/09 21:08
* Eduard_Munteanu wants some nice Agda -> Haskell bindings for Xmas11/09 21:08
xplatit doesn't let you, say, give an irrelevant argument to a module in place of a regular argument and get a module with everything irrelevantized11/09 21:09
xplatso you still have to duplicate a lot of stuff, like a special irrelevant IsEquivalence record instead of reusing the regular one11/09 21:10
xplati kind of liked projection functions being highlighted as fields :711/09 21:14
glguyWhat could you do with that information?11/09 21:14
glguyare you talking about function you defined which were characterized as projection functions until recently in darcs agda?11/09 21:15
xplatyeah11/09 21:16
xplati could tell if the optimization was kicking in, for one thing11/09 21:17
xplatsince it can often make the difference between resources linear in depth and resources exponential in depth during typechecking, it's more than a mere implementation detail11/09 21:18
xplatmaybe there's a better way to supply that information, but it seems like the highlighting was better than nothing11/09 21:19
skiis there some documentation/paper which describes that ?11/09 21:19
xplati don't think there's a paper that describes the exact thing they're doing11/09 21:19
xplatit's close to, i think, 'indexed families need not store their indices' (i don't think that's the exact title)11/09 21:20
xplatbut i don't know how close11/09 21:20
xplati'd say at best 'kind of close' and at worst 'vaguely reminiscent'11/09 21:21
* ski would like such things to be checked by the type-system11/09 21:22
ski(i.e. not just an optimization kicking in if you happen th do things the right way)11/09 21:22
xplatwell, that would be nice11/09 21:24
xplatbut it seems to be standard in almost every language all over the typing spectrum that resource usage is controlled by voodoo and checked by benchmarks11/09 21:25
xplatso i was ecstatic just to have something turn colors if it's liable to be slow11/09 21:27
skii was thinking about stuff like `_!!_ : {A : Set} -> {n : Nat} -> Vector A n -> Finite n -> A' being able to enforce in the type system that the result doesn't depend (directly) on the `n' parameter, so it doesn't have to be passed11/09 21:28
dolioYou could do that with the irrelevancy support if they ever figured out how to make it work properly in the dependent case.11/09 22:07
--- Day changed Mon Sep 12 2011
RotsorNice! Updating agda to the latest version brought the time needed for deciding my (isPrime? 15) down from 10 minutes to like 10 seconds! :D12/09 00:37
Eduard_MunteanuHeh.12/09 00:39
the_fcostupid question, I want to implement a function insert : {n : ℕ} -> ℕ -> NatList n -> NatList (suc n) that inserts a number in a list of naturals, how do I compare the number x with the head of the list to swap or not the values?12/09 00:41
the_fcolike this function http://pastebin.com/BCvwj0tp (it doesn't compile)12/09 00:44
Rotsorthe_fco: Stupid answer, you use pattern matching to take off the list head and then compare using Data.Nat._≤?_?12/09 00:44
Eduard_MunteanuYeah, a ≤ b is a proof a <= b, it doesn't compare them.12/09 00:46
RotsorYou used ≤ there. ≤ returns a proposition, not a decision. To actually decide if that proposition is true or not, you need ≤?12/09 00:47
the_fcowhat are the results ≤? of  true | false?12/09 00:47
RotsorThe result is (yes <proof of yes>) or (no <proof of no>)12/09 00:48
copumpkinno12/09 00:48
copumpkinoh I see12/09 00:48
copumpkinis that question mark part of the symbol or part of the sentence? :P12/09 00:48
the_fcothe second one does not exist12/09 00:48
RotsorPart of the symbol, lol12/09 00:48
Eduard_Munteanu_≤?_12/09 00:48
Rotsorthe_fco: what does not exist?12/09 00:49
Eduard_MunteanuYou just need to pattern-match on yes _ and no _12/09 00:49
copumpkinwhen you prove that your list is sorted, you'll pattern match on yes and no and look at the proofs :P12/09 00:49
Eduard_MunteanuOr that :)12/09 00:50
copumpkinbut I'd probably write a type of sorted lists12/09 00:50
the_fcowhat am I doing wrong? http://pastebin.com/szw9C8Mg12/09 00:50
glguydo you have Relation.Nullary imported?12/09 00:51
glguyIt has the yes and no constructors of the Dec type12/09 00:51
the_fcoyay!! it works!! I was missing the import of Relation.Nullary!12/09 00:52
Eduard_MunteanuYou can use C-c C-n in emacs to test it if you want.12/09 00:55
Eduard_Munteanu(to eval an expression)12/09 00:55
glguyThe mnemonic is "normalize"12/09 00:55
the_fcothanks, and it works! :D12/09 00:58
* Eduard_Munteanu ponders real numbers in Agda.12/09 01:02
Eduard_MunteanuThis seems suitable (and allegedly used before): http://en.wikipedia.org/wiki/Construction_of_the_real_numbers#Construction_from_the_group_of_integers12/09 01:02
Eduard_MunteanuOther ideas?12/09 01:03
doliohttp://arxiv.org/abs/cs/060505812/09 01:04
Eduard_MunteanuLooks nice, thanks.12/09 01:04
copumpkinthat paper has fucked-up typography12/09 01:09
Eduard_MunteanuIt seems nicely written, though.12/09 01:14
augurcopumpkin: where how why12/09 01:15
Eduard_Munteanu"_Proof._ Easy." :)12/09 01:15
Eduard_Munteanuaugur: http://arxiv.org/abs/cs/060505812/09 01:16
Eduard_MunteanuTake the first paragraph, the letters line up badly.12/09 01:16
Eduard_Munteanue.g. "is" in "This"12/09 01:17
* Eduard_Munteanu thinks somebody played with microtypographical features.12/09 01:17
Eduard_MunteanuOr maybe it's just bad kerning.12/09 01:20
Eduard_MunteanuWow, it really is a neat mix of analysis, CT and Haskell-ish stuff.12/09 01:43
Eduard_MunteanuHm, wait, there *is* actual Haskell code.12/09 01:51
drdoHow would one write append for that usual Vec type?12/09 01:51
copumpkinthe definition is exactly the same as append for lists12/09 01:52
drdonamely, how does one convince the type checker that we actually have type Vec A n → Vec A m → Vec A (nplus n m)12/09 01:52
copumpkinassuming you recurse on the same side that you did when defining addition12/09 01:53
augurEduard_Munteanu: i dont see what youre talking about :(12/09 01:54
copumpkinlook at http://snapplr.com/jdkh12/09 01:55
copumpkinor http://snapplr.com/zk9y12/09 01:55
copumpkinor more wtf-like, http://snapplr.com/j6y412/09 01:55
augurfrom the paper Eduard_Munteanu linked to?12/09 01:56
copumpkinyep12/09 01:56
copumpkinmight just be the PDF not getting on well with my renderer12/09 01:56
augurwhat pages? because im not seeing these issues12/09 01:56
glguyThe lowercase letters vary slightly in height12/09 01:57
copumpkinyeah, it's not fucked if I load it in Preview on my mac12/09 01:57
copumpkinbut the chrome viewer hates it12/09 01:57
augurwell theres your problem!12/09 01:57
augurthe chrome viewer is lame12/09 01:57
augurobviously12/09 01:57
copumpkinit is, however, a fucked up PDF12/09 01:57
augurlook at you blaming the author or his editors12/09 01:57
Eduard_MunteanuI'm using evince here12/09 01:57
copumpkinhttp://snapplr.com/30h112/09 01:57
augurtsk tsk12/09 01:57
copumpkinwhy the fuck is it rasterized?12/09 01:57
Eduard_MunteanuHm, funny thing... if I zoom to 400% it seems to go away12/09 01:58
Eduard_MunteanuThe problem, I mean.12/09 01:58
augurits obviously some sort of output from a non-native PDF program12/09 01:58
augurperhaps its even a scan12/09 01:58
copumpkinI think all academics should be required to publish their TeX source12/09 01:58
copumpkinso I can rerender their papers and remove the suck12/09 01:58
copumpkinespecially the ancient .ps.gz ones I find occasionally12/09 01:58
augura lot of papers are like this12/09 01:58
auguri agree copumpkin12/09 01:58
copumpkinI know12/09 01:58
auguri think academics should also publish all of their raw data12/09 01:59
augurat least where there is data12/09 01:59
glguyWon't someone think of the funding??12/09 01:59
copumpkinthen you might discover how they cherry-picked it to look most favorable12/09 01:59
Eduard_MunteanuWait, is that our roconnor?12/09 01:59
copumpkinyes12/09 01:59
augur:|12/09 01:59
Eduard_MunteanuNice.12/09 01:59
augurshame on him12/09 01:59
Eduard_MunteanuThe content is nice though.12/09 01:59
augurits about maths12/09 02:00
augurso its obviously boring12/09 02:00
Eduard_Munteanu:)12/09 02:00
auguroh god i did it again12/09 02:00
augur>_<12/09 02:00
drdocopumpkin: What do i do if i need plus defined in various ways to make it work for different functions?12/09 02:00
augur"maths"12/09 02:00
copumpkindrdo: define it multiple ways and prove them equal12/09 02:00
copumpkinthen you can convert between definitions as you please12/09 02:00
drdois it possible to prove some equality and have the type checker use it to try to unify types?12/09 02:01
glguydrdo: you think thinking you'd need a version of plus that is recursive in the right argument?12/09 02:01
* Eduard_Munteanu asks him12/09 02:01
glguyare you*12/09 02:01
copumpkinI think there's a version of plus that switches its arguments as it moves along12/09 02:02
copumpkinused in the interleave function12/09 02:02
copumpkindrdo: no12/09 02:02
copumpkinit'd be nice but sadly that way lies madness :P12/09 02:02
glguydrdo: in some cases you can just prove a property which holds for + and use that to rewrite whatever type you had in mind for rewriting12/09 02:02
drdocopumpkin: what sort of madness happens? :D12/09 02:02
Eduard_MunteanuHm, it's available here as well, including the implementation... http://r6.ca/FewDigits/12/09 02:02
copumpkinthe crazy kind12/09 02:02
drdoglguy: In this particular case i was thinking i could just prove (plus x zero = x) and then the type checker would try to rewrite using that if it got stuck12/09 02:03
glguydrdo: you can't do that, but do you know about the "rewrite" syntax?12/09 02:03
Eduard_MunteanuBah, he went out.12/09 02:03
drdono i don't12/09 02:03
glguymy_definition x y z rewrite +-identity x = ?12/09 02:04
glguythe "rewrite +-identity x" is the rewrite syntax part12/09 02:04
Eduard_MunteanuWait, rewrite syntax?12/09 02:04
auguri dont know anything about rewrites in agda :D12/09 02:04
glguyit will rewrite cases of the left hand side of the equivalence to the right hand side as it occurs in the goal12/09 02:04
Eduard_MunteanuNew 2.2.12 tip goodness?12/09 02:05
glguyit is sugar for with + two expressions12/09 02:05
glguyold feature12/09 02:05
Eduard_MunteanuHm.12/09 02:05
glguyI'm sure I have some examples12/09 02:05
glguyhold please12/09 02:05
* Eduard_Munteanu greps release notes12/09 02:05
augurwhats new in agda, btw?12/09 02:06
auguranything good?12/09 02:06
Eduard_MunteanuAh, 2.2.612/09 02:06
glguyhttp://www.galois.com/~emertens/integer-properties/Data.Integer.Addition.Properties.html12/09 02:06
glguyway nicer than using subst and cong12/09 02:07
Eduard_MunteanuHm, nice indeed.12/09 02:10
glguyThe AIMXIV notes mention "Discussion on “abstract” Ulf: (explaining why it makes typechecking quicker,"12/09 03:58
glguyAnyone know much more about this?12/09 03:58
copumpkinI wonder if that's related to my feature request12/09 03:59
glguycan you import something as abstract12/09 04:02
glguyor do you have to rename it in an abstract section?12/09 04:03
copumpkinthat was the feature request12/09 04:03
copumpkinyou have to rename it12/09 04:03
glguyAnything to make it easier to import modules and rely on the properties they export rather than leaking implementation details all over the place would be great12/09 04:07
copumpkinyeah12/09 04:07
copumpkinif you chime in on the ticket maybe they'll take it more seriously12/09 04:07
copumpkinI ask for a lot of shit on there :P12/09 04:07
glguyI'm not sure how much "glguy wants it" counts :)12/09 04:07
copumpkin"someone else wants it", if not glguy :)12/09 04:08
glguyWhich ticket is it?12/09 04:13
copumpkinhttp://code.google.com/p/agda/issues/detail?id=43312/09 04:13
copumpkinnot really sure what's up with it12/09 04:13
copumpkinit was accepted for a moment12/09 04:14
copumpkinthen reverted to new again12/09 04:14
glguyStatus: Accepted12/09 04:14
glguyLabels: Priority-Medium12/09 04:14
glguyoh12/09 04:14
glguyright12/09 04:14
glguymaking the type of permutations abstract took my linear logic module type checking time from about 36 to 6 seconds12/09 04:29
glguyHow do you define something that can see into the abstract section12/09 04:30
glguybut which is not abstract?12/09 04:30
glguylike C++'s friends12/09 04:31
glguybasically anything using Solvers (Ring solver, commutative monoid solver) seems like it will benefit hugely from not being able to see into the proofs it is working with12/09 04:32
copumpkinhmm12/09 04:35
glguycopumpkin: Is this the best I can do in this situation? http://hpaste.org/5125812/09 04:35
copumpkinthe approach xplat used was to define abstract stuff and also an equality within the abstract block12/09 04:36
glguyThe main thing I'm trying to hide are the proofs in isCommutativeMonoid12/09 04:36
copumpkinso you can rewrite it to the real definition if you want it12/09 04:36
glguyI don't think I actually need a implementation of bag equality12/09 04:45
glguyI could just require an abstract equality which satisfies the commutative monoid laws when used with _++_12/09 04:45
glguypostulate12/09 04:50
glguy  _∼[bag]_ : List Expr → List Expr → Set12/09 04:50
glguy  isCommutativeMonoid : IsCommutativeMonoid _∼[bag]_ _++_ []12/09 04:50
glguyinstant permutations :)12/09 04:50
glguyWhy is universe polymorphism not that default12/09 05:38
glguyis it still controversial ?12/09 05:38
copumpkinI've considered proposing they remove it12/09 05:38
copumpkinI'd upvote that feature request :P12/09 05:38
copumpkinon the other hand12/09 05:38
copumpkinif when it was turned off12/09 05:38
copumpkinI could write forall {A} -> A -> A12/09 05:38
copumpkinwithout it turning yellow12/09 05:38
copumpkinI'd advocate leaving it as an option12/09 05:38
copumpkinbut currently there's no real benefit to not having it on (except for people who are too lazy to type it out)12/09 05:39
dolioYou cannot write forall {A} -> A -> A, even without universe polymorphism.12/09 06:08
dolioThe only way it is unambiguous is if there is only one universe.12/09 06:09
copumpkinI guess so12/09 06:09
copumpkinit should default ;)12/09 06:09
dolioIt is unambiguous when --type-in-type is on.12/09 06:15
copumpkinI'll just use that from now on12/09 06:19
augurhmm12/09 07:32
augurso heres a peculiar thing12/09 07:33
augurin terms of data types, you can define two distinct types corresponding to the languages { (abc)^n | n : Nat } and { a^n b^n c^n | n : Nat }12/09 07:39
augurbut only the former is a CFL12/09 07:39
auguryet these are isomorphic languages12/09 07:40
auguronly the former has a catamorphism tho12/09 07:40
augurat least in a simple definition12/09 07:41
auguri wonder if theres a way to relate these facts12/09 07:41
augurso that the CFL data types can be mapped to strings using a catamorphism but the CSL types cant12/09 07:41
augurinteresting12/09 07:56
augurif Sym is the set of symbols in the output string, then the number of catamorphically-defined functions from A^n B^n to Sym* is, i believe, |Sym|^(2 + K*|A| + K*|B|), by recursion on A^n and B^n separately, and assuming the recursively computing Sym*'s that are produced therein have no affect on how each level of the A^n/B^n's get mapped12/09 07:58
augurwhere K is the number of binary operations you have on strings12/09 07:59
augurwhereas for (AB)^n i think its |Sym|^(1 + K*K*|A|*|B|)12/09 08:00
augurmaybe more12/09 08:01
augurmaybe 2*K*K*|A|*|B| even12/09 08:01
augurno maybe not12/09 08:02
augurhmm12/09 08:02
augurno i think its 2*K*K*|Sym|^(1 + |A|*|B|), since theres |Sym| points in Sym, and for each function A*B -> Sym, theres also 2*K*K choices for the string combinators and their precedence, so 2*K*K*|Sym|^(|A|*|B|) such functions12/09 08:24
augurand i think it should also be K*K*|Sym|^(1 + |A|*|B|) earlier12/09 08:25
augurno..12/09 08:28
augurdamnit i cant do this :(12/09 08:28
augurwhat exactly is reflection in agda?12/09 10:21
mixisreflection as mentioned in the release notes?12/09 10:34
augurmixis: i suppose! whatever is used for making pseudotactics12/09 10:39
mixisthe way i understand it it's a way to have a look at your program from within your program12/09 10:41
auguralso, is anyone familiar with the relationship between the substantive aspects of a logic and its associated type theory?12/09 10:44
augurlike, the relationship between logics that dont suppose that relations are subsets of a cross product, and the type theory for this?12/09 10:45
auguror the relationships relating to different kinds of variables?12/09 10:46
mixiswhen it comes to tactics, it's probably difficult to build the from functions and types in the syntax world, so you walk on the structure of the program12/09 10:46
mixisso, i join you in asking, what exactly is reflection in agda12/09 10:48
Eduard_Munteanuhttp://r6research.livejournal.com/21747.html12/09 19:26
Eduard_MunteanuI wonder what other connectives there might be. I'm thinking of completing this proof.12/09 19:26
Saizanyou could generalize from NatEq to a polymorphic equality12/09 19:27
Eduard_MunteanuHm, this sounds simple, /me tries12/09 19:28
Eduard_MunteanuDone, I think: http://paste.pocoo.org/show/474817/12/09 19:30
Eduard_MunteanuIs extensionality controversial in any way (say, like LEM)? It looks more like a definition for function equality to me.12/09 19:34
copumpkinno, it's desirable12/09 19:35
copumpkinbut postulating or parametrizing by it doesn't give you everything you want12/09 19:35
copumpkinnamely, things won't reduce past it12/09 19:35
Saizanthe main problem is that taking it to hold judgementally makes typechecking undecidable, but OTT shows how you can have an intentional judgemental equality and an extensional propositional equality coexist12/09 19:36
Eduard_MunteanuBTW, why can't we make postulate that reduce / evaluate?12/09 19:37
Eduard_Munteanu*postulates12/09 19:37
Saizanwhat would they evaluate to?12/09 19:37
Eduard_MunteanuI imagine it might make sense to postulate    f : [...] A ≡ B, f = refl  for some A and B12/09 19:37
copumpkinyou don't have postulate definition12/09 19:38
copumpkins12/09 19:38
Eduard_MunteanuYeah, I know, but I wonder if that'd make sense.12/09 19:38
Saizanthere's trustMe though12/09 19:38
Eduard_MunteanuOh, right.12/09 19:38
Eduard_MunteanuI wonder if it makes sense to generate IsClassical to arbitrary/higher universes.12/09 19:45
Saizani'd think so12/09 19:45
Eduard_MunteanuI tried this when I started writing the proof, but Agda complained the datatype's level depended on the Set index level :/12/09 19:47
copumpkinI wouldn't do it that way12/09 19:48
copumpkinalso, you don't get \top and \bot at polymorphic levels12/09 19:48
copumpkinso it'd be a pain12/09 19:48
Eduard_MunteanuI figure I want IsClassical : Set m -> Set n, where n is "large enough"12/09 19:48
Eduard_MunteanuOh, hrm.12/09 19:48
Saizan"data IsClassical {l} : Set l -> Set (suc l) where .." should work somehow12/09 19:49
Eduard_MunteanuAh, I tried that too, but 'l' won't unify in the constructors.12/09 19:49
Saizanyes, l is a parameter there12/09 19:50
Saizanyou'd need polymorphic versions of top and bottom12/09 19:50
Eduard_MunteanuPossibly because it tries to unify 0 (in the bot and top case) with 'l'12/09 19:50
Eduard_MunteanuAha.12/09 19:50
copumpkinyou can Lift top12/09 19:50
copumpkinand lift bottom12/09 19:50
Eduard_MunteanuYep, that worked, thanks: http://paste.pocoo.org/show/474833/12/09 19:56
* Eduard_Munteanu should get rid of Data.Nat12/09 19:57
copumpkinI'd write the thing as a custom universe12/09 19:57
copumpkinwith an interpretation function12/09 19:57
copumpkinand then you can make the level depend on the argument12/09 19:58
Eduard_Munteanucopumpkin: like Power of Pi's universes?12/09 22:52
Eduard_MunteanuI suppose that'd be a lot more verbose. What's the downside of how I approached it?12/09 22:52
--- Day changed Tue Sep 13 2011
glguyhttp://hpaste.org/5128213/09 00:51
* glguy wonders if anyone else has needed this before13/09 00:51
glguyI got tired of writing things like: (_ ∷ _ ∷ _ ∷ _ ∷ _ ∷ _ ∷ [])13/09 00:52
Saizancute13/09 00:57
Saizannot seen that before13/09 00:57
xplatlooks kind of similar to curry^n^h or something13/09 01:17
Saizan^h?13/09 01:18
xplath for hidden, if i guess correctly13/09 01:18
xplatis aim still going on?13/09 01:18
xplatulf totally poured water on my favorite agda bug report yesterday13/09 01:20
xplatreclassified it from high-priority defect to medium-priority enhancement :(13/09 01:20
xplatwith a comment that basically said 'so don't do that, then'13/09 01:21
Saizanoww13/09 01:21
xplathttp://code.google.com/p/agda/issues/detail?id=351#c213/09 01:21
xplatoh, also he changed the summary to make it sound more ambitious and less important13/09 01:23
copumpkinxplat: which?13/09 01:23
copumpkinoh13/09 01:23
copumpkinit was NAD who downgraded it, fwiw13/09 01:24
xplatoh, you're right.  so it got double-teamed :(13/09 01:24
xplatsemantically, irrelevant terms should be easier to infer than relevant ones13/09 01:25
xplatany solution that would be valid if it were relevant should still be valid13/09 01:26
glguyxplat, I tried to figure out how to use Data.Vec.N-ary to do this. I think I'd have to implement curry^n^h myself in the module and then use it with Data.Vec.toList13/09 01:26
xplatand if there are syntactically conflicting constraints, it's okay to just throw one out and continue looking13/09 01:27
xplatthat gets you at least as many solutions as in the relevant case, and that's without any nondeterministic guessing that would earn the name 'proof search' in its own right13/09 01:29
xplatglguy: huh, i was sure there was a working curry^n^h13/09 01:31
xplati know there's a \all^n^h for sure13/09 01:31
Saizanxplat: i imagine there's some more complication given by erasing stuff early, though i don't have an example13/09 01:32
copumpkinxplat: comment on the bug! otherwise they won't know real people have a problem with this :P13/09 01:36
glguycd -13/09 01:42
xplatSaizan: yeah, erasing stuff early could cause a problem.  it's already being kept around longer than it used to for termination checking, but it could still be a problem in some cases, especially across modules13/09 02:16
xplatbut purely semantically speaking there's no reason it should ever be yellow when a relevant argument wouldn't13/09 02:17
xplatit's all an implementation matter13/09 02:17
xplatcopumpkin: and yeah, i need to comment on the bug13/09 02:17
copumpkin:)13/09 02:18
glguy_It did not occur to me to make a constructor like this13/09 07:52
glguy_constructor Q:_ [ ] :_sound:_13/09 07:52
glguy_for a record13/09 07:52
glguy_(or a data type, for that matter)13/09 07:52
Saizanwith some weird whitespace character?13/09 10:26
augurwark13/09 15:54
Saizanhttp://code.google.com/p/agda/issues/detail?id=292#c14 <- you can omit fields like that?13/09 19:55
--- Day changed Wed Sep 14 2011
glguySaizan: I think that the whitespace is a consequence of my copying it out of a PDF and not part of what you would type into a .agda file14/09 01:09
Saizanah, ok14/09 01:11
augurhow can i evaluate something exp and then use the result of evaluating it to show that exp = x, if i can match on exp?14/09 05:27
augurlike if exp is a test or something of that sort?14/09 05:28
augurim trying to show that a set can be divided into two disjoint subsets by a function, basically14/09 05:32
augurso that P ~ P' + P'' where f is a test on P14/09 05:32
augursuch that P' = {p in P | f p} and similar for P''14/09 05:33
xplatf is what, a boolean test?14/09 05:36
xplatbecause if you use Dec/Decidable instead you can get that for free with proof of purchase14/09 05:36
copumpkinaugur: how are you even representing subsets?14/09 06:01
copumpkinas sigmas?14/09 06:01
augurxplat: yes14/09 06:02
augurcopumpkin: in this case, yes14/09 06:02
augurSigma P f14/09 06:03
copumpkinit seems like it should be pretty easy, but I can't say I've tried14/09 06:03
augurwell14/09 06:03
augurSigma P \ x -> p x == true14/09 06:03
copumpkinouch14/09 06:03
copumpkinso not Dec14/09 06:03
copumpkin?14/09 06:03
augurguess not14/09 06:03
auguri mean, it IS decidable14/09 06:03
dolioYou shouldn't use booleans.14/09 06:03
auguri should look at Dec instead14/09 06:03
dolioAnd certainly not == true.14/09 06:03
augurAAAAAAAHHHHH14/09 06:04
copumpkin== true in that context actually makes more sense than in most14/09 06:04
copumpkinbut yeah, don't use booleans14/09 06:04
dolioT is almost certainly better than == true.14/09 06:05
copumpkinsure14/09 06:05
copumpkinI just meant that the usual "== true is retarded" argument doesn't work here14/09 06:06
augurdolio: cant match on it!14/09 06:06
auguri mean, im trying to show an isomorphism, right, and so its hard to really case analyze a propositional test14/09 06:06
copumpkinI'm not sure what you mean14/09 06:11
copumpkinoh, you shouldn't use Dec or bool14/09 06:12
copumpkinor maybe you should14/09 06:13
copumpkin:P14/09 06:13
auguri mean basically14/09 06:14
augurthe proof can be computed on the fly14/09 06:15
augurthe positive proof14/09 06:15
augurwell, rather14/09 06:15
auguragh14/09 06:16
copumpkinwell, keep in mind that if you're using types as sets14/09 06:16
copumpkinyou can't enumerate14/09 06:16
augurglguy: are you emertens?14/09 17:57
glguyaugur: I am14/09 17:59
augurglguy: well then, i can annoy you about explaining how the solvers work :)14/09 18:00
glguyCertainly14/09 18:00
copumpkinyour monoid solver seems pretty similar to my fold associativity stuff14/09 18:00
copumpkinbut my fold associativity thing is fugly :)14/09 18:01
glguyaugur: Did you want to ask me questions or did you want me to try and explain it from scratch?14/09 18:01
augurnot right now :P14/09 18:01
augurbut ill probably ask you to big-picture it14/09 18:02
glguyOh, OK. I try to be in #agda a lot, so let me know :)14/09 18:02
augurglguy: i know youre here a lot :p14/09 18:02
auguryou're one of the regulars!14/09 18:02
auguri didnt know you were emertens tho14/09 18:02
augurnow that i do, youre fucked ;D14/09 18:03
glguyThat's the best kind of are!14/09 18:03
auguractually, how about right now14/09 18:03
auguruntil my student shows up14/09 18:03
augurat the large scale, whats going on to automate these proofs?14/09 18:03
glguyI do all my Agda stuff as "glguy". I'm surprised you would rather ask emertens questions than glguy :)14/09 18:03
augurwell, i meant from the link14/09 18:04
auguryour stuff is under ~emertens on the galois website14/09 18:04
glguyAt the large scale you write a normalization function with gives you syntactically reflexive proof obligations14/09 18:04
augurok, youll have to explain this a bit :P14/09 18:04
glguyand you provide a proof that equality on the normalized form is as good as equality on the arbitrary forms14/09 18:04
glguysure14/09 18:04
glguybut that's the high-level14/09 18:04
augurwell what i mean is14/09 18:05
augurwhat do you mean syntactically reflexive proof obligations14/09 18:05
glguya + (b + c) == a + (b + c)14/09 18:05
glguyyou don't need to know anything about a, b, c or +14/09 18:06
glguyit's the same syntax, so its the same value14/09 18:06
glguyso if you know that your equality relation is reflexive, you're done14/09 18:06
augurim not entirely sure i follow14/09 18:07
glguyif == is reflexive it means you have a procedure that for all 'a'14/09 18:07
glguya == a14/09 18:07
glguyso if I ask you to prove a + (b + c) == a + (b + c)14/09 18:07
glguyand you know  for all a. a == a14/09 18:07
glguyyou can prove it by picking 'a' to be a + (b + c)14/09 18:08
glguyyou don't need to know anything else about my type or operation14/09 18:08
glguyAre you with me up to this point?14/09 18:08
augurright14/09 18:08
glguyOK, so if I ask you to prove (a + b) + c = a + (b + c)14/09 18:08
augurand this is on _expressions_ a + (b + c) not their values14/09 18:09
glguyyes14/09 18:09
auguri see14/09 18:09
augurohh i think i see14/09 18:09
glguyyou would have to know something about +14/09 18:09
glguythat isn't *obviously* true14/09 18:09
glguyso in agda you don't have access to knowing how expressions are constructed14/09 18:10
augurso you're basically saying that since == is reflexive, at the denotation level you want to say eval ((a + b) + c) == eval (a + (b + c)), so we can reason that at the syntactic level (a + b) + c = a + (b + c)?14/09 18:10
augurok, agda without access. yes14/09 18:11
glguythis is where the reflection part comes in, you have to tell the solver what the shape of the goal expression is.14/09 18:11
glguyI'm thinking about your question :)14/09 18:12
glguyI'm pretty bad at the actual theory of this stuff, so I really have to concentrate when you start using things like denotation :)14/09 18:13
augurwell, normalized value instead of denotation, if you prefer14/09 18:14
augur"the thing you evaluate down to" :P14/09 18:14
glguyyeah, OK :)14/09 18:14
glguythen yes, I believe your statement is correct14/09 18:14
augurok14/09 18:14
augurso reflection14/09 18:14
glguythis is why I stopped giving tech talks about Agda at work. People kept wanting to dive into the theory of things and I wasn't able to answer their questions at that level14/09 18:15
glguyso we do two semantic evaluation functions, one which constructs a value which has the correct syntactic representation as our goal14/09 18:15
glguyand one which has a normalized syntactic representation14/09 18:15
glguy(both of these work on the "reflected" value)14/09 18:15
glguywhere operator application is made explicit14/09 18:16
glguythe type of the equivalence produced will be syntactically identical to the one goal, and so it will be accepted, and the type of the equivalence you are asked for will be syntactically reflexive14/09 18:17
glguyand easy to provide14/09 18:17
glguy(if I'm focusing on the parts you already get, let me know)14/09 18:17
augurcan you give a simple toy example just so i can make sure i know what you mean by this?14/09 18:17
glguyso in my simple (a + b) + c == a + (b + c) case14/09 18:18
glguyI'm going to construct a "reflected" value   (a b c : Fin 3) -> (a :+ b) :+ c := a :+ (b :+ c)14/09 18:18
glguy:+ is a constructor14/09 18:18
glguy:= is a constructor14/09 18:18
glguyFin 3 is the type of variables var0, var1, and var214/09 18:18
augurright14/09 18:19
glguymy first semantic evaluation function will replace all instances of := with ==14/09 18:19
glguy:+ with the operation +14/09 18:19
glguyand substitute all the variables with ones you provide14/09 18:19
glguythe second semantic evaluation functions first normalizes that express to a list of variables14/09 18:20
glguyit knows that associativity isn't going to matter14/09 18:20
glguyand then it foldrs all the :: into + and [] into 014/09 18:21
glguyWe use the proof that + is associative and 0 is identity to show that this doesn't change the meaning14/09 18:21
glguyno matter what reflected value we start with14/09 18:21
glguy(I haven't tried explaining this before, can you tell?)14/09 18:22
glguyso the fact that normalization is now proven not to change the meaning means we can use proofs about the normalized values14/09 18:23
glguyto prove things about the non-nomalized ones14/09 18:23
glguy[[ (a :+ b) :+ c := a :+ (b :+ c) ]] evaluates to (a + b) + c == a + (b + c)   and [[ (a :+ b) :+ c := a :+ (b :+ c) \down]] evaluates to a + (b + c) == a + (b + c)14/09 18:24
glguywhich part of this is the most confusing? is it the relationship between what [[_]] and [[_\down]] does?14/09 18:25
glguyIncidentally, "Definable Quotients in Type Theory" http://www.cs.nott.ac.uk/~txa/publ/defquotients.pdf14/09 18:35
glguyUses this same notion of normalized representation14/09 18:35
copumpkinso you're basically proving ((a + b) + (c + (0 + d)) + e equal do (((a + 0) + b + c) + d + e) by first removing all 0s14/09 18:55
copumpkinand then reassociating all addition to the right, and then checking things are equal14/09 18:56
copumpkinright?14/09 18:56
glguyyes14/09 18:56
copumpkinand obviously carrying proofs that the reassociated versions being equal implies the originals being equal14/09 18:56
copumpkinI guess you lost augur along the way though14/09 18:57
copumpkinthat or his student showed up and he had to disappear14/09 18:57
glguyI'm hoping that it is the later :)14/09 18:57
copumpkinbut it makes sense14/09 18:57
glguycopumpkin: Have you read through that definable quotients paper?14/09 19:03
copumpkinnope14/09 19:03
augursorry, i student came and i had to talk to him :P14/09 19:09
augurok so whats the point of the distinction [[_]] vs [[_\down]] again?14/09 19:10
glguythe expression returned from [[_]] is the one you want the solver to return14/09 19:11
glguyso that it will fit in the context you are trying to use the solver in14/09 19:11
glguyand the expression returned by [[_\down]] is the one that is easy to reason about14/09 19:13
glguyif your objective is to have a value of type  (a+b)+c==a+(b+c),   you pick a "reflected" expression R such that [[ R ]] evaluates to (a+b)+c==a+(b+c)14/09 19:14
copumpkinhttp://hpaste.org/49430 is the stuff that's sort of similar, that I was working on14/09 19:14
copumpkinbut very different goal14/09 19:14
glguy[[ R \down]] evaluates to, a+(b+c)==a+(b+c)14/09 19:15
glguyand we know that that is true because == is reflexive14/09 19:16
auguraha!14/09 19:17
augurwhat does the proof automation look like, roughly?14/09 19:18
augurlike, if you need a proof (a+b)+c==a+(b+c)14/09 19:18
glguyit applies assoc and identity to the left and right hand side until they both are fully right associative14/09 19:19
augurright right i mean14/09 19:19
glguyoh, you would type:14/09 19:19
augurwhat does use of tactics look like, and how does that translate into these things14/09 19:19
glguysolve 2 (\a b c -> (a :+ b) :+c := a :+ (b :+ c)) refl14/09 19:19
copumpkinand eventually quoteGoal t in solve t refl14/09 19:19
copumpkinor something14/09 19:19
glguyand this has the type:   (a b c : Nat) -> (a + b) + c == a + (b + c)14/09 19:20
augurwhat is the purples of the 2 and the refl there?14/09 19:20
augur..14/09 19:20
augurpurples!14/09 19:20
augurpurpose14/09 19:20
glguy2 is a typo14/09 19:20
glguyshould be 314/09 19:20
auguror three!14/09 19:20
glguyit is the number of variables I want14/09 19:20
auguri see14/09 19:20
glguysolve 3 takes a function of 3 arguments to a reflected expression14/09 19:20
augurwhere a reflected expression is ..14/09 19:21
augurim not perfectly clear on the whole reflection thing14/09 19:21
glguy(\a b c -> (a :+ b) :+c := a :+ (b :+ c))14/09 19:21
glguythe right hand side of the -> is the "reflected" expression14/09 19:21
glguy:+ is a constructor and not the actual + operation you want14/09 19:22
augurright right14/09 19:22
augurwhere do these reflected expressions come from?14/09 19:22
glguyyou write them14/09 19:22
glguyit's manual reflection14/09 19:22
glguyyou look at your goal and add :'s before everything, basically14/09 19:22
augurright right14/09 19:22
auguror () as some people seem to do :p14/09 19:23
glguyyeah, any convention works :-P14/09 19:23
copumpkinthe refl will fail if your expression doesn't evaluate to the actual goal14/09 19:23
glguyit will also fail if your expression's normal forms aren't the same14/09 19:23
glguyif your expression doesn't evaluate to the actual goal the solve will have the wrong type14/09 19:24
augurhmm14/09 19:25
augurso these are sort of14/09 19:25
augurtype-level programs that are run at type check time, basically14/09 19:26
augurand failure to type check is, at worst, refutation, and at best, evidence that your tactics arent good enough14/09 19:26
glguysounds about right14/09 19:27
glguyThere is nothing that says that your normal form is complete14/09 19:27
glguyso if you don't pick an actual normal form then it might not work14/09 19:28
glguyit can still give you a possibly simpler goal14/09 19:28
glguyit just won't be reflexive14/09 19:28
glguyOK, I have a meeting now. See you later!14/09 19:28
copumpkinciao14/09 19:29
augurknowing this, i think itll be easier for me to understand the solver14/09 19:33
augurnow all i need to do is learn how to understand the equational reasoning stuff! :P14/09 19:33
copumpkinequational reasoning is basically a clean way of writing big chains of transitivity proofs14/09 19:34
copumpkinit works for anything that supports transitivity14/09 19:35
copumpkinso any preorder14/09 19:35
augurno certainly14/09 19:36
auguri just dont understand the big picture stuff of that either14/09 19:36
augurim used to the SICP way of learning stuff14/09 19:39
augursimple toy examples + full, detailed evaluation traces14/09 19:39
auguryielding an understanding of particular examples so that you have an intuition that you can then generalize14/09 19:40
tac-ticsIs there a list of useful programs written in Agda lying around?14/09 23:37
augurtac-tics: yes14/09 23:39
augurif you navigate your web browser to the webpage about:blank you'll find a comprehensive list of useful agda programs that people have written14/09 23:40
Nebasukewas anyone daring enough to try to install agda 2.2.10 on Windows 7 Home? I'm trying to install it (running it as administrator) but still get the error "could not modify permissions for {app}\lib-0.514/09 23:40
tac-ticsaugur: hurrrr :D14/09 23:41
augur:D14/09 23:41
tac-ticsIt reminds me of the mathematician's mindset. Useful programs can be written. I have proved it. So why would I ever do it?14/09 23:42
augurthe genuinely serious motto of agda, right now, is that youve already typed checked it and proved it correct, so theres no point in running it14/09 23:43
glguyThe biggest Agda program I remember executing would take lines of input and match them against a regular expression for you14/09 23:44
augurglguy!14/09 23:48
augurhows life.14/09 23:48
glguyIt's life :)14/09 23:50
--- Day changed Thu Sep 15 2011
glguyaugur: have you ever written a long chain of "trans" statements trying to prove that some A was related (equivalent, less-than, etc) to some B?15/09 02:36
augurmaybe!15/09 02:36
lambdabotaugur: You have 1 new message. '/msg lambdabot @messages' to read it.15/09 02:36
augurno15/09 02:36
augurbut!15/09 02:36
glguywow, all of those things?15/09 02:37
glguyHave you used "trans"?15/09 02:38
auguroccassionaly but not often15/09 02:51
Eduard_MunteanuThat eq reasoning thingy is nice if you want to avoid trans.15/09 03:06
xplatthe nicest thing about eq reasoning isn't avoiding trans15/09 03:10
xplatit's the fact that it allows you to write out the intermediate expressions in a train of transes so you can see them when looking at the source15/09 03:11
Eduard_MunteanuYeah, it actually looks like transforming equalities.15/09 03:11
xplatit's like the difference between directions like 'walk 45 paces, turn 75 degrees to the left, go 10 more paces, ascend 3 steps, ...' and an actual map with a dotted line on it15/09 03:13
xplatthere's really no fancy trick to it though; it's basically just using trans with one more explicit argument and with the arguments in a nicer order15/09 03:15
xplatthere's a lot of syntactic cleverness, but the only non-syntactic cleverness is wrapping the equivalence relation so things don't compute too fast15/09 03:17
Eduard_MunteanuDamn, how do you work with subsets in Agda without wishing you were dead? :)15/09 08:21
* Eduard_Munteanu is trying to extend Algebra.Structures with subgroups, but .. *sigh*15/09 08:22
Eduard_MunteanuI guess what I want is an injection B -> A to define B as a subgroup of A.15/09 08:23
Eduard_MunteanuOr maybe an injection on setoids (B, e') -> (A, e), though Algebra.Structures uses some ad-hoc setoid-like structure.15/09 08:25
Eduard_MunteanuThat way I suppose one only needs to prove A is a group, and the image of B through the injection is a group.15/09 08:27
Eduard_MunteanuHrm, but that doesn't seem to guarantee B is closed wrt the group operation.15/09 08:29
danrEduard_Munteanu: an injection (mono) would be the CT way of doing it I suppose, but I guess you can do a member predicate15/09 08:49
Eduard_MunteanuWell, I somewhat want to avoid subgroups being different from regular groups, so I can comfortably say C < B < A. That sounds problematic if I say B is a set plus a membership predicate.15/09 08:51
Eduard_Munteanu(actually, B is A plus a membership predicate)15/09 08:52
danrOk right. But I guess you could compose the predicate?15/09 08:52
Eduard_MunteanuYeah, but that seems to require different notions of a group for B and A. One takes a set and a predicate, the other just a set.15/09 08:53
Eduard_MunteanuI'm thinking a mono/injection might allow B to be defined as an ADT whose constructor enforces membership.15/09 08:58
danrI think it could be possible B being a Group as well, but with another carrier, a Σ-type of A's carrier and that the predicate is satisfied15/09 08:58
Eduard_MunteanuHm, I see.15/09 08:59
danrI need to go now, but good luck :)15/09 09:00
Eduard_Munteanudanr: thanks o/15/09 09:00
Eduard_MunteanuHrm, maybe I can define it in terms of injective group morphisms.15/09 09:31
Eduard_MunteanuWhat do you guys think about this?   http://hpaste.org/5137015/09 10:08
Eduard_MunteanuSorry about the ^ stuff, it copy-pastes badly.15/09 10:08
Eduard_MunteanuThey should read like _≈̂_15/09 10:08
Eduard_MunteanuIs it too much, too little, both?15/09 10:11
Eduard_MunteanuHm, maybe I should repost the question... http://hpaste.org/5137015/09 12:30
Eduard_MunteanuWhat do you think about that definition of a subgroup (the group's definition is from the stdlib)? Is it enough, is it too little?15/09 12:31
xplatEduard_Munteanu: instead of the two 'closed' properties you should have lift (x ·^ y) \~~ lift x · lift y and likewise for inverse15/09 12:44
xplat(those are stronger properties than the 'closed' ones, so it was 'too little')15/09 12:47
Eduard_Munteanuxplat: ah, I see. However I was hoping I could prove the inverses are the same in a subgroup.15/09 12:47
Eduard_MunteanuBut yeah, I guess that's better.15/09 12:48
Eduard_MunteanuThanks.15/09 12:48
xplatthanks to having an inverse you can prove that the identity is the same, at least15/09 12:48
Eduard_MunteanuHm, I see.15/09 12:49
xplatyou might be able to get away without the inverse condition too, it's been a while, but you definitely need the multiplication condition i gave you15/09 12:50
Eduard_MunteanuYeah, that looks alright.15/09 12:51
Eduard_Munteanuxplat: my initial thought was I had to make sure B is closed wrt to the operation, so if I lift into A I don't "step out" of B when applying the operation.15/09 12:51
Eduard_MunteanuMaybe I can prove that using the multiplication-is-compatible-with-lift thingy.15/09 12:52
xplatyou can prove the closure trivially from that (the proof is 'lift (x · y) , sym ·-compatible')15/09 12:54
xplat(i assume symmetry of \~~ is buried in there somewhere)15/09 12:55
Eduard_MunteanuOh, nice. Yeah, it's supposed to be an equivalence.15/09 12:56
xplatEduard_Munteanu: i'm pretty sure now you don't need a separate compatibility law for inverse15/09 13:10
Eduard_MunteanuThanks. I'll try to prove it without assuming it.15/09 13:10
Eduard_MunteanuClosure for multiplication worked fine, Auto guessed it alright.15/09 13:11
xplathint : first prove lift \Ge \~~\^ \Ge\^15/09 13:12
xplatthe reason, btw, that you want compatibility rather than closure is without it the subgroup wouldn't behave like a subset15/09 13:14
Eduard_Munteanuxplat: doesn't lift being an injection solve the subset part?15/09 13:15
xplatlike, you could have A as the rationals under addition, and B as the positive rationals under multiplication15/09 13:15
xplatwait, that doesn't work15/09 13:16
xplatbut there are finite examples15/09 13:16
xplatwhere the product will be different if you take it in B or A15/09 13:17
xplatso then the elements of the subgroup won't act like they're just alternate 'names' for elements of the larger group15/09 13:18
xplatof course, if you have an injective function into a group A that's closed under all operations, you can always construct a group out of it by 'pulling back' the group structure of A along the map15/09 13:20
xplatthe compatibility condition just ensures that your group structure on B already matches the structure you would get by doing that15/09 13:21
Eduard_MunteanuAh, I see.15/09 13:22
xplati wonder what the agda team's policy is like on substantial patches from outside15/09 13:24
Eduard_MunteanuI'm planning on submitting this, if I get far enough. :)15/09 13:25
Eduard_MunteanuLike, getting to normal subgroups and that stuff.15/09 13:25
xplatah, i meant for agda, not the library15/09 13:26
Eduard_MunteanuAh.15/09 13:26
Eduard_MunteanuIt might be nice to merge copumpkin's stuff into the stdlib though.15/09 13:27
Eduard_MunteanuThe CT stuff, I mean.15/09 13:27
xplatthat's unlikely15/09 13:27
xplatthe CT stuff is getting to be around the same size as the whole stdlib, i think15/09 13:28
xplatif not yet, soon15/09 13:28
Eduard_MunteanuHeh.15/09 13:30
xplatand the agda maintainers don't want the stdlib to get much bigger so it won't become a large maintenance burden15/09 13:31
Eduard_MunteanuYeah, they're still not using NCIs for 'show', for example. :/15/09 13:32
xplatwell, one of the design criteria for NCIs was that you could make parameterized modules typeclassy without them being designed that way15/09 13:33
xplatby using {{...}} or whatever15/09 13:33
Eduard_MunteanuI wonder if a monic group homomorphism identifies a subgroup.15/09 13:37
xplatyes15/09 13:38
Eduard_MunteanuI see, that might be a nice alternate description.15/09 13:39
xplatthat's basically what you have already, since for group homomorphisms 'is monic' <-> 'has an underlying function that is injective'15/09 13:40
Eduard_MunteanuOh, hrm, and homomorphism gives me compatibility with the operation.15/09 13:41
djahandariehttps://github.com/agda/agda-frp-js/ Sweet jesus15/09 19:50
djahandarie"FRP and Javascript backends were too easy in Haskell, so let's combine them and do it in Agda!"15/09 19:53
Eduard_MunteanuWow, heh.15/09 20:31
--- Day changed Fri Sep 16 2011
Saizanhttp://code.google.com/p/agda/issues/detail?id=460 <- ugh?16/09 04:27
dolioI like 460 better than 459.16/09 04:29
copumpkinwtf16/09 04:32
xplatO_o 46016/09 04:44
copumpkino_O 45916/09 04:44
xplatthat's an interesting idea, 459.  i've often found writing ? too useful, so it would be nice to have that around when i just want to make things hard on myself16/09 04:46
augurhey xplat16/09 04:55
augurxplat: check out some things i observed!16/09 04:57
augurhttp://wellnowwhat.net/linguistics/Phrase%20Markers.pdf16/09 04:57
mrAgdaxplat?16/09 14:02
copumpkinoh wow, it's mrAgda16/09 14:15
* mrAgda waves at copumpkin16/09 14:15
copumpkin:)16/09 14:15
mrAgdado you know what xplat had in mind when he said "i wonder what the agda team's policy is like on substantial patches from outside" ?16/09 14:16
copumpkinno idea (I can't even see that on my scrollback), but I assume he was talking about doing some work himself on agda16/09 14:17
copumpkinwe were talking about that at hac phi but we got sucked into a proof and never got any time to work on agda itself16/09 14:18
Eduard_MunteanuI was there when he said it, but I have no idea what he meant, didn't ask :/16/09 14:18
Eduard_MunteanumrAgda: btw, I've been meaning to ask you this... was it ever the case Agda had cumulative universes? Your thesis seemed to take that direction.16/09 14:19
mrAgdawhat he should do is open an enhancement request on the bug tracker and volunteer do fix it himself16/09 14:19
mrAgdai believe i was just hoping there would be writing the thesis :P16/09 14:22
copumpkin:)16/09 14:28
copumpkinhow much longer is the AIM?16/09 14:28
mrAgdafinished yesterday16/09 14:29
copumpkinoh no!16/09 14:29
mrAgdait's DTP now, i'm back in sweden though16/09 14:30
copumpkinnot interested in ICFP?16/09 14:31
mrAgdasure, but don't really have the time16/09 14:31
copumpkinah ok16/09 14:31
Saizanmaybe it was inference for irrelevant arguments16/09 15:13
mrAgdayeah, i saw he wasn't overjoyed by my analysis on that one :)16/09 15:24
copumpkinburn16/09 15:45
glguyI wish AIM could last forever. I love seeing the stream of commits16/09 17:01
* copumpkin cashes in on his bitcoin fortune and founds the Agda Development Initiative, hiring all Agda developers and enthusiasts full time for $500k a year, with ultimate freedom16/09 17:02
glguy  * record constructors are no longer live in the record modules16/09 17:02
glguySo any code using record constructors needs to be updated now?16/09 17:03
glguySo I was working through the proofs that integers form a commutative ring with negation, addition, and multiplication working with the representation of a pair of naturals and an equivalence that considers two values equal if the difference in those two numbers is equal.16/09 17:11
glguyThe paper on definable quotients in type theory suggests this16/09 17:11
glguybut it seems like you just move all of the hassle to the proofs that the operations preserve this new equality16/09 17:11
copumpkinyeah16/09 17:14
glguyPerhaps I'm missing some obvious technique for making the congruence proofs simple16/09 17:16
glguyI did the first one for _+_ but it was kind of a mess16/09 17:16
xplatwell, i just wrote a substantial comment on 351 and it failed to submit16/09 18:04
copumpkinfailhttp16/09 18:04
xplatno, failfancyjavascriptedtextarea16/09 18:06
xplatwithout javascript there are two textareas, and i guess i picked the wrong one16/09 18:07
glguyyou are probably a bot16/09 18:15
xplatokay, went through this time.16/09 18:18
xplatfixing 351 myself feels a little too hard for me right now, what i wanted to do myself was add a little extra support for reflection16/09 18:21
xplatthings like allowing quote and quoteGoal in syntax declarations16/09 18:22
xplatso using tactics can at least look less nasty16/09 18:24
xplat(maybe syntax that hides reflection could get its own highlight style so it stands out without looking ugly)16/09 18:26
Saizanthat'd be nice, and idris already have something like that iirc16/09 18:28
tac-ticsIn Agda, how are the injectivity and disjointness of constructors expressed in the underlying type rules?16/09 18:40
tac-ticsI'm trying to write a minimal depedent type language with only Nat and the Empty builtin types16/09 18:41
tac-ticsBut I am having trouble proving that 0 != 1 :)16/09 18:41
xplatyou probably don't want to use Agda as your model there, since Agda expresses this with complex rules for dependent pattern-matching16/09 18:41
tac-ticsxplat: Do you happen to know about other systems?16/09 18:42
tac-ticsMaybe I should ask in #Coq16/09 18:42
xplat'core calculi' like CIC express this by giving an elimination rule for each inductive type16/09 18:42
xplatwhich is a function of an appropriate type16/09 18:43
Saizanagda pattern matching can be reduced to such eliminations rules plus an heterogenous equality type with UIP16/09 18:43
tac-ticsxplat: well, I have written NatRec, which is Forall P:Nat->*. P Zero -> (Forall n :Nat. P n -> P(Sn)) -> Forall n':Nat. P n'16/09 18:44
xplatEmpty's eliminator is simple: \all A -> Empty -> A16/09 18:44
tac-ticsCan I use the elimination rule to prove this?16/09 18:44
copumpkinxplat: did you see ulf in here asking after you before?16/09 18:45
Saizantac-tics: http://citeseer.ist.psu.edu/viewdoc/summary?doi= 18:45
Saizantac-tics: "no confusion" is the one you want16/09 18:45
Saizanhttp://citeseer.ist.psu.edu/viewdoc/summary?doi= <- also relevant16/09 18:46
tac-ticsThanks :D16/09 18:46
xplatcopumpkin: yeah, that's part of why i went and cleared up what i wanted to do, in case anybody else shows up and asks when i'm not active (since ulf doesn't seem to be here right now)16/09 18:50
copumpkinhe should be DrAgda16/09 18:51
copumpkinnot MrAgda16/09 18:51
xplatmaybe he wants to express that he's married to the language?16/09 18:51
copumpkincould be16/09 18:52
xplatwell, so much for that hunch16/09 18:53
xplatpattern-matching lambdas don't quote particularly well, do they?16/09 18:53
xplati was hoping i could figure out how they quote and unquote them for pattern-matching, but the quotation doesn't contain sufficient information to construct them, there's only a gensym16/09 18:54
xplatSaizan: do either of the references you just quoted instruct on how to determine the proper type for a fully-dependent eliminator?16/09 18:55
copumpkinxplat: it seems fairly straightforward to compute that16/09 18:56
copumpkinbut maybe I'm just misunderestimating it16/09 18:56
Saizanxplat: i don't remember but the second one is more likely, there's a table in the view from the left though16/09 18:56
xplatcopumpkin: i know the nondependent eliminator is easy, but not so sure about dependent ones.  starting in agda instead of coq means i haven't seen a lot of them, relatively speaking.16/09 18:57
copumpkinhmm16/09 18:58
copumpkindon't you just take one parameter for each constructor16/09 18:58
copumpkinoh, I guess the question could be what to do for recursion?16/09 18:58
copumpkinparamorphism-like?16/09 18:58
xplatalso, looks like agda doesn't have quoteTerm16/09 18:59
xplatstill16/09 18:59
xplatit doesn't actually add additional power, since you can fake it up with quoteGoal and a record type16/09 19:00
xplatit's just that it takes up most of a line per use that way16/09 19:00
copumpkinwhy do you need a record?16/09 19:01
xplatwell, a record or a data16/09 19:01
copumpkinokay yeah16/09 19:01
xplatyou need something that holds the term in the (fully-normalized) type so it's visible to quoteGoal but holds a Term inside16/09 19:02
xplat(at the value level, so you can return it)16/09 19:02
xplatso you need a projection on the outside, an injection on the inside, and the quoteGoal binder sandwiched between.  not difficult, but noisy.16/09 19:03
kamatsuI've been out of the agda loop for a while16/09 19:13
kamatsuhas any progress been made on record setters? I understand that if you have a dependent record then you might need to update more than one thing simultaneously, but i don't see that as being an insurmountable problem16/09 19:14
copumpkinfix (agda kamatsu)16/09 19:14
kamatsuand right now if you want to set a value on a record you have to make a whole new record and copy everything over, which is syntactically very noisy16/09 19:14
copumpkinyou mean just the syntax?16/09 19:15
copumpkinah, I doubt it16/09 19:15
copumpkinyou have a feature request for it?16/09 19:15
kamatsunope, i complained about it on the mailing list, and then i was swamped by work16/09 19:15
copumpkinI'd just throw a ticket on the tracker16/09 19:15
copumpkinstuff gets lost on the list16/09 19:15
kamatsuWhen I have time to write a decent proposal, i might do that16/09 19:16
kamatsueither that or i'll implement them myself16/09 19:16
kamatsualso, there's some stuff surfacing on the list that I hadn't seen before16/09 19:17
kamatsucan anyone explain to me what this irrelevance stuff is all about?16/09 19:18
kamatsu(i'm also wondering about "abstract" blocks)16/09 19:18
kamatsucan't find any docs anywhere16/09 19:18
copumpkinabstract blocks have been around for a while16/09 19:19
copumpkinit basically tells agda not to reduce past the definitions exported from the block16/09 19:19
kamatsuoh, so you can give prettier errors?16/09 19:19
copumpkinirrelevance is a bit like a more granular Prop/Set distinction à ala coq16/09 19:19
copumpkinprettier goals16/09 19:19
kamatsuah, right16/09 19:19
copumpkinsometimes you don't want things to normalize all the way16/09 19:19
copumpkinalso, sometimes you don't want to expose your implementation16/09 19:19
copumpkinand just want to expose properties you guarantee16/09 19:19
kamatsuyep, cool16/09 19:19
kamatsumakes sense, but it's odd it's not documented anywhere16/09 19:20
kamatsu(that I could find)16/09 19:20
kamatsuI haven't used Coq beyond a brief test, I got the feeling it was Agda's theory with Isabelle's disgusting syntax16/09 19:20
kamatsuProp/Set distinction?16/09 19:21
kamatsuwhat is there to make distinct?16/09 19:21
tac-ticsI am also curious about the need for a distinct Prop and Set16/09 19:22
Saizani don't think Coq really has irrelevant for stuff in Prop anyhow?16/09 19:22
Saizan*irrelevance16/09 19:22
copumpkintac-tics: in Prop, you can have LEM16/09 19:22
copumpkinsafely16/09 19:22
tac-ticsLEM?16/09 19:22
copumpkinlaw of excluded middle16/09 19:22
kamatsuexcluded middle16/09 19:22
kamatsup or not p16/09 19:23
kamatsuwhat's unsafe about going, say16/09 19:23
copumpkinalso, I think anyone who's worked with proofs for a while has an intuition for what "doesn't carry information"16/09 19:23
copumpkinsay you have a proof that two values are equal16/09 19:23
Saizananyhow, the idea of agda's irrelevance is that if you have (f : .A -> B) then forall x y. f x = f y16/09 19:23
kamatsupostulate em = P or not P16/09 19:23
copumpkinmaybe the proof does crazy recursion over the arguments16/09 19:23
Saizanand similarly for records, irrelevant fields are automatically equal16/09 19:24
kamatsusome sort of injectivity?16/09 19:24
copumpkinit _should_ be possible to throw that proof out (and maybe not even compute it in the first place)16/09 19:24
kamatsuoh wait16/09 19:24
copumpkinkamatsu: it behaves a bit like "taint"16/09 19:24
kamatsunevermind16/09 19:24
kamatsuhm16/09 19:25
kamatsuso, i'm not seeing the use case here16/09 19:25
kamatsuso f : .A -> B literally means that "f ignores the argument A"?16/09 19:26
kamatsuor the result of f does not depend on its argument?16/09 19:26
copumpkinit's more interesting on constructors or records16/09 19:27
Saizanmore the latter16/09 19:27
copumpkinalso, in an ideal world16/09 19:27
copumpkinwe could talk about something "parametric"16/09 19:27
copumpkinreverse : forall {.n} -> Vec n -> Vec n -> Vec n16/09 19:27
Saizansince f can pass the A to stuff which expects an irrelevant argument too16/09 19:27
kamatsucopumpkin, why is the implicit arg irrelevant?16/09 19:28
Saizankamatsu: also, operationally, irrelevant fields gets discarded early, so less memory use during typechecking16/09 19:28
copumpkinkamatsu: well, that doesn't actually work16/09 19:29
copumpkinbut in an ideal world, it'd prevent you from pattern matching on it in that non-irrelevant function16/09 19:29
copumpkinI sort of doubt it'll ever work that way though :(16/09 19:29
kamatsui fail to see how that helps at all16/09 19:29
Saizananother use is making e.g. a Functor record where the laws are irrelevant, so two functors are definitionally equal iff the actions on objects and morphisms are, and it doesn't matter how you've proved the laws16/09 19:29
copumpkinkamatsu: it gives you more guarantees about what the function does, based on its type16/09 19:30
copumpkinwe don't get parametricity in agda16/09 19:30
copumpkinit'd be nice if irrelevance could get us closer to it16/09 19:30
copumpkinor rather, we do get it, but we can't prove anything about it :Pp16/09 19:30
Saizanreverse can recover what 'n' is by looking at the vectors though :)16/09 19:30
copumpkinwe also can't make statements about whether a pi is parametric or not16/09 19:30
Saizanrather, it has to16/09 19:30
copumpkinSaizan: true16/09 19:30
kamatsuthat's what was puzzling me16/09 19:31
tac-ticsWhat happens when you try to embed LEM into Set then?16/09 19:31
tac-ticsDo you break your strong normalization?16/09 19:31
kamatsuwell, it lets you prove things non-constructively16/09 19:32
tac-ticsOther than that, though, is there a serious issue with adding LEM to Set?16/09 19:33
copumpkintac-tics: where does it pull the proofs from?16/09 19:33
copumpkinits ass? :P16/09 19:33
tac-ticscopumpkin: Is "ass" a euphemism for _|_?16/09 19:34
copumpkinLEM : forall {A : Set} -> A or (Not A)16/09 19:34
tac-tics;)16/09 19:34
copumpkinthat's like Either in haskell16/09 19:34
copumpkinlet's say A is Nat16/09 19:34
copumpkinLEM {Nat}16/09 19:34
copumpkinthat should produce Left <something>16/09 19:34
copumpkinwhat should <something> be?16/09 19:34
tac-ticsbut unlike Haskell, it's untagged, isn't it.16/09 19:34
copumpkinno16/09 19:34
kamatsuit's tagged16/09 19:35
copumpkinor is just Either16/09 19:35
kamatsuor is just Either16/09 19:35
kamatsublah, jinx16/09 19:35
tac-ticslol16/09 19:35
kamatsudata _\/_ (A : Set) (B : Set) : Set where inl : A -> A \/ B; inr : B -> A \/ B16/09 19:36
kamatsusomething like that16/09 19:36
kamatsuwith universe polymorphism, potentially different constructor names, and unicode magic16/09 19:36
tac-ticscopumpkin: ah, I get it16/09 19:36
tac-ticsIt "does" pull it from it's bottom.16/09 19:37
tac-ticsI totally missed that amazing pun opportunity16/09 19:37
tac-ticsOh well16/09 19:37
kamatsuwhat about this encoding?16/09 19:37
kamatsupostulate LEM : \forall  {A : Set} -> not (not A) -> A16/09 19:37
kamatsu:D16/09 19:38
kamatsui guess you're still pulling it out of your ass, but more dangerously16/09 19:38
kamatsuor at least, conveniently16/09 19:38
tac-ticsSo the idea is... correct me if I'm wrong16/09 19:39
tac-ticsProp doesn't have any computational power (or something), so there's never a pattern match on A v -A16/09 19:39
kamatsuthat would be correct16/09 19:39
tac-ticsAHHHHHHHHH16/09 19:39
tac-ticsI get it :D16/09 19:39
kamatsunot so much computation power16/09 19:40
kamatsubut it's not part of your program16/09 19:40
kamatsuCoq likes to pretend that your proofs and your programs are seperable16/09 19:40
tac-ticsGotcha16/09 19:40
Saizanit's more that any such case expression should produce something in Prop16/09 19:40
tac-ticsSo it's almost like "runtime programming" = Set and "compiletime programming" = Prop16/09 19:40
kamatsuehh.. kinda16/09 19:40
kamatsubut the runtime programming runs at compile time too16/09 19:41
tac-tics"kinda" is good enough for me16/09 19:41
kamatsuso, you could think of Set as the type of constructive propositions16/09 19:41
kamatsuand Prop as the type of potentially non-constructive propositions16/09 19:41
tac-ticsI know enough now that I 1) Don't really need a Prop in my language and 2) I can't prove things with LEM16/09 19:41
tac-ticskamatsu: That is a much clearer way to put it16/09 19:41
tac-ticsThanks guys :)16/09 19:42
kamatsuso, is Agda's irrelevance designed to allow us to safely admit LEM?16/09 19:42
kamatsui.e16/09 19:46
kamatsuLEM : all {P} -> .(P or not P)16/09 19:46
kamatsuit's irrelevant, so you can't pattern match on it?16/09 19:47
copumpkinno16/09 19:47
copumpkinwell, maybe16/09 19:47
Eduard_Munteanukamatsu: I think you can postulate LEM without worries, even without irrelevance16/09 19:48
Eduard_MunteanuThat is, Agda + LEM is consistent.16/09 19:49
kamatsuI would hope so, but it'd be nice to know if a proof was non-constructive.16/09 19:50
Eduard_Munteanukamatsu: you can embed it in a monad of sorts, I've seen that a few days ago.16/09 19:50
Eduard_MunteanuIt's like you simply lift your non-constructive stuff into Not Not16/09 19:51
dolioNo, it's not for that.16/09 19:51
Eduard_Munteanuhttp://www.galois.com/~emertens/Classical.html16/09 19:51
Eduard_Munteanudolio: what did you mean?16/09 19:52
copumpkinoh wow, mrAgda turned into drAgda!16/09 19:52
drAgda:)16/09 19:52
dolioIrrelevance is not for that.16/09 19:52
Eduard_MunteanuAh.16/09 19:52
Eduard_MunteanuYeah, AFAICT it's a performance thingy mostly.16/09 19:52
dolioMaybe you could use it for that. I don't know.16/09 19:53
copumpkinxplat: he's back!16/09 19:53
drAgdai wrote some stuff on 351 for xplat, still not quite sure how it would work though16/09 19:53
dolioI wouldn't necessarily say it's all for performance, either, although that's probably a big factor.16/09 19:54
dolioIn the endgame, it lets you say things that you couldn't before.16/09 19:55
xplatdrAgda: ah, thanks.  i'll go read it.  btw the features i wanted to implement myself were extra syntax support for reflection.16/09 19:55
drAgdaah, that'd be nice16/09 19:55
dolioAbout parametricity.16/09 19:55
Eduard_MunteanuOh.16/09 19:56
dolio.(x : A) -> ... is parametric in x.16/09 19:56
Eduard_MunteanuSo it's like the typechecker will accept some stuff because you promise not to use the value?16/09 19:56
drAgdathe reflection stuff could definitely use more love16/09 19:57
dolioIn theory, you could create your own universe, and then for f : .(x : U) -> El x -> El x, you know that f is the identity.16/09 19:57
dolioSame as f : (A : Set) -> A -> A.16/09 19:58
Eduard_MunteanuHm, I see.16/09 19:58
dolioEven though there exists an inductive eliminator for U, i.e. type case.16/09 19:58
Eduard_MunteanuWell, U is closed, unlike Set, so I guess that makes a difference.16/09 19:59
dolioWell, you could even add type case for Set, and you'd know that f : .(A : Set) -> A -> A is the identity, provided type case was restricted properly.16/09 20:00
Saizanit seems like unIrr r == suc _42 could just be solved by saying _42 is filled if we are use _42 doesn't appear in any relevant context16/09 20:00
Saizans/use/sure/16/09 20:00
drAgdawhich we can since it was created in an irrelevant position16/09 20:01
kamatsutype case?16/09 20:01
drAgdai'm just not sure what to solve it with16/09 20:02
Eduard_MunteanuI think he meant pattern-matching on the universe/set.16/09 20:02
kamatsuyou can do that?16/09 20:02
Eduard_Munteanus/set/Set/16/09 20:02
Eduard_MunteanuOn custom universes yeah.16/09 20:02
Eduard_MunteanuNot on Set.16/09 20:02
kamatsuoh, but they'd be closed16/09 20:02
kamatsuah, right16/09 20:02
kamatsui see what you're getting at now16/09 20:03
Eduard_MunteanuErm, custom universes a-la Power of Pi, which are just datatypes.16/09 20:03
kamatsuyes16/09 20:03
Eduard_MunteanuIt'd be nice to be able to pattern-match on Set, provided your function was total even though Set was open, i.e. if it had a default case.16/09 20:04
SaizandrAgda: i was thinking of something like DontCare, it might need to keep track of the reference to r though16/09 20:04
drAgdayeah.. except that it might not need to depend on r. the next constraint might be _42 r == zero16/09 20:05
dolioEduard_Munteanu: Well, I can't guarantee that you could add type case to Agda without causing inconsistency.16/09 20:06
dolioBut if you could, and you had irrelevance of the right sort, you would still have a type of parametric functions.16/09 20:06
leo_hi16/09 20:07
kamatsuright16/09 20:07
kamatsuseems interesting16/09 20:07
dolioIt's probably safer since Agda is predicative.16/09 20:07
Eduard_MunteanuYou still have a sort of type case...  f _ = Int   or stuff like that. :/16/09 20:07
leo_Building Agda-2.2.11...16/09 20:07
leo_src/full/Agda/Interaction/BasicOps.hs:2:35:16/09 20:07
Eduard_Munteanuleo_: hi16/09 20:07
leo_    unsupported extension: DeriveFunctor16/09 20:07
leo_cabal: Error: some packages failed to install:16/09 20:07
leo_Agda-2.2.11 failed during the building phase. The exception was:16/09 20:07
leo_exit: ExitFailure 116/09 20:07
kamatsuis the drive to add it practically-minded?16/09 20:07
kamatsuleo_, perhaps you need newer GHC16/09 20:07
Eduard_Munteanukamatsu: I'm not sure there's a practical use for that, but it might be fun16/09 20:08
kamatsuEduard_Munteanu, i mean irrelevance16/09 20:08
Eduard_Munteanukamatsu: ah, yes, irrelevance helps with Agda *programs*, where you can mark proof terms (parameters) as irrelevant.16/09 20:08
Eduard_MunteanuSo they get erased at runtime.16/09 20:09
kamatsuyes16/09 20:09
drAgdaoh yeah sorry leo, DerivingFunctor was too tasty to pass on, you should grab the latest haskell platform16/09 20:09
dolioI just think it's an interesting feature, irrespective of performance.16/09 20:09
dolioAnd like the underlying theory.16/09 20:09
kamatsuplus it improves the typechecker's performance too16/09 20:09
dolioThey let you write datatypes that you couldn't otherwise, as well.16/09 20:09
kamatsuso everybody wins.16/09 20:09
Eduard_Munteanudolio: are there any papers on that?16/09 20:09
doliodata Exists (A : Set) (T : A -> Set) where _,_ : .(x : A) -> T x -> Exists A T16/09 20:09
dolioIs a weak sum.16/09 20:10
Eduard_MunteanuWeak sums? Hooray.16/09 20:10
leo_ok i'm trying to install the development vesion of agda, to see if that version can solve my problems16/09 20:10
leo_of16/09 20:10
Eduard_MunteanuThey're like Haskell existentials, no?16/09 20:10
leo_out of memory16/09 20:10
dolioIf you dot the second argument, it's a subset type where the T is squashed to a proposition.16/09 20:10
kamatsuyou can't "unpack" them, right?16/09 20:10
dolioYou can't project out of them effectively.16/09 20:11
kamatsuright16/09 20:11
dolioYou have to unpack both sides together, effectively.16/09 20:11
dolioAnd the first part is opaque.16/09 20:11
kamatsuso, like some haskell Exists GADT.16/09 20:11
dolioYeah.16/09 20:11
kamatsucool, i see16/09 20:12
dolioEduard_Munteanu: Nathan Mishra-Linger and Tim Sheard have some papers on this stuff.16/09 20:12
dolioAnd the former wrote his thesis on it.16/09 20:12
Eduard_MunteanuThanks, I'll google for that stuff.16/09 20:12
dolioThe papers have titles involving "Erasure Pure Type Systems".16/09 20:12
kamatsucanonical implicit args and reflection are exciting features too16/09 20:13
xplatdrAgda: yeah, it's tricky to know what to do with constraints that couldn't hold without irrelevance, the conservative thing would be to just drop them, although then it might be unpredictable whether a solution is found.  but then that's already true for irrelevant fields buried in records when eta might trigger or might not ... it would probably be more predictable overall16/09 20:13
Eduard_Munteanukamatsu: non-canonical :)16/09 20:13
xplater, wow, i didn't realize that was that long ... :-/16/09 20:13
kamatsuderp16/09 20:13
kamatsui think they renamed them16/09 20:13
Eduard_MunteanuBut yeah, they're nice.16/09 20:13
Eduard_MunteanuI don't remember the new name.16/09 20:14
kamatsu"Instance arguments"16/09 20:14
Eduard_MunteanuAh.16/09 20:14
kamatsumakes sense16/09 20:14
kamatsualthough it sort of shoehorns them into the use-case of emulating typeclasses16/09 20:14
Eduard_MunteanuNCI made for an acronym16/09 20:14
kamatsuthe reflection capabilities are still awkward though16/09 20:15
Eduard_MunteanuThat'd be nice for the ring solver in the stdlib.16/09 20:16
drAgdai suppose just checking the top-level of an irrelevant constraint for irrelevant metas wouldn't be very hard16/09 20:16
kamatsusome of the more sophisticated tactics i see in other provers like isabelle would be difficult or impossible to implement in Agda as it currently stands.16/09 20:16
kamatsueven with reflection, difficult.16/09 20:17
drAgdagoing inside terms looking for metas seems like a trickier proposition16/09 20:17
Eduard_Munteanukamatsu: you know about Agsy/Auto, right?16/09 20:17
Eduard_Munteanu(or C-c C-a)16/09 20:18
kamatsuEduard_Munteanu, yes, but this is more of what I would call sledgehammer in Isabelle16/09 20:19
kamatsuit comes up with some proof terms for you and then spams them into your program16/09 20:20
kamatsusometimes you actually don't care about those proof terms, you just want to automate simple repetitive proof drudgery16/09 20:20
kamatsuand make it easier for humans to read in the process16/09 20:20
kamatsufor example, induction in isabelle is just (induct_tac inductiveVariable)16/09 20:21
drAgdai wonder how much time/memory erasure buys us.. xplat when you have time could you go into TypeChecking.Serialise and change the DontCare case to keep the term (currently it throws it out and replaces it with Nothing) and then type check your category theory stuff and check what the penalty is16/09 20:22
xplatdrAgda: sure, i'll do that ... at least for a few of the files.  if the penalty turns out to be large it won't be possible to check some of the more complex modules at all16/09 20:23
drAgdait'd be interesting to know when discussing constraint solving16/09 20:24
drAgdafor irrelevant things16/09 20:24
drAgdamy guess is that it won't be that bad, since we're just going to carry the terms around and never actually do anything with them16/09 20:26
drAgdaof course they might be ginourmous and cause interface generation to take ages16/09 20:27
xplati'm pretty sure the CT library would have unfeasibly large interface files if that were done directly to 2.2.10, but a lot of hugeness in the terms came from projector-like functions, so it remains to be seen...16/09 20:28
xplatsome of my optimizations using abstract flipped over and became pessimizations after that change16/09 20:30
drAgda:)16/09 20:30
xplatas far as reflection, is there any reason not to have a quoteTerm as well as quoteGoal?16/09 20:40
xplatit seems like anything one could do with quoteTerm, one could do without it, a little more awkwardly16/09 20:41
xplat(of course you could technically say that about quoteGoal too, but it's a lot easier to simulate quoteTerm with quoteGoal than it is to reflect by hand)16/09 20:43
drAgdai don't think there's a problem quoteTerm, you'd just have to make sure that the type can be inferred16/09 20:46
drAgdawith quoteTerm16/09 20:46
xplati was thinking i'd just have the user supply a type along with the term16/09 20:49
drAgdayeah that'd make the most sense16/09 20:49
dolioxplat: Oh, I can actually use Agda once again.16/09 20:52
dolioOne of the hundreds of patches in the last week or two randomly fixed the emacs interaction somehow.16/09 20:52
xplatdolio: oh, nice16/09 20:53
drAgdaobviously on purpose16/09 20:53
dolioObviously.16/09 20:53
drAgdaquoteTerm: http://hpaste.org/5142516/09 20:55
drAgdawith some minor noise16/09 20:56
drAgdaanyway i'm off to bed, cya later16/09 21:00
djahandarieHeh, was that Ulf?16/09 21:11
Eduard_Munteanudjahandarie: yeah16/09 21:14
Eduard_MunteanuWell, at least according to /whois, he's been here earlier too.16/09 21:14
Eduard_MunteanuHe doesn't come in here often, does he?16/09 21:14
djahandarieMaybe one of the decisions made at AIM was "go on #agda IRC channel more often" :-)16/09 21:15
Eduard_MunteanuHeh.16/09 21:15
augurxplat!16/09 21:28
xplatyou know, i just got Solvation working for 2.2.1116/09 23:46
copumpkinooh16/09 23:46
xplatand i decided to try evaluating my test to see what proof term would be produced.  it is... big.16/09 23:46
glguyThe reflection wrapper for data.nat's semi ring solver?16/09 23:46
copumpkinlol16/09 23:46
xplatthe goal is: shuffle-test : (a b c : ℕ) → a + b + c + b ≡ 2 * b + (c + a)16/09 23:47
xplatthe 'normal form' window is 161 lines.16/09 23:47
xplatdespite that, it works!16/09 23:48
xplatglguy: and yeah, the very same16/09 23:48
Eduard_MunteanuORLY?16/09 23:48
Eduard_MunteanuNice.16/09 23:48
Eduard_MunteanuAt the same time I wonder what code lies behind Coq's tactics.16/09 23:49
Eduard_Munteanus/what/how much/16/09 23:50
xplatit also does shuffle-test : (a b c : ℕ) → a + b + 2 + c + b ≡ 1 + 2 * b + (c + a) + 1, which wouldn't work in 2.2.10 because of the literals16/09 23:55
copumpkinnice!16/09 23:56
copumpkinmake a feature request on the wiki and attach your patch :D16/09 23:56
xplatoh, this is before any new syntax16/09 23:57
xplati wanted to just first get that working, and next get an idea of how the new stuff like 'constructors' and 'unquote' work in practice16/09 23:58
--- Day changed Sat Sep 17 2011
copumpkinoh yeah17/09 00:00
copumpkinbut it's useful on its own17/09 00:00
augurwibble17/09 00:11
copumpkinaugur: did you add fpqc to the access list on ##ct?17/09 00:12
augurwhat17/09 00:12
copumpkinnegi17/09 00:12
copumpkinthat dude17/09 00:12
copumpkinI was just asking if you'd added him to the access list17/09 00:13
xplatwell, i'm just saying, this already works on 2.2.12 as is17/09 00:22
copumpkinbut nobody can haz it17/09 00:25
copumpkincause only u haz it17/09 00:25
copumpkinmost projects like to have bugs even for things that are already done17/09 00:25
copumpkinso they can be closed immediately17/09 00:25
copumpkinwith a patch17/09 00:25
xplatoh, do you mean for the library?17/09 00:26
copumpkinyeah17/09 00:26
xplati was going to roll it and some other stuff into a small library of my own17/09 00:27
xplat'tactics', a very no-frills name17/09 00:28
copumpkinoh, nice17/09 00:28
copumpkincan you make a peano arithmetic solver too?17/09 00:28
copumpkinkthx17/09 00:28
xplatoh, this is initial industry tactics.  the peano solver goes in final fantasy tactics.17/09 00:30
copumpkin:O17/09 00:30
xplatbut that can't ever be made, due to trademark issues and the lack of readily available hypercomputers17/09 00:31
copumpkinoh no :(17/09 00:31
xplatmaybe i could set up a fake straw peano solver à la haskell typenats sometime, that seems to often be enough in practice17/09 00:33
copumpkinyeah, it could return Maybe (Dec P)17/09 00:33
copumpkinspit out nothing if it doesn't know17/09 00:33
copumpkinwe could also use it to test strategies for deciding!17/09 00:35
copumpkinalso a real-closed field decider17/09 00:35
copumpkinthat's if we really want to stress-test agda :)17/09 00:36
copumpkinfor some large proof terms :P17/09 00:37
xplatso, hey, about sized types17/09 00:38
xplati kind of thought they would be a little more turnkey17/09 00:38
xplatis it true that you have to rearchitect your inductive types to store their sizes, or is there a way around that?17/09 00:39
xplatif there is, i'd like to know, because i'm getting pretty tired of inlining my combinators17/09 00:40
xplatit kind of defeats the whole purpose of having combinators, you know?17/09 00:41
xplatglguy: version 0.2 is here: http://hpaste.org/5143717/09 01:16
xplatneeds further modularization, as well as being modified to use unquote instead of needing explicit quantification like that17/09 01:17
glguyDoes using unquote need you won't have to define a function which describes the type that you are going to produce?17/09 01:26
xplatwell, you already don't technically need to do that, although it's one of the easier ways to get the correct goal type17/09 01:28
xplatwith unquote it should probably be usable right in the middle of equational reasoning proofs and the like17/09 01:28
xplatalthough they'd have to have simple variables for all the terms to be rearranged, at the moment.17/09 01:29
xplatif i also create a better structure for translating syntactically unique terms to unique Fins and modify the parser to take advantage of it, even that limit would disappear17/09 01:31
xplatideally someone should also modify the semiring solver to get all the redundant zeros out of the sum-of-products normal form17/09 01:34
xplatbut they only really kill you if you have very high-degree polynomials and/or large numbers of variables17/09 01:35
xplatugh, trie type for lists appears to not be strictly positive?17/09 02:51
xplatafter seeing why it's not strictly positive i get the feeling that strict positivity in inductive families is extremely analogous to structural recursion; am i dreaming?17/09 03:02
xplatunfortunately the thing that is *not* really falling out of that real or imagined analogy for me is a way to use an accessibility predicate to create a petrol-powered inductive family17/09 03:04
doliodata ListTrie a k = Node k (a -> ListTrie a k)?17/09 03:11
xplatdolio: that's not a complete trie-ification17/09 03:40
xplatdata ListTrie (subtrie :: * -> *) k = Node k (subtrie (ListTrie subtrie k)), only that doesn't work17/09 03:43
dolioTrue. Not all type functions are functorial.17/09 03:51
dolioIf you had miniAgda's variance annotations, you could write the right type.17/09 03:54
dolioOr you could define a universe of keys.17/09 03:54
glguyI worked through the Integer data type from the quotient types paper, things ended up working out well. I really would have benefited from xplat17/09 04:03
glguy's Solvation17/09 04:03
glguyhttp://www.galois.com/~emertens/alternative-integers/AlternateIntegers.html17/09 04:03
xplatit'd sure be nice if agda had scoped operators like haskell17/09 04:26
xplatinstead of 5000 renames, just two public opens inside a local module named N17/09 04:27
xplatcould still do that for everything but + and *, i guess17/09 04:29
glguyinstance parameters could possibly help17/09 04:29
xplatwell, you could actually do that17/09 04:30
xplatexcept that even if you opened the semiring versions with instance arguments, you'd *still want to shadow them* in that module.17/09 04:30
xplatso you'd just be bringing in a bunch of machinery for no purpose17/09 04:31
glguyqualified operators would certainly be more direct17/09 04:32
glguyThere is probably a bit of trickiness with mix fix stuff in general17/09 04:32
xplatis the inverse to emb in there somewhere?17/09 04:32
copumpkinright above it?17/09 04:33
glguy[[_]] and emb are the normalization and embedding functions17/09 04:33
xplatyeah, i'm going to really have to dig into how the mixfix parsing works for the syntax-for-tactics stuff so i can probably tell you later how hard qualified operators would be17/09 04:33
xplatoh, heh, i started looking from below emb17/09 04:34
xplatxplat: tunnel vision much?17/09 04:34
glguyCases like this would make using reflection tricky, I think:17/09 04:39
glguycong₂ (λ a' b' → ⟦ num a' b' ⟧)17/09 04:39
glguysince [[_]] is a function you get no hints about the next two arguments17/09 04:40
glguywhich is why I couldn't hide the first four parameters in my congruence functions: +-cong : ∀ a b c d → a ∼ b → c ∼ d → (a + c) ∼ (b + d)17/09 04:41
glguyI guess this is why it would be a good idea to write _\eq_ in a new type17/09 04:42
xplatmm, yes, usually it is good to wrap an equality in a type17/09 05:13
xplater, in a data or record type, specifically17/09 05:13
xplatfor that very reason17/09 05:15
xplat(of course, if the types you're equating are records with irrelevant members it'll usually fail anyway currently, but hopefully that can be fixed eventually17/09 05:16
glguyaren't irrelevant members supposed to make that *easier*?17/09 05:30
glguyWhat's going on with them now17/09 05:30
xplatthey make it easier to be type-correct, harder to be terse.17/09 05:36
xplatread issue 351 if you want the details17/09 05:36
augurxplat: :|17/09 05:51
xplatmaybe instead of a universe of possible keys, i should make a universe of possible tries17/09 05:58
xplatkind of the same, but not quite17/09 05:59
augurxplat :|17/09 06:01
augurxplat: tell me what you think wellnowwhat.net/linguistics/Phrase%20Markers.pdf17/09 06:01
xplataugur: i already downloaded it, now i'm gradually trying to dig down through the accumulation of pdfs in the corner of my desktop to find it (and a couple of other things)17/09 06:04
augur:p17/09 06:04
glguyIs there an interesting difference between relevant and irrelevant propositional equality (or any type which has a single inhabitant)?17/09 08:22
glguyother than the irrelevant version being more difficult to use17/09 08:23
Saizanthat proofs of the latter are definitionally equal17/09 08:27
glguyactually, one type with a single inhabitant I hadn't consider is the standard less-than on ants17/09 08:27
glguynat17/09 08:28
glguyconsidered...17/09 08:28
Saizanyeah, the same holds for that17/09 08:28
glguybut I'm trying to understand what process you use for determining when something should be irrelevant. i don't know when to apply it.17/09 08:30
glguyshould a function mark as many of its parameters as possible as irrelevant to be the most general?17/09 08:30
Saizanin theory i guess so, though i can't say i've tried to do so17/09 08:34
Saizanlucklily if you're using that function in an irrelevant context it doesn't matter17/09 08:35
Saizanalso i'm not sure if there's always a most general type wrt irrelevance, higher order functions might mess with that17/09 08:36
Saizanyou can have apply : (A -> B) -> A -> B, but also (.A -> B) -> .A -> B, but also .apply : (A -> B) -> .A -> B and i haven't checked but i don't think there's one that subsumes all the others17/09 08:39
Saizanfor now i just added irrelevance when it was useful for unstucking some terms17/09 08:48
xplatsomeone pointed out on the mailing list that primTrustMe makes it workable to use irrelevant propositional equality17/09 15:00
xplatbecause primTrustMe can magically reconstruct a witness17/09 15:01
xplatand the magic witness computes whenever the normal one would have17/09 15:01
xplatthat is, in contexts where the equality is definitional17/09 15:02
xplatthere are also a lot of cases where you can reconstruct witnesses the hard way, so to speak17/09 15:04
xplatthe problem is, sometimes the hard way is actually hard17/09 15:04
xplatthe result type for DivMod is determined by its indices, but if you made it irrelevant there'd be no point using it at all17/09 15:05
Saizanyeah, DivMod m n is weird because while it's a singleton the values contained aren't totally useless at runtime17/09 15:18
augurbleugh17/09 22:04
kamatsubleugh?17/09 22:30
--- Day changed Sun Sep 18 2011
glguyI wonder if using this would help make things defined in terms of well-founded recursion any more efficient were they ever compiled18/09 08:38
glguydata Acc n : Set where18/09 08:38
glguy   acc : (∀ {m} → .(m < n) → Acc m) → Acc n18/09 08:38
glguyI did all-acc : ∀ n → Acc n   as a simple sanity check18/09 08:39
glguyfor nat18/09 08:39
glguyit bothers me when the runtime of an algorithm is affected by the tricks we have to do to pass the type checker or when we restructure a data type to support provability over efficiency.18/09 08:41
glguyIt makes  the answer to the question in the topic "proof-assistant"18/09 08:41
glguyeven with the irrelevant <, things defined in terms of acc would still require as many pattern matches are there are nat between the current and next recursive call argument...18/09 08:43
glguyas we get one "acc" constructor per suc18/09 08:43
glguyIs there an enhancement request in the ticket tracker to allow pattern matching on irrelevant arguments when there is only a single, non refutable pattern?18/09 08:46
glguyI guess there is an issue with dependent pattern matching even still18/09 08:47
augurhey glguy18/09 08:55
glguyo/18/09 08:55
augurare you, perchance, at all interesting in linguistics?18/09 08:55
* copumpkin is not interesting at all18/09 08:56
augur:p18/09 08:56
augurhow about glow in the dark cats?18/09 08:56
glguyaugur : I could find it interesting, but I don't particularly know anything about it18/09 08:56
augur:o18/09 08:56
auguri could teach you some :D18/09 08:57
glguyare you interesting in linguistics?18/09 08:58
augurobviously i meant interested!18/09 08:58
augur:|18/09 08:58
augurXP18/09 08:58
glguy;)18/09 08:59
augurtho i would hope im also interesting18/09 08:59
glguy(just playing around with slimmed down irrelevant wf http://www.galois.com/~emertens/irr-wf/IrrWf.html )18/09 09:00
glguyinterest me!18/09 09:00
glguywe use (not me) GF at work18/09 09:02
glguy"grammatical framework"18/09 09:02
glguyrelevant?18/09 09:02
augurwell, theres a collection of ideas in chomskyan syntax surrounding the idea that language might not display any global properties whatsoever18/09 09:03
augurno, GF is pretty much irrelevant in theoretical linguistics18/09 09:03
glguydoes that relate to something i said or were you just thinking about it?18/09 09:05
augurthe latter really18/09 09:06
augurtho i suppose it could be interesting to you if you're interested in non-locality!18/09 09:06
glguyno telling18/09 09:06
glguywhat is it?18/09 09:06
augurwell, there are a number of things that people discuss relating to that issue18/09 09:08
augurthe one im currently most interested in is the constraints on non-linearity of resource use18/09 09:09
augurwhere there are some ideas that non-linear use of resources is admissable only when it minimizes some property, usually distance between the reuse sites18/09 09:10
glguymaybe i should sleep and reengage with you when I'm a little more awake :)  i'm still lost ;)18/09 09:11
glguycya soon!18/09 09:12
augurthats most peoples reaction XD18/09 09:12
glguyOh, I was wrong last night about thinking that I was going to have a bunch of extra acc constructors made in an algorithm implemented using an accessibility proof for termination18/09 22:44
glguyonce you make the < irrelevant you'll have exactly as many acc constructors as recursive calls18/09 22:45
glguy(well, it was always the same number, but you don't pay the cost of making the < value)18/09 22:45
glguyIs my understanding correct that an irrelevant function argument is not evaluated?18/09 22:52
glguyat run-time, at least18/09 22:53
edwinbAcc is erasable anyway - it's collapsible since there's no computationally relevant information18/09 22:54
edwinbI don't know if Agda's compiler does this though18/09 22:54
edwinbIdris does ;)18/09 22:54
glguyI've done the proof that all values of Acc are equivalent modulo extensionality. Is it necessarily obvious that that is the case for all types18/09 22:55
glguy?18/09 22:55
glguyDoes Idris provide a way to provide manual proofs?18/09 22:55
SaizanIOW how smart is the collapsible check in idris?18/09 22:56
edwinbit just does a syntactic check on the indices and recursive arguments18/09 22:57
edwinbthere's no way to provide manual proofs of collapsibility18/09 22:58
glguyDoes it automatically know that functions which return collapsible results are collapsible then18/09 22:58
edwinbthough it'd be nice18/09 22:58
edwinbthe compiler will turn them into functions which always return a dummy value18/09 22:58
edwinbwhixh gets inlined18/09 22:59
glguyI thought that Idris didn't have a termination checker18/09 22:59
edwinbthat isn't really the point here...18/09 22:59
edwinb(if something doesn't terminate that optimisation may not be valid though...)18/09 22:59
glguyWhat about a type like <= with zero<=n and s<=s18/09 23:00
glguyThis type gives you no more information than you get from the indexes18/09 23:00
edwinbindeed18/09 23:00
edwinbthat's an example in my thesis of a collapsible thing ;)18/09 23:01
glguyDoes your language provide a way to state an expectation that something is collapsible?18/09 23:01
glguyHow do you know that the optimization worked?18/09 23:01
edwinbno, but that'd be nice18/09 23:01
glguy(as a user)18/09 23:01
edwinbyou can inspect it at the prompt18/09 23:01
edwinb:d Foo18/09 23:02
edwinbI must find out if Agda does this, it is quite a big win in lots of cases18/09 23:02
edwinbor, more accurately, quite a big non-loss18/09 23:02
Saizanm <= n is also a representation of the subtraction though, and if you use it as that but it has been erased you might end up duplicating a subtraction done earlier, i guess? though that's probably as costly as traversing the structure anyway18/09 23:04
edwinbyou would be storing the result of the subtraction because that's what the index gives you18/09 23:05
edwinbyou still get the indices, because you need them for the function to type check18/09 23:06
edwinbwhich is why you can erase the proof18/09 23:06
Saizanthe result is not an index here, only the arguments18/09 23:06
edwinbit's just removing duplicated storage and duplicated pattern matches18/09 23:06
edwinbif you have m <= n you have to have m and n available somewhere18/09 23:07
Saizanyep18/09 23:07
edwinbso it's safe to lose the proof18/09 23:07
copumpkinit's safe but you may recompute stuff18/09 23:08
edwinband you won't end up doing extra work because the values you need are still around18/09 23:08
RotsorIs there a way of defining the operator _::_ such that (8 :: ℕ) is 8?18/09 23:08
glguyyou might do 2x the pattern matches matching on m and n again instead of just matching down the subtraction proof18/09 23:08
edwinbat worst, you'll do the same amount of work as you did before18/09 23:08
glguyrather the amount you didn't do since the value got erased :)18/09 23:09
copumpkinRotsor: you mean as a typing relation?18/09 23:09
copumpkinRotsor: with a syntax declaration18/09 23:09
copumpkinit's in the standard library18/09 23:09
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Function.html#249518/09 23:10
copumpkinthey use a single pseudocolon though18/09 23:10
Rotsorcopunpkin: yes, I can do the reverse with _::_ : (A : Set) → A → A, but not sure if one can do it properly.18/09 23:10
Saizani'm not so convinced, since i might have many calls that reuse the same proof of m <= n, maybe what i mean is that in some cases it might be better to erase the indices rather than m <= n18/09 23:10
glguySaizan: _-_ erases the indexes :)18/09 23:12
Saizanglguy: that's too easy for the compiler :)18/09 23:12
Rotsorcopumpkin: Oh, I see, they do it with "syntax".18/09 23:13
copumpkinyep18/09 23:13
copumpkinonly way to get your dependence backwards18/09 23:13
RotsorThank you18/09 23:13
copumpkinnp18/09 23:13
edwinbSaizan: it's not always clear which erasure will be best, true. I mean in contrast to the naive compilation...18/09 23:31
copumpkinisn't lazy eval nice there?18/09 23:33
Saizanedi think i was assuming that the matching on m and n would be done with dot patterns, so that it wouldn't be done at runtime18/09 23:33
glguyit's probably a little silly worrying about efficiency when naturals are implemented in unary18/09 23:34
Saizanheh18/09 23:35
Saizanthe Acc case is pretty clear instead18/09 23:35
edwinbhehe18/09 23:36
edwinbI think they fixed the natural numbers in the epic back end18/09 23:37
glguyI tried compiling http://www.galois.com/~emertens/irr-wf/IrrWf.html with MAlonzo, epic, and js backends18/09 23:37
glguyto see what actually happened18/09 23:37
glguymalonzo was a mess and unreadable, and epic and js failed to compile18/09 23:37
copumpkinlol18/09 23:37
glguyruntime failure18/09 23:37
edwinboh dear18/09 23:37
Saizantry without irrelevance :)18/09 23:37
glguybut that was the whole point! :-p18/09 23:38
Saizanif the epic backend erases Acc it'll do it even without irrelevance18/09 23:39
glguyYeah, but I didn't know that it would actually notice that Acc has no computational value18/09 23:51
glguyso I wondered if it was going to go through the motions of constructing the < proof18/09 23:51
--- Day changed Mon Sep 19 2011
augurwibble19/09 00:38
Eduard_Munteanuwobble19/09 00:52
RotsorIs there a simpler way of saying (≤⇒≤′ ∘ s≤s ∘ ≤′⇒≤)? I mean not necessarily shorter, but without unnecessary conversions.19/09 00:56
copumpkinwhat's the type of that?19/09 00:57
copumpkinoh, it's just incrementing it19/09 00:58
copumpkinI think there's already something in Data.Nat for it?19/09 00:58
RotsorHm, I don't see anything like that. Never mind though -- I have plenty of much uglier code anyway. My proof of irrationality of sqrt(2) is almost 100 lines already and not finished yet...19/09 01:06
copumpkinhow are you even stating that?19/09 01:06
copumpkinyou using the Rationals from the std lib?19/09 01:06
copumpkinthere's almost nothing in that module :o19/09 01:07
RotsorNo, no rationals, I am stating Sqrt₂Pred m = (n : ℕ) → n * n ≡ m * m * 2 → m ≡ 019/09 01:08
RotsorAnd I say that sqrt₂Irrational : (m : ℕ) → Sqrt₂Pred m19/09 01:08
RotsorThat's split in two parts because I use <-rec19/09 01:09
copumpkinisn't that saying that there exist no naturals that squared make 2?19/09 01:09
copumpkinthe innaturality of sqrt 2?19/09 01:09
RotsorNo, I say n*n=m*m*2, that means no rationals of form n/m squared make 219/09 01:10
copumpkinoh ok19/09 01:10
Eduard_MunteanuLEM might make it easier :/19/09 01:11
RotsorWhat is LEM?19/09 01:11
Eduard_MunteanuLaw of excluded middle. It's just I've seen some proofs using that in some form or another.19/09 01:12
Eduard_Munteanu(usual, paper proofs)19/09 01:12
RotsorI am proving that by showing that 2 divides n * n, thus 2 divides n, thus n can be replaced with (2*q), thus (2*q) * (2*q) = m * m * 2, thus m * m = q * q * 2, and recurse19/09 01:14
Eduard_MunteanuDon't take my word for it, it's more like a question.19/09 01:14
RotsorA tricky thing was showing that q < m to prove termination19/09 01:15
RotsorNow I wonder how to prove ∀ {m n : ℕ} → (2 * n) * (2 * n) ≡ 2 * m * m → m * m ≡ 2 * n * n19/09 01:16
RotsorShould I try the Ring Solver?19/09 01:16
copumpkinI'd use the ring solver to rearrange the input and then cong (2*) on the result19/09 01:22
RotsorThanks. Will learn how to use the ring solver then.19/09 01:25
copumpkinxplat has a magic version of it that requires almost no work19/09 01:31
Eduard_MunteanuYou're supposed to give it an AST of the expression.19/09 01:33
copumpkinnot with xplat's magic version19/09 01:33
Eduard_MunteanuYeah. I'm still not sure why reflection didn't work with the ring solver.19/09 01:33
Eduard_Munteanu(erm, until xplat's stuff)19/09 01:33
copumpkinbecause it's a pain to work with :)19/09 01:34
Eduard_MunteanuAh.19/09 01:34
RotsorWoohoo, I've succeeded in using SemiringSolver the straightforward way. Next time I'll try the xplat's stuff.19/09 02:34
copumpkin:)19/09 02:36
RotsorOh, the next time came too soon. Now I need 2 * m ≡ 2 * n + 1 -> m + (m + 0) ≡ n + (n + 0) + 1 for recursive step of oddIsNotEven.19/09 02:46
RotsorSo, where can I get that magical stuff you were talking about? :)19/09 02:46
copumpkinyou need to vigorously poke xplat19/09 02:47
RotsorOh19/09 02:47
RotsorI'm not sure I'm up to it19/09 02:48
RotsorUnrelated to the semiring solving, are there any known ways of writing performance-certified programs in Agda?19/09 02:51
RotsorI'd like to be able to say, "a sorting function working in O(log(N))" in my type system19/09 02:52
copumpkinI think you'd have to write an embedded language with an interpreter19/09 02:52
Rotsoroh19/09 02:52
Rotsorthat'd be too fast19/09 02:52
copumpkinsuch that you can reason about complexities on it19/09 02:52
xplatcopumpkin: version 0.2 is here: http://hpaste.org/5143719/09 03:01
xplatRotsor: (of that magic thing)19/09 03:01
Rotsorxplat: Oh, thank you!19/09 03:02
RotsorIs there a usage example available?19/09 03:03
RotsorAh, I think shuffle-test is one.19/09 03:04
xplati'm working on an even more magic version, but i needed finite maps from terms, so i decided to use tries, but the straightforward way wouldn't pass the termination checker, so i'm doing strategies for generalized tries, for which i needed inductive finite indexed products in the form of parameterized vectors, and then i needed some yak hair to write _[_]=_19/09 03:04
xplatyeah, shuffle-test is an example19/09 03:05
copumpkinwhy specialize it to Data.Nat?19/09 03:05
copumpkininstead of any Semiring?19/09 03:05
xplatcopumpkin: because you know how if you write 1 + x it becomes suc x?19/09 03:06
copumpkinoh19/09 03:06
xplati have no way to handle the analogous phenomenon for arbitrary semirings19/09 03:06
xplati'm working on stuff that would at least make it easier19/09 03:10
RotsorI wonder why after inlining the solver: ((quoteGoal g in solve-goal g refl) x y) it goes yellow19/09 03:13
RotsorI also wonder how can one understand error messages like "_103 : Set _102" :)19/09 03:16
RotsorHmm, I still don't get it19/09 03:44
Rotsortest : (m : ℕ) → m ≡ m19/09 03:44
Rotsorthis works: test = (quoteGoal g in solve-goal g refl)19/09 03:44
RotsorThis goes yellow: test m = (quoteGoal g in solve-goal g refl) m19/09 03:44
copumpkinthe solver wants a universally quantified statement, I think19/09 03:45
copumpkinmeaning a function19/09 03:45
copumpkinthe term it gets probably looks different in the other case19/09 03:45
RotsorIt says Sort _40 is unresolved19/09 03:46
copumpkinI imagine if you write test = (quoteGoal g in solve-goal g refl)19/09 03:47
copumpkinthe goal is (m : Nat) -> m == m19/09 03:47
copumpkinhowever19/09 03:47
copumpkinif you apply it, it could be something that can be instantiated to Nat19/09 03:47
copumpkinit could be {A : Set} (m : A) -> m == m19/09 03:48
copumpkinand you just happened to apply that to m, instantiating A to Nat19/09 03:48
xplatin any case this version doesn't work when you apply the quoteGoal term immediately19/09 03:48
RotsorI see19/09 03:49
xplatyou have to either have it as the sole definition of a typed function, or maybe an argument to a function, or maybe you could import type-signature from wherever it lives in the stdlib and attach the type right to the term with \:19/09 03:50
xplata future version won't require that, but you probably don't want to wait a week19/09 03:51
RotsorThe "an argument to a function" part looks promising (I mean I may be able to avoid writing the types multiple times this way)19/09 03:53
RotsorNow I write it once in the EqualityReasoning part and then am forced to write again in the signature of a separate function.19/09 03:53
Rotsorcopumpkin, when you said you could use cong (*2) to implement (x*2 == y*2 -> x == y), did you mean something other than cong? Because as far as I can tell cong only works the other way around.19/09 04:48
copumpkinoh maybe I did19/09 04:48
copumpkinI guess I mean that *2 is injective19/09 04:48
copumpkinwhich is fairly easy to prove if the operand isn't 019/09 04:49
xplatthere's a cancellation law for * somewhere, for one side anyway19/09 05:00
xplatgrep for 'cancel'19/09 05:00
copumpkincancel-*-right : ∀ i j {k} → i * suc k ≡ j * suc k → i ≡ j19/09 05:01
copumpkinpuuurrrrfect19/09 05:01
RotsorIndeed :)19/09 05:01
RotsorAnd I just finished writing it :D19/09 05:02
copumpkinso sqrt 2 is officially irrational?!?19/09 05:02
RotsorNo, not that "it"19/09 05:03
Rotsor*2-inj19/09 05:03
copumpkin:)19/09 05:03
RotsorI wonder if it is possible to define Haskell's `infix application` syntax using agda syntax definitions. :)19/09 05:05
RotsorFor sqrt 2 to be officially irrational I need two more things: that m = suc (m * 2) is empty and that (^2) is monotonic.19/09 05:12
copumpkinRotsor: I think the new agda might be able to spot that the first one is empty if you switch that * 2 to 2 *19/09 05:13
Rotsor"m ≡ suc (2 * m) should be empty, but that's not obvious to me"19/09 05:15
copumpkinyou have the latest agda?19/09 05:15
copumpkinor a recent build19/09 05:15
RotsorLet me check...19/09 05:15
copumpkin2 * m should reduce to m + m + 019/09 05:15
copumpkinand it should (I think) be able to see that m = suc (m + m + 0) is empty19/09 05:16
copumpkinlet me test19/09 05:16
copumpkinoh, maybe not actually19/09 05:16
copumpkinsince it can't reduce the function application to something obviously mish19/09 05:16
RotsorI think I updated it, but it still reports 2.2.10 on "--version"19/09 05:17
RotsorCan it possibly lie? :)19/09 05:17
copumpkinyou may not have updated the agda executable19/09 05:17
copumpkinbut anyway, I was wrong19/09 05:17
copumpkinanyway, there's a helper function in there19/09 05:18
copumpkinin Data.Nat.Properties19/09 05:18
RotsorWell, I remember it complaining about old things in library (some stuff with Levels) and forced me to update the library, so it's probably new.19/09 05:18
copumpkinjust use the solver to rewrite suc (m * 2) to m + suc m19/09 05:20
copumpkinand then call i+1+j≢i on it19/09 05:20
RotsorOk, I'll try that19/09 05:20
RotsorOk, that worked. (sqMonotonic : {m n : ℕ} → n * n <′ m * m → n <′ m) is the only thing left.19/09 05:26
copumpkinthere's the function you want for <= but not for <'19/09 05:27
RotsorIt is obvious that n /= m and <= together with /= give <19/09 05:29
RotsorSo, that should work with a bit of effort19/09 05:29
RotsorWhich function are you taking about?19/09 05:29
copumpkin_*-mono_ : _*_ Preserves₂ _≤_ ⟶ _≤_ ⟶ _≤_19/09 05:29
RotsorAh19/09 05:29
RotsorI think it works in the opposite direction19/09 05:30
RotsorI guess I can add negations ¬ (n * n >= m * m) -> ¬ (n >= m) and then transform it to n >= m -> n * n >= m * m19/09 05:32
RotsorWoohoo, typechecked! 230 lines total. O_O19/09 05:57
copumpkinnice!19/09 05:58
copumpkinso now we can believe that sqrt 2 is irrational!?19/09 05:58
copumpkinI never really trusted the proof before19/09 05:58
RotsorYes we can! :)19/09 05:58
copumpkinlet's see it!19/09 05:58
RotsorOh, my agda executable seems to be old indeed19/09 06:00
copumpkinnobody uses agda executable anyway19/09 06:00
RotsorIt refuses to generate HTML saying some nonsense about Levels19/09 06:00
copumpkinoh19/09 06:01
Eduard_MunteanuIt sort of works to paste it to hpaste with Haskell syntax highlighting19/09 06:01
RotsorThe generated HTML is one of the best features of Agda :D19/09 06:02
RotsorSo I'd like not to miss on that19/09 06:03
RotsorOK, I've pasted this horror here: http://hpaste.org/5151519/09 06:06
RotsorI've run out of names too soon, so some lemmas are called completely incomprehensibly19/09 06:06
Rotsorsqrt₂ is the main theorem19/09 06:07
copumpkinoh, the second half is unrelated19/09 06:07
copumpkinoh I see19/09 06:08
copumpkinyou have two files in one19/09 06:08
RotsorYes19/09 06:08
RotsorThey are both needed19/09 06:08
copumpkinyou can do Even and Odd fairly cleanly if you do them inductively19/09 06:09
copumpkinrather than with |19/09 06:09
RotsorYou mean nmEvenMeansNOrMEven?19/09 06:09
copumpkinjust in general19/09 06:10
copumpkinyou can make an inductive type for Even-ness19/09 06:10
copumpkinit's fairly easy to work with19/09 06:10
copumpkinthe divisibility thing is kind of painful19/09 06:10
RotsorAh, I see, I thought you meant | as in pattern guard rather than as in "divides"19/09 06:10
copumpkinoh yeah19/09 06:10
copumpkinI mean something like19/09 06:10
copumpkindata Even : Nat -> Set where zero-is-even : Even 0; suc-suc : forall {n} -> Even n -> Even (suc (suc n))19/09 06:11
copumpkinor you can have mutual types back and forth between even and odd19/09 06:11
RotsorYeah, I really have to learn when to use inductive data types. It turns out I used none in this proof.19/09 06:12
copumpkinpeople love using them for all sorts of things in agda :)19/09 06:13
copumpkinor at least, I do19/09 06:13
Rotsor:)19/09 06:13
RotsorThis problem is the 6th one from http://as305.dyndns.org/aps/problem19/09 06:17
Rotsor4 of the first 5 were solved by automated prover19/09 06:17
RotsorThis one -- not so much!19/09 06:18
copumpkin:)19/09 06:20
copumpkinwow, http://as305.dyndns.org/aps/problem/viewa/26519/09 06:21
RotsorI don't understand Coq (which is the reason I learned about Agda), but yeah, a short one. :)19/09 06:24
copumpkinthat'd be a pain to do in agda, I'm pretty sure19/09 06:24
copumpkinI wonder how far we could golf it19/09 06:25
RotsorThank you for your help. Good bye!19/09 06:33
Eduard_MunteanuHrm, I should do some of those.19/09 06:34
glguyWhich one would be a  pain?19/09 07:16
copumpkinis-square is decidable19/09 07:17
copumpkinnot necessarily a pain19/09 07:17
copumpkinbut just not nearly as short as that tiny thing19/09 07:17
copumpkinit's using integer square root, I guess19/09 07:18
copumpkinwhich makes it pretty trivial :P19/09 07:19
Eduard_MunteanuHow do you read   { perfect_square n } + { ~perfect_square n } ?19/09 07:48
Eduard_Munteanu"it's a perfect square or not"?19/09 07:49
copumpkinit's like Dec19/09 07:49
copumpkinEither (PerfectSquare n) (Not (PerfectSquare n))19/09 07:49
Eduard_MunteanuAh.19/09 07:49
Eduard_MunteanuIt should be pretty easy, no? You could start at n - 1, square, check if it's n, go to n - 2 and so on, right?19/09 07:51
copumpkinnow prove that terminates19/09 07:52
copumpkinoh I guess you're going down19/09 07:52
Eduard_MunteanuYeah.19/09 07:52
copumpkinbut that's inefficient19/09 07:52
Eduard_MunteanuTo 019/09 07:52
copumpkin:P19/09 07:52
Eduard_MunteanuSure :)19/09 07:52
copumpkinproving it's not a square is also not trivial19/09 07:53
Eduard_MunteanuYeah, I'd need to prove (0 <= k < n -> k ^ 2 /== n) -> Not (PerfectSquare n) and invoke that19/09 07:57
drdoHow does one do IO in Agda?19/09 09:14
Eduard_Munteanudrdo: did you look at the stdlib IO stuff?19/09 09:15
drdoOh, it's there19/09 09:16
drdothanks19/09 09:16
drdotaking forever to load19/09 09:19
Eduard_Munteanudrdo: you'll have to compile an executable though, you can't normalize terms which go through FFI19/09 09:22
drdoAm i missing something? It's taking more than a minute to load a file with just "import IO"19/09 09:24
dolioIt's probably loading a dozen auxiliary modules.19/09 09:25
Saizandrdo: the first time it's going to take more since it checking a lot of the stdlib too19/09 09:25
drdoSaizan: It's the second time19/09 09:26
drdoAnd now i got a weird compilation error19/09 09:26
drdothe error message is a couple of pages19/09 09:26
Eduard_MunteanuHm, I seem to get an error related to primTrustMe as well.19/09 09:30
Eduard_Munteanu(if that's what you're getting too)19/09 09:30
drdonope, that doesn't appear here19/09 09:31
Eduard_MunteanuOk, looks like primTrustMe's definition wasn't updated in the stdlib.19/09 09:42
Eduard_MunteanuOr the other way around, I should really pull.19/09 09:48
xplatdependent foldl for heterogeneous vectors is annoying :(19/09 15:51
xplatalso, coq really makes agda look readable19/09 15:59
copumpkin:P19/09 16:02
xplatthe problem with the dependent fold is the types in the computation tree should only depend on the left part of the vector of indices19/09 16:03
xplatso they will get introduced in reverse order19/09 16:03
xplatso the natural thing to end up with is a type dependent on the *reverse* of the original index vector19/09 16:04
xplatwhich is fine, except it seems to require a proof to know that's what you're actually building up in the fold19/09 16:04
copumpkinhmm19/09 16:05
copumpkinwouldn't doing something more or less how the Vec foldl is defined in the standard library work?19/09 16:05
xplatVec foldl is taking advantage of the fact that reverse is trivially id on naturals19/09 16:11
xplatso the same technique works for the computation, basically, but it won't typecheck19/09 16:12
copumpkinhmm!19/09 16:16
copumpkinfucking foldl, how do you work19/09 16:16
xplatconcat is pretty hard too, but that's about figuring out what type it should be :)19/09 16:23
copumpkinwait, how are you defining the heterogeneous vectors? my concat was pretty simple when I wrote it19/09 16:28
copumpkinare they just heterogeneous or are they "telescopic"? :P19/09 16:28
RotsorDo dependent types make things like Template Haskell redundant?19/09 17:10
tac-ticsRotsor: In many cases, probably.19/09 17:16
tac-ticsBut for any kind of programming, there's always a metaprogramming someone will want to write a template for19/09 17:17
tac-ticsRotsor: For example, tuples in dep. types are just static-length lists (aka Vect's) that are definable in the language19/09 17:18
tac-ticsAnd the projections (fst, snd) are just indexes using the finite sets (Fin's)19/09 17:18
glguyI think that if dependent types made template haskell redundant we wouldn't have reflection in agda19/09 17:19
glguythings like unquote19/09 17:19
xplatcopumpkin: just heterogeneous19/09 18:20
xplatcopumpkin: but concat, not ++19/09 18:21
xplatcopumpkin: so i was trying to figure out if i should do things like use the heterogeneity to do ragged concatenation19/09 18:21
glguycopumpkin: if I can prove that    1 + 2 * a =/= 2 * b  later today my square root 2 irrational proof will be done19/09 18:55
glguymy code was becoming increasingly messy as I got sleepier last night19/09 18:56
tac-ticswhere a and b are both integers, yeah?19/09 18:58
tac-ticsand b is nonzero, yeah?19/09 18:59
^angel^Hi19/09 18:59
glguynaturals, and it should matter what a and b are19/09 19:00
tac-ticsI'm not sure it really matters. Mod both sides by 2.19/09 19:01
tac-ticsOne side will be the opposite parity of the other, right?19/09 19:02
glguyshouldn't*19/09 19:02
glguyI don't think it will end up being hard, that's just when I fell asleep :)19/09 19:04
glguyhttp://hpaste.org/5153519/09 19:05
glguysqrt-2 : (n m : ℕ) → Acc _<_ n → n * n ≡ 2 * m * m → m ≡ 0, either n and m are zero and you're done, or n*n and m*m are divisible by 2 and you can use the recursive call to show suc m == 019/09 19:09
tac-ticsglguy: But... that's an absurdity!19/09 19:10
tac-ticsXD19/09 19:10
glguyerr, "or they are divisible by 4 because n and m are divisible by 2"19/09 19:10
glguyanyway, the things seems to work19/09 19:10
copumpkinglguy: wait, you're doing a proof of sqrt 2 irrationality too?19/09 19:27
glguyI was there last night19/09 19:28
glguymy proof might be done19/09 19:28
glguyit's loading :)19/09 19:28
glguydone:)19/09 19:28
copumpkin:O19/09 19:29
glguyhttp://hpaste.org/5153519/09 19:29
glguythere we go19/09 19:29
glguydon't mind the naming convention or the indentation19/09 19:29
glguyor the liberal use of solve19/09 19:29
copumpkinwhy make Even a record?19/09 19:29
glguyI was going to ask why not make Odd a record :)19/09 19:30
glguyI did most of this at 1am last night19/09 19:30
glguyI was trying to finish before I fell asleep19/09 19:30
copumpkinah :)19/09 19:30
glguyDid someone already present an attractive irrationality proof this morning while I wasn't watching?19/09 19:32
copumpkinjust Rotsor's from yesterday :)19/09 19:33
copumpkinbut now I feel compelled to make one of my own19/09 19:33
glguyHow did he write it?19/09 19:33
copumpkinI think I'll stick to pricing options though19/09 19:33
copumpkinoh, you didn't see it?19/09 19:33
copumpkinhttp://hpaste.org/5151519/09 19:33
copumpkinyou both wrote your Even proofs in scary ways (to me)19/09 19:34
copumpkinI think they can be simpler, but who knows :)19/09 19:34
tac-ticsglguy: I think the greeks did19/09 19:34
tac-ticsYou must not have been born when they did it :P19/09 19:35
glguyWhoa, Agda is OLD19/09 19:35
copumpkindrAgda's been perfecting it for two thousand years!19/09 19:35
copumpkinmore, maybe19/09 19:35
drAgdashh don't tell anyone19/09 19:36
tac-ticsI find it funny the greeks had so many issues accepting irrational numbers19/09 19:36
tac-ticsand that still today, so many high school student don't accept complex numbers19/09 19:36
tac-ticsdoes a data structure by any other name not have theorems isomorphic?19/09 19:37
tac-ticsIf you prick them, do they not bleed?19/09 19:37
glguycopumpkin: What kind of "even" predicate would you have liked?19/09 19:37
Saizandata Even : \bn -> Set where zero : Even zero; 2+ : forall {n} -> Even n -> Even (suc (suc n))  ^19/09 19:40
glguyand then separately implement Even n -> Sigma [ k : nat ] 2 * k = n19/09 19:41
glguy?19/09 19:41
copumpkinglguy: yeah, but that's fairly trivial I think19/09 20:15
* copumpkin shrugs :)19/09 20:15
xplathere's an interesting one for someone to prove: if a natural has a rational square root it has a natural square root19/09 20:21
xplator better yet, iff19/09 20:21
xplati decided to punt on fancy maps for now, by just using alists i have the chance to work on the tactics, i.e. the stuff i actually care about19/09 20:24
xplatwithout fighting repeated rounds of deathmatches with the stratification and termination checkers19/09 20:25
copumpkin:P19/09 20:25
tac-ticsHow would I write a proof by authority in Agda?19/09 20:26
copumpkinpostulate copumpkinSaidSo : forall {A} -> A19/09 20:27
tac-ticslol19/09 20:27
xplatthere's also trustMe, although that kind of falls into the realm of 'trust, but verify'19/09 20:37
Rotsorxplat: while we are on topic of trustMe, how is it verified?19/09 21:15
RotsorI've been able to prove \bot with it.19/09 21:15
xplatRotsor: it verifies ... at runtime!19/09 21:21
RotsorOh... So it will be able to tell which trustMe went wrong if it did?19/09 21:22
Saizanat runtime, really?19/09 21:30
doliotrustMe only does stuff at compile time.19/09 21:31
dolioWhen you go to evaluate a trustMe, it checks if the two sides of the equality are definitionally equal, and evaluates to refl if so.19/09 21:32
dolioUnless things have changed, at runtime it just computes to refl always.19/09 21:33
dolioFor alonzo, at least.19/09 21:33
Saizanthat sounds more reasonable19/09 21:33
dolioAnd if you only use it appropriately, that shouldn't matter.19/09 21:33
RotsorWell, when I typed trustMe as 1 == 2, it compiled. Why didn't the check work?19/09 21:34
Rotsor(or was it primTrustMe?)19/09 21:34
dolioIt's supposed to work.19/09 21:35
dolioHowever, if you try to use trustMe with subst to change a Vec A 1 to a Vec A 2, it will get stuck.19/09 21:36
dolioAt compile time, at least.19/09 21:36
dolioIn the emacs evaluator, too.19/09 21:37
dolioIf you normalize subst (Vec A) trustMe (0 :: []), you'll get the same thing back out.19/09 21:38
dolioFor 1 == 2.19/09 21:38
dolioFor 1 == 1, you should get 0 :: [] out.19/09 21:38
xplathm, i thought it did that check at runtime too, but how would i know since i've never actually run agda code :)19/09 21:43
xplati meant more generally 'at evaluation time' anyway19/09 21:43
dolioYeah. If you count C-c C-n as runtime, then it works the same way.19/09 21:53
dolioWhether or not the alonzo behavior is acceptable is kind of questionable, I guess.19/09 21:54
dolioAs long as you only use trustMe to introduce true equalities, you're okay, I guess.19/09 21:54
--- Day changed Tue Sep 20 2011
xplatokay, who has used unquote before?20/09 02:41
copumpkina tiny bit20/09 02:42
copumpkinit's really annoying20/09 02:42
xplatas soon as i thought to myself 'how could unquote possibly work?' i immediately answered 'i bet it's really annoying'20/09 02:43
xplatso how does it work?20/09 02:43
copumpkinyou give it a Term, it gives you a term20/09 02:44
copumpkinyour Term must have no holes in it and must obey some unspecified rules that I don't fully understand20/09 02:44
xplatdo you have to basically write 'quoteGoal g in unquote (blah g)' if you don't want to muck around adjusting de bruijn indices for the free variables?20/09 02:44
copumpkinhm, not sure20/09 02:44
copumpkinI was just playing with it in isolation20/09 02:45
xplatbut if you want to do 'var n' and have it refer to a given var, the unquote has to be in the actual scope of the var, right?20/09 02:46
xplatthat's kind of annoying, but not as annoying as not having it at all, i guess20/09 02:46
xplatthe next solver version is really close to being cooked20/09 02:49
xplatif nothing else goes wrong :)20/09 02:49
copumpkinooh20/09 02:50
xplatyour solver will probably be 'quoteGoal g in unquote (solve g)'20/09 02:55
xplatwhich is a mouthful, but at least it never changes20/09 02:55
xplatand there hopefully shouldn't need to be special preparations at all20/09 02:56
* npouillard is one of the unquote's authors, do not hesitate to complain to me (constructive comments are apreciated :)20/09 03:39
xplatnot sure it's anything i could really complain about ... way better than not having it, and it's not easy to think of something better ...20/09 03:54
xplatat least, anything better in the same general family20/09 03:55
xplatmaybe i'll have something more specific to say tomorrow though20/09 03:56
xplatnpouillard: okay, here's something weird, although there's a good chance it's not your fault : the binder g in 'quoteGoal g in foo' doesn't get a de bruijn index20/09 04:28
xplatso there's no way, apparently, to refer to it from unquote20/09 04:29
RotsorI have a problem which is best described with this: http://hpaste.org/51554 . Can anyone help me understand how to extract knowledge from types like F?20/09 04:30
glguy_Rotsor: is one of your options to redefine the type?20/09 04:31
glguy_one way to formulate that is with an explicit equivalence proof20/09 04:32
glguy_otherwise you'll need to assign a name for the index expression that you can case on20/09 04:32
Rotsorglguy_, Yes, I can do that with equivalence proof, but I'm specifically learning how to use the inductive data types and how to extract knowledge from them.20/09 04:33
glguy_it is just generally a bad idea to use functions in your indexes20/09 04:33
RotsorBut they do it in DivMod, apparently for some benefit20/09 04:34
Eduard_MunteanuHmmm... so there's a third compiler backend in Agda now.20/09 04:35
* Eduard_Munteanu should check it out.20/09 04:35
dolioThere's nothing particularly wrong with using a function in an index.20/09 04:35
RotsorI can implement postulate A : Set20/09 04:36
Rotsorpostulate B : Set20/09 04:36
Rotsorpostulate someB : B20/09 04:36
Rotsoroh20/09 04:36
Rotsorwrong paste O_O20/09 04:36
RotsorI can implement useF' : (a : A) → (b : B) → F a b → f a ≡ b20/09 04:36
RotsorBut is there a simpler way to implement useF?20/09 04:37
RotsorWithout implementing useF'20/09 04:37
dolioProbably not.20/09 04:38
Eduard_MunteanuMkay... so with the Epic backend I see GHC eating up 3.5 GiB RAM.20/09 04:38
dolioActually...20/09 04:39
Eduard_MunteanuFor a simple hello world. I wonder why it needs GHC at all.20/09 04:39
glguy_Is this what you ended up with? http://hpaste.org/5155420/09 04:39
dolioYeah, glguy got it.20/09 04:39
Eduard_MunteanuAaaand it's already been running for 10 minutes :)20/09 04:39
Rotsorglguy_: No, the best I've had was the version with useF'. Thank you!20/09 04:41
glguy_I know we've covered this already, but I redid my irrational 2 proof from last night, I think this is about as clear as I can get  http://www.galois.com/~emertens/irrational/Parity.html20/09 04:41
glguy_I think copumpkin showed me Rotsor's approach this morning20/09 04:41
glguy_Do we already have a library of even and odd functions somewhere?20/09 04:43
copumpkinohai20/09 04:43
RotsorYeah, mine is somewhat longer20/09 04:43
glguy_copumpkin jabbed at the complexity of my last even predicate20/09 04:44
copumpkinlol20/09 04:44
RotsorActually I don't think Odd and Even should play important part in the proof because the proof should ideally work for any prime :)20/09 04:44
glguy_So I need to redo it more generally, eh...20/09 04:45
glguy_I was kind of happy to be done with it :)20/09 04:46
RotsorI think you can improve it forever20/09 04:46
glguy_it's that bad? ;)20/09 04:47
glguy_That "Anarchy Proof system" looks awesome20/09 04:48
glguy_I wish they accepted Agda files20/09 04:48
RotsorIndeed20/09 04:48
glguy_I showed that to my wife tonight. Her questions were: "What's the input?" "What's the output?"20/09 04:51
glguy_"It doesn't really *run*"20/09 04:52
copumpkinthe input is a program20/09 04:52
RotsorWell, the input is a proof of n * n == m * m * 220/09 04:52
copumpkinthe output is a judgment of whether the program is well-typed20/09 04:53
RotsorThe output is a proof of m == 020/09 04:53
glguy_She learned Pascal and doesn't consider "got the file to type check" to mean much20/09 04:53
copumpkinyou should teach her agda!20/09 04:53
Rotsorglguy_: I think you used something different from <-rec in a previous version of your proof20/09 04:56
RotsorWhat was that?20/09 04:56
glguy_Acc is the accessibility proof that <-rec uses under the hood20/09 04:57
glguy_It was late and I was in a hurry :)20/09 04:57
glguy_and I bolted that on after the fact when I decided I needed well-founded recursion20/09 04:57
glguy_well-founded recursion (using Induction.WellFounded) is actually structural recursion in Acc20/09 04:58
glguy_Ooh, I have a file handy that shows the connection20/09 04:59
glguy_http://www.galois.com/~emertens/irr-wf/IrrWf.html20/09 05:00
glguy_the "recursion" of this file is basically <-rec20/09 05:00
RotsorI see20/09 05:02
RotsorWhat does ".(m < n)" mean?20/09 05:04
glguy_That m < n is irrelevant20/09 05:04
glguy_and that all I'm allowed to do with it is use it in irrelevant contexts and show that it is uninhabited (if that turns out to be the case)20/09 05:05
glguy_You can't pattern match on it, otherwise20/09 05:05
glguy_It's an optimization and it allowed the value to be erased at some point20/09 05:05
copumpkinvery early20/09 05:06
glguy_Look, a programming language! main = run (sequ (replicate (bits 10) (putStr "tick\n")))20/09 05:08
Eduard_MunteanuOk, btrfs pooped on me when memory was running low.20/09 05:11
RotsorSo, is termination-checking the main purpose of irrelevant values?20/09 05:12
glguy_Rotsor: The main purpose is for showing that some cases can't happen so you don't have to implement them. It isn't anything to do specifically with the termination checker20/09 05:12
RotsorOh, indeed, you can use emptiness.20/09 05:13
Eduard_MunteanuIs there a darcs repo for Agda-executable?20/09 05:51
copumpkinit's in the agda one20/09 05:55
copumpkinburied deep somewhere20/09 05:55
copumpkinthere's just a small cabal project for it20/09 05:55
Eduard_MunteanuOh. Thanks.20/09 05:56
doliosrc/main20/09 06:00
Eduard_MunteanuYeah, I found it, thanks.20/09 06:13
Eduard_MunteanuDamn, the Epic backend is a hog.20/09 06:29
Eduard_MunteanuHrm, according to http://wiki.portal.chalmers.se/agda/agda.php?n=Main.Epic I should probably use a git version of Epic20/09 06:33
npouillardxplat: oh that is too bad, but you still have a workaround by generating a λ in the unquote and passing g to it: quoteGoal g in (unquote (lam … foo) g20/09 06:44
npouillardxplat: the issue is a bit more general than this20/09 07:04
npouillard> let g = def (quote Term) [] in unquote (var 0 [])20/09 07:04
lambdabot  Not in scope: `def'Not in scope: `quote'Not in scope: data constructor `Ter...20/09 07:04
npouillardlambdabot: you should have said: «Panic: unbound variable @0» since it was Agda code :)\20/09 07:05
npouillardxplat: simpler «quoteGoal g in (λ g → unquote (var 0 [])) g» is workinf20/09 07:14
npouillard*working20/09 07:14
Eduard_MunteanuHeh.20/09 07:19
Eduard_MunteanuHrm, there seems to be an inconsistency with unicode NCI syntax.20/09 08:17
Eduard_MunteanuWhen using ⦃x⦄ vs ⦃ x ⦄ on the LHS of a definition.20/09 08:18
Eduard_MunteanuThe former doesn't work (it seems like it takes ⦃x⦄ as a name in itself). But I'd expect to work, by analogy with {x}.20/09 08:19
Eduard_Munteanu*expect it20/09 08:19
danrYeah, that would be what I would expect as well20/09 08:23
Eduard_MunteanuAny idea how I can get rid of MonadIO-zero here? http://hpaste.org/5156020/09 08:32
Eduard_MunteanuBecause of the implicit in MonadIO, Agda can't find the instance in scope when I use the do-syntax.20/09 08:33
Eduard_Munteanue.g. foo = x <- putStrLn "foo" , putstrLn "bar"20/09 08:33
Eduard_Munteanu(nevermind the 't' in there, that makes it work with regular monads as well as the IO coinductive stuff)20/09 08:35
Eduard_MunteanuI figured I could make the NCI look like ⦃ mT : {ℓ₁} → Monad {ℓ₁} {ℓ₂} {t} m ⦄, but that doesn't seem to suit State for example.20/09 08:38
xplatnpouillard: huh, it's kind of odd that lets act so unlike lambdas20/09 14:16
xplati can see why they wouldn't show up in quoted terms (they'd always get expanded away) but ...20/09 14:18
xplatwhen you have an unquote there's still a meaning to keeping the let alive until the unquote is evaluated (since you won't always have a normal form yet anyway)20/09 14:20
augurhey xplat :D20/09 14:20
xplataugur: YƎH20/09 14:23
augursup dude20/09 14:23
xplati'm doing a lot of messing around with agda reflection20/09 14:24
auguroh?20/09 14:24
xplat‘con Algebra.recCon-NOT-PRINTED …’ <-- wat20/09 15:04
copumpkinAngkor20/09 15:13
copumpkinxplat: there's a bostonhaskell coming up!20/09 15:13
copumpkin*nudge* *nudge* *wink* *wink*20/09 15:13
xplatoic, that's a record constructor.  but i have a feeling putting that in will not work as planned :(20/09 15:14
npouillardxplat: lets have a strange behavior in Agda in general, like they are not visible in typing env of a hole :(20/09 15:15
xplatnpouillard: is there a way to construct record constructors with unquote?20/09 15:16
npouillardquote myConstructor ?20/09 15:17
copumpkinwhat if the record doesn't have a constructor?20/09 15:17
xplatah, but these are the record {} ones20/09 15:18
xplat(and i can't exactly go and add a constructor spec because the types are from the stdlib)20/09 15:18
npouillardxplat: oh you can use the constructors function20/09 15:22
npouillardmaybe20/09 15:22
npouillardhead (constructors (quote MyType))20/09 15:23
danrIs your quote-reflection-hacking uploaded somewhere? Github? (/me is curious)20/09 15:24
npouillardotherwise I would suggest to report a bug20/09 15:24
* npouillard as well20/09 15:24
npouillardxplat: you can still workaround by writing a construction function using record{} and then quote this function20/09 15:27
xplatdanr: i hopefully will have something on github later today20/09 15:34
xplatearlier versions that only used a single file ended up on hpaste20/09 15:34
danrxplat: cool. what's your username on github?20/09 15:35
xplatdanr: also xplat20/09 15:35
danrxplat: ok20/09 15:36
xplati just need to figure out how to quote polynomials and the final refl in the proof20/09 15:56
xplatsince there's no form of escaping for literal values in terms i have to write functions to manually quote things so unquote can unquote them20/09 15:57
xplatfor leaf values like polynomials technically i could just use reflection to quote them, but i'd probably get unwieldy terms that way20/09 15:59
npouillardxplat: strangely enough "where" blocks work better than "let" ones20/09 16:13
npouillardquote foo where foo : ℕ | foo = 020/09 16:14
npouillardwhereas with let neither quote x nor var n [] can catch it20/09 16:15
npouillardxplat: I'm filling bugs about quoteGoal/unquote20/09 16:20
drAgdalet-bound names live in their own context which the reflection machinery doesn't have access to at the moment20/09 16:22
npouillarddrAgda: Yeah do you have an explanation and/or suggestion on what should be the solution20/09 16:25
npouillardafter a whois, /me is pretty sure you do actually :)20/09 16:26
drAgda:)20/09 16:27
drAgdait shouldn't be too difficult to jack up quote to work for let bound names as well as defined names20/09 16:27
npouillardok, without de Bruijn indices?20/09 16:28
drAgdayeah, they don't have deBruijn indices20/09 16:28
npouillardok, is there a simple intuition we can have about the way lets work in Agda20/09 16:29
* npouillard is thinking of let bound variable not being displayed in the typing context in interactive mode20/09 16:30
Saizanyou don't get variables defined with a where either, do you?20/09 16:31
copumpkin(you don't even see those in your context, if you ask for it in emacs)20/09 16:32
copumpkinI have a bug for that :)20/09 16:32
npouillardSaizan: right as much annoying20/09 16:33
drAgdanpouillard: lets get inlined during type checking, so they don't exist at all in the internal representation20/09 16:38
npouillarddrAgda: Ok, and quoteGoal makes use of let right?L20/09 16:53
npouillard-L20/09 16:53
drAgdayes20/09 17:07
Saizanedwinb: in the dsl-idris draft you've the same code example twice in section 420/09 17:31
xplatokay, this now works:20/09 17:45
xplatshuffle-test : (a b c : ℕ) → a + b + 2 + c + b ≡ 1 + b * 2 + (c + a) + 120/09 17:45
xplatshuffle-test a b c = quoteGoal g in (unquote (solve-goal g))20/09 17:45
Saizanand how much time does it take?20/09 17:45
copumpkinwhoa, even eating the parameters yourself?20/09 17:45
xplati wouldn't say it's exactly speedy ...20/09 17:45
xplatand i'm not sure where to allocate the blame for slowness exactly.  alists as maps with quadratic slowdown shouldn't matter a whole lot since n is 3 here and a more sophisticated map would eat that up in the constant20/09 17:47
Saizancall-by-name might be the biggest problem20/09 17:48
xplatcould be20/09 17:49
xplatnot much i could do about that quickly20/09 17:49
Saizanah, wait, there's another inefficiency because of unquote i think, since you produce a proof that's typechecked after being unquoted, right?20/09 17:50
xplatyeah, but the proof that's being fed in for typechecking is basically the same as the one you'd write for the RingSolver20/09 17:52
xplatit doesn't get prenormalized before quote/unquote and typecheck, the only difference is all the {n}s on fin constructors are given explicitly20/09 17:52
Saizanin that case it'd be more efficient to have solve-goal : (g : SomeGoalRepr) -> {_ : IsTrue g} -> [[ g ]], so you only need to compute IsTrue g and [[ g ]], not typecheck the generated proof20/09 17:53
xplatthe generated proof, as i mentioned, isn't typechecked, really.  it's just a call to 'prove' with the appropriate polynomials and environment vector that gets checked20/09 17:54
Saizanah, ok, i'm not so familiar with how the ringsolver does it20/09 17:55
xplatand i have to use unquote no matter what, since that's the only way to get access to local vars in the caller's scope20/09 17:55
xplatwell, okay, technically there's another way but it's complicated and requires user participation20/09 17:56
xplatand it doesn't actually take much complication or need for user participation for the raw ringsolver to catch up20/09 17:57
Eduard_MunteanuHrm, time to ask again...20/09 17:59
Eduard_MunteanuCan I eliminate MonadIO-zero here? http://hpaste.org/5156020/09 17:59
Eduard_MunteanuNCIs don't pick up plain MonadIO because of the implicit.20/09 18:00
tac-ticsDo you guys tend to cut&paste and emacs macro all the unicode?20/09 18:01
tac-ticsOr do you have turn-A's and lambdas on your keyboards?20/09 18:01
Eduard_Munteanutac-tics: you can type \forall and get ∀ in Emacs' agda-mode20/09 18:02
tac-ticsgotcha20/09 18:02
tac-ticsI haven't actually played with Agda yet20/09 18:02
tac-ticsBut I got as much as to understand you guys are all emacs users20/09 18:02
Eduard_MunteanuWha? No way :)20/09 18:02
Eduard_MunteanuI use emacs just for Agda stuff.20/09 18:03
SaizanEduard_Munteanu: where are you using Monad-zero?20/09 18:03
danrI have bound ∀ and λ on my keyboard :)20/09 18:03
Eduard_MunteanuSaizan: say I have   func = x <- putStrLn "foo" , putStrLn "bar"    as a simple example20/09 18:03
xplatEduard_Munteanu: that's a common thing (implicits preventing instance arguments from being picked up)20/09 18:04
Saizanin that case you wouldn't really need Monad-zero, but a IOMonad-zero20/09 18:04
Saizanoh, sorry, i can't read.20/09 18:05
Eduard_MunteanuWell, I have MonadIO-zero, which is MonadIO for level zero20/09 18:05
Saizannvm20/09 18:05
Eduard_Munteanuxplat: anything I can do about it, besides manually let-open in each case?20/09 18:06
Eduard_MunteanuIn fact, I think this is asking how we encode superclass constraints in NCIs.20/09 18:07
Eduard_MunteanuAnyway, even if I do that... IO is still quite tricky with all those sharps around.20/09 18:08
Eduard_MunteanuBTW, anything I should read to understand the coinduction primitives?20/09 18:09
Eduard_Munteanu(so far I'm thinking of it as some sort of wrapper that helps the termination checker, but I'm unsure if that's correct)20/09 18:11
Saizanthere's an old mailing list post about their introduction20/09 18:16
Eduard_MunteanuAh, I'll look there.20/09 18:17
Saizani think of them as force and delay combinators, since that's how they affect computation too20/09 18:17
Eduard_MunteanuSo I guess ♯ builds computations, and ♭ tears it down / consumes it, no?20/09 18:19
Saizanyeah, ♯ acts like a barrier suspending normalization, ♭ removes that20/09 18:20
Eduard_MunteanuOh, makes sense, thanks.20/09 18:20
Saizanthere's the additional catch that every use of ♯ is generative, since it's translated to a circular binding20/09 18:22
xplatyou can pro-hash-tinate to infinity, unless you first get flattened by a deadline20/09 18:22
Saizana bit like (\ ()) get desugared to a toplevel definition20/09 18:22
Eduard_MunteanuHeh, nice mnemonic.20/09 18:23
xplathttps://github.com/xplat/agda-tactics20/09 18:52
xplatthere's only two files in the repo, so you shouldn't need a roadmap (or a README) to figure things out20/09 18:54
danrnice, let's see!20/09 18:55
Eduard_MunteanuNice, I was just telling jacobian about your stuff :)20/09 18:57
tac-ticsWhat exactly is Martin Lof type theory?20/09 19:00
xplatit's basically the ancestor of all modern forms of dependent type theory20/09 19:01
jacobianI'm glad to see tactics20/09 19:01
tac-ticsWhat are the defining features of it?20/09 19:01
tac-ticsI've only heard it referenced. I've never seen a language def for it20/09 19:01
dolioIt has a bunch of primitive definitions.20/09 19:02
dolioSums, products, finite sets, integers, pi, sigma, W and a universe U.20/09 19:02
dolioOh, and lists, I think.20/09 19:02
dolioAnd identity types, of course.20/09 19:02
dolioWith most of the introduction, elimination and compute rules you'd get by defining those types in Agda.20/09 19:03
xplatbecause it was created to investigate the foundations of logic, there are several variations, it's more defined in the sense of ZFC than something like Coq or Agda20/09 19:03
dolioBut, no eta rules. And whether or not U has an inductive eliminator depends on what you're reading.20/09 19:04
tac-ticsWhat is the inductive eliminator for U?20/09 19:04
tac-ticsI've never heard of such a thing20/09 19:04
tac-ticsU is like * or Set right?20/09 19:04
xplatU is the thing that is most varied in different versions of MLTT20/09 19:04
dolioU can be defined by induction-recursion in Agda.20/09 19:04
dolioIn Agda, you can define functions by case analysis on such a U.20/09 19:05
dolioBut, Martin-loef sometimes included that ability, and sometime didn't.20/09 19:05
xplatif U has an inductive eliminator, then you basically have typecase on a programming level20/09 19:05
dolioYeah.20/09 19:05
dolioYou also don't get axiom K in MLTT.20/09 19:06
tac-ticstypecase as in switch (typeof t) ?20/09 19:06
dolioWhereas Agda has it by default.20/09 19:06
Eduard_MunteanuBut can be turned off! :)20/09 19:06
xplatEduard_Munteanu: probably20/09 19:06
dolioIt'd be like being able to do: 'f : Set -> ... ; f Bool = ... ; ...'20/09 19:06
Eduard_Munteanuxplat: surely, --without-K20/09 19:07
xplatEduard_Munteanu: no, --without-K *probably* doesn't have K20/09 19:07
dolioI don't think anyone's proved that you can't prove K when --without-K is enabled.20/09 19:07
tac-ticsWhat does K do again?20/09 19:07
Eduard_MunteanuOh,20/09 19:07
tac-ticsIt does something with making Eq mean something more than definitional equality or something, right?20/09 19:07
Eduard_MunteanuYeah, I see your point now.20/09 19:07
dolioK says that all proofs of x == x are refl.20/09 19:07
xplatK gives you 1) proof-irrelevance for equalities 2) heterogeneous equality 3) the kind of refinements agda gives you in dependent pattern matching20/09 19:08
* Eduard_Munteanu found this useful... http://homotopytypetheory.org/2011/04/10/just-kidding-understanding-identity-elimination-in-homotopy-type-theory/20/09 19:08
tac-ticsEduard_Munteanu: I think you linked me that a week ago, but I didn't get too far into it20/09 19:09
danrxplat: Nice quoteGoal usage :)20/09 19:09
copumpkin--special-K20/09 19:09
Eduard_MunteanuPossibly, I think dolio linked me to it recently as well :)20/09 19:09
Eduard_MunteanuHeh.20/09 19:09
danrIt's ever so annoying to rewrite the goal when using solvers20/09 19:09
danrThis is a good idea: ‼_ = arg visible relevant20/09 19:10
tac-ticsSo Eq basically says that if x : A = B and y : A = B, then x can be replaced by y?20/09 19:10
tac-tics... or something?20/09 19:10
danrYou could probably use it in the entire file20/09 19:10
xplatin the homotopy type theory view, it says that every type in your universe is a disjoint union of contractible types20/09 19:10
tac-ticsDoes K have anything to do with substitution lemmas (which I've also heard about)20/09 19:10
tac-ticscontractable meaning you can transform them under beta, eta, and alpha or something?20/09 19:11
xplattac-tics: contractible meaning they are a point, or a blob with no holes in it20/09 19:11
tac-ticsxplat: Somehow, I don't think it should require topology to understand equality :P20/09 19:12
xplattac-tics: well, in homotopy type theory you view a type as a space, a value as a point, and equality as 'connected by a path'20/09 19:13
tac-ticspaths that are defined by the standard transformations on terms, yeah?20/09 19:14
tac-tics(btw, what is the general term for eta, beta, and alpha as a group of transformations?)20/09 19:14
tac-tics(reduction rules? but they don't all reduce)20/09 19:14
jacobianproof normalisation?20/09 19:14
xplatwell, they're all rewrite rules, but that doesn't help much :)20/09 19:14
tac-ticsrewrite rules works for me20/09 19:15
tac-ticsSo S(S(Z)) and S(Z) + S(Z) would be connected because you can beta reduce one to another20/09 19:16
tac-ticsBut something like Axy:Nat. x + y can't be reduced to Ayx:Nat. x + y directly by reduction20/09 19:16
tac-ticsSo you need some Eq tech in there20/09 19:17
tac-ticsDoes that sound like I'm on the right path?20/09 19:17
xplati think only closed terms are actually points of the space, open terms get mapped to something else20/09 19:19
edwinbSaizan: oops, so we did. In the second, it should be Reading instead of Writing20/09 19:19
xplatvariable points of some kind20/09 19:19
* edwinb fixes20/09 19:19
edwinbta20/09 19:19
tac-ticsThose are closed terms20/09 19:19
tac-ticsI closed them with A20/09 19:20
tac-ticsor \forall as you gents call it20/09 19:20
Saizannp20/09 19:20
xplatoh, yeah, you're right.  closed terms of a different type than i was thinking that you were thinking, though.20/09 19:20
tac-ticsBut that's why you need to invoke K, right? For when two things are equal, but don't reduce to each other?20/09 19:21
edwinboh, plus a 'read h' at the end20/09 19:21
tac-ticsReplaceable, not equal on reduction20/09 19:21
xplattac-tics: K is basically about how much it tells you that two things are equal if you don't know anything else about them20/09 19:23
tac-ticsMaybe I should just look at the type of K to understand it instead of guessing wildly >__>20/09 19:24
wieczykHi. Is it possible that agda2-mode does not work with emacs 23.2.1? C-c C-? shows me goals, but C-c C-f and C-c C-b always told me that there are no goals.20/09 21:42
glguywieczyk: there is a bug if you have {-----------------} or similar comments20/09 21:46
glguy(I don't know if that is what you are experiencing)20/09 21:46
wieczykI have removed all comments and still have problem ;[20/09 21:47
glguyI'm using This is GNU Emacs 23.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.29)20/09 21:47
glguy(and it works)20/09 21:47
wieczykHm. Even if I have cursor in '_' and run M-x agda2-auto then emacs tells "For this command, please place cursor..."20/09 21:48
glguy_ isn't a goal, ? is20/09 21:48
wieczykLOL20/09 21:49
wieczykHAHA, I was always using '_' instead of '?'.20/09 21:49
wieczykThanks ;]20/09 21:49
xplatusing Tactics.Nat.Semiring i managed to save 4 whole lines in a 96-line proof of the uniqueness of DivMod20/09 21:50
xplator 2 lines if i count the extra imports :-720/09 21:50
copumpkinoh sweet20/09 21:51
copumpkinoh, drAgda is gone :(20/09 21:51
xplatwell, 3 since i can get rid of an open20/09 21:51
xplatcopumpkin: did you see i put this on github?20/09 21:51
copumpkinyep :D20/09 21:52
xplatsure is slow as hoek though20/09 21:53
glguyI'd guess you could fix some of that with putting abstract in a clever place20/09 21:54
xplat      toℕ r₁ + n₁ * suc m + suc m20/09 21:54
xplat    ≡⟨ (quoteGoal g in unquote (solve-semiring g)) ⟩20/09 21:54
xplat      toℕ r₁ + suc (m + n₁ * suc m)20/09 21:54
xplatit's nice to be able to do things like that, though20/09 21:55
copumpkinnow we just need to ask for a primitive quoteGoal g in unquote (f g)20/09 21:55
copumpkinto avoid the noise20/09 21:56
xplatit's pretty hard to figure out where the slowdowns were introduced since so many things changed from the last working version20/09 21:59
xplat1) use unquote 2) use manual quoters to include values in unquote 3) accumulate arbitrary terms as variables instead of just variables introduced in the current goal20/09 22:01
xplat4) representation of polynomials as a lower bound for the number of variables plus a function to give the actual polynomial when given a specific number of variables and proof that it's high enough20/09 22:02
xplat5) state monad of alien terms seen so far so that identical terms can become identical variables 6) turn answer monad into answer transformer so it can stack over that state monad20/09 22:04
glguyyeah… that *is* a lot of changes20/09 22:05
glguyat some point it would be nice to have profiling tools for this kind of thing:)20/09 22:05
Saizan5 sounds expensive20/09 22:06
xplatlooking at the proof again makes me think it would be helpful to have a tactic to prove an equation given another equation20/09 22:47
xplatfor the integers that just means deciding if the remainders of both sides of the consequent are equal when divided by the difference between the sides of the hypothesis20/09 22:49
xplatbut it's harder for naturals because no subtraction, or the subtraction you do have isn't nice20/09 22:50
copumpkinhow about a magic tactic that lets me prove x == y + 2 -> x - 2 == y20/09 22:51
copumpkinthat's what you mean?20/09 22:51
copumpkinexcept without the subtraction20/09 22:51
xplatyeah20/09 22:51
copumpkinbut something that uses the ring solver with hypotheses20/09 22:51
--- Day changed Wed Sep 21 2011
dylukescopumpkin: hey, sorry21/09 03:33
copumpkinuo21/09 03:33
copumpkinyo21/09 03:33
dylukesokay, so I see what you meant with dependently typed functions21/09 03:33
dylukesyou'd need a function to map the input types to output types.21/09 03:34
copumpkinso21/09 03:34
copumpkinnow say you have two of those functions21/09 03:34
copumpkinhow would you compose them?21/09 03:34
copumpkinthe types have to match21/09 03:34
dylukesso you'd have to really be composing both them as well as the functions that express the type dependency21/09 03:34
copumpkinyeah21/09 03:35
dylukesis there a more naive way to write the signature for composition?21/09 03:35
dylukesthat might make more sense and I can reduce to what I see here?21/09 03:35
dylukeshttps://gist.github.com/123106921/09 03:35
copumpkinthat's about as simple as it gets21/09 03:35
copumpkinyou could progressively work up to it though by only making one of the functions dependent21/09 03:36
dylukesbtw, can you do matching like n@(Succ _)21/09 03:36
dylukesas in haskell?21/09 03:36
copumpkinand working through what that would make21/09 03:36
copumpkinno21/09 03:36
dylukesjust realized the n there needs to be Succ n21/09 03:36
dylukeswhich is kind of annoying since I take it apart and then put it right back together21/09 03:36
copumpkinyeah21/09 03:36
copumpkinI don't care what Nat you actually pass in21/09 03:37
copumpkindoesn't really affect the concept at all21/09 03:37
dylukesI know. :P21/09 03:37
dylukesanyways, I have that f21/09 03:37
dylukesso maybe I should come up with a g to have to test composition with21/09 03:37
copumpkinyeah21/09 03:37
copumpkinwell, see if you can write a composition function if only the first parameter is dependent21/09 03:37
copumpkinf . g where f has a dependent type21/09 03:38
dylukesyou mean, only f, and not g?21/09 03:38
copumpkinand g doesn't21/09 03:38
copumpkinyeah21/09 03:38
dylukesbut that doesn't work really...21/09 03:38
dylukesi.e. if I try to compose my f to some non-dependent g I'd get a type error21/09 03:38
copumpkinwhy not?21/09 03:38
dylukes a non dependent function can't take either a nat or a bool.21/09 03:38
dylukes:\21/09 03:38
copumpkinyou just need g to produce a Nat21/09 03:38
copumpkinf will produce something dependent on the Nat g produces21/09 03:38
copumpkinso the composition will too21/09 03:39
dylukesoh, mixing up the order21/09 03:39
dylukesright right21/09 03:39
copumpkinyeah, the other one is a bit trickier21/09 03:39
dylukesI'll just make g a decrement capped at 0 then21/09 03:39
dylukeshttps://gist.github.com/123106921/09 03:39
copumpkinsounds good21/09 03:39
dylukesokay... so first for partially dependent :\21/09 03:40
dylukesokay... lets see21/09 03:42
dylukesbefore I continue trying to figure it out21/09 03:44
dylukesheres my first (wrong) guess21/09 03:44
dylukeshttps://gist.github.com/123106921/09 03:44
copumpkinit's not bad21/09 03:44
copumpkinnot as general as it could be though21/09 03:44
dylukesit doesn't work21/09 03:44
dylukes"g x != x of type .A"21/09 03:44
dylukes"when checking that the expression f (g x) has type .B x"21/09 03:44
dylukeslet me just try again >_>21/09 03:45
copumpkinsorry, in middle of something21/09 03:46
copumpkinwill check in a few21/09 03:46
dylukesI think the dependently typed one is starting to make sense now anyways21/09 03:47
dylukesIs there a name for the helper function (as an example)?21/09 03:47
copumpkinwhich helper?21/09 03:48
dylukesi.e, in there, the B21/09 03:49
dylukesthe function mapping input type to output type21/09 03:49
copumpkinnot really21/09 03:49
dylukesgot it!21/09 03:51
dylukesit makes more sense now21/09 03:51
dylukesthe only difference is in the type of C21/09 03:51
dylukesin the fully dependently typed version C is a function with two degrees of freedom pro ducting the final result type...21/09 03:51
copumpkinyep21/09 03:51
dylukesin the partial one, C is just some type.21/09 03:51
copumpkinand the C needs to take the result of a dependent function, itself, as one of its parameters21/09 03:52
dylukeshttps://gist.github.com/123106921/09 03:52
dylukesI picture a tree of possible results.21/09 03:52
dylukesIt's set exponentiation.21/09 03:52
copumpkinin some sense, yeah21/09 03:53
dylukeslike, A -> B may have n possible B's21/09 03:53
dylukesthen each of those n B's may have m C's...21/09 03:53
copumpkinnormal functions are exponents, too21/09 03:53
dylukesyeah, I'm aware21/09 03:53
dylukesT -> S is S ^ T yes?21/09 03:53
copumpkinyeah21/09 03:53
dylukesso here its just one more21/09 03:54
dylukesA -> B -> C is C ^ (B ^ A)21/09 03:54
dylukesexcept its like... exponentiation, but then its constrained21/09 03:54
dylukeslike instead of all possible B's and C's, you only get some...21/09 03:54
dylukesidk how to explain what I'm thinking, or if its correct21/09 03:54
copumpkinanother way to think of it21/09 03:55
copumpkin(x : A) -> B x21/09 03:55
copumpkinis an A-ary product of Bs21/09 03:55
copumpkin"indexed by A"21/09 03:56
copumpkinin fact, dependent functions in type theory are often called Pi types21/09 03:56
copumpkinthe Pi stands for product21/09 03:56
dylukesoh, thats what the Pi is for!21/09 03:56
copumpkindo you see the product-ness?21/09 03:56
dylukeswhat do you mean A-ary product btw.21/09 03:57
dylukeslike -ary product21/09 03:57
copumpkinso, going back to haskell21/09 03:57
copumpkinsay you have (a, a)21/09 03:57
dylukessure21/09 03:57
copumpkindo you see how that's equivalent in a sense to Bool -> a21/09 03:57
dylukesthats just because Bool has two inhabitants21/09 03:57
copumpkinwhere fst f = f False21/09 03:57
dylukesa ^ 2 = a x a21/09 03:57
copumpkinand snd f = f True21/09 03:57
copumpkinyep21/09 03:57
copumpkinso in haskell that has to be (a, a)21/09 03:58
copumpkinwe can't write (a, b)21/09 03:58
copumpkinbecause the type of the element can't depend on the index21/09 03:58
dylukeswait... what?21/09 03:58
copumpkin(Bool -> a) ~ (a, a)21/09 03:58
copumpkinright?21/09 03:58
dylukesright.21/09 03:58
dylukesthe Bool could be seen as abstractly "isLefT"21/09 03:58
dylukesor something.21/09 03:59
copumpkinsure21/09 03:59
dylukesah, but we can't have (a, b)21/09 03:59
copumpkinbut think of what's missing and why that has to be (a, a)21/09 03:59
copumpkinhow would you write the function equivalent to (a, b) in haskell?21/09 03:59
dylukesThe first thing that comes to mind uses dependent types.21/09 03:59
copumpkinexactly :P21/09 03:59
dylukesSo I don't know if you can.21/09 03:59
copumpkinin agda, you can make your product21/09 04:00
copumpkin(which : Bool) -> if which then A else B21/09 04:00
dylukeswe'd need (x : Bool) -> helper x where helper True = a; helper False = b21/09 04:00
copumpkinyeah21/09 04:00
copumpkinnow you have a perfect analog of (a, b) as a function21/09 04:00
copumpkinbut there's nothing forcing you to stop at 2 elements in your product21/09 04:01
copumpkinyou could have a product indexed by three21/09 04:01
copumpkinor four21/09 04:01
copumpkinor even by a type with infinite inhabitants21/09 04:01
dylukesbut you need to stack up functions21/09 04:01
dylukeswhich as I said, looks like composition21/09 04:01
copumpkinstack up?21/09 04:01
dylukeser, nod that usage21/09 04:01
dylukesI mean how you have to do like21/09 04:01
dylukes{A : Set}{B : A → Set}{C : (x : A) → B x → Set}21/09 04:01
dylukeseach subsequent one depends on the previous one.21/09 04:02
copumpkinoh no, you're confusing the number of parameters to the function with the number of elements in the product I think21/09 04:02
dylukeser no no21/09 04:02
dylukesthe number of elements in the product corresponds to the number of inhabitants of the parameter21/09 04:02
copumpkinyeah21/09 04:02
dylukesfor three we'd need something like21/09 04:02
dylukesdata Ternary = Black | White | Grey21/09 04:02
copumpkinyep21/09 04:02
dylukesin the case of function composition though, theres also composition going on of those products21/09 04:03
dylukescan you generalize it out to simplify the type signature of *21/09 04:03
dylukes?21/09 04:04
copumpkinnope21/09 04:04
dylukes:<21/09 04:04
copumpkinthe type signature of composition is as simple as it can be if you want full dependence21/09 04:04
dylukesokay well, I have a challenge for myself then, but I have no idea how to do it21/09 04:04
dylukesokay assume we have a basic list type21/09 04:04
dylukeswhat if I want a dependently typed N-ary composition?21/09 04:04
dylukesof an entire list?21/09 04:04
dylukesI guess it'd be easier to just fold it.21/09 04:05
dylukesso, silly really.21/09 04:05
copumpkinyou mean a list of dependent functions?21/09 04:05
dylukesyeah21/09 04:05
copumpkinit'd get really hairy, and you couldn't use a standard list21/09 04:05
dylukesi.e, [f,g,h,i,j] x21/09 04:05
dylukes=21/09 04:05
copumpkincause the elements would all have different types21/09 04:05
dylukesoh, thats true21/09 04:05
copumpkinyou can make a special list for it :)21/09 04:05
nappingtelescopes21/09 04:05
dylukeswell I guess it'd be something like21/09 04:06
dylukes[f : C -> D, g : B -> C, h : A -> B]21/09 04:06
dylukesnapping: ?21/09 04:06
nappingIt will resemble a telescope21/09 04:07
dylukeswhat is a telescope out of curiosity?21/09 04:08
nappingMcBride uses them21/09 04:09
copumpkina super dependent list21/09 04:10
nappinglike, a list of types scoped over the earlier types21/09 04:10
dylukesI have no idea how to write this list .21/09 04:11
dylukes:<21/09 04:11
copumpkindon't try21/09 04:12
copumpkin:P21/09 04:12
dylukes:<21/09 04:12
dylukesany simple exercises you'd recommend?21/09 04:12
copumpkinhmm, I'd work through the agda pdf21/09 04:12
copumpkinthe usual ulf norell tutorial21/09 04:13
copumpkinit may be slightly out of date, but it's not bad21/09 04:13
dylukesOh, btw21/09 04:14
dylukesdot patterns21/09 04:14
dylukesthey still baffle me21/09 04:14
dylukesI'm not getting it.21/09 04:14
dylukeswell, I kind of do... but not really...21/09 04:15
djahandarieOh nice, dylukes is taking another shot at Agda?21/09 04:19
dylukeswell I have too!21/09 04:19
* djahandarie hands dylukes a pistol21/09 04:19
dylukesI'm trying to write a simple dependently typed language, being able to understand dependent types is *kind of* important.21/09 04:19
dylukesITS FOR SCHOOL ;D>21/09 04:19
djahandarieOh, cool21/09 04:20
djahandarieI still think you should stick to something like System F21/09 04:20
djahandarie(i.e., Haskell-like)21/09 04:20
nappinghow about a PTS?21/09 04:22
glguy_wow, there is a lot of backlog to read21/09 04:24
dylukesdjahandarie: any simple Agda exercises you'd recommend?21/09 04:25
dylukesor could you explain dotted patterns to me?21/09 04:25
djahandarieHmmm, I don't really know of any good Agda exercises to be honest21/09 04:27
djahandarieI think the general thing people do is just prove simple stuff from basic number theory or whatever21/09 04:27
glguy_http://corollary.artefact.org.nz/archives/000553.html has a suggestion21/09 04:29
glguy_http://as305.dyndns.org/aps/problem has some things, not all easy21/09 04:30
dylukesI just don't know how to approach proof in agda.21/09 04:30
dylukesor how to use goals or anything21/09 04:30
djahandarieProof is a value21/09 04:30
djahandarieLike a GADT in Haskell21/09 04:30
dylukessure, I get that21/09 04:31
dylukespropositions correspond to types, proofs to inhabitants21/09 04:31
djahandarieIf you can use the constructors to build a term with the proper type21/09 04:31
djahandarieThen it's a 'proof'21/09 04:31
dylukesassuming your grounds are good :P21/09 04:31
dylukesideally you'd want to introduce more parameters and remove all assumptions though, I guess21/09 04:31
djahandarieSo when you want to talk about proving something you need to make a type that can represent your theorem, and use its constructors to get that type21/09 04:32
djahandarieThe 'simple' example here is usually parity21/09 04:32
dylukesdo tell21/09 04:33
glguy_http://hpaste.org/5159421/09 04:33
* glguy_ gambles that that is what djahandarie is talking about21/09 04:34
djahandarieYep21/09 04:34
dylukesokay, that one makes sense21/09 04:34
dylukesso what about what you linked with the sublist?21/09 04:34
dylukeshow would you approach that?21/09 04:34
djahandarieAre you sure that makes sense?21/09 04:34
djahandarieUse it to prove something involving numbers and parity21/09 04:35
dylukesyou could use it to prove that the two of two even numbers is even21/09 04:35
copumpkinsum21/09 04:35
copumpkinhow would you state that property?21/09 04:35
dylukeshm21/09 04:35
dylukesI have no clue.21/09 04:36
dylukesI mean, I know how you'd prove it I guess...21/09 04:36
dylukesor not...21/09 04:36
copumpkinforall {n m} -> Even n -> Even m -> Even (n + m)21/09 04:36
glguy_(n : ℕ) → Even (n + n)21/09 04:36
copumpkinthat says "forall numbers n and m, if Even n, and if Even m, then Even (n + m)"21/09 04:36
glguy_is an even easier place to start21/09 04:36
copumpkinoh, that's even simpler21/09 04:36
copumpkinyeah21/09 04:36
copumpkindylukes: you'll need addition in scope, first21/09 04:36
glguy_OH, I was wrong21/09 04:36
glguy_your example has an easier proof21/09 04:37
copumpkinyours is a simpler type :)21/09 04:37
glguy_we're both pretty great21/09 04:37
copumpkinbackpat21/09 04:37
dylukeshm21/09 04:39
glguy_dylukes: start like this:21/09 04:39
dylukesI have addition/multiplication already there21/09 04:39
glguy_even-plus : ∀ {a b} → Even a → Even b → Even (a + b)21/09 04:40
glguy_even-plus e = ?21/09 04:40
glguy_and load the file21/09 04:40
glguy_you can use C-c C-, to see the type of your goal and the types of your arguments21/09 04:40
copumpkinjust one parameter?21/09 04:40
glguy_oh21/09 04:40
djahandarieHardcore21/09 04:40
glguy_yeah, maybe two parameters :)21/09 04:40
glguy_you can do it with one just the same :-) you don't need to case on the second!21/09 04:40
copumpkineven if you did, you can stick cases into lambdas now :o21/09 04:41
* copumpkin shudders21/09 04:41
djahandarieBecause Agda code wasn't scary enough before.21/09 04:41
dylukeswhat21/09 04:41
copumpkinanyway, start with what glguy_ gave you21/09 04:41
copumpkinyou _are_ editing this stuff in emacs, right?21/09 04:41
dylukesno, I use word21/09 04:42
copumpkinoh okay21/09 04:42
djahandarieThat's fine too21/09 04:42
djahandarieCheck out this word macro I built for Agda21/09 04:42
dylukesI execute it by emailing it from my yahoo email to the microsoft agda server21/09 04:42
dylukesI mail merge in my types21/09 04:42
dylukesits emailed back in 2-3 business days21/09 04:42
copumpkin:)21/09 04:42
* glguy_ shudders at the thought of writing Agda outside of Emacs21/09 04:42
dylukestypechecker@agda.com21/09 04:42
dylukesCC: terminationchecker@agda.com21/09 04:42
dylukeshttps://gist.github.com/123118021/09 04:42
dylukesso, question21/09 04:43
dylukeswhy is this valid, tbh21/09 04:43
dylukesI have multiple definitions of zero/suc?21/09 04:43
copumpkinagda doesn't mind if you have overlapping constructor names21/09 04:43
dylukeswhy does it allow overlapping constructors?21/09 04:43
dylukesor rather, how does it manage it?21/09 04:43
copumpkinit decides which one you want by looking at the type21/09 04:43
dylukessmarty21/09 04:43
copumpkinif it can't figure it out, it'll make it yellow21/09 04:43
copumpkinthat's often the case by the way21/09 04:44
copumpkinif you see yellow or pinkish in your file21/09 04:44
copumpkinit means agda is unhappy21/09 04:44
dylukestermination checker too21/09 04:44
dylukessalmon21/09 04:44
dylukes:|21/09 04:44
dylukeso btw21/09 04:44
copumpkinyeah, that's what I meant by pinkish :)21/09 04:44
dylukesshouldn't I put two arguments to even-plus?21/09 04:44
dylukesi.e, even-plus m n = ?21/09 04:44
copumpkinyes21/09 04:44
dylukesoh also, how do I GET RID of a goal :P21/09 04:44
dylukesI can't delete the fucker21/09 04:45
dylukesalt-del works I suppose21/09 04:45
copumpkinselect the whole thing, then delete it21/09 04:45
dylukesokay so21/09 04:45
dylukes Even (.a + .b)21/09 04:45
glguy_Or write something in it and type C-c C-r21/09 04:45
dylukesI don't know how to dots21/09 04:45
copumpkinthat just means the variables aren't technically in scope21/09 04:45
copumpkinbut that's your goal21/09 04:45
copumpkinso21/09 04:46
dylukesI thought the dot meant like, its inferred by the type checker, not a pattern match21/09 04:46
dylukesso that would just mean21/09 04:46
copumpkinnope, that's a different dot :P21/09 04:46
copumpkindot means lots of things21/09 04:46
dylukesffs21/09 04:46
copumpkindepending on where it is21/09 04:46
dylukesokay so21/09 04:46
copumpkinso let's say you knew a = zero21/09 04:46
copumpkingiven your definition of addition, what would your goal be?21/09 04:46
dylukeswhich a?21/09 04:46
copumpkin.a21/09 04:46
copumpkin:P21/09 04:46
dylukes>_>21/09 04:46
dylukesthen b would have to be even21/09 04:47
dylukeser .b21/09 04:47
dylukes>_>21/09 04:47
copumpkinyour goal becomes Even (zero + .b)21/09 04:47
copumpkinright?21/09 04:47
dylukesum, its not magically changing now that I thought about it,21/09 04:47
dylukesno21/09 04:47
glguy_no way, it'll simplify21/09 04:47
copumpkinwell, I was going to ask him to simplify it :P21/09 04:47
dylukesemacs doesn't have brain-interface yet21/09 04:47
copumpkindylukes: I'm trying to give you intuition for how you approach the problem :P21/09 04:47
dylukescouldn't I just first start with the easy case?21/09 04:48
copumpkinthat is the easy case21/09 04:48
dylukesi.e, even_plus zero n = n21/09 04:48
dylukeswell, kind of21/09 04:48
copumpkinbut yeah, that's what you want to do21/09 04:48
dylukeseven-plus zero zero = {!zero!}21/09 04:49
dylukes:021/09 04:49
dylukesIncomplete pattern matching for even-plus. Missing cases:21/09 04:50
dylukes  even-plus {._} {._} zero (suc {_} _)21/09 04:50
dylukes  even-plus {._} {_} (suc {_} _) _21/09 04:50
dylukeswhen checking the definition of even-plus21/09 04:50
dylukesCURSES21/09 04:50
dylukes(ncurses?)21/09 04:50
copumpkinyou need to write out all the patterns21/09 04:50
copumpkin:)21/09 04:50
copumpkinyou can also ask agda to do that for you21/09 04:50
dylukeshm?21/09 04:50
copumpkinso go back to even-plus x y = ?21/09 04:50
copumpkinand load the file21/09 04:50
copumpkinwhen you get a hole in the place of the ?21/09 04:50
copumpkintype x into the hole21/09 04:51
dylukesk21/09 04:51
copumpkinand type C-c C-c21/09 04:51
dylukeswhat21/09 04:51
dylukeswhat did I just do :<21/09 04:51
copumpkinit pattern matched for you21/09 04:51
copumpkinon x21/09 04:51
dylukes._.21/09 04:51
dylukesso if I type y in again can I keep doing zis?21/09 04:51
copumpkinyeah21/09 04:51
dylukesto infinite and beyond?21/09 04:52
copumpkinsure, but it gets kind of annoying :P21/09 04:52
copumpkinbut keep in mind that you don't necessarily need to match on all parameters21/09 04:52
dylukesokay, so how SHOULD I do this21/09 04:52
copumpkinwell, one clue21/09 04:52
copumpkinis that the definition of _+_ never matches on its second argument21/09 04:52
dylukesmm21/09 04:52
copumpkinso chances are the proof about _+_ shouldn't have to either21/09 04:52
dylukesbtw, what is C-c C-r21/09 04:52
dylukesjust like "accept this if it type checks"21/09 04:53
copumpkinbasically that means that _+_ "doesn't care about" its second parameter in some sense21/09 04:53
copumpkinC-c C-r is a magic filler-inner21/09 04:53
copumpkinit fills in a hole with something that fits, if only one thing fits21/09 04:53
copumpkinit also can write out functions for you21/09 04:53
augurxplat! koninkje_away!21/09 05:16
augurtwo people i can talk to!21/09 05:16
augurkoninkje_away: i really want your opinion on this d-sharing/nccpsc stuff21/09 05:16
jacobiandoes agda do sections to facilitate pointless programming?21/09 12:17
Saizannope21/09 12:29
jacobianagda by default will do what with a non-terminating function which is used in a type?  It seems that the behaviour will lead to non-termination during type checking.  Does it default to allowing it?21/09 13:58
jacobianoops21/09 13:58
jacobianbot : (A : Set) -> Set21/09 13:58
jacobianbot = bot21/09 13:59
jacobianI suppose that answers my question21/09 13:59
mokusby default agda doesn't allow non-termination at all21/09 14:04
jacobianhmmm21/09 14:04
jacobianIn emacs I just entered that and a function following it with a type of bot Bool and it tried to type check it leading to termination.  I suppose I must have some switch to allow non-termination.21/09 14:05
mokusyea, there is such a flag... --no-termination-check i think21/09 14:06
jacobians/termination/non termination/21/09 14:06
Saizanno, that's how it works, but if you checked bot alone it would have marked it in a funny color21/09 14:06
jacobianyup, I did notice that as well21/09 14:06
Saizanafter that you proceed at your own risk, with the current implementation at least :)21/09 14:07
jacobianSo - incremental development is better21/09 14:07
jacobian:)21/09 14:07
Saizanseems so :)21/09 14:08
Saizani guess it'd be easy to add a switch to make it report non-termination-checking early, if there isn't one21/09 14:10
mokusso the emacs mode doesn't check termination in the same way as the command line executable?21/09 14:14
jacobianIf you have suspicious functions it will highlight them red, but if you use them in a type, it just goes out to lunch.21/09 14:16
mokusah21/09 14:17
mokusso it sounds like it just switches termination checking to an advisory mode instead of enforcing it21/09 14:18
jacobianYes, it appears that way21/09 14:18
Saizanonly for the current module, i think21/09 14:25
mokusah, that would make sense21/09 14:25
mokusthe emacs mode sounds nice, i might have to get over my loathing of emacs long enough to try it sometime21/09 14:26
xplat23:44 < dylukes> SALMON NEVER TERMINATES <-- such an excellent mnemonic, i salute you sir21/09 14:35
mokuswhat is it a mnemonic for?21/09 14:36
xplateither 1) that the salmon color highlight means that the function might not terminate 2) that the default color of the nontermination highlight is called 'salmon' or 3) that salmon age as they swim upstream and de-age as they swim downstream21/09 14:41
xplatit all depends which things you already know21/09 14:41
mokusheh21/09 14:44
mokusi don't think i knew any of those21/09 14:44
* Saizan is not sure what 3) means21/09 14:45
mokusthat's why i didn't say "i only knew #3"21/09 14:45
mokusbecause it sounds similar to something i knew, but doesn't quite match21/09 14:45
npouillardhttp://vimeo.com/29361996 <= Coq is better than Agda21/09 15:06
copumpkinlolwut21/09 15:09
jacobianWTF?21/09 15:11
jacobianlol21/09 15:11
Saizanmaybe that's why abel wanted undefined?21/09 15:11
xplatlol21/09 15:17
jacobian he prints happy and it just says eq_refl21/09 15:17
jacobianso eq_refl itself must be insane21/09 15:17
xplatyeah, lolwtfbbq21/09 15:18
jacobianI wonder if he loaded an inconsistent axiom for eq_refl or hacked coq or what21/09 15:18
dylukesI have some good news.21/09 15:20
dylukesIn math I need to give some presentation on somethng math related that's interesting.21/09 15:20
dylukesShould I do Agda >.>?21/09 15:20
dylukes(this is in a few months, so I assume I'll learn more by then)21/09 15:20
dylukes(we're discussing proof theory right now, so its relevant)21/09 15:20
copumpkinsure21/09 15:22
dylukesAt the moment I'm trying to decide how to show commutativity of my addition21/09 15:23
dylukesthe type I came up with is comm+ : ∀{a b} → (a + b) == (b + a)21/09 15:24
xplatthat's an acceptable type21/09 15:24
dylukesI'm not sure how to proove it.21/09 15:25
dylukesprove*21/09 15:26
dylukeslike, other than showing inductively its true for all a's and 'bs21/09 15:26
xplatusually it's easiest to do this with a lemma or two21/09 15:26
dylukesdo tell21/09 15:26
xplatwell, you know how you have zero + b = b and suc a + b = suc (a + b) by definition?21/09 15:27
dylukessure.21/09 15:27
xplatif you also had b + zero = b and b + suc a = suc (b + a) then your proof would be really easy, wouldn't it?21/09 15:27
dylukesah, yeah21/09 15:28
xplatso prove them first!21/09 15:28
dylukesso I'd need to also define a version of addition that matches its right argument21/09 15:28
dylukeswhat's a good name for this?21/09 15:28
dylukescomm+-+r-lemma?21/09 15:28
dylukesidk21/09 15:28
xplator just prove those laws as theorems for regular addition21/09 15:28
dylukesmaybe _ might be cleaner21/09 15:28
dylukesI could just add more patterns to my _+_ too maybe...21/09 15:29
dylukesno... they'd be unreachable.21/09 15:29
xplati'd call them +-identity-right and +-suc-right or something21/09 15:29
xplatyeah, extra patterns would work for you in maude but not agda :)21/09 15:30
xplatbut maude is a whole different paradigm (rewriting)21/09 15:30
xplatnot connected to dependent types at all21/09 15:31
dylukes:\21/09 15:31
dylukesbut I cant just do this21/09 15:31
dylukes+-identity-right : ℕ → ℕ → ℕ21/09 15:31
dylukes+-identity-right m zero = m21/09 15:31
xplatno, no, those are laws21/09 15:31
xplat+-identity-21/09 15:32
dylukesoh so it would be21/09 15:32
dylukesmaybe21/09 15:33
dylukes+-identity-right : ∀{n} → (zero + n) == n21/09 15:33
dylukeswould be better?21/09 15:33
xplater, +-identity-right : \all {n} -> n + zero == n21/09 15:33
dylukeshm?21/09 15:33
dylukesoh right21/09 15:33
dylukesI like using ?21/09 15:34
dylukes:321/09 15:34
dylukesI can just lay out everything I need to prove then work on it21/09 15:34
xplatyeah, ? is nice21/09 15:34
dylukesokay so I need something of type21/09 15:34
dylukes.n + zero == .n21/09 15:34
xplatyou want to prove this by induction on n21/09 15:35
dylukesleft assoc is easy :P21/09 15:35
dylukeser, left identity21/09 15:35
dylukesI alreayd have zero + m = m defined, so its just refl21/09 15:35
xplatyeah, left identity is true by definition21/09 15:35
* npouillard is wondering why would we still need quoteGoal since «type (quote my-goal)» works fine21/09 15:36
xplatfor right identity you have the base case as refl too, since it's the same as left identity21/09 15:36
dylukeswhoo, c c21/09 15:36
dylukes+-identity-right {zero} = refl21/09 15:36
dylukesbam21/09 15:36
dylukes:D21/09 15:36
xplatnpouillard: for when you want to quote a goal that's not identical to a named identifier21/09 15:37
dylukesokay now I need suc n + zero == suc n21/09 15:37
dylukesah, maybe...21/09 15:37
xplatnpouillard: like the example i quoted yesterday of using quoteGoal inline in equational reasoning21/09 15:37
dylukesis there a command to get the current type of a goal?21/09 15:38
dylukeslike, of what I have typed in?21/09 15:38
xplatdylukes: C-c C-.21/09 15:38
xplatwill print both 'what you need' and 'what you have' so you can compare21/09 15:39
dylukesso I need to define +-identity-right inductively :\21/09 15:39
npouillardxplat: ookay, this is right...21/09 15:39
npouillardbut calling tactics by simply saying «solve (quote my-goal)» would nicer, no?21/09 15:40
xplatnpouillard: or just «solve»21/09 15:41
dylukes+-identity-right {suc n} = {!+-identity-right n!}21/09 15:41
dylukesdoesn't work though21/09 15:41
dylukesI mean, I'd think that'd work :\21/09 15:41
dylukesoh21/09 15:42
dylukesits an implicit21/09 15:42
dylukesright21/09 15:42
dylukesoh, C-c C-. is useful21/09 15:42
xplatdylukes: do you have cong defined for your _==_?21/09 15:43
dylukescong?21/09 15:43
dylukesnope :<, just refl21/09 15:43
dylukeswhats cong?21/09 15:43
Eduard_Munteanuxplat: btw, you said implicit args commonly step on NCIs toes. Does that mean there's no solution yet?21/09 15:43
Eduard_Munteanudylukes: congruence. It lets you transform equalities, like f == g into a f == a g21/09 15:44
dylukesheh?21/09 15:44
dylukesexplain it maybe?21/09 15:44
dylukesidk, I'm thinking the easiest solution here is just to define a right-inductive _+R_ operator or something21/09 15:45
xplatcong is pretty useful.  the most basic form is \all {A B} (f : A -> B) {x y : A} -> x == y -> f x == f y21/09 15:45
Eduard_MunteanuFor example, equality on numbers is a congruence wrt multiplication.21/09 15:45
npouillardxplat: by solve I meant a user defined function, not a keyword and don't see what sense this could have otherwise21/09 15:45
Eduard_MunteanuSo if n == m, you also have a * n == a * m21/09 15:45
npouillardxplat: but something like: solveGoal my-solver21/09 15:46
dylukesxplat: Looks like a functor :P21/09 15:46
xplatnpouillard: well, something i wanted was support for 'syntax' to include quotes and unquotes21/09 15:46
dylukesalso doesnt type check21/09 15:46
npouillardhow could be useful indeed, even if we should try to stay away from macro programming21/09 15:47
xplatdylukes: what is your definition for _==_?21/09 15:47
dylukesdata _==_ {A : Set} (x : A) : A -> Set where21/09 15:47
dylukes  refl : x == x21/09 15:47
dylukes  cong : ∀{A B}{x y : A}(f : A → B) → x == y → f x == f y21/09 15:47
dylukesmight be the problem heh21/09 15:47
danrthat's a bit controversial21/09 15:47
xplatoh, don't put it inside the data21/09 15:47
Eduard_MunteanuThat doesn't sound right.21/09 15:47
dylukeshow should it be written?21/09 15:48
Saizancong is supposed to be a function, not a constructor21/09 15:48
xplatit's not a constructor, it's something you can prove21/09 15:48
Eduard_MunteanuInstead you want your _==_ to carry around a proof of congruence.21/09 15:48
dylukesah21/09 15:48
Saizancong : ∀{A B}{x y : A}(f : A → B) → x == y → f x == f y; cong refl = refl21/09 15:48
Eduard_MunteanuSo you can put _==_ and cong in a record.21/09 15:48
dylukesEduard_Munteanu: que?21/09 15:48
Saizans/cong refl/cong _ refl/21/09 15:48
xplatEduard_Munteanu: that's not relevant for this _==_21/09 15:48
xplatEduard_Munteanu: since propositional equality is automatically a congruence for everything21/09 15:49
dylukescong : ∀{A B}{x y : A}(f : A → B) → x == y → f x == f y21/09 15:49
dylukescong _ refl = refl21/09 15:49
dylukesso this looks like a functor21/09 15:49
dylukes:|21/09 15:49
dylukesjust sayin21/09 15:49
xplatEduard_Munteanu: you just need to prove it once21/09 15:49
Eduard_MunteanuAh, right.21/09 15:49
dylukesso here I see where I need this21/09 15:49
dylukesI need to use cong suc21/09 15:50
xplatright21/09 15:50
dylukes+0 : ∀{n} → (n + zero) == n21/09 15:50
dylukes+0 {zero} = refl21/09 15:50
dylukes+0 {suc n} = cong suc (+0 {n})21/09 15:50
dylukesC-c C-. helped21/09 15:51
Saizan"cong suc +0" also works21/09 15:51
dylukeswait... how...21/09 15:52
dylukes+0 {suc n} = cong suc +021/09 15:52
xplatin this case it's a little more readable with the {n}, but yeah, agda can infer it here21/09 15:52
dylukesweird, I'll leave it with21/09 15:52
dylukesEduard_Munteanu: what did you mean a record?21/09 15:52
dylukeslike package up the data type, its laws, as well as all of the proofs of it?21/09 15:53
dylukeser, I have more class21/09 15:53
dylukesbrb21/09 15:53
xplatdylukes: yeah, there are cases when it's good to package things like that, especially if the laws are true for a lot of types21/09 15:53
* npouillard still thinks that the quoteGoal syntax is not quite satisfactory21/09 15:55
copumpkinyeah21/09 15:56
npouillardxplat: what about simply quoteGoal (λ g → unquote (solve-goal g)) or quoteGoal (unquote ∘ solve-goal)21/09 15:56
xplatnpouillard: i'd like to have a «quoteTerm *term* [: *type*]» syntax, but it couldn't replace the functionality of quoteGoal.  the lambda syntax might be nice21/09 15:58
xplatis unquote actually a function so that you could use it with _∘_ though?21/09 15:59
npouillardxplat: you are right that is currently not possible21/09 15:59
xplati don't think there's a lot of 'currently' about it, unquote can't be a function because you can't typecheck it without already knowing its argument21/09 16:01
xplatso it can't be applied to neutral terms, etc, which makes it essentially different from a function21/09 16:02
npouillardyeah I got that but still kind of dreaming ...21/09 16:02
xplatin any case «quoteGoal g in (unquote my-solver)» is definitely a little heavy21/09 16:05
npouillardxplat:  I'm not sure to get the intention behind the «: *type*» of  «quoteTerm *term* [: *type*]»21/09 16:05
xplatnpouillard: because quoteTerm doesn't get any type information pushed in naturally (its return type is just Term), so it can't infer the type of any term that couldn't be typed as a toplevel declaration21/09 16:07
npouillardyeah but maybe we want a solving keyword expanding to quoteGoald (λ g → unquote (my-solver g))21/09 16:07
npouillardok21/09 16:08
npouillardxplat: I've filled these issues yesterday BTW (466 and 467)21/09 16:09
dylukesokay Im back21/09 16:27
dylukesxplat: So how would it look?21/09 16:27
dylukeshttp://cl.ly/AJjq21/09 16:31
dylukeswhat I have21/09 16:31
dylukesI feel like I need to show == is transitive and commutative21/09 16:43
dylukesin order to prove a+b=b+a21/09 16:43
dylukeslike for the zero case21/09 16:43
xplattransitive and reflexive21/09 16:43
dylukesI have (zero +n) == n, and (n + zero) == n21/09 16:44
dylukesbut the type I want is zero +m == m + zero21/09 16:44
xplatyou can prove those laws of equality21/09 16:44
xplatfirst, what do you think their types are?21/09