/home/laney/.irssi/irclogs/Freenode/2009/#agda/November.log

<
--- Log opened Sun Nov 01 00:00:44 2009
-!- jfredett_ is now known as jfredett01/11 05:09
-!- dolio is now known as Guest3859284501/11 08:28
-!- Guest38592845 is now known as asparagus01/11 08:28
-!- asparagus is now known as opdolio01/11 08:29
-!- opdolio is now known as dolio01/11 08:29
-!- copumpkin is now known as TheHunter01/11 22:03
-!- TheHunter is now known as copumpkin01/11 22:03
FunctorSal"open" can't be undone?01/11 23:03
FunctorSal(later in the file)01/11 23:03
Saizani don't think so01/11 23:04
Saizanbut you could make a nested module and then open that one in the larger scope01/11 23:04
FunctorSalhmm I get an error "t != s" when trying to pattern match on refl : t ≡ s01/11 23:23
FunctorSal(t and s are terms, not vars)01/11 23:23
FunctorSalI thought the point of the match was to *make* them equal :)01/11 23:23
Saizanyou probably have some other pattern that's conflicting with those being equal01/11 23:24
Saizani.e. "foo t s refl = .." doesn't work, but "foo t .t refl = .." does01/11 23:25
FunctorSalah. but I have (essentially): t = (id ∘ f ≡ id), s = f01/11 23:26
FunctorSalerr cancel that01/11 23:26
FunctorSalt = id ∘ f,   s = f01/11 23:26
FunctorSalso there is no pattern binding t01/11 23:26
FunctorSal(the pattern binds ∘, but that's a function)01/11 23:27
Saizanmh, i'd probably use subst instead of pattern matching on refl01/11 23:29
dolioYou can't match on an equality unless it's able to refine a variable to equate the two sides. Two terms won't work.01/11 23:31
dolioSo 'v == u' would work, since it can refine v to be u, or vice versa. And 'v == expr' would work, since it can refine v to be expr.01/11 23:33
FunctorSalhmm but one side is a variable01/11 23:34
dolioWhere does t come from?01/11 23:34
FunctorSalFWIW I'm proving the left identity law for product categories01/11 23:34
FunctorSalso I want to make use of the left id for the first factor category01/11 23:35
FunctorSal(which is (id ∘ f ≡ f), ignoring implicits)01/11 23:35
FunctorSalSaizan: yeah I should probably use cong2 for (_,_)01/11 23:36
FunctorSalbut I wanted to see how far you can take matching on refl01/11 23:36
dolioAnd you need to prove that (id o f, id o g) = (f, g)?01/11 23:36
dolioTo do that with matching, I'd do "with id o f | id o g | left-id-f | left-id-g"01/11 23:38
FunctorSalyes (or id ∘ (f,g) = (f,g))01/11 23:38
FunctorSaloh cool didn't know about the pipe syntax01/11 23:38
dolioWell, presumably that normalizes into what I wrote? Otherwise you're probably better off going with equational reasoning stuff.01/11 23:39
FunctorSalyes I think it should normalize01/11 23:39
dolioAnyhow, that would presumably let you match "... | .f | .g | refl | refl" and you'd have to prove that (f , g) = (f , g).01/11 23:41
FunctorSaldolio: great that worked01/11 23:53
FunctorSalweird.01/11 23:53
--- Day changed Mon Nov 02 2009
Saizanonce you've written inside the holes, how do you make the braces and the numbers disappear?02/11 15:26
FunctorSalC-c C-space02/11 15:32
FunctorSal(you can right click on the hole to see all the shortcuts)02/11 15:32
Saizani never use the emacs GUI :)02/11 15:43
--- Day changed Tue Nov 03 2009
--- Day changed Wed Nov 04 2009
faxhuh04/11 14:19
faxagda is so buggy it's insane to call this a proof checker04/11 14:19
Saizannew bug?04/11 14:20
faxyes04/11 14:21
faxnew bugs found every couple of days04/11 14:21
faxit's funny in software when yo ufind a problem:04/11 14:22
faxYou patch it and say, "There we go it's fixed"... but now you have a different program04/11 14:22
faxif you keep finding bugs surely it suggests th approach of fixing them is flawed?04/11 14:25
kosmikushm, I haven't used Agda in a while, but in my experience it was quite usable04/11 14:26
kosmikusbut then, I'd never call it a proof checker04/11 14:26
kosmikuswhat's the bug?04/11 14:26
faxoh yeah it is very useful and useable04/11 14:26
faxI am just talking about edge cases04/11 14:26
faxthere's a new post where someone prove false every week or so :P04/11 14:27
Saizanthey should start writing the compiler in agda so they can prove it correct, ..or not04/11 14:39
faxheh04/11 14:39
Saizanmh, i wonder if the incompleteness theorem prevents that in principle or not04/11 14:42
faxI think we can be very informal and argue that cut elimination is consistency and that proving SN in itsself simply proves inconsistency04/11 14:45
dolioWriting a compiler in Agda would be, I think, arguably less of an incompleteness problem than writing an interpreter.04/11 14:51
faxoh somehow I read 'compiler' and thought 'typechecker'04/11 15:27
faxif your input is programs paired with well-typedness proofs I can imagine that being possible04/11 15:27
dolioWell, yeah, I guess it depends on what all you expect the compiler to do. If it has to verify the well-typedness of the program, it's no better.04/11 15:34
dolioWhich is a reasonable expectation for an Agda compiler.04/11 15:34
dolioI was thinking of translating terms in one language to terms in another language, which isn't necessarily hard.04/11 15:35
dolioYou could write a translation from the untyped lambda calculus to an untyped continuation passing calculus in Agda, I suspect.04/11 15:36
faxyes you could even prove it correct :)04/11 15:36
dolioBut you couldn't execute either one.04/11 15:36
faxwell you can "execute" it04/11 15:36
faxif you produce some domain and interpret the terms into that (to give them one place where meaning is defined)04/11 15:37
dolioOf course, you could also argue that an interpreter is a compiler whose target language only contains normal forms. :)04/11 15:38
dolioWhich is sort of what James Chapman's stuff does.04/11 15:38
yakovevening04/11 20:59
faxare there any other dependent type channels on freenode ?04/11 22:23
yakovfax #coq?04/11 23:10
--- Log closed Wed Nov 04 23:25:10 2009
--- Log opened Wed Nov 04 23:25:23 2009
-!- Irssi: #agda: Total of 20 nicks [0 ops, 0 halfops, 0 voices, 20 normal]04/11 23:25
-!- Irssi: Join to #agda was synced in 97 secs04/11 23:26
--- Day changed Thu Nov 05 2009
copumpkinhmm, I'm confused05/11 01:16
copumpkinI decided to make a "subtypeish" data in agda called PredSet. It takes a type a and a Pred a (which is a -> Set) and returns Set, and has a constructor that carries the value and a predicate on that value. It's forcing me to put PredSet into Set1. Is that normal?05/11 01:18
copumpkinI guess it's because Pred itself gives me a Set105/11 01:22
dolioI'm not really sure how to answer that without seeing code. I doubt Agda's wrong about it not fitting in Set, though.05/11 01:27
copumpkinyeah, probably :) I'll play with it and see05/11 01:27
dolioIt might be wrong about it fitting in Set, but not the reverse. :)05/11 01:29
copumpkinno, I think it's fine actually05/11 01:29
dolioWell, I mean, universe polymorphism seems to have a fair amount of bugs with things fitting in Sets smaller than they should.05/11 01:30
dolioOr maybe just one bug that shows up in several different ways. Who knows?05/11 01:30
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11817#a1181705/11 01:31
copumpkinI'm still on the old agda on this computer05/11 01:31
copumpkinso no universe polymorphism even :)05/11 01:31
copumpkinjust plain ol' Set105/11 01:31
dolioOh, yes, that's right.05/11 01:33
copumpkincause Pred gives me a Set1, right?05/11 01:33
dolioSimilarly, you can't do: "data Exists (P : Set -> Set) : Set where _,_ : (A : Set) -> P A -> Exists P"05/11 01:33
dolioIf you store a Set in a constructor, your datatype gets put in Set1, and so on.05/11 01:34
copumpkinyeah05/11 01:34
* copumpkin tries to think of interesting things to do with this type05/11 01:34
dolioWhy not move it to the other side of the colon, though?05/11 01:35
dolioThen it can be in Set.05/11 01:35
copumpkinoh, much prettier05/11 01:36
copumpkinsilly me :)05/11 01:37
copumpkinI wonder if it makes sense to make the predicate implicit05/11 01:37
copumpkinI'm sure it should be able to figure out my x in that paste automatically05/11 01:37
copumpkinoh I guess that's silly05/11 01:38
copumpkinhmm, I'm gonna write me a function "lifter" into it05/11 01:40
copumpkinwhoa, I was not expecting a syntax error here05/11 01:45
copumpkincan I not parentheses in a parameter to a lambda?05/11 01:46
copumpkinto decompose a constructor?05/11 01:46
copumpkinI guess not05/11 01:49
dolioYou can't pattern match in lambdas or lets.05/11 01:49
copumpkinjust because?05/11 01:50
copumpkinany idea why all the yummy stuff in http://www.cs.nott.ac.uk/~nad/listings/lib/Relation.Unary.html#183 is private?05/11 01:51
copumpkinI mean, it gets opened up later and thus exported05/11 01:54
copumpkinbut is that some roundabout way of doing something useful?05/11 01:54
copumpkinthis is kind of fun, if a little too easy05/11 01:55
dolioThey don't want to export the Dummy module, just its contents.05/11 02:03
dolioAnd don't want to write {a : Set} at the beginning of every type.05/11 02:03
copumpkinbut why make it a module in the first place? to avoid writing \all {a} everywhere05/11 02:04
copumpkinah05/11 02:04
copumpkinfair enough :)05/11 02:04
copumpkinthis PredSet feels like a restricted monad05/11 02:06
dolio"Restricted monads" are hacks to get monads on categories that don't have all Haskell types as objects.05/11 02:16
copumpkinyeah05/11 02:17
dolioPredSet is a sort of subset type.05/11 02:17
copumpkinbut this behaves just like a functor/applicative/monad except for needing to satisfy the predicate05/11 02:17
copumpkinit's basically the restricted identity functor05/11 02:17
dolioIt isn't a predicate on types. It's a predicate on the elements of the type.05/11 02:18
copumpkinyeah05/11 02:18
copumpkinI meant that the elements need to satisfy the predicate05/11 02:18
copumpkinso you can't simply lift a function into the functor, you need to prove that the predicate is preserved by the function05/11 02:18
copumpkinI dunno, maybe it's just a false resemblance05/11 02:20
copumpkinhere's moar: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11817#a1182005/11 02:20
dolioI mean, the obvious connection is that restricted monads need to define a subset of haskell types.05/11 02:25
dolioThat isn't specific to monads, though.05/11 02:26
copumpkinyeah, I guess05/11 02:26
copumpkinbut I could easily make it into one05/11 02:26
copumpkin(assuming restrictedness was allowed)05/11 02:26
dolioMake what into what?05/11 02:26
copumpkininto a monad that behaved like the identity monad, for restricted types05/11 02:27
dolioWhat's the category?05/11 02:29
copumpkinhmm05/11 02:31
copumpkin(x : type, predicate on x) pairs for objects with morphisms being functions that preserve the predicates?05/11 02:32
dolioPredSet a U is, of course, isomorphic to a, so \a -> PredSet a U is the identity functor.05/11 02:32
copumpkinIt seems basically just like Hask, with a more granular notion of type05/11 02:32
copumpkinif you roll the predicate into the set05/11 02:32
copumpkinbut maybe not?05/11 02:34
dolioThat may well be a category, but I don't see how PredSet is a restricted monad in Agda that is equivalent to the identity monad on that category.05/11 02:39
copumpkinhmm05/11 02:40
dolioA restricted monad would be like: 'record RMonad (P : Set -> Set) (M : Set -> Set) : Set1 where field return : {A : Set} {pf : P A} -> A -> M A ...'05/11 02:41
copumpkinwell, I'm sort of switching between views on it05/11 02:41
dolioWhere P determines what As are allowed to be used in return.05/11 02:41
dolioWhich is equivalent to a monad over the category with objects satisfying P, and arrows that are functions between those types.05/11 02:42
copumpkinbut I mean, if you look through sufficiently blurry glasses, lift : ∀ {a b p q} → (f : a → b) → (∀ {x} → p x → q (f x)) → (PredSet a p → PredSet b q) is basically fmap05/11 02:42
copumpkinright?05/11 02:42
dolioIt's an arrow in that category you described.05/11 02:43
dolioOr, a constructor of such arrows.05/11 02:44
copumpkinsee, to me it looks just like the fmap for the Functor instance of Identity05/11 02:44
copumpkinbut maybe my glasses are too blurry05/11 02:45
dolioIt's half of an isomorphism functor between (T, p : pred T) and (PredSet T p).05/11 02:46
dolioOr, a functor that's half of an isomorphism.05/11 02:47
copumpkinyeah05/11 02:48
dolioAn isomorphism between two separate categories.05/11 02:48
copumpkinwhat are the categories?05/11 02:49
dolioOne has pairs of types and predicates as objects, and the other has PredSets as objects.05/11 02:49
dolioOr something like that.05/11 02:50
copumpkinoh05/11 02:50
copumpkinokay, my blurry glasses had unified those :)05/11 02:50
copumpkinbut yeah, ok05/11 02:50
dolioYou can probably write (PredSet a p -> PredSet b q) -> Sigma (a -> b) (\f -> \all {x} -> p x -> q (f x)), too05/11 02:51
copumpkinthat would read as "if I have a function between predsets, there must exist a function that preserves the p to q"?05/11 02:52
copumpkinactually, I'm not sure how to describe that relationship between p and q succinctly05/11 02:52
copumpkinthat way I just did it doesn't sound right05/11 02:52
dolioSomething along those lines.05/11 02:53
dolioIf you have a function between PredSets, there must be a function between the underlying sets that preserves the predicate.05/11 02:54
copumpkinyeah05/11 02:54
copumpkinexcept it isn't just preserving a single predicate05/11 02:54
copumpkinI keep being tempted to call it "monotonic" but that isn't the right word either05/11 02:54
dolioAlthough, maybe there isn't a unique function on the underlying sets, so maybe it's not an isomorphism after all.05/11 02:54
copumpkinI think Data.Product contains an exists symbol somewhere, let me look05/11 02:55
dolioYeah, it's Sigma with the first argument implicit.05/11 02:55
copumpkinhmm05/11 02:56
dolioYou might not be able to write that inverse, actually.05/11 02:57
copumpkinnot constructive enough?05/11 02:57
dolioBecause you can't use the PredSet function to compute f on the elements that fail don't satisfy the predicate.05/11 02:57
copumpkinwell, at least I can write the type :P05/11 03:00
copumpkinand postulate it!05/11 03:00
dolio:)05/11 03:00
copumpkinare you positive it's impossible to write?05/11 03:00
dolio90%05/11 03:01
copumpkinit does seem like it would be pretty hard, since I'm only given a function05/11 03:01
copumpkinin classical logic I'd be able to prove that though, right?05/11 03:03
copumpkin(I'd hope)05/11 03:03
dolioI have trouble thinking in classical logic anymore. :)05/11 03:04
dolioPredSet is Sigma, by the way, you do know?05/11 03:04
copumpkinwell, it seems like I can argue that if such a function did not exist, I could never have the PredSet function in the first place05/11 03:04
copumpkinoh :o05/11 03:04
copumpkinwow, you're right05/11 03:05
copumpkinI just reinvented the wheel, I'm so proud05/11 03:05
dolioIt's a sort of subset operation as long as the P has either 0 or 1 elements for any A.05/11 03:06
copumpkinyeah, so Sigma is more general05/11 03:06
dolioSo, if P targeted Prop, and Prop had the same restrictions as when --proof-irrelevance was in.05/11 03:06
dolioWhich is gone now, allegedly.05/11 03:07
copumpkinwhy?05/11 03:14
dolioIt didn't actually implement proof irrelevance.05/11 03:16
copumpkinoh05/11 03:16
dolioIt didn't interact with --type-in-type nicely, either.05/11 03:17
dolio--type-in-type seems to make everything Set, including Prop, so it effectively negated --proof-irrelevance.05/11 03:17
ccasin--type-in-type is already inconsistent, right?05/11 03:18
dolioYeah.05/11 03:18
ccasinsure can make code cleaner though :)05/11 03:19
dolioWell, once universe polymorphism gets finished, it should provide most the benefits with less extra typing.05/11 03:21
ccasinyes, amen05/11 03:21
ccasinthough, some form of impredicativity would be even nicer05/11 03:22
dolioWell, you can only have impredicativity of Set0 without causing inconsistency.05/11 03:23
ccasinyes05/11 03:23
ccasinbut it would be very convenient05/11 03:23
ccasineven just at Set005/11 03:24
ccasinI find I use coq's Set impredicativity a lot05/11 03:24
dolioImpredicativity of Prop seems nice. It seems less necessary for data when you have inductives.05/11 03:24
ccasinI think I got netsplit there05/11 03:30
ccasinmy biggest wish for agda is something that does the work of coq's "rewrite" tactic05/11 03:30
ccasintoday I wrote 500ish lines of equality reasoning, and specifying the context where you are rewriting every time you use subst or cong gets old really fast05/11 03:30
dolioYeah, that is a pain.05/11 03:31
dolioAnd the rewrite thing they added doesn't do any extra work.05/11 03:32
ccasinyeah05/11 03:32
ccasinthe syntax is a little better05/11 03:32
ccasinbut marginally05/11 03:32
copumpkinI'm still somewhat surprised that my PredSet is Sigma05/11 03:58
doliohttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11817#a1182805/11 04:02
dolioThere's the categories.05/11 04:02
dolioTurned out a bit different than I thought.05/11 04:02
copumpkinoh wow05/11 04:02
dolioI used the same objects for both. The difference is in the arrows.05/11 04:03
copumpkinI haven't actually played with CT in agda yet, so still absorbing those types05/11 04:03
copumpkinlooks pretty elegant05/11 04:04
copumpkinwhy do the morphisms get to have a different universe from the objects?05/11 04:04
dolioBut, the PredPairs category has pairs of types and predicates thereon as objects, and predicate-preserving functions as arrows.05/11 04:05
dolioAnd the Subsets one has paris of types and predicates as objects, and functions between the determined subsets as arrows.05/11 04:05
dolioWhy not?05/11 04:05
copumpkingood question :)05/11 04:06
copumpkinI just couldn't think of a reason to, but I can't think of a reason not to either05/11 04:06
dolioI might be able to come up with a category where it's necessary.05/11 04:06
ccasinthat's cool stuff05/11 04:08
copumpkinso you think the Functor Subsets PredPairs is impossible?05/11 04:08
ccasinbut since you have dependent types, why not formalize the properties too05/11 04:08
ccasin?05/11 04:08
copumpkin(I'm impressed that you came up with that since I brought it up)05/11 04:08
dolioBecause I'm lazy, and this is just an example. :)05/11 04:08
copumpkinbesides, if you filled in all the bits there'd be no leftovers for me to gnaw on05/11 04:09
copumpkinand take half an hour writing a single function while you write a whole module in the same time :P05/11 04:09
* copumpkin finally gives in and builds the latest agda05/11 04:10
dolioOh, PredPairs actually has the objects and arrows in different universes, apparently.05/11 04:11
ccasinI tried to make some categories in agda a while back:05/11 04:12
ccasinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=1182905/11 04:12
dolioO is in Set1, and P => Q is in Set.05/11 04:12
copumpkinthat's a really long arrow05/11 04:12
ccasinit became a mess pretty quickly though, because I didn't think to parameterize the equality relations05/11 04:12
copumpkinseems like everyone's doing CT in agda now05/11 04:13
copumpkinmaybe I should jump on the bandwagon and use it as a tool to help me learn it05/11 04:14
ccasinmy conclusion was it probably wouldn't help learn CT05/11 04:14
ccasinCT is all about pictures05/11 04:14
ccasinand you can't draw them in agda05/11 04:14
ccasinthe types would be so complex, you can't get at the simplicity of "this diagram commutes"05/11 04:15
copumpkinhm, the pictures just seemed like another way to visualize identities05/11 04:15
copumpkin?05/11 04:15
copumpkinah05/11 04:15
ccasinthey are, but they contain a ton of information05/11 04:15
ccasinit's much harder to write down in type theory05/11 04:15
copumpkinhmm05/11 04:16
copumpkinis agda still 2.2.5?05/11 04:28
copumpkineven after the universe polymorphism?05/11 04:29
dolioApparently.05/11 04:34
copumpkindolio: Σ Set Pred isn't quite what I had05/11 06:16
copumpkinlooks like Relation.Unary hasn't had any --universe-polymorphism love yet05/11 06:18
copumpkinI wish we had general TeXish syntax05/11 06:52
copumpkinbeing able to write PredSet as a_{p} and then write Nat_{even}05/11 06:53
copumpkinor maybe superscript05/11 06:53
copumpkinooh, \ell is so much prettier than l05/11 07:04
copumpkindolio: wow, this PredSet all feels so much more fundamental now. extract = proj1, lift = map and inject = map id. I feel thoroughly illuminated05/11 07:15
SaizanPredSet a p = Sigma a p05/11 10:53
SaizanSet  and  Pred a  are the types of  a  and  p  respectively05/11 10:54
doliocopumpkin: Yes. But the objects are supposed to consist of all elements of a particular PredSet A P, and objects aren't indexed by anything.05/11 11:29
dolioA and P determine a particular PredSet. { A : Set, P : Pred A | PredSet A P} isn't right as an object, because that's an A a P and an element of PredSet A P.05/11 11:34
dolioSo, I can't think of a way to distinguish 'the set of sets of the form PredSet A P' other than just 'the set of pairs (A , P)'.05/11 11:40
dolioOh, actually, I did think of a way.05/11 11:55
doliohttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11817#a1186705/11 11:57
dolioThere's the category, and an isomorphism between it and the other one I wrote.05/11 11:57
dolioYou might notice that the proof that the set is of the form Sig A P stores A and P, and that fully determines the set, so it's sort of doing the same thing as the one that stores just A and P.05/11 12:36
copumpkinI see05/11 15:04
copumpkinthanks :) Saizan: that's what I had, yep05/11 15:04
copumpkinI renamed PredSet to \ur= cause it looked cuter05/11 15:05
Saizanwith all this unicode i'll need a bigger font, i can hardly tell the difference between \== and \==n05/11 15:47
dolioYeah, I've been running emacs with a 12 pt font, and even then it can be hard to make some things out.05/11 15:59
dolioTurning it up to 14 looks ridiculous, though.05/11 16:00
stevanhi05/11 16:09
yakovhello05/11 16:12
stevancould someone help me understand why even (n + n) in the if statement (see goal ?0) doesn't normalize in the first module: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11875#a11875  ? thanks.05/11 16:13
Saizanwell, n is a variable05/11 16:14
Saizanso it can't evaluate _+_ further, etc..05/11 16:15
Saizanyou need to prove it by induction, afaiu05/11 16:15
stevanisn't it the same case in the second module?05/11 16:15
Saizanthe .true is given because you pattern match on the lem-even n witness05/11 16:16
Saizannot because there's been any evaluation05/11 16:16
stevani do the same thing in the first module?05/11 16:16
Saizanoh, sorry, and it gives an error?05/11 16:17
stevanthe even (n + n) bit in the first module isn't reduced to true in the if statement05/11 16:18
stevan(while it is so in the second)05/11 16:18
Saizanhow do you tell that?05/11 16:19
stevanby looking at the zeroth goal05/11 16:20
stevanC-c C-, inside ?005/11 16:21
copumpkinis it overkill to write even/odd functions in a mutual block?05/11 16:22
stevanif you got even, then odd = not even?05/11 16:22
copumpkinwell, that makes a painful set of (x -> _|_)05/11 16:23
copumpkinall I did was even zero = T05/11 16:23
copumpkineven (suc n) = odd n05/11 16:23
copumpkinodd zero = _|_05/11 16:23
copumpkinodd (suc n) = even n05/11 16:23
copumpkinin the mutual block05/11 16:24
copumpkinso now I can write ℕ ⇗ even05/11 16:24
copumpkinand feel fancy05/11 16:24
stevanoh, if even : N -> Bool, then you could just use the logical not05/11 16:24
stevani mean boolean not05/11 16:24
copumpkinoh yeah, I just made it a Pred Nat05/11 16:24
copumpkinis there an advantage to going through bool?05/11 16:25
stevanyou could always get the Set back using T : Bool -> Set from Data.Bool?05/11 16:25
copumpkinyeah I know05/11 16:26
copumpkinbut why? :)05/11 16:26
copumpkinthere's that True thing that does just that05/11 16:26
stevanwell in this case you would get odd for free not needing any mutual block :-p05/11 16:26
copumpkinI can do that anyway though, without Bool05/11 16:26
stevanbut that's irrelevant probably05/11 16:26
stevanyes05/11 16:26
copumpkinwell, how would I write even succinctly?05/11 16:27
Saizancopumpkin: going via Bool implicitly proves it decidable05/11 16:27
copumpkinSaizan: I guess, yeah05/11 16:27
copumpkinit just seemed like more of a pain to prove True (boolean_prop) than just set_prop05/11 16:28
Saizanstevan: if you move that ?0 out in a lemma e do the pattern matching there you get the normalization, but i guess that's not surprising05/11 16:41
Saizanthe problem might be that the type of ?0 gets formulated after the pattern matching05/11 16:42
* Saizan doesn't really know05/11 16:42
Saizanthe type checker is quite timid about applying equalities inferred by refl05/11 16:43
doliodata Even : Nat -> Set where view : (k : Nat) -> Even (k + k)05/11 16:44
stevanSaizan: hmm, yes. thanks05/11 16:45
Saizandolio: i'd call view the function (n : Nat) -> Even n though05/11 16:47
dolioYeah.05/11 16:47
stevanare you implying that the proof lemma-even will be hard using by def of even? :-)05/11 16:49
stevans/by def/my def/05/11 16:50
Saizanmore that it's nicer to work with an inductive family like Even in general05/11 16:51
stevanyeah05/11 16:52
copumpkinwhat's the advantage of making the constructor be (n : Nat) -> Even n?05/11 16:53
Saizanthough i'd like to know if there's room to make \== less surprising (, or if they are simply bugs?)05/11 16:53
Saizanno, not the constructor05/11 16:54
copumpkinoh05/11 16:54
Saizanthe function to go from the Nat to the corresponding Even05/11 16:54
copumpkinI see05/11 16:54
copumpkinmy main goal was to have a Pred to use that ridiculous symbol I decided to use with05/11 16:55
copumpkinin other news, I finally understood all those sharps and flats yesterday05/11 16:59
faxcool how does it go?05/11 17:00
copumpkinhow does what go?05/11 17:01
faxsharps and flats05/11 17:01
copumpkinoh, sounds just like beethoven05/11 17:01
faxk05/11 17:01
copumpkinbut the point is to keep the codata in one place I think05/11 17:01
copumpkinsharp sticks something into it, and flat takes it back out05/11 17:02
copumpkinI'm happy because of Conat05/11 17:03
dolioIt's delay and force, essentially.05/11 17:03
copumpkinbeing able to write infinity as a natural05/11 17:03
copumpkinyeah05/11 17:03
copumpkinI'd glossed over those two symbols before cause they looked scary05/11 17:04
copumpkinand then I checked out the module and they were super simple05/11 17:04
Saizanfst : ∀{i j A P} → Σ {i} {j} A P → A05/11 17:04
copumpkinprobably the case with many things05/11 17:04
Saizando you really need those i and j, there?05/11 17:04
faxSaizan: you could annotate A and P instead05/11 17:05
dolioI'm pretty sure if I don't write them there, I have to write {A : Set i}.05/11 17:05
dolioWhich is longer.05/11 17:05
faxbut you have to tell someone what they're for05/11 17:05
Saizani guess you can't just omit them completely :)05/11 17:05
copumpkindamn levels always getting in the way :P05/11 17:06
copumpkinI always forget what module subst lives in05/11 17:12
dolioLevel checking is rather broken. I believe my categories typed fine in Set (max i j), even though they really need to be in Set (suc (max i j)).05/11 17:12
faxlol05/11 17:13
faxanother proof of false on the way05/11 17:13
dolioIt doesn't seem to look through max.05/11 17:13
copumpkinaha05/11 17:15
copumpkinit's a real pain to pull properties out of the huge mess of nested algebraic structures05/11 17:18
Saizandon't they open public one in the other?05/11 17:19
Saizanit was nice seeing that RawMonad does05/11 17:20
copumpkinhttp://www.cs.nott.ac.uk/~nad/listings/lib/Data.Nat.Properties.html05/11 17:20
copumpkinwhat's the easiest way to pull +-identity out of that?05/11 17:20
copumpkinlast time I tried it it took several more lines than just writing it myself05/11 17:20
copumpkinbut maybe I'm missing something05/11 17:20
SaizanisCommutativeSemiring should export a +-identity field, afaict05/11 17:25
dolioYes, it does.05/11 17:26
Saizanso the syntax is IsCommutativeSemiring.+-identity05/11 17:26
Saizan"IsCommutativeSemiring.+-identity isCommutativeSemiring" ?05/11 17:26
dolioIsCommutativeSemiring.+-identity isCommutativeSemiring05/11 17:26
copumpkinah05/11 17:26
Saizanopen public is a must for any module system i'd like to use :)05/11 17:27
dolioOr just whip out the ring solver and tell it to solve the equation x = x + 0. :)05/11 17:27
copumpkinbah05/11 17:28
copumpkinAn internal error has occurred. Please report this as a bug. Location of the error: src/full/Agda/TypeChecking/Substitute.hs:5305/11 17:28
copumpkinthat's what I get for using the darcs version :)05/11 17:29
sinelawcopumpkin has bugs?05/11 17:29
copumpkinit doesn't seem to like Data.Nat.Properties05/11 17:29
dolioWow, you caused a GHC error by running Agda.05/11 17:29
copumpkinthat's a ghc error?05/11 17:29
dolioYes.05/11 17:29
copumpkin:o05/11 17:30
copumpkin  apply EmptyTel  _   = __IMPOSSIBLE__05/11 17:31
copumpkinI think it's an Agda error?05/11 17:31
copumpkinunless agda likes to report its errors by triggering GHC errors05/11 17:31
dolioAh, okay.05/11 17:31
copumpkinthat would've been funny though05/11 17:31
copumpkinwrite such abominable code that you break the compiler of your compiler05/11 17:32
sinelawheh, whenever you have an error in your program, yes.05/11 17:33
Saizanyo dawg i herd you like reportin bugs..05/11 17:33
copumpkinyeah, yeah05/11 17:33
copumpkincan someone reproduce it by the way? just use a recent darcs agda and try to load Data.Nat.Properties ?05/11 17:34
sinelawis hackage agda good enough? i'm guessing not05/11 17:34
copumpkinI don't think so, I remember using Data.Nat.Properties a while ago on it and it worked05/11 17:37
dolioI have it loaded here.05/11 17:37
dolioMy Agda is like 3 weeks old.05/11 17:38
copumpkinah05/11 17:38
stevansame here05/11 17:38
copumpkinhmm05/11 17:38
dolioMan, where did I find documentation on this ring solver last time I looked at it?05/11 17:44
dolioThere's no explanation of how to use it.05/11 17:44
Saizani've seen an example somewhere05/11 17:45
dolioOh, I think one of the modules uses it.05/11 17:45
copumpkindocumentation! pff05/11 17:48
copumpkinTHIS IS AGDA!!!05/11 17:48
Saizanso #coq is Persia?05/11 17:48
copumpkinyeah05/11 17:48
copumpkinwhen 300 agda users overcame hundreds of thousands of coq users05/11 17:49
Saizanall of them dying. nice that we're still 16 here05/11 17:51
fax16??05/11 17:52
copumpkin24?05/11 17:53
dolio+-id {n} = solve 1 (λ n → n :+ con 0 := n) refl n05/11 17:53
copumpkincute05/11 17:53
copumpkinso it's called a ring solver because it works on any ring?05/11 17:54
Saizanyes, sorry, 24 (i can't even read the infos from my irc client today)05/11 17:54
copumpkin(yeah, I'm a fast one)05/11 17:54
copumpkinseems like for many equations you'd need more than a ring05/11 17:55
dolioYes, but Nat isn't even a ring. It works on multiple ring-related structures.05/11 17:55
copumpkinis there no agda trac?05/11 19:07
doliohttp://code.google.com/p/agda/issues/list05/11 19:08
copumpkinthanks :)05/11 19:08
copumpkinhmm, how does one refer to a state of a repository in darcs? Is there some sort of a hash I can use to identify which agda and stdlib I have?05/11 19:11
dolioI just tell them when I last pulled/built.05/11 19:12
dolioApproximately.05/11 19:12
copumpkinfair enough... but darcs has no such facility? it seems like a pretty important thing to have05/11 19:12
dolioI don't really know. I've never really considered it.05/11 19:12
kosmikuscopumpkin: it does, but it's not a hash; you can create a context file that identifies the current state of the repo; in essence, the context file contains all patches since the last tag, it can be quite long05/11 19:40
copumpkinyeah05/11 19:40
copumpkinI just did the simple thing05/11 19:41
copumpkinI find negations a lot harder to prove than direct statements05/11 19:43
copumpkinare there some useful helper functions for them?05/11 19:43
kosmikushelper functions?05/11 19:43
copumpkinwell, I consider subst and sym and such helper functions05/11 19:43
copumpkinit's sad how excited I get after proving absolutely trivial things05/11 20:05
edwinbI don't see what's sad about that ;)05/11 20:06
copumpkinI just proved that a natural is either odd or even :P05/11 20:07
copumpkinand that if you're one, you're not the other05/11 20:07
edwinbwoo!05/11 20:07
copumpkin:P05/11 20:08
edwinbIt's always nice to push the boundaries of mathematical knowledge05/11 20:08
copumpkinyeah! soon I'll be proving that even + even = even05/11 20:08
copumpkinthen I shall consider this to be a successful day05/11 20:09
dolioYou should turn on --type-in-type and prove that odd + odd = odd.05/11 20:11
faxhttp://rosettacode.org/wiki/Evens_Sum_To_Even05/11 20:12
dolioWasn't expecting the TCL.05/11 20:14
faxI just deleted it05/11 20:16
faxconfused people keep adding crap to that article05/11 20:16
dolioOh? I didn't actually look at it. Did it really prove something?05/11 20:16
faxrosettacode is dying because of poor managment anyway05/11 20:16
dolioYeah, I'm going to have to say no, tentatively.05/11 20:33
copumpkinI don't wanna cheat, I want to prove it myself!05/11 20:37
dolioWell, then, you can write the odd + odd = odd proof. It's significantly more difficult. :)05/11 20:38
copumpkinlol05/11 20:38
copumpkinI meant even + even = even05/11 20:38
copumpkinby the way, do you think you could take that inconsistency you mentioned about the category universe05/11 20:38
copumpkinand actually prove false with it?05/11 20:39
dolioYes, probably.05/11 20:39
copumpkinwow05/11 20:39
dolioHold on, let me try something.05/11 20:39
copumpkinthat'd make an awesome bug report05/11 20:39
copumpkin"either agda is broken or logic is, not sure"05/11 20:40
copumpkinI guess that's sort of what your "all functions are injective" email was like :)05/11 20:40
dolioThey already know level checking is buggy.05/11 20:41
copumpkinah05/11 20:41
doliodata Wrap {i j : Level} : Set (max i j) where  wrap : (A : Set) → Wrap05/11 20:43
dolioThat checks.05/11 20:43
copumpkinwhat's wrong with it?05/11 20:45
dolioWrap is isomorphic to Set, so that's Set : Set.05/11 20:45
copumpkinoh05/11 20:45
dolioSince I can set i = j = 0.05/11 20:45
copumpkinoh, I see05/11 20:45
dolioIt also works if you have (A : Set k) for any k.05/11 20:45
dolioYou can actually make it polymorphic in K.05/11 20:46
doliodata Wrap {k i j : Level} : Set (max i j) where  wrap : (A : Set k) → Wrap05/11 20:46
dolioSo Wrap {k} is isomorphic to Set k, but Wrap {k} can inhabit any other universe.05/11 20:47
dolioAt that point it's just a matter of inserting the wrappings around the proof using --type-in-type.05/11 20:49
copumpkinhmm, when I ask for context of an expression, it seems to ignore things that where binds05/11 20:55
dolioYeah, it'd be nice if it displayed those.05/11 20:55
dolioAlthough, I typically have to write types for things in where clauses anyway.05/11 21:01
dolioIt's not often I write "where e = ..."05/11 21:01
copumpkinah05/11 21:02
copumpkinYAYAY05/11 22:42
copumpkinI proved even+even≡even : ∀ {x y} → even x → even y → even (x + y)05/11 22:42
copumpkinprobably in the most roundabout way ever05/11 22:42
* edwinb applauds05/11 22:42
copumpkinthank you05/11 22:42
edwinbI am currently having trouble with a program that doubles an integer05/11 22:47
edwinbwe really do push back the limits of compsci here05/11 22:47
copumpkinlol05/11 22:48
copumpkindoubling is hard!05/11 22:48
edwinbat least I know that if I start with an even number, I should end with one too05/11 22:48
edwinbthanks to earlier results05/11 22:48
copumpkinlol05/11 22:50
copumpkinstanding on the shoulders of giants, eh05/11 22:51
--- Day changed Fri Nov 06 2009
FunctorSaladcopumpkin: hmm did it in a harder way than proving that equality modulo n is respected by addition?:o06/11 00:12
FunctorSaladmaybe someone should hook agda up to a term rewriting engine ;)06/11 00:14
FunctorSaladcalculations are not so fun when every step is explicit06/11 00:14
faxFunctorSalad: by the way, all the term rewrite stuff I saw was pretty contrived.. Can you show me a more natural example?06/11 00:17
Saizan_you mean all the sym/cong/subst and/or binding new variables so they can get refined?06/11 00:17
FunctorSaladfax: x * x^-1 ---> e06/11 00:17
FunctorSalad;)06/11 00:17
FunctorSaladSaizan_: just rewriting with equations, e.g. in arithmetic or groups06/11 00:18
faxFunctorSalad but you want that in the convertability?    In my situation I just have a tactic which can reduce that automatically -- of course it doesn't apply to the congruence but I never needed it to06/11 00:18
FunctorSaladfax: AIUI, putting it into the convertibility endangers some nice properties... maybe just feed the equations to the rewrite engine and automatically reconstruct what the engine did as an agda proof06/11 00:19
FunctorSaladthen you don't need to worry about confluence as long as you get the result you want06/11 00:20
faxalright well seems you are really just missing tactic based proof automation06/11 00:20
FunctorSalad_oh no lost connection06/11 00:21
FunctorSalad_<FunctorSalad> fax: AIUI, putting it into the convertibility endangers some nice properties... maybe just feed the equations to the rewrite engine and automatically reconstruct what the engine did as an agda proof06/11 00:21
FunctorSalad_<FunctorSalad> then you don't need to worry about confluence as long as you get the result you want06/11 00:21
FunctorSalad_but convertibility would be nicer of course06/11 00:21
FunctorSalad_I'd also like unification modulo associativity :)06/11 00:21
fax <fax> alright well seems you are really just missing tactic based proof automation06/11 00:22
faxwhy would it be nicer?06/11 00:22
FunctorSalad_well, coq has tactics and I still often had to manually do trivial steps06/11 00:23
fax(btw I'm starting to wonder why all the fuss about type theories being intentional..)06/11 00:23
FunctorSalad_you do have autorewrite, but you want the trivial steps to be transparent while you're doing higher-level things06/11 00:23
FunctorSalad_fuss in what sense? that extensional TT isn't so bad after all?06/11 00:24
dolioExtensional theories tend to run into decidability problems.06/11 00:24
FunctorSalad_(if you're proving a serious number theory theorem, you don't want to get distracted with reassociating expressions, at all)06/11 00:24
dolioWhich is what OTT is designed to skirt, after all.06/11 00:24
FunctorSalad_dolio: yes but why not sacrifice decidability06/11 00:25
faxyeah need to figure out what on earth OTT is.. does.. whatever06/11 00:25
FunctorSalad_let it do some search, then give up after some time06/11 00:25
FunctorSalad_it will find the trivial steps you want it to find06/11 00:25
dolioI mean type checking isn't decidable.06/11 00:26
FunctorSalad_yes, I referred to type checking in the last 2 msges06/11 00:27
dolioAlthough I'm not clear on what sort of terms are undecidable.06/11 00:27
FunctorSalad_that's easy, add (even first-order) peano arithmetic to definitional equality -> undecidability06/11 00:27
FunctorSalad_but I don't want the typechecker to solve real problems, just the trivial arithmetic06/11 00:28
dolioOne of the OTT papers has an example that under the hypothetical assumption a = a -> a you can type omega, which I guess spins forever, or something.06/11 00:28
fax:(06/11 00:28
Saizan_(any good example of using equational reasoning?)06/11 00:28
dolioWhereas in an intensional theory (and OTT), that doesn't happen.06/11 00:28
faxSaizan my favorite is Shin-Cheng Mus stuff with AoP06/11 00:29
faxdolio, I think that a similar issue came up with (a flawed approach to) proof irrelevance06/11 00:29
faxrecursion on hypothetical proofs06/11 00:29
dolioAh.06/11 00:29
FunctorSalad_Saizan_: doesn't it happen all the time in math?06/11 00:30
Saizan_i meant the agda lib06/11 00:30
FunctorSalad_ah :)06/11 00:30
Saizan_s/lib/module/06/11 00:30
dolioBut, yeah, I don't know if that sort of stuff is a problem in practice.06/11 00:30
dolioI haven't heard lots of NuPRL people complaining.06/11 00:30
FunctorSalad_to avoid spinning, the typechecker would do a fair search and give up after some time, I suppose06/11 00:31
FunctorSalad_I don't see how that's worse than simply quitting with a type error06/11 00:32
dolioFair search of what?06/11 00:34
FunctorSalad_hmm with a confluence-breaking change, it will have decision points, won't it?06/11 00:34
FunctorSalad_I just meant it shouldn't just try one branch06/11 00:35
dolioDoes infinite beta reduction of (\x -> x x) (\x -> x x) have decision points?06/11 00:35
faxdolio doesn't lambda calculus have confluence though?06/11 00:36
FunctorSalad_you mean after "A = A -> A" has been added?06/11 00:36
copumpkinbah, I want Nat.Properties!06/11 00:36
dolioI thought that was the problem with the example in the OTT paper.06/11 00:36
FunctorSalad_dolio: you'd have made a decision to rewrite with that equation instead of doing something else06/11 00:36
FunctorSalad_(and I think it's the user's own fault if he adds that ;))06/11 00:37
faxyes but it doesn't break confluence06/11 00:37
faxbreaking confluence would be like some strange value X,  X --> 1  and  X --> 206/11 00:37
dolioYou don't add it like an axiom. But in an extensional theory you can write \(pf : a = a -> a) -> omega, essentially.06/11 00:38
FunctorSalad_hmm it would break confluence in the sense that maybe the checking would have terminated if you did something else than using "A = A -> A"06/11 00:38
dolioOf course, it's the user's fault if he writes that term, too.06/11 00:38
Saizan_undecidability means you no longer know if your code is incorrect or the compiler was too stupid to find a solution06/11 00:39
FunctorSalad_(say you also have "A = ()")06/11 00:39
dolioYou can write that hypothetical in Agda, too, but it doesn't compute infinitely.06/11 00:39
FunctorSalad_timeout?06/11 00:39
faxI still want decidible typechecking btw :p06/11 00:39
copumpkintimeout isn't a good indication of either06/11 00:39
FunctorSalad_well there could be a command "compile without rewrite rules"06/11 00:40
faxFunctorSalad what about a reflective implementation of congruence closure -- that'd work nicely with equational reasoning in Agda06/11 00:41
FunctorSalad_fax: I don't know much about reflection but it could work I suppose06/11 00:41
faxFunctorSalad_: it means that you write a meaningful program06/11 00:42
faxget some quoted term as input, and produce a proof of the evaluation (meaning) of the text (or a "I can't prove it token" or "this is false")06/11 00:44
faxso to prove e.g. P -> P you might use some decision procedure you implement and prove sound: djinn ("P" "-->" "P")06/11 00:45
faxcongruence closure would be an interesting one though06/11 00:45
fax(I think very difficult also)06/11 00:46
copumpkinwoo! odd+even≡odd : ∀ {x y} → odd x → even y → odd (x + y)06/11 00:52
copumpkinproved that too06/11 00:52
copumpkinmy proofs are fugly06/11 00:52
dolioStill waiting on that odd+odd=odd06/11 00:52
copumpkinlol06/11 00:52
copumpkinmight take me a while ;)06/11 00:52
faxuse group homomorphism06/11 00:53
Saizan_http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11879#a11879 <- there a way to avoid cong there?06/11 01:03
dolioI don't think so.06/11 01:08
faxThat's how to do all four proofs in one go by homomorphism http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11880#a1188006/11 01:17
dolioWow, that befunge hilighting is something.06/11 01:20
copumpkinI really need that begin thing: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11881#a1188206/11 02:23
faxdid you see the link I gave?06/11 02:27
copumpkinthat's a nice way of doing it06/11 02:28
copumpkinjust saw it now06/11 02:28
copumpkinand I agree with dolio06/11 02:28
copumpkinthe highlighting is definitely something06/11 02:28
copumpkinit's interesting how many different approaches there are to do roughly the same thing06/11 02:31
faxI've only seen two (mine and yours), what have the others been?06/11 02:31
copumpkinI mean in general06/11 02:31
copumpkinI guess another way would be through mod06/11 02:32
copumpkinwhich sounds like a nightmare06/11 02:32
faxI don't think so06/11 02:36
copumpkinthe mod in the standard library looked awfully painful06/11 02:37
faxoh right06/11 02:37
copumpkinbut maybe I shouldn't be scared awy06/11 02:37
faxI just define everything from scratch06/11 02:37
faxeven k <=> k = 0 (mod 2); even k /\ even k' ==> even (k + k') because 0 + 0 = 0 (mod 2)06/11 02:37
faxthat sort of thing shouldn't be difficult to encode06/11 02:38
copumpkinyeah06/11 02:38
copumpkincan I express this nasty chain of animal noises with the begin/ ≈⟨ ⟩ / ■ ?  http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11881#a1188206/11 03:18
copumpkinthe universe polymorphism is a little weird06/11 04:13
copumpkinit seems to break eta reduction06/11 04:14
copumpkinI guess just for backward compatibility06/11 04:14
copumpkinman, an agdabot would be awesome06/11 04:15
copumpkinpibot?06/11 04:15
copumpkinrunning out of suitable symbols for my newbie category theory stuff06/11 05:15
Saizan_begin/ ≈⟨ ⟩ / ■ seem to mostly be about uses of trans06/11 11:49
copumpkinSaizan_: so there's no easy way to simplify that nasty mess I made in that proof?06/11 16:06
Saizan_copumpkin: i hope there is, but i don't know how :)06/11 16:08
copumpkinwell, those animal noises are pretty awesome06/11 16:08
copumpkinso maybe it isn't so bad06/11 16:08
copumpkin:)06/11 16:08
Saizan_sometimes i keep pattern matching on the refl's and they arguments to make the typechecker refine, rather than use the helpers06/11 16:09
copumpkinhow do you mean?06/11 16:09
copumpkinalso, how would you have approached that proof? it felt needlessly ugly06/11 16:10
Saizan_(but i don't think that's particulary nicer)06/11 16:10
Saizan_mh, let me try06/11 16:11
copumpkinno rush, was just curious if you'd have done it differently06/11 16:12
copumpkinfax posted a different approach entirely to parity yesterday06/11 16:12
copumpkinwhich would probably make those proofs easier too06/11 16:13
Saizan_copumpkin: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11881#a1189806/11 16:25
copumpkinzomg06/11 16:25
copumpkinso much prettier :)06/11 16:25
copumpkinI was trying to do something like that but couldn't get it to accept it06/11 16:26
copumpkinso I did the long, roundabout way06/11 16:26
copumpkinlike the double +-comm thing made me feel gross06/11 16:26
Saizan_i find that when i write code using lots of sym/subst/cong i have an hard time understanding it after06/11 16:32
Saizan_though splitting it into several animal noises help :)06/11 16:32
copumpkinmoo06/11 16:32
Saizan_odd+odd≡even {suc m} {suc n} pm pn = subst odd (sym (m+1+n≡1+m+n m n)) (even+even≡even pm pn) <- without pattern matching06/11 16:38
copumpkinomg :)06/11 16:38
copumpkinso much prettier06/11 16:39
copumpkinlol06/11 16:41
copumpkinwhat's funnier06/11 16:41
copumpkinis that I already had that in my odd+even proof06/11 16:41
copumpkinalmost :)06/11 16:41
Saizan_ah, yeah :)06/11 16:42
Saizan_you already proved it!06/11 16:42
copumpkinlol06/11 16:43
Saizan_too bad agda didn't rememberù06/11 16:43
copumpkinyeah!06/11 16:43
copumpkintoo bad I didn't either06/11 16:43
copumpkinnor did I realize I'd already done it :P06/11 16:43
copumpkinlol and my even+odd proof is way overcomplicated06/11 16:44
copumpkinnow that I look at it06/11 16:44
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11881#a1190006/11 16:45
copumpkinlol06/11 16:45
* copumpkin tries to get rid of all the extra unnecessary stuff in these proofs06/11 16:45
copumpkindoes the lack of polymorphism cost agda anything?06/11 16:51
copumpkinor is the implicit parameter approach equivalent?06/11 16:51
Saizan_i'd say you get more control over it, since you can manually instantiate an implicit parameter if you want06/11 16:55
copumpkinyeah06/11 16:55
Saizan_not sure if agda's type checker can infer all the types e.g. GHC can, currently06/11 16:56
Saizan_myid = \lambda x -> suc x gets marked in yellow, for example06/11 16:58
Saizan_but that's not even about polymorphism anymore :)06/11 16:59
copumpkinwoot06/11 16:59
copumpkinI simplified my proof even more06/11 16:59
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11881#a1190106/11 17:00
copumpkinoh and I can get rid of some of the implicit args too06/11 17:00
copumpkinanyone have any idea how the hell one should type ⊎?06/11 17:07
Saizan_\u+ ?06/11 17:09
copumpkinnice :)06/11 17:09
copumpkinthanks06/11 17:09
Saizan_"C-u C-x =" answers that in general06/11 17:10
Saizan_over the symbol06/11 17:10
copumpkinoh cool06/11 17:10
copumpkinhttp://snapplr.com/5x43 is that sufficient to show that even/odd is decidable and that they are mutually exclusive?06/11 17:12
copumpkinit seems like they might not be mutually exclusive given that type06/11 17:12
copumpkinI could do (even n × ¬ odd n) ⊎ (¬ even n × odd n)06/11 17:13
faxwhat's the definition of ⊎06/11 17:13
copumpkinit's just a sum06/11 17:14
copumpkinEither06/11 17:14
copumpkinfax: I made my sum parity proofs a lot prettier!06/11 17:14
* copumpkin beams06/11 17:14
copumpkinstill not quite as elegant as your homomorphism, but pretty simple still06/11 17:15
Saizan_mh, you could make a separate proof odd n -> \neg even n and some other direction :)06/11 17:16
copumpkinI did that originally06/11 17:16
copumpkinthe proofs were so simple that I figured if I needed them I'd just do them on the fly06/11 17:17
copumpkinbut does that parity function at least constitute a proof that the two are decidable?06/11 17:17
copumpkinif not necessarily mutually exclusive06/11 17:17
Saizan_i think it does only if you know they are one the negation of the other06/11 17:20
copumpkinbut it produces a value of either inj1 or inj2 given any input06/11 17:21
Saizan_to extract a "even n ⊎ ¬ even n" from there you need to know "odd n -> ¬ even n"06/11 17:23
copumpkinah, true06/11 17:24
copumpkinlol, I was having some trouble proving this statement06/11 17:30
copumpkineven→¬odd : ∀ {x} → even x → ¬ even x06/11 17:30
copumpkinlittle typo there :P06/11 17:30
Saizan_heh06/11 17:31
copumpkinhow's this? http://snapplr.com/efqq06/11 17:31
Saizan_good, though i'd make the first two more symmetric06/11 17:33
copumpkinhow so?06/11 17:33
Saizan_use wtf in both or () in both06/11 17:35
copumpkinlol06/11 17:35
copumpkinok06/11 17:35
Saizan_(unless i'm mistaken here..)06/11 17:35
copumpkinhttp://snapplr.com/1prx ?06/11 17:36
Saizan_yup06/11 17:37
copumpkinnow I'm left wishing I had Data.Nat.Properties again06/11 17:40
copumpkinoh, I can work around it without copying and pasting code06/11 17:44
copumpkinyay06/11 17:45
copumpkinI proved the same things for multiplication06/11 17:45
copumpkindamn, I can't seem to get around to doing odd*odd==odd06/11 17:53
copumpkinwithout *-comm, which I don't have and don't feel like getting06/11 17:53
fax(2x+1)(2y+1)=2(2xy+x+y)+106/11 17:57
copumpkinyeah, I know that :P06/11 17:57
copumpkintrying to do this all with simple peano06/11 17:58
faxthat works in PA06/11 17:58
copumpkinyeah, but doesn't feel particularly natural to work with, unless I'm doing it wrong06/11 17:59
copumpkinaha, got it06/11 18:00
copumpkinlots of mutual06/11 18:00
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11881#a11904 !!!06/11 18:01
fax(2x+1)(2y+1)=2(2xy+x+y)+1 is an extremely trivial proof there's no need for it to be natural or not06/11 18:02
copumpkintrivial to encode in agda?06/11 18:02
copumpkinI mean, sure, I could've written that in middle school06/11 18:02
copumpkinbut I wouldn't know how to do that without massive amounts of term-jumbling using things from Nat.Properties06/11 18:05
copumpkinI'd be interested in seeing it though, if you were willing to write it up :)06/11 18:08
copumpkinI really want to get up to speed with this stuff06/11 18:08
copumpkinare there any other interesting things to prove about parity and basic natural operations?06/11 18:14
copumpkinthe only way to make infinite lists is with Colist/codata, right?06/11 19:26
faxStream A = Nat -> A06/11 19:27
copumpkinah, interesting06/11 19:27
copumpkinmy application isn't very suited to being index by Nat though, even though it's countable06/11 19:28
copumpkinit also isn't necessarily infinite06/11 19:28
copumpkinoh no, my function is pink06/11 19:51
copumpkinor salmon, I guess06/11 19:52
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11910#a1191006/11 20:06
copumpkinI stole it from control-monad-omega06/11 20:06
doliostripe has two problems.06/11 20:08
faxare you doing cantors proof?06/11 20:08
copumpkinnope, actually playing with regular languages :) but I needed this06/11 20:09
copumpkindolio: what are they?06/11 20:09
doliocase 2 is problematic for 'es = [] :: # es'06/11 20:10
copumpkinhmm06/11 20:10
doliocase 3 is problematic because the corecursive call isn't directly guarded by constructors.06/11 20:11
copumpkinhmm06/11 20:12
dolioThe latter may not be a fundamental problem, just a problem with Agda's restrictions on productivity checking.06/11 20:13
dolioBut I haven't fiddled with codata enough to know what the techniques are to get around it.06/11 20:14
copumpkinwell, agda hasn't highlighted any problem with the latter06/11 20:14
copumpkinbut the second case is definitely pink06/11 20:14
copumpkinhttp://snapplr.com/yfge06/11 20:14
dolioThe former just won't work at all, so there's some invariant that isn't being expressed.06/11 20:14
copumpkinhmm06/11 20:14
dolioOh, well, perhaps I'm wrong about the latter case. I don't think I've ever seen agda not pink out all the calls to a function when even one is wrong.06/11 20:15
copumpkinmaybe that's new, I am running a 2-day-old agda06/11 20:16
dolioMaybe that's new.06/11 20:16
copumpkinhmm, so what can I do about the second case?06/11 20:16
copumpkindoes it need major reworking?06/11 20:16
dolioWill it still work if it's [] :: # stripe (b xss)?06/11 20:18
copumpkinI can't stick [] in the output, since it's a List+06/11 20:19
dolioOh. You're screwed, then.06/11 20:19
copumpkinlol06/11 20:19
copumpkindamn06/11 20:19
copumpkinhmm06/11 20:19
faxregular languages on infinite sequences??06/11 20:22
copumpkinfax: well, I'm writing an enumerator for them for the fun of it06/11 20:22
copumpkinand it seems like enumerating union and concatenation of infinite languages requires some care06/11 20:24
copumpkinas well as the kleene star, obviously06/11 20:26
copumpkinhmm, this might be more complicated than I thought, too06/11 20:27
copumpkinoh, no06/11 20:28
copumpkinhow does one deal with extensional equality in agda?06/11 20:29
copumpkinFinite : Set → Set Finite A = Σ (∃ (Vec A)) (λ v → ∀ x → x ∈ proj₂ v)06/11 20:47
copumpkindoes that seem reasonable?06/11 20:47
dolio∃ (Vec A) = List A06/11 20:52
copumpkinyeah, I know06/11 20:52
copumpkinI just used Vec because List didn't seem to have a \in06/11 20:52
copumpkinhttp://snapplr.com/kwk6 is what I have06/11 20:54
copumpkinI wonder how I'd prove that something isn't finite06/11 20:59
* copumpkin tries06/11 21:00
dolioRather depends on what infinite set you're trying with.06/11 21:01
copumpkinwell yeah :P06/11 21:01
copumpkinit seems like Nat would be the simplest06/11 21:01
copumpkinbut I'm still not sure how I'd go about proving it06/11 21:01
faxdefinition of negation06/11 21:02
copumpkinah, I think I see it06/11 21:02
faxx1 + x2 + ... + xn + 1 is not in [x1, x2, ..., xn]06/11 21:02
copumpkinor even just suc xn06/11 21:03
dolioWhat if x(n-1) = suc xn?06/11 21:03
copumpkinhmm, true06/11 21:03
dolioYou don't have to store them in order. :)06/11 21:04
copumpkinmakes sense :)06/11 21:04
dolioAnyhow, you could also construct a colist of all naturals, and prove that the colist contains a natural that isn't in a vector of naturals, for any vector.06/11 21:06
dolioBy induction on the vector.06/11 21:06
faxthat sounds difficult ?06/11 21:06
dolioThen the negation of Finite Nat is a consequence.06/11 21:06
copumpkinit does sound difficult :P06/11 21:06
copumpkingonna try the sum way first06/11 21:06
faxI guess the idea is filter out everything in the vector from the stream, now you have the condition that every element in the stream is different from those in the vector: And by construction still has infinite size06/11 21:08
faximplementing and using filter has to make it awkward06/11 21:08
copumpkinwhat does an error of "Cannot split on the constructor here" mean?06/11 21:25
copumpkinwhere here is probably the \in constructor06/11 21:25
faxdolio would that work "induction on the vector"?06/11 21:28
faxbecause if you have the hyp.  n not in vs,  and you want to find some number not in v::vs,  what do you do when v = n?06/11 21:28
faxoh of course you just take another element of the stream...06/11 21:29
dolioIt might be easier to just not use the stream.06/11 21:29
dolioJust keep counting up until you find something not in the vector.06/11 21:30
faxyeah dolio that seems equiv to the x1 + x2 + ... + xn + 1 one06/11 21:47
faxin terms of having to talk about >06/11 21:47
dolioYes, having toyed a bit with it.06/11 21:49
dolioAnd deciding I'm not really interested in working out the details.06/11 21:49
dolioSo, I'm reading Proofs and Types, and it occurred to me that James Chapman's thesis only proves weak normalization of the relevant calculi, which is, of course, all you need for an interpreter.06/11 21:53
copumpkinanyone know how C-c C-c works?06/11 22:08
copumpkin(case split)06/11 22:08
copumpkinit appears to be relevant to that error I was getting before06/11 22:10
dolioInability to do case analysis on something usually comes from its type being defined by recursion.06/11 22:16
copumpkinah06/11 22:17
dolioSo if you define vectors by recursion over the size, you can't do case analysis on the vector until after you've done analysis and know whether the size is 0 or suc n.06/11 22:17
copumpkinI see06/11 22:17
dolioBut, that's not the case for your error, so I'd probably have to see the context to explain it.06/11 22:18
copumpkinhttp://snapplr.com/hcd706/11 22:19
copumpkinI get the feeling I need a with06/11 22:19
dolioWhat were you trying to split?06/11 22:20
copumpkinI don't even know what it means by splitting06/11 22:20
copumpkinI just tried to write the `there' constructor for \in06/11 22:21
copumpkinas a pattern06/11 22:21
copumpkinand it told me that06/11 22:21
copumpkinI was expecting to get an incomplete pattern match error because I didn't provide the here06/11 22:21
dolioOh, another place where you get an error that sounds like that is if you're trying to do a dependent match, and it can't refine something.06/11 22:22
dolioAnd, I think your case there is such a situation.06/11 22:23
copumpkinhmm ok06/11 22:23
doliomatching on 'here : x \in ys' refines the first element of ys to x, or vice versa.06/11 22:24
copumpkinoh06/11 22:24
dolioIn your case, x = suc (sum ys), and there's no way it can refine ys to a term referencing itself.06/11 22:24
copumpkinhm06/11 22:25
dolioI think you need to prove a lemma. Like 'All (< sum ys) ys'.06/11 22:25
copumpkinI see06/11 22:26
copumpkinI'll try that :)06/11 22:26
dolioThen in your main proof, you'll have 'suc (sum ys) < suc (sum ys)'06/11 22:27
copumpkinI might be able to do it with a simpler lemma I think06/11 22:27
copumpkinactually nope06/11 22:27
copumpkinwriting All using type-level predicates seems to need universe polymorphism06/11 22:37
faxwhat are the predicates?06/11 22:38
copumpkinwell in this case it'd be (< sum ys)06/11 22:38
copumpkinor \lambda x -> x < sum ys I guess06/11 22:39
faxI don't understand06/11 22:39
copumpkinwell _<_ : Rel Nat06/11 22:39
copumpkinRel : Set -> Set106/11 22:39
faxwhy does it go into Set1?06/11 22:40
copumpkinbecause Rel a = a -> a -> Set06/11 22:40
dolioAll : forall {A n} (P : A -> Set) -> Vec A n -> Set06/11 22:41
faxI don't see the problem06/11 22:41
dolioAll P [] = \top ; All P (x :: xs) = P x /\ All P xs06/11 22:42
copumpkinI guess it depends on how you implement All06/11 22:42
dolioOr something like that.06/11 22:42
dolioThere are lots of ways to define it.06/11 22:42
dolioYou could define it inductively, too.06/11 22:43
doliodata All {A : Set} {n : Nat} (P : A -> Set) : Vec A n -> Set where empty : All P [] ; cons : forall {x xs} -> P x -> All P xs -> All P (x :: xs)06/11 22:44
copumpkindolio: my problem with the original one is that I don't know how to write /\ for Set06/11 22:45
faxyou can define modalities <> and [] for 'everywhere' and 'somewhere' generically for quite a big universe06/11 22:45
dolio /\ is product06/11 22:45
copumpkinoh06/11 22:45
faxinfact maybe it was the whole thin06/11 22:45
copumpkinthat makes sense then06/11 22:46
dolioPropositions as types.06/11 22:48
copumpkinyeah, I see06/11 22:48
copumpkinit's actually All (<= sum xs) xs isn't it06/11 22:53
dolioYeah, I meant to have a suc in there.06/11 22:54
copumpkincool06/11 22:55
copumpkingetting closer :)06/11 23:14
copumpkinI can't figure out how to manipulate the predicate inside the All06/11 23:27
copumpkinI have All (λ x' → x' ≤ sum xs) xs and want to show that for some x, All (λ x' → x' ≤ (x + sum xs)) xs06/11 23:27
copumpkinit seems obvious (given that we're working with naturals) but I can't for the life of me figure out how to break out the predicate in there :/06/11 23:30
copumpkinmaybe I should've used dolio's data All06/11 23:30
faxgo more general06/11 23:31
copumpkinmore general in what sense?06/11 23:31
faxshow  (P -> P') -> All P m -> All P' m06/11 23:31
faxinstaniate with your situation here06/11 23:31
copumpkinoh, I see06/11 23:31
faxafterwards06/11 23:31
copumpkinI'll try that, thanks!06/11 23:31
copumpkinbbl :) thanks for all the help!06/11 23:55
--- Day changed Sat Nov 07 2009
-!- sharada is now known as fax07/11 18:00
FunctorSaladcopumpkin: sure, why wouldn't agda allow 2-cats?07/11 19:18
copumpkinI thought it would and was just making sure I wans't being ridiculous :)07/11 19:18
FunctorSaladbut you'd really want proof irrelevance for functors and NTs07/11 19:19
FunctorSalador mess with equivalence relations :|07/11 19:19
dolioYou really want extensional equality, too, because setoids suck.07/11 19:19
FunctorSaladyes. I'm beginning to think that having a decent equality is the real killer app of traditional set theories ;)07/11 19:20
dolioMaybe we can hold a telethon to raise money so as to pay Conor and his gang to finish Epigram 2.07/11 19:21
FunctorSaladsubstituting equals for equals with no questions asked is a fundamental activity in math, isn't it?07/11 19:21
FunctorSaladtelethon?07/11 19:21
dolioYeah. Rent some public access television, put on bad ventriloquism acts and such, and beg people call us and donate money.07/11 19:21
copumpkinlol07/11 19:22
FunctorSalad:)07/11 19:22
FunctorSaladwouldn't that be cool about being wealthy? you could pay a team do develop a series app in something like epigram just to confuse the people who say it's too academic07/11 19:23
FunctorSalad*serious app07/11 19:23
copumpkindoesn't epigram have ascii-art style equations?07/11 19:23
FunctorSaladnever used it because I'm waiting for 2 to come out ;)07/11 19:24
FunctorSalad(maybe I wasn't clear enough, I meant you need proof irrelevance if you want to consider functors as morphisms in CAT)07/11 19:25
dolioYes. Its type (and data) declarations look like natural deduction.07/11 19:26
faxsetoids suck?07/11 19:26
faxlol @ telathon07/11 19:26
* copumpkin is having trouble with the world's most trivial proof ever07/11 19:28
dolioA |- A?07/11 19:28
copumpkinm < n -> m <= n07/11 19:29
faxlol07/11 19:29
copumpkin:P07/11 19:29
faxdefinitions of < and <= and whatever types you have may matter here07/11 19:29
copumpkinwell it's just for naturals07/11 19:29
dolioWrite m <= n -> m <= suc n07/11 19:29
copumpkinso m < n is just suc m <= n07/11 19:29
copumpkinah, good idea07/11 19:30
faxthere's also something like ~ x < y -> y <= x07/11 19:31
faxx < y + x = y -> x <= y07/11 19:32
FunctorSaladgotta run to the supermarket, but before I forget it: is church-rosserness necessary for the *soundness* of agda's logic or just for termination? does it rely on "if two terms have different normal form, then they are unequal"?07/11 19:33
faxchurch-rosser <=> confluence07/11 19:33
faxif you don't have confluence then you can't really take a normal form can you?07/11 19:34
dolioChurch-Rosser doesn't actually have to do with termination. Untyped lambda calculus can have Church-Rosser for the terms that do have normal forms.07/11 19:34
faxdolio but I think lambda calculus has church-rosser for even diverging terms (is that correct?)07/11 19:35
faxuh "for even diverging terms" is confusing, I mean "even for diverging terms"07/11 19:35
dolioI don't really know. Are there terms that can be reduced in ways that aren't cyclic?07/11 19:36
faxyes you can make a term that expands into the infinite sequence of pi or whatever07/11 19:36
dolioActually, I supposed it'd have to be stronger than that. You'd have to be able to make a branch where you can't convert from one side to the other.07/11 19:37
dolioI suppose Church-Rosser may hold for all terms.07/11 19:38
dolioI was thinking about unique normal forms or no normal form, but that's not what Church-Rosser actually says.07/11 19:39
faxcertainly church-rosser does not imply normal forms exist, but I think it's a precondition (err,  normal forms existing imply church rosser? hm)07/11 19:39
faxoh hm07/11 19:39
faxI have not ever considered non-unique normal forms07/11 19:39
faxI guess quotients bring this up? (unless you have choice) ... not sure07/11 19:40
dolioChurch-Rosser just says that if t ~> u, v, then there exists w such that u ~> w and v ~> w.07/11 19:40
dolioI think "normal form" is typically meant to mean, in part, unique.07/11 19:41
faxalternatively you might say   can't be reduced any further07/11 19:43
faxand then prove every sequence from the same start has the same destination07/11 19:43
dolioYes.07/11 19:44
dolioChurch-Rosser implies that latter part, because if you reduce to two potentially different normal forms, they can be reduced to a common form. But, since normal forms can't be reduced (except in 0 steps to themselves), they must be the same.07/11 19:45
* fax nod07/11 19:45
dolioSo, I've been thinking about System F and Curry-Howard, and it seems like a weird 2nd order logic that it corresponds to.07/11 19:50
dolioWikipedia describes second order logic as having quantification over both elements, and sets of elements, but system F's second order quantification is over propositions.07/11 19:51
dolioAnd it doesn't really have first order quantification.07/11 19:51
dolioI guess first-order quantification would be more like dependent typing.07/11 19:51
Saizanwhen they say "first-order logic" they usually mean "first-order _predicative_ logic"07/11 19:53
Saizanwhich would be dependent types07/11 19:53
dolioPredicate logic, you mean?07/11 19:53
Saizanwhile first order propositional logic has no quantificators07/11 19:53
Saizan*quantifies07/11 19:53
Saizan..well, those.07/11 19:54
Saizanoh yes, predicate logic, i mistranslated07/11 19:54
Saizanand second order propositional logic is the one with quantification over propositions07/11 19:56
dolioYeah, that makes sense. Wiki is pretty focused on the propositional logic.07/11 19:57
dolioPredicate logic, even.07/11 19:57
dolioAnd I don't think the article on propositional logic mentions higher-order extensions, just predicate logic as an extension.07/11 19:58
Saizani got quite confused about this from wiki too07/11 19:58
Saizanin the past, i mean07/11 19:58
dolioI suppose from a lambda cube perspective, ([],*,*) (F2) is second order propositional, (*,[],[]) is first order predicate, and both together is second order predicate.07/11 19:59
dolioAnd since propositions are types, the second-order quantification can be seen as both over sets and propositions.07/11 19:59
dolio(In the last one.)07/11 20:00
dolioOn a side note, I was adding F2 and Fw to my pure type system interpreter to fool with this, and predicative F2 sucks.07/11 20:02
dolio(A B : *) -> ... is invalid.07/11 20:03
dolioSo with the rule ([],*,[]) you can only quantify over one type, at the top level.07/11 20:04
FunctorSalad"<fax> if you don't have confluence then you can't really take a normal form can you?" <--- I meant normal form in the sense "can't reduce further". Yes, it needn't be unique if you don't have confluence07/11 20:04
FunctorSalad"Church-Rosser doesn't actually have to do with termination." <-- sorry, I meant both (since both would possibly be broken if you allow reflecting rewrite rules into the conversion)07/11 20:04
FunctorSalad"Wikipedia describes second order logic as having quantification over both elements, and sets of elements, but system F's second order quantification is over propositions." <-- but unary props are like sets, aren't they?07/11 20:07
FunctorSalad(obviously Ijust went through the backlog)07/11 20:07
FunctorSaladwhat I was getting at is that if you have rewrite rules which are confluent and terminating, then we have  " equality E holds in the equational theory defined by the rules  ---->  both sides of E rewrite to the same normal form " IIRC07/11 20:10
FunctorSaladin contrast to the other direction, which holds for any set of rules07/11 20:11
dolioWell, the logic corresponding to F doesn't talk about anything like "elements" so it wasn't clear to me how it related.07/11 20:11
FunctorSaladso you can prove things *equal* using arbitrary rules, but you can only prove things *unequal* (in the initial model) if you have a confluent&terminating system, correct?07/11 20:12
dolioYou can only quantify over things that you get to use in logical connectives, and there is nothing like predicates.07/11 20:12
FunctorSaladhmm yes07/11 20:12
FunctorSaladthe background is that I'm wondering whether hacking rewrite rules into agda will just make it fail to terminate sometimes, or make it able to prove nonsense07/11 20:14
dolioOf course, there's a connection if you view propositions as classifying their proofs, in a propositions-as-types way, but that doesn't seem very motivated by the logic.07/11 20:14
FunctorSalad(assuming the equation you gave it isn't nonsense, of course)07/11 20:15
FunctorSaladyes I agree it seems like there are no individuals in the logic of system F07/11 20:15
FunctorSaladis the Agda source hard to understand?07/11 20:23
dolioYes, I think you'd need a confluent and terminating system for equality to be decidable forall terms.07/11 20:23
dolioI haven't looked at it.07/11 20:23
FunctorSaladI'm thinking about whether you could implement the equational layer on top of the intensional kernel07/11 20:24
FunctorSaladthus not breaking anything :)07/11 20:24
dolioIf not confluent, then you might make a mistake during reduction, and fail to recognize two equal terms. If not terminating, you may never finish.07/11 20:25
FunctorSaladevery type should have a canonical extensional equality, and the reasoner for this equality would kick in automatically07/11 20:25
FunctorSalador make that a signle heterogenous equality07/11 20:26
FunctorSalad(this equality would be seperate from definitional equality)07/11 20:27
dolioThis sounds like OTT.07/11 20:27
FunctorSaladhmm I admit I don't know OTT :) (looked at the paper very briefly)07/11 20:27
dolioOTT has a heterogeneous equality that is extensional and substitutive, but it isn't the definitional equality.07/11 20:28
FunctorSaladdoes it support automation of reasoning about the extensional equality?07/11 20:29
FunctorSaladI think it'd be great if you'd have a central registry of rewrite rules for it07/11 20:30
dolioI don't think it's much different in practice than using _==_ in Agda, except it's extensional.07/11 20:30
FunctorSaladcoq has this, but it's only used by the 'autorewrite' tactic, which I find a bit clunky IMHO07/11 20:30
dolioBut you could build on that.07/11 20:30
FunctorSalad(it should be more transparent, really)07/11 20:31
FunctorSaladis there some instructive example of OTT?07/11 20:31
FunctorSalad(long paper is long)07/11 20:32
dolioThey implemented it for a universe of types in Agda...07/11 20:32
doliohttp://www.cs.nott.ac.uk/~wss/Misc/ott.agda07/11 20:32
dolioWith the extensional equality, you apparently only need 0, 1, 2, Pi, Sigma and W in your core theory to implement all inductive and coinductive families.07/11 20:33
FunctorSaladoh wait it wasn't that long after all (10 pages)07/11 20:33
FunctorSaladthanks07/11 20:33
copumpkinI feel like I should know this, but can I ask a stupid high-level question?07/11 20:34
copumpkinoh crap, I asked if I could ask a question07/11 20:34
dolioAlthough, from reading a bit on the blog, there's still the whole universes thing to worry about.07/11 20:34
dolioMaybe that's orthogonal, though.07/11 20:35
FunctorSaladcopumpkin: we're all stupid07/11 20:35
copumpkinit's about proving the negation of a statement, I still don't really have a good grasp of how to do it in general07/11 20:35
copumpkinFunctorSalad: some more than others :)07/11 20:35
faxcopumpkin dead simple:  ~P = P -> False07/11 20:35
faxassume P and derive a contradiction07/11 20:35
copumpkinso if I want to prove f : x -> \neg y07/11 20:35
faxfor example if you want to show  ~ 0 = 107/11 20:35
copumpkinfax: yeah, I understand that much, but the more specific aspect of it07/11 20:35
dolioWait, this .agda doesn't look right. I think this might be Agda1 code.07/11 20:35
faxyou could make a function   f 0 = True ; f 1 = False07/11 20:35
copumpkinf pfx wtf = <this should be _|_>07/11 20:35
copumpkinok07/11 20:36
faxunder the assumption 0 = 1 we know True = False, so you can cast a proof of true into a proof of false07/11 20:36
FunctorSaladfax: that just relocates the problem07/11 20:36
FunctorSaladTrue /= False for the same reason that S 0 /= 007/11 20:36
faxFunctorSalad: no07/11 20:36
copumpkinmy real question I guess is how do I pull _|_ out of anything?07/11 20:36
copumpkinI need to produce a value of type _|_ which is obviously impossible07/11 20:36
FunctorSaladfax: Bool isn't special for all I know07/11 20:36
faxcopumpkin my example is the basis of pretty much all of this07/11 20:37
FunctorSaladthis is the no-confusion property hardwired into inductive datatypes07/11 20:37
dolioFunctorSalad: http://code.haskell.org/Agda/examples/outdated-and-incorrect/OTT/ObsEq2.agda looks more current, although it's in a directory called "outdated-and-incorrect"07/11 20:37
faxFunctorSalad that is not hard wired07/11 20:37
copumpkinfax: okay07/11 20:37
faxFunctorSalad you have to derive it by an elaborate version of the construction I just gave07/11 20:37
faxFunctorSalad: oh well in Agda yea it's a primitive07/11 20:38
faxFunctorSalad: but it can be elaborated into just eliminators + K07/11 20:38
FunctorSaladfax: it's a primitive everywhere I know. in coq it's called "discriminate"07/11 20:38
dolioFunctorSalad: I think he means the types True and False.07/11 20:38
FunctorSalad(two terms with different constructors are equal ~> falsity)07/11 20:38
copumpkinfax isn't he?07/11 20:39
faxFunctorSalad: discriminate uses the method I just described: Agda uses pattern matching but that's justified by the genneral principle that you can turn pattern matching into eliminators07/11 20:39
faxyeah sorry that might have been the mixup,  data True : Set where I : True ; data False where    is what I was referring to07/11 20:40
copumpkinah07/11 20:40
FunctorSaladwell yes, you don't need to take the inequality directly as an axiom07/11 20:40
FunctorSaladhmm or wait07/11 20:40
faxanyway understanding how raw type theory lets you disprove 0 = 1 is very illuminating imo07/11 20:41
faxthe shorthand pattern matching gives you is convenient but doesn't tell you much07/11 20:41
copumpkindo you think you could elaborate more on your example?07/11 20:41
FunctorSaladfax: ah I thought you meant data Bool = True | False when I said it's relocating the problem07/11 20:41
copumpkinI still don't really understand how I can produce a _|_ or somehow convince agda that I'm unable to07/11 20:41
faxcopumpkin is it not clear? what part[s]?07/11 20:41
copumpkinwell, with my example07/11 20:41
faxFunctorSalad: yeah sorry I was thinking about the Coq types, I don't know the names in Agd07/11 20:41
copumpkinf : x -> ¬ y; f pfx wtf = ? -- the hole is of type _|_07/11 20:42
FunctorSaladhmm so you prove that two *types* are equal if 0=1?07/11 20:42
faxcopumpkin, we can prove ~ 0 = 1, becaue 0 = 1 -> f 0 = f 1 ~> True = False, and give True = False then I : True --> <rewrite the True = False equation on the type of I> : False07/11 20:43
FunctorSaladand then you can coerce I:True to a proof of False?07/11 20:43
faxyes exactly07/11 20:43
FunctorSaladhmm :)07/11 20:43
FunctorSaladclever07/11 20:43
faxand this would be the general approach for any proof of False07/11 20:43
FunctorSaladbut... I thought you could only coerce with definitional equality07/11 20:44
faxwhen you write some pattern match in Agda07/11 20:44
faxf ... ()07/11 20:44
copumpkinyeah07/11 20:44
copumpkinI've done that before07/11 20:44
faxyou can consider it as f ... = <prove False using that idea and them elim it>07/11 20:44
copumpkinI mean, I have proved several negations of statements but am not sure I fully understand how it works07/11 20:45
faxFunctorSalad, you need a = b -> P a -> P b   with P eliminating into Set1 (P : A -> Set1)07/11 20:45
FunctorSaladdolio: ok I'll try ObsEq2.agda07/11 20:45
faxcopumpkin maybe try and prove ~ 0 = 1 without using the () in pattern matching then07/11 20:46
copumpkinhm, okay07/11 20:46
FunctorSaladfax: if "=" is prop. equality? I thought that was a derived theorem too07/11 20:46
faxdata _=_ : ... where refl : a = a07/11 20:46
FunctorSaladso now I'm confused where the primitive is07/11 20:46
FunctorSaladwe prove *prop.* equality of True and False, right?07/11 20:47
FunctorSaladdoes the pattern match on refl do the magic after that?07/11 20:47
faxif by prop equality you mean  True <-> False,  then no07/11 20:47
copumpkinmoo : ¬ 0 ≡ 1 moo = {!!}07/11 20:48
copumpkinso I wrote moo wtf = {!!}07/11 20:48
FunctorSaladdolio: getting "Incomplete pattern matching for NatR. Missing cases:07/11 20:49
FunctorSalad  NatR _ (fs {._} (fs {._} _))"07/11 20:49
copumpkinand now wtf is 0 === 107/11 20:49
FunctorSaladfax: by prop equality I mean that type you just defined07/11 20:49
FunctorSaladdata _=_ : ... where refl : a = a07/11 20:49
copumpkinnot sure where to go next though07/11 20:49
copumpkinI have an absurd proof that 0===1 and need _|_07/11 20:50
faxprove True === False and use that to cast a value of type/proof of True into one of False07/11 20:51
faxby showing that 0 === 1 -> f 0 === f 1, with f 0 = True ; f 1 = False07/11 20:51
copumpkinhmm07/11 20:52
faxthis probably seems quite artifical at first but after applying it 100x it will make sense07/11 20:52
copumpkinbut I can't prove true === false can I? :P07/11 20:52
faxin the context {0 === 1}, yes you can07/11 20:52
copumpkinhmm, so I'll stick it in a where clause07/11 20:53
FunctorSaladin coq I was told that pattern matching doesn't add any definitonal equalities to the context07/11 20:53
FunctorSaladin #coq07/11 20:54
dolioYou don't need K to prove constructor distinction. J suffices.07/11 20:54
FunctorSaladis agda different?07/11 20:54
faxFunctorSalad: well pattern matching in Coq isn't "proper" dependent pattern matching07/11 20:54
FunctorSaladoh07/11 20:54
copumpkinhttp://snapplr.com/31ec ?07/11 20:54
FunctorSaladbut what if you pattern match on an axiom "A = A -> A" for some type A then?07/11 20:55
FunctorSaladdon't you get the issue that dolio was talking about the other day?07/11 20:55
faxthat's fine: Axioms don't reduce so you wont be able to loop with it07/11 20:55
copumpkinmine is fine?07/11 20:55
FunctorSaladthey don't reduce by themselves, but I thought once you pattern match on the refl, you get definitional equality in that scope07/11 20:56
faxFunctorSalad; well an axiom of P = Q isn't a refl constructor --- this only becomes an issue with certain treatments of proof irrelevance07/11 20:57
copumpkinhm07/11 21:00
FunctorSaladfax: seems like it just refuses this:07/11 21:02
doliocopumpkin: Here are the primitives you'd get to prove 0 /= 1...07/11 21:02
FunctorSalad  foo : (Bool == (Bool -> Bool)) -> Bool07/11 21:02
FunctorSalad  foo (refl y) = True07/11 21:02
FunctorSalad("==" is the "=" you defined)07/11 21:03
dolioJ : forall {A : Set} {x y : A} (P : A -> Set) -> x == y -> P x -> P y07/11 21:03
FunctorSalad"y != Bool of type Set07/11 21:03
FunctorSaladwhen checking that the pattern refl y has type07/11 21:03
FunctorSaladBool == (Bool → Bool)"07/11 21:03
dolioinduction : forall (P : Nat -> Set) -> P 0 -> (forall n -> P n -> P (suc n)) -> (n : Nat) -> P n07/11 21:04
dolioThat's it, for the eliminators.07/11 21:05
dolioSo, that's what you use in moo.07/11 21:06
copumpkinhmm ok :)07/11 21:09
copumpkinwho'd have thought it'd be so hard to prove something so trivial-sounding :)07/11 21:09
Saizanmh, but \top \== \bot uses a \== in a different universe, right?07/11 21:18
faxyes07/11 21:18
dolioI've got to jet. Here's my solution, once you figure out yours: http://code.haskell.org/~dolio/agda-share/html/Distinct.html#46607/11 21:18
FunctorSaladdolio: wish ObsEq2.agda had comments ;)07/11 21:19
FunctorSalad(and _>_<_!_ is going a bit overboard with the mixfix imho_07/11 21:20
FunctorSalad)07/11 21:20
Saizanit's a nice smile though07/11 21:20
copumpkin:)07/11 21:21
FunctorSaladok I fixed the compile errors by just adding some absurd patterns for some absurd cases07/11 21:24
FunctorSaladnow there are these funny ?0 : blah messages left07/11 21:25
FunctorSalad(missing types?)07/11 21:25
copumpkindo you have holes?07/11 21:25
FunctorSaladand some things are highlighted in pink07/11 21:25
copumpkinoh07/11 21:25
FunctorSalador apricot07/11 21:25
copumpkinthat's not good :)07/11 21:25
FunctorSaladcopumpkin: not my development, http://code.haskell.org/Agda/examples/outdated-and-incorrect/OTT/ObsEq2.agda07/11 21:26
copumpkinah07/11 21:26
FunctorSaladcopumpkin: it does have holes but maybe that's some old syntax being misinterpreted07/11 21:26
FunctorSalad{! !}07/11 21:27
copumpkinoh yeah07/11 21:27
copumpkinI think that is a hole07/11 21:27
FunctorSaladsince I don't get this at all I wouldn't know what to put in the holes07/11 21:27
faxI use _07/11 21:28
copumpkinthen it just marks it yellow07/11 21:28
faxyellow means it needs filled in07/11 21:28
copumpkinI thought it meant that it couldn't infer some aspect of it07/11 21:29
FunctorSaladthe numbered holes are olive green in my emacs07/11 21:29
copumpkinholes allow you to do C-c C-,07/11 21:29
copumpkingiving you the goal and context07/11 21:29
FunctorSaladbut there are also these flesh-colored highlights07/11 21:29
Saizandolio: why do you use the small case in t≢f ? you already have a term of type \bot that you pass as an argument to it07/11 21:30
FunctorSalad:)07/11 21:30
Saizanthe pink is when it can't prove termination07/11 21:31
copumpkinyeah07/11 21:31
FunctorSaladah07/11 21:31
copumpkinthat was the problem with that diagonal function :(07/11 21:32
FunctorSalad:(07/11 21:32
copumpkinyou should give that a go as a challenge! ;)_07/11 21:32
Saizanwhich diagonal?07/11 21:33
faxcopumpkin well I forgot what it was, regex eum or something, but I did Cantors dialonalization with Nat -> A fine07/11 21:33
copumpkinah07/11 21:34
faxAdams CPDT has some regex stuff07/11 21:34
faxwhich seems obvious when you read it but I couldn't come up with his method myself.. did a roundabout way that was horrid complex07/11 21:34
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=1191007/11 21:34
copumpkinthat typechecks but is pink07/11 21:34
copumpkin(I just stole it and converted it from control-monad-omega)07/11 21:36
Saizan?hoogle List⁺07/11 21:42
copumpkinI want agdabot07/11 21:43
copumpkinhttp://www.cs.nott.ac.uk/~nad/listings/lib/Data.List.NonEmpty.html#50707/11 21:44
Saizanmh, it's yellow here07/11 21:48
Saizanthe second clause of stripe07/11 21:48
copumpkinyeah, that's pink here07/11 21:48
copumpkinI have the latest agda07/11 21:48
copumpkinmaybe it's better at inferring stuff now07/11 21:49
Saizanwith that type stripe is really non-productive, if you've an infinite colist of []07/11 21:54
copumpkinoh07/11 21:54
faxeyah same reason filter is hard to define/use07/11 21:55
copumpkinmaybe it hsould be a Colist of List+ a07/11 21:55
copumpkinoh maybe we need a Colist+07/11 21:55
Saizanthat might work if it fits with the rest07/11 21:56
Saizanthe minimal additional requirement is that either the input colist is finite or at least on of its elements is non-empty, i think07/11 21:58
copumpkinyeah07/11 21:59
copumpkinthat makes sense07/11 21:59
copumpkinhmm07/11 21:59
Saizanor maybe that's not even sufficient07/11 22:01
Saizansince once you're past the guaranteed-non-empty element you're back to the current situation07/11 22:02
Saizanthere needs to be infinitely many non-empty elements :)07/11 22:02
copumpkinyeah, hmm07/11 22:02
Saizanthat, or you've to know that the remaining tail is only of empty lists07/11 22:04
Saizanso you can just truncate the output colist there07/11 22:04
copumpkinseems like a bunch of conditions07/11 22:04
Saizan3 alternatives07/11 22:05
copumpkinhm yeah07/11 22:06
Saizani'd go with Colist (Colist+ a) as input if your use of diagonal permits it07/11 22:10
copumpkinI think it might, but I'll need to think about it some more07/11 22:11
copumpkinhmm07/11 22:17
copumpkinoh maybe I only need List (Colist a) for my application07/11 22:17
copumpkinno, I do need Colist (Colist a)07/11 22:18
copumpkinbut Colist+ on the inside might still be okay07/11 22:20
copumpkinwell, in one case it isn't, but I could special case that07/11 22:21
copumpkinI'm just one hole away from proving Nat isn't finite!07/11 22:31
copumpkinw00t :)07/11 22:31
Saizanwoot07/11 22:31
Saizanmh, how do you state that?07/11 22:31
copumpkinFinite A = Σ (∃ (Vec A)) (λ v → ∀ x → x ∈ proj₂ v)07/11 22:32
Saizanah, clever07/11 22:34
copumpkinthe existential vector is just a list07/11 22:34
copumpkinbut for some reason List doesn't have ∈07/11 22:34
copumpkinand I didn't feel like writing it07/11 22:34
Saizanmakes sense :)07/11 22:34
copumpkinAny¬⇒¬All : ∀ {a n P} {xs : Vec a n} → Any (¬_ ∘ P) xs → ¬ All P xs07/11 22:35
copumpkinwhat I'm working on now :)07/11 22:35
Saizani actually think Vec should be Σ (List A) (λ xs -> length xs \== n)07/11 22:37
copumpkinthat sounds like it might be more painful to work with though07/11 22:37
copumpkinalthough it would reduce the duplication in the functions07/11 22:37
Saizanmh, true, depends on what happens to the proof when you pattern match on the list07/11 22:38
* Saizan reads about \inf07/11 22:38
copumpkinyou mean the codata thing?07/11 22:39
Saizanyeah07/11 22:44
copumpkinyay, I proved that statement too07/11 22:46
copumpkinalmost there!07/11 22:46
copumpkinoh whoops, I needed the other way around :)07/11 22:52
copumpkinAll⇒¬Any¬ : ∀ {a n P} {xs : Vec a n} → All P xs → ¬ Any (¬_ ∘ P) xs07/11 22:56
copumpkindid that one too07/11 22:56
copumpkingetting so close! :o07/11 23:05
--- Day changed Sun Nov 08 2009
copumpkinI've reduced the finiteness of Nat to 1+n≰n : ∀ n → ¬ (1 + n ≤ n)08/11 00:06
copumpkinlol08/11 00:06
copumpkinor rather, the infiniteness08/11 00:07
copumpkinTADA08/11 00:09
* copumpkin succeeded!!!08/11 00:09
copumpkinbiggest and ugliest proof I've done so far in agda :)08/11 00:09
faxcool paste it?08/11 00:17
copumpkinit's very ugly :( but I'll paste it anyway, and then work on cleaning it up08/11 00:20
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11939#a1193908/11 00:20
copumpkinjust gonna prove that Fin is finite first08/11 00:22
dolioSaizan: I don't know. Momentary insanity, I guess.08/11 00:27
dolioFunctorSalad: Yeah, it probably helps to read one of the papers along with the agda code.08/11 00:28
dolioSaizan: Anyhow, I'm not changing it now. Updating the html causes like 100-piece changesets in darcs.08/11 00:30
* copumpkin feels like he's making progress! at this rate in a million years I shall prove that P/=NP using agda08/11 00:34
dolioI think I finally get the whole logical framework thing.08/11 00:38
faxoh right?08/11 00:38
dolioI hadn't realized it before, but looking at the lambda cube article on wikipedia the other day, it noted that the rule (*,[],[]) gave you LF.08/11 00:39
dolioBut, that vertex of the lambda cube corresponds to first-order predicate logic.08/11 00:40
dolioSo, couching your theory in the logical framework is like presenting it as a theory in first-order logic.08/11 00:40
FunctorSalad[] is Kind?08/11 00:52
dolioYeah. The level above *08/11 00:52
FunctorSaladand I'm not sure what you're getting at... is there some big advantage of first-orderness over presenting it in CoC or something?08/11 00:53
dolioWell, usually I'd expect a type theory to be given directly by rules, like a logic. At least, that's how most people seem to do it.08/11 00:54
dolioI thought mathematicians were big into formulating stuff in first-order logic, though.08/11 00:54
FunctorSaladI wasn't saying you're wrong, just wondering08/11 00:55
dolioWhich, Martin-Loef developed the logical framework for doing foundations in constructive mathematics, I think.08/11 00:55
FunctorSaladwe are talking about type theories to formalise type theories? ._.08/11 00:56
FunctorSaladwe won't reach the mainstream mathematicians that way.... ;)08/11 00:56
dolio:)08/11 00:56
copumpkinhpaste is getting abused :(08/11 00:59
dolioWhy did you paste the same code three times?08/11 01:00
copumpkinthat's what I mean08/11 01:01
copumpkinthe spambots are fucking with our forms08/11 01:01
copumpkinI believe08/11 01:01
copumpkinnot sure what other explanation there is for it08/11 01:02
copumpkinyay, my bug was accepted! http://code.google.com/p/agda/issues/detail?id=22008/11 01:05
dolioNice. Every time I report something, it turns out someone's already filed it using a subject line that I'd never come up with, and thus don't notice.08/11 01:07
copumpkinyeah, my bug subject was pretty bad too :/08/11 01:08
copumpkinbut as it's marked critical with any luck it'll get fixed before someone else encounters it08/11 01:08
copumpkinsuc on Fin is a pain to work with08/11 01:21
copumpkinyay, proved Fin is finite08/11 01:33
copumpkinby the way, what's a good name for:08/11 01:33
copumpkin∀ {a b n} {f : a → b} (x : a) → {xs : Vec a n} → x ∈ xs → f x ∈ map f xs08/11 01:33
faxmap08/11 01:33
copumpkinreally?08/11 01:33
copumpkinfair enough :)08/11 01:34
copumpkinmaybe \in-map ?08/11 01:34
faxalthough looks like map has already been used08/11 01:34
copumpkinyep08/11 01:35
copumpkinyay :)08/11 01:35
copumpkinI guess with a proof of an injective function, and infinite domain, I can prove the range is infinite too08/11 01:36
copumpkinthat way I could prove List is infinite08/11 01:36
copumpkinthis is all pretty useless, eh :)08/11 01:38
copumpkinhttp://snapplr.com/j8c7 is weird08/11 01:45
dolioIt doesn't know what universe b is expected to belong to.08/11 01:46
copumpkinoh08/11 01:47
copumpkinbut I don't even have universe polymorphism turned on08/11 01:47
copumpkinI guess the _==_ is polymorphic from outside08/11 01:47
faxwhat are you using injective for?08/11 01:47
dolioYeah. I don't know why the 'f x == f y' doesn't determine it.08/11 01:47
copumpkinI want to prove List is infinite by providing an injection from nat08/11 01:47
copumpkinthat's reasonable, right?08/11 01:48
faxhow does that prove it?08/11 01:48
copumpkinif nat is infinite and I have an injective function from nat to list (was thinking of using replicate), then list is infinite?08/11 01:49
faxthat's not a proof :P08/11 01:50
faxjust a statement that's true08/11 01:50
copumpkinwell, I was going to write a function that did that08/11 01:50
copumpkinor is that not valid?08/11 01:52
copumpkinmight be harder to write than I thought :)08/11 01:56
copumpkinnot even sure it's possible to write actually08/11 01:58
copumpkinhmmm08/11 02:09
faxagain I would recommend to generalize08/11 02:10
faxprove that any set with ____-relation to Nat is infinite08/11 02:10
copumpkinthat's what I was trying to do :)08/11 02:10
copumpkinwith ___-relation?08/11 02:10
faxwe don't know what the relation is yet:  It might be injectivity but I doubt it08/11 02:10
copumpkinwell I originally thought that if I had a function from a to b and a was infinite, then b would be too08/11 02:11
copumpkinbut that isn't true if the function isn't injective08/11 02:11
copumpkinit may not be necessary but it seems to be sufficient (in theory at least; but I'm not sure I can actually write this function)08/11 02:11
ccasinyeah, it's definitely sufficient but not necessary08/11 02:13
ccasinare you having trouble proving it?  I've never played with set theory in agda08/11 02:13
copumpkinI'm trying to prove ∀ {a b} → (f : a → b) → ¬ Finite a → Injective f → ¬ Finite b08/11 02:14
copumpkinwhere Injective f = ∀ {x y} → f x ≡ f y → x ≡ y08/11 02:14
ccasinwhat's Finite?08/11 02:15
copumpkinFinite A = Σ (∃ (Vec A)) (λ v → ∀ x → x ∈ proj₂ v)08/11 02:15
copumpkinccasin: what is necessary?08/11 02:17
ccasinI don't know a concise necessary condition on f for b to be infinite08/11 02:19
copumpkinah :)08/11 02:19
faxmy suggestion was work on  forall A B -> A [R] B -> ~ Finite A -> ~ Finite B   for some 'R' that you can leave undefined until the proof makes it clear what it should be08/11 02:19
ccasinleave an agda hole?08/11 02:20
ccasinthat's a clever way to play with it08/11 02:20
copumpkinoh, so a more general relation than just a function?08/11 02:20
faxin one respect, you want something strong enough to actually finish the proof: But on the other hand, you need something weak enough so that you can prove it in all cases that matter08/11 02:20
fax(prove it 'easily')08/11 02:20
copumpkinwell what worries me is that even with the excessively "powerful" injective requirement08/11 02:21
copumpkinI'm having trouble proving that08/11 02:21
copumpkin:)08/11 02:21
ccasinjust because it's true and obvious in set theory doesn't mean it should be so in UTT :)08/11 02:22
faxhehe08/11 02:22
copumpkinyeah08/11 02:22
copumpkinat least from what I have now, I need an inverse of f08/11 02:22
copumpkinbut a bijection is obviously way too strong08/11 02:23
faxyeah we don't have the set style choice so injectivity doesn't give you left inverses08/11 02:23
copumpkinboo :)08/11 02:30
copumpkinso I can't write that function?08/11 02:30
copumpkinSurjective f = ∀ y → ∃ (λ x → f x ≡ y)08/11 02:45
ccasinyeah, I think fax is right08/11 02:48
ccasinyou really want to write a function B -> Maybe A08/11 02:48
copumpkinyeah, I'm pretty sure I can't write it08/11 02:48
copumpkinah, hmm08/11 02:48
ccasinand there is no such decidable function08/11 02:48
copumpkin:(08/11 02:48
ccasinso that proof technique won't work in constructive logic08/11 02:48
copumpkinboo!08/11 02:48
ccasinwell, no such decidable function that is the function I want08/11 02:49
ccasinthe inverse one08/11 02:49
copumpkinyeah :)08/11 02:49
ccasinbut we already knew constructive set theory is weird08/11 02:49
copumpkinit's fascinating08/11 02:49
ccasina good question is, what can I assume that will let me write that function08/11 02:49
copumpkinlearning haskell was fun but I feel like even the little agda I know so far has been so much more mind-widening08/11 02:50
copumpkinsomehow :)08/11 02:50
copumpkinmaybe I just take haskell for granted now08/11 02:50
ccasin:)08/11 02:50
ccasinagda is magic08/11 02:50
ccasinit's so much fun to write08/11 02:51
ccasinyou get the video-game effect that we already saw in coq, plus the feel of functional programming08/11 02:51
ccasinit's addictive08/11 02:51
ccasinanyway, if I hadn't already been drinking, I'd try to write down a full proof of this in ZFC and see where it breaks08/11 02:52
faxhehe08/11 02:52
ccasinit's not totally obvious to me that it really requires C08/11 02:52
faxjust going from injectivity ==> left inverse08/11 02:53
ccasinyes, well, I see how to prove it with C08/11 02:53
ccasinbut maybe there is another way08/11 02:53
faxah, how to say it's impossibile without08/11 02:53
dolioAssume it and use it to prove C. :)08/11 02:53
copumpkinlol08/11 02:54
copumpkinit's sad, I don't want to go to the grocery store because I want to prove random trivial statements instead08/11 02:54
dolioYou're like those people who play World of Warcraft for 80 hours straight and then die.08/11 02:55
ccasinyeah, that's what I'd try08/11 02:55
copumpkinlol08/11 02:55
ccasinalso yes, you're right08/11 02:55
ccasinwell, I don't play WoW08/11 02:55
ccasinbut back in the day I could play MUDs for days on end08/11 02:55
ccasinjust imagine how long we could go if there were pictures08/11 02:56
dolioYou're still alive, so you couldn't have been that hardcore.08/11 02:56
faxlol08/11 02:56
ccasin:)08/11 02:56
copumpkinI'm back!08/11 03:30
copumpkinon a new mission to prove more trivial statements!08/11 03:30
ccasinhooray!08/11 03:30
ccasinbut ZFC != trivial08/11 03:30
copumpkinoh well if they aren't trivial, I can't prove them08/11 03:30
ccasinindeed, perhaps ZFC = false!08/11 03:30
ccasinhooray for UTT08/11 03:30
copumpkinright now I'm doing Finite-Vec : ∀ {x} → Finite x → {n : ℕ} → Finite (Vec x n)08/11 03:30
copumpkinthis looks like it's going the same way as that dude who was in here recently wanting to prove probability theory08/11 03:32
faxnoooo08/11 03:34
faxdo it a better way08/11 03:34
copumpkinoh? :)08/11 03:34
ccasinI bet this theorem is provable in agda08/11 03:35
ccasinbut a ton of work08/11 03:35
copumpkinwhich theorem?08/11 03:35
ccasinthe one you just proposed08/11 03:35
copumpkinoh08/11 03:35
copumpkinyeah, I'm sure it is08/11 03:35
FunctorSaladwhat are you doing?08/11 03:35
copumpkinbut I'm curious what better way there is08/11 03:35
FunctorSalad:o08/11 03:35
faxcopumpkin btw you could prove this by construction08/11 03:35
copumpkinfax: yeah, that's what I was planning to do08/11 03:35
faxuhh08/11 03:35
copumpkinno?08/11 03:36
faxhow do I say this08/11 03:36
faxlike when you don't actually write any proofs; The thing is just true because it is08/11 03:36
dolioIsn't proving Finite (Vec x n) going to require you to construct a vector of size |x| * n?08/11 03:36
copumpkinoh08/11 03:36
faxthe other sense of 'proof by construction08/11 03:36
copumpkindolio: yep08/11 03:36
FunctorSaladwhy are we using constructive math when just using agda as a prover anyway?08/11 03:37
ccasindolio: it could potentially be that big, but doesn't need to be, I think08/11 03:37
copumpkinfax: hmm08/11 03:37
FunctorSaladmakes things even harder...08/11 03:37
* FunctorSalad hugs his classical math with a SINGLE definition of finiteness ;)08/11 03:37
dolioIt does for his definition of Finite, I think.08/11 03:37
copumpkinwhat's the alternative?08/11 03:37
faxanyway the plan was define a universe of finite types and show that for every n Vec A n lives here08/11 03:38
copumpkinI'm very open to suggestions for improving this stuff :) so if there's a nicer definition of Finite08/11 03:38
copumpkinfax: oh, hmm08/11 03:38
FunctorSaladcopumpkin: http://ncatlab.org/nlab/show/finite+set08/11 03:39
FunctorSaladthough that may confuse more than help08/11 03:39
faxdata TYPE ... where  BOOL : TYPE ...   data VALUE : TYPE -> Set where ... "true" : VALUE BOOL ; "false" : VALUE BOOL ; ...08/11 03:39
faxinterpretaion from VALUE T --> [[ T ]] etc etc08/11 03:39
copumpkinI guess having a bijection with Fin would be a simpler definition of Finite08/11 03:40
FunctorSalad"A set is subfinite if it admits an injection into some finite set."08/11 03:40
FunctorSalad"A set is finitely indexed (also called Kuratowski-finite, K-finite, or even sometimes, confusingly, subfinite) if it is a surjective image of some finite set."08/11 03:41
copumpkinyeah08/11 03:41
FunctorSaladthen it gets ridiculous ;)08/11 03:41
copumpkinlol08/11 03:43
FunctorSaladthough to be fair to intuitionistic math, the logic of a topos is intuitionistic in general, even if you are classical08/11 03:43
FunctorSalad(as the page points out)08/11 03:43
faxif my suggestion didn't make sense I can show an example08/11 03:54
copumpkinsure, that'd be nice :)08/11 03:54
faxhttp://pastie.org/68853408/11 03:55
faxit should be quite easy to fill in all the proofs if needed08/11 03:55
copumpkinoh that looks nice08/11 03:56
copumpkingoing to try to finish my current attempt and then will play with your idea08/11 03:58
copumpkinthis is getting a little tedious08/11 04:19
copumpkinI've generated my |x| ^ n vectors08/11 04:19
FunctorSaladwhich def *are* you using?08/11 04:26
copumpkinthe one I've been using all along08/11 04:26
FunctorSaladI wasn't there08/11 04:26
copumpkinFinite A = Σ (∃ (Vec A)) (λ v → ∀ x → x ∈ proj₂ v)08/11 04:27
FunctorSaladthat's equivalent to "admits a surjection from { 1 ... n }" isn't it?08/11 04:29
FunctorSaladnot saying that def would be handier08/11 04:29
copumpkinis there a cleaner way of writing http://snapplr.com/zzwx ?08/11 04:53
dolioWhat if you write "(\ ()) (pv y)"?08/11 04:55
copumpkinit turned yellow08/11 04:56
copumpkinhttp://snapplr.com/6pnx08/11 04:56
dolioWhat is pv's type?08/11 04:56
copumpkin((x : .a) → x ∈ [])08/11 04:58
dolioWell, there are no metas to fill, unfortunately.08/11 05:00
copumpkinyeah :)08/11 05:00
copumpkinwhat does that mean when it's yellow but there's nothing unspecified?08/11 05:00
dolioI don't know, really. What's it say at the bottom?08/11 05:01
copumpkinSort _523  [ at /Users/pumpkin/Sandbox/Finite.agda:125,34-47 ] _524 : _523  [ at /Users/pumpkin/Sandbox/Finite.agda:125,34-47 ]08/11 05:02
copumpkinmaybe it's a universe polymorphism thing again?08/11 05:02
dolioI don't think it has to do with universe polymorphism.08/11 05:02
dolioAnyhow, the unifier doesn't like it for some reason.08/11 05:03
copumpkinah well, I can live with with08/11 05:03
copumpkinthat's the easy part of the proof anyway08/11 05:03
dolioIt's too bad there's no way to add local type annotations, other than the backwards operator.08/11 05:03
copumpkinyeah :/08/11 05:04
copumpkinis the syntax set in stone?08/11 05:04
copumpkinit seems weird to work around syntax in such a research language08/11 05:04
copumpkinwell, if not research, experimental08/11 05:04
dolioYeah.08/11 05:04
faxbackwards operator ?08/11 05:06
copumpkinthere's a way of adding local type annotations through a hack08/11 05:06
dolioYou can't define an operator 't : T', because T has to precede t for the type of _:_ to work out.08/11 05:06
dolioThat's one thing Coq's notations have over Agda's mixfix, I think.08/11 05:06
dolioInstead you have to define 'T : t' which is backwards.08/11 05:07
dolioI suppose it isn't that big a deal, but it's less than ideal.08/11 05:08
copumpkinmmm, a 10-line long goal :/08/11 05:11
copumpkinI know it likes to reduce everything to normal form08/11 05:12
copumpkinbut it'd be nice if it stopped when it reached functions we defined locally or something08/11 05:12
copumpkinthis is daunting :)08/11 05:24
copumpkinx ∷ ys ∈ (map (_∷_ x) (replicateVec (x ∷ xs))) ++ (concatMap (λ f → map f (replicateVec (x ∷ xs))) (map _∷_ xs))08/11 05:26
copumpkinI'm not even sure how it got that crazy expression08/11 05:33
copumpkinoh I see08/11 05:33
copumpkinC-c C-n isn't much use08/11 05:35
copumpkinI'm manually simplifying the epic expression and I ask C-c C-n to reduce my simplified expression08/11 05:36
copumpkinand it writes _61308/11 05:36
copumpkinVec-Infinite : ∀ {x} → Infinite x → {n : ℕ} → Infinite (Vec x n)08/11 06:07
copumpkinthat one seems quite hard08/11 06:07
copumpkinhmm, I'm not even sure it's possible without carrying more information around in my finiteness proof08/11 06:18
copumpkinoh maybe it is08/11 06:22
faxis anyone from chalmers.se around?08/11 10:35
faxI can't access the chalmers.se ftp :(08/11 10:36
SaizanCoinduction links http://thread.gmane.org/gmane.comp.lang.agda/633 which talks about the delay operator ~, but then Data.Colist doesn't use it, is there a short answer or should i read the thread?:)08/11 11:56
dolioSaizan_: ~ was part of the original syntax for coinductive definitions. 'f <x> = e' was a recursive definition, and 'f <x> ~ e' was a corecursive definition.08/11 15:52
Saizan_so now it's gone and we don't need anything to replace it?08/11 15:53
dolioYes, although I haven't really followed the details of what's disallowed to make that the case.08/11 15:55
dolioThe state of the art for doing coinduction in Agda still strikes me as weird.08/11 16:07
dolioUsing F nuF instead of nuF, basically.08/11 16:08
dolioUsing nuF complicates proofs, though.08/11 16:08
Saizan_mh, not directly the F you'd use to make the fixpoint even08/11 16:14
Saizan_just the "view" you'd get when destructing08/11 16:15
dolioWell, F doesn't correspond to the data declaration exactly.08/11 16:15
Saizan_ah, k08/11 16:16
dolioI mean, basically, you get the F for 'data CoT where ...' by looking for the shape of 'data T where ...', where the latter has the infinities removed.08/11 16:18
dolioThen CoT = F nuF, I believe.08/11 16:19
dolioAnd \inf CoT = nuF08/11 16:19
Saizan_mh, yeah, that makes sense08/11 16:21
Saizan_i got confused with the "internal state + observers" formulation of codata08/11 16:21
dolioOf course, you can write, I think, 'data CoT : Set where C0 : CoT -> CoT ; C1 : \inf CoT -> CoT', and I don't even know what that is.08/11 16:22
dolioI don't think you can make sense of that definition without splitting it into two fixed points.08/11 16:24
dolioCoT = nu X. mu Y. Y + X08/11 16:25
dolioWith the nu always outside, due to the way Agda handles things, as Nils has noted.08/11 16:26
copumpkinooh, I can simplify my Finiteness08/11 18:20
copumpkinNils said he'd noticed me using Vec for \in from the logs of this channel, and sent me a personal email telling me about a module I hadn't noticed doing the same thing for List08/11 18:21
Saizan_oh, cool, Nils is watching us?:)08/11 18:22
Saizan_which module, btw?08/11 18:23
copumpkinData.List.Any/All08/11 18:24
copumpkinwhich include a \in for List08/11 18:24
copumpkinI have a weird situation in my current proof08/11 18:24
copumpkinso I keep getting the error: g v != x of type .b08/11 18:28
copumpkin_inside_ subst, which I'm using a proof in that g v == x08/11 18:29
copumpkinI guess I wasn't convincing enough?08/11 18:29
Saizan_by inside subst you mean subst (\lambda x -> <here?>) gv=x08/11 18:30
copumpkinyeah08/11 18:30
copumpkinwell the lambda has the type08/11 18:30
copumpkinsince it's the predicate08/11 18:30
copumpkinoh08/11 18:32
copumpkinthis worked08/11 18:32
Saizan_however you don't know they are equal in the body of the lambda there08/11 18:32
copumpkinwell somehow08/11 18:33
copumpkin\z -> z \in map g (v \:: vs) was accepted in the lambda08/11 18:33
copumpkinand \z -> z \in g v \:: map g vs did not08/11 18:33
copumpkinthe only reason I was doing the latter is because the goal type had expanded that for me08/11 18:33
Saizan_weird08/11 18:34
Saizan_are those Colists?08/11 18:34
copumpkinnope, Vec08/11 18:34
copumpkinI'm going to be changing them to lists soon though08/11 18:34
copumpkinsince they're easier to work with08/11 18:34
copumpkinwell the injective infinity proof may not work08/11 18:35
copumpkinbut I did a surjective finiteness proof08/11 18:36
copumpkinFinite⇒Finite : ∀ {b a} → Finite a → (f : a -> b) → Surjective f → Finite b08/11 18:36
dolioOh, yeah, I should have mentioned the List.Any/All stuff. I actually coded up a proof that Nat is infinite using them some time when you were last talking about the stuff.08/11 18:54
copumpkin:O08/11 18:54
copumpkin:)08/11 18:54
copumpkinthe proof that vectors over a finite domain are finite is getting tedious, I might postpone it08/11 18:55
copumpkinI even have two different approaches to it, but both of them are tedious08/11 18:56
copumpkinat least I have my infinite vector proof08/11 18:56
doliohttp://code.haskell.org/~dolio/agda-share/html/Infinite.html08/11 18:57
copumpkinoh, nice :)08/11 18:58
dolioThat proof revealed a serious lack of \lub proofs in Data.Nat.Properties.08/11 18:58
copumpkinone day I'll write elegant proofs too08/11 18:58
dolioThere are several for \glb, but none for \lub.08/11 18:58
copumpkinah08/11 18:59
dolioUnless I'm supposed to use some kind of duality for that or something.08/11 18:59
copumpkinI think map : ∀ {A} {P Q : Pred A} → P ⋐ Q → All P ⋐ All Q is already in Data.List.All08/11 19:00
copumpkinor rather08/11 19:00
copumpkinlemma₄ : ∀{A l} {P Q : A → Set} → (∀{x} → P x → Q x) → All P l → All Q l08/11 19:00
copumpkinis map08/11 19:00
dolioYeah, it probably is.08/11 19:00
dolioI was avoiding importing Relation.Unary, because I didn't want to keep dealing with conflicting operator names defined in the two.08/11 19:01
copumpkinah08/11 19:02
copumpkinwow, my code is such a mess :)08/11 19:03
copumpkinalmost 200 lines, too!08/11 19:03
copumpkinfor proofs that Bools are finite, Nats are not, Fins are, and that if you have an Infinite carrier, then Vec over it is also infinite (unless length is 0) and Vec a 0 is always Finite08/11 19:04
dolioIt isn't hard for things to add up.08/11 19:04
dolioI think my entire interpreter for pure type systems in Haskell is shorter than my proof in Agda that insertion sort successfully sorts lists.08/11 19:06
copumpkinlol08/11 19:06
copumpkinnow prove timsort! :P08/11 19:07
dolioYeah, good luck with that.08/11 19:07
dolioI guess I'm slightly off in that comparison. :)08/11 19:08
dolioThe sorting has around 425 lines.08/11 19:08
copumpkinhow big is your interpreter?08/11 19:08
copumpkinah08/11 19:08
copumpkinyesterday I spent around 20 minuetes trying to prove that x \in [] by the way :P08/11 19:10
dolioAlthough it depends on what you include. The interpreter has around 350 for the syntax + type checker + parser, and then 180 defining lots of different rules for the lambda cube and stuff, and then 275 for the REPL.08/11 19:10
dolioSo the core stuff actually is shorter.08/11 19:10
copumpkinah, I see08/11 19:10
* copumpkin moves back to regular languages08/11 19:22
copumpkinI wonder how hard it'll be to work with them without going through DFAs08/11 19:22
copumpkinI imagine constructing the intersection of two languages would be quite hard08/11 19:22
copumpkinworking on making the diagonal function work :)08/11 19:42
copumpkintrying     stripe : ∀ {a} → Colist⁺ (Colist⁺ a) → Colist⁺ (List⁺ a)08/11 21:24
copumpkinbah!08/11 22:21
copumpkinhmm, it still can't figure out that my stripe will terminate :(08/11 22:22
copumpkinwell, it might not, but it doesn't like it :(08/11 22:22
copumpkinI feel like I've eliminated the non-productive possibilities with the Colist+ stuff08/11 22:23
copumpkinhttp://moonpatio.com/fastcgi/hpaste.fcgi/view?id=4864#a486408/11 22:24
dolioI told you it wouldn't like the last case. :)08/11 22:25
copumpkinit doesn't like either of the stripe (♭ xss) calls08/11 22:25
copumpkinlast and second-to-last :/08/11 22:26
faxwhat's the method(s) for proving a corecursion terminates?08/11 22:26
faxlike for induction you can use well founded orders08/11 22:26
dolioYes, but what if you replace the last with a question mark?08/11 22:26
copumpkindolio: magic!08/11 22:26
copumpkinhmm08/11 22:26
copumpkinall the pink went away08/11 22:26
dolioI also said the fact that it wasn't hilighting the one case was weird. :)08/11 22:27
copumpkinso now that I've converted it to Colist+ it's behaving the way you expected it to behave before with Colist :O08/11 22:27
dolioObviously gremlins fixed the productivity hilighting over night.08/11 22:27
copumpkinlol08/11 22:27
copumpkinhow is the last case not productive?08/11 22:27
dolioBecause stripe isn't directly guarded by #.08/11 22:28
copumpkinoh08/11 22:28
dolioAnd that's the only way the productivity checker knows how to verify things are productive.08/11 22:28
copumpkinI could make zipCons take a \inf08/11 22:28
copumpkindo you think that would help?08/11 22:28
dolioNAD and co. have a paper on this, where they solve the problem by making an auxiliary codata type for relevant productive coprograms.08/11 22:29
dolioSo, zipCons would be a constructor of that language.08/11 22:29
dolioThen you write a projection from the coprograms to your colists.08/11 22:30
copumpkin:O08/11 22:30
copumpkincoprograms!08/11 22:30
dolioWhich is fairly roundabout.08/11 22:30
-!- copumpkin is now known as coprogrammer08/11 22:30
doliohttp://www.cs.nott.ac.uk/~nad/publications/danielsson-altenkirch-mixing.pdf08/11 22:31
coprogrammerthanks!08/11 22:31
dolioYou know, the other unfortunate thing about the current coinduction formulation is that only ♯ gets hilighted in that nice yellow.08/11 22:38
coprogrammerlol, I see how this works08/11 22:42
coprogrammerit's ugly :P08/11 22:42
dolioYes.08/11 22:42
coprogrammerbut I guess I can do that08/11 22:42
dolioLots of oddities with codata.08/11 22:48
coprogrammerso I guess I'd make a processor type with a :: constructor and a zipCons constructor, and then a way to translate it back into regular Colists?08/11 23:07
dolioYes, I think so.08/11 23:08
coprogrammerhm, it's forcing me to stick my type into Set1 :(08/11 23:26
coprogrammerhttp://snapplr.com/drp6 in the paper08/11 23:28
coprogrammerI'm not sure why my type, which is very similar to that, doesn't fit in Set08/11 23:29
faxwhat is it?08/11 23:31
coprogrammerhttp://snapplr.com/wkgm08/11 23:32
faxand List+ : Set -> Set?08/11 23:33
coprogrammerdata List⁺ (A : Set) : Set where08/11 23:34
faxstrange that there's no mention of impredicative set in the paper08/11 23:41
coprogrammeroh, they did say earlier in the paper that they ignored universe levels for clarity08/11 23:42
coprogrammerI guess their datatype doesn't fit in Set either08/11 23:42
coprogrammeroh I see what I should do08/11 23:43
faxoh Agda doesn't have an option for impredicative set, you have to turn off levels08/11 23:50
coprogrammerI thought there was type-in-type08/11 23:52
coprogrammeror is that something else?08/11 23:52
coprogrammerI get the impression that when I'm done with this, it's going to be a nightmare to prove things about08/11 23:59
coprogrammerbut first things first08/11 23:59
--- Day changed Mon Nov 09 2009
dolioSet : Set is different from impredicativity.09/11 00:18
copumpkinah09/11 00:18
dolioThat paper might not bother with noting universe levels, perhaps.09/11 00:21
dolioIt's not really relevant to what they want to discuss.09/11 00:21
copumpkinyeah, it said so earlier in the paper09/11 00:21
copumpkinw00t09/11 00:23
copumpkinI wrote diagonal :)09/11 00:23
copumpkinnot sure it's correct though!09/11 00:23
faxI wanna see it09/11 00:23
copumpkinjust a sec :)09/11 00:24
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11962#a1196209/11 00:25
copumpkinkind of scared to try running something in it09/11 00:25
copumpkinthe type of diagonal is more restrictive than it really has to be, but it was simpler this way09/11 00:26
copumpkinugh, constructing list literals is painful :P09/11 00:29
copumpkinhmm C-c C-n 's output for Codata isn't very obvious09/11 00:39
dolioExample?09/11 00:41
copumpkinhttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=11963#a1196309/11 00:42
dolioOh, right.09/11 00:42
copumpkinit contains an unevaluated diagonal thingy in it09/11 00:42
dolioObviously.09/11 00:42
copumpkinI need an rnf!09/11 00:43
* copumpkin writes it09/11 00:43
dolioWrite take : Nat -> Colist a -> List a09/11 00:43
copumpkinah, that's better09/11 00:43
dolioThat is the normal form for that codata. :)09/11 00:43
copumpkin:o09/11 00:44
copumpkinyay09/11 00:45
copumpkinfor my test case, it matches control-monad-omega09/11 00:46
copumpkinproof by example of correctness! ;)09/11 00:46
dolioHeh.09/11 00:46
faxand what situations does this apporach not work?09/11 00:46
faxthis stuff  whnf : ∀ {a} → DiagonalP a → DiagonalW a09/11 00:46
Saizan_lazyness by relfection?09/11 00:48
copumpkinI should probably prove some things about diagonal09/11 00:49
dolioGood luck with that.09/11 00:51
copumpkinlol09/11 00:51
copumpkin"More precisely, if x appears at a finite index in xs, and y appears at a finite index in f x, then y will appear at a finite index in each xs >>= f."09/11 00:51
Saizan_oh, i though you just needed a constructor in front of the recursive call to prove that it's productive09/11 00:56
copumpkinproof : ∀ {a b} → ∀ (x : a) → (xs : Colist⁺ a) → (f : a → Colist⁺ b) → x ∈ xs → (y : b) → y ∈ f x → y ∈ diagMap f xs09/11 01:01
* copumpkin trembles09/11 01:01
copumpkinwell, at least I can write it down, right?09/11 01:03
copumpkinproof is a pretty bad name, isn't it09/11 01:04
Saizan_yeah :)09/11 01:04
copumpkinsometimes getting patterns to work together is really hard09/11 01:18
copumpkinI can't get agda to accept my pattern :/09/11 01:59
copumpkinhttp://snapplr.com/qd3z09/11 02:00
dolioMatch on it after the with.09/11 02:04
copumpkinhow do you mean?09/11 02:04
dolioInstead of "... | [ .y ]", write "proof a [ .a ] f now y now | [ .y ]"09/11 02:05
dolioI'm not sure that will work, but it may.09/11 02:06
copumpkinah nope, I tried that before :/09/11 02:06
copumpkinoh wait09/11 02:06
dolioJust leave it as a variable before the with.09/11 02:07
copumpkinyeah I did09/11 02:07
copumpkinhttp://snapplr.com/xmwb09/11 02:07
Saizan_miss a dot on one of the two?09/11 02:08
copumpkinoh my, it worked when I changed the variable name09/11 02:11
copumpkin(from the original pre-with thingy)09/11 02:11
copumpkinI didn't realize that the earlier binding was still around09/11 02:12
copumpkinyay09/11 02:14
Saizan_to prove (forall x. f x = g x) -> P f -> P g you need extensionality, right?09/11 02:15
copumpkinbeats me :) does my proof need that?09/11 02:16
Saizan_mine does :)09/11 02:16
faxSaizan: yes (instaniate P f' := f = f')09/11 02:16
copumpkinSaizan_: whatcha proving? :)09/11 02:16
Saizan_i'm writing down in agda Conor's first order unification and the proof of its correctness09/11 02:17
copumpkin:o09/11 02:18
Saizan_i guess i should have read the whole paper before starting09/11 02:18
copumpkinsounds a lot more profound than what I'm doing :)09/11 02:18
faxSaizan well you don't need eta (or proof irr.) for any of the implementation, not sure about the proofs but I doubt it too09/11 02:18
Saizan_fax: as the paper presents this proof it's pretty much explicitly required, but maybe i can rework it, the the implementation uses a concrete representation for substitutions afterall09/11 02:20
Saizan_i'm referring to "The Optimist's Lemma"09/11 02:21
faxhm?09/11 02:26
Saizan_page 3 of http://strictlypositive.org/foubsr-website/proof.ps09/11 02:27
faxyes09/11 02:27
faxwhere you have   f =^. g  that reall means  forall x, f x = g x  ?09/11 02:28
Saizan_yes09/11 02:28
faxwhere does it need ext.?09/11 02:28
Saizan_so, given "f =^. g <> p" and "Q (f <> a)" it proves "Q (g <> p <> a)"09/11 02:29
faxsince Agda has eta can you use  Q (f <> a) = Q (\x -> f (a x))  ?09/11 02:30
faxoh but then you must rewrite under a binder...09/11 02:30
Saizan_heh09/11 02:30
Saizan_the problem is that you can't get hold of that lambda bound 'x'09/11 02:31
Saizan_or, at least, that's where i'm stuck09/11 02:31
dolioEta doesn't get you the 'forall x ...' extensionality.09/11 02:31
dolioEta seems to be widely referred to as "extensional" in the literature, but it's weaker than 'forall x ...'.09/11 02:32
dolioThe latter gets you the former, though.09/11 02:32
dolioAssuming you have beta, of course. :)09/11 02:34
faxif you can just show  Q (f <> a) <-> Q (g <> p <> a),  that's enough,  they don't have to be equal09/11 02:36
fax(I think?)09/11 02:36
faxif so, taht seems possible09/11 02:36
Saizan_i just need to produce the latter from the former09/11 02:37
Saizan_though Q codomain is Set, so i don't see how to manipulate it09/11 02:40
dolioIt's possible you're stuck, since extensional equality isn't substitutive.09/11 02:43
faxif you look at Conors proof <http://strictlypositive.org/foubsr-website/unif.l> - he defines Property slightly different than in the paper:  It also says that is respects equality09/11 02:47
dolioWhat is this? Lego?09/11 02:48
faxyeah I think so09/11 02:48
faxit's either Lego or Oleg09/11 02:48
faxprobably Lego09/11 02:48
faxwhen I said 'equality' a moment ago, that should be the =^. one09/11 02:48
faxI think that defining property in that way lets you avoid ext. because whenever you need it you have a proof of  f =^. g -> P f -> P g09/11 02:51
Saizan_ah, it cheats!09/11 02:52
copumpkinthis proof is kicking my ass09/11 02:58
copumpkinneed moar lemmaz09/11 02:59
Saizan_i guess i need a \Sigma in Set1 then09/11 03:04
copumpkingot 15 holes in my code :P09/11 03:07
copumpkin16 actually09/11 03:08
Saizan_your second window must be huge09/11 03:08
copumpkinyeah :/09/11 03:10
copumpkinthis proof is scary09/11 03:10
copumpkinthese unnamed quantities are a real pain09/11 03:27
copumpkin_310, I hate you!09/11 03:27
dolioBetter naming of metas would be nice.09/11 03:28
copumpkinmy enumerator is sort of working09/11 04:22
copumpkinenumerating kleene star might require some more guarded corecursion pain though09/11 04:27
copumpkinyep, definitely pink in its current state09/11 04:57
* copumpkin sighs09/11 04:57
copumpkinoh no, something just occurred to me09/11 04:59
copumpkinwith my current code, enumerating the union of two identical languages will produce duplicate strings09/11 04:59
copumpkinor even non-identical languages09/11 05:00
dolioThat sounds like a problem.09/11 05:06
copumpkinwell, I could just claim that my enumerate function generates all strings of the language at a finite index, not that they aren't duplicated09/11 05:06
copumpkinbut that's cheap09/11 05:06
copumpkinI wonder what a good strategy for enumerating all strings from kleene is in the first place09/11 05:14
copumpkinoh, I think I can do it simply09/11 05:14
copumpkinhm, maybe not :)09/11 05:20
copumpkinusing \ell for languages is pretty09/11 05:54
dolioOh, so that's what that's called.09/11 05:56
copumpkinSaizan_ also mentioned a key combo for telling you what the shortcut is for any unknown symbol, but I forgot it09/11 05:57
dolioYeah. C-u C-x =09/11 05:57
copumpkinI wish I could get agda to tell me all the constraints for a given hole, somehow09/11 05:57
copumpkinI provide it something of the type it asks for and then I get a huge new error09/11 05:58
copumpkinit's writing them in my bottom window as unnamed metas I think, but I have no way of associating them09/11 06:06
copumpkinhttp://snapplr.com/s0ve09/11 07:28
copumpkindoes that look reasonable?09/11 07:28
faxhttp://www.cs.nott.ac.uk/~txa/publ/pisigma-new.pdf09/11 13:44
faxI totally don't understand the point of this ...09/11 14:44
-!- Saizan_ is now known as Saizan09/11 15:01
faxwhat is the point of a core language?  Especially one that can't implement all the types you want, and that isn't sounda09/11 15:40
faxI mean why not use lambda calculus or scheme?09/11 15:40
faxclearly there is a good reason, I just don't know it :/09/11 15:41
jlairethat language looks a lot like lambda calculus to me09/11 15:41
jlairejust with many extensions09/11 15:42
FunctorSaladfax: missed the context... which language?09/11 15:49
jlaire15:44:45 < fax> http://www.cs.nott.ac.uk/~txa/publ/pisigma-new.pdf09/11 15:50
faxhttp://www.cs.nott.ac.uk/~txa/publ/pisigma-new.pdf09/11 15:50
FunctorSaladah yes I noticed that on hackage09/11 15:50
FunctorSaladactually I liked the idea09/11 15:50
FunctorSaladI think it is for building your own logic on top of it09/11 15:50
faxwhat IS the idea? :P09/11 15:50
faxI was just complaining about how I don't understand this09/11 15:50
FunctorSaladso you don't have to replicate the core stuff09/11 15:50
jlaire"These features ... complicate the metatheoretic study and can be the source of subtle bugs in the type checker. To address such problems, we can use a core language which is small enough to allow metatheoretic study."09/11 15:51
jlairemakes sense to me09/11 15:51
FunctorSaladbut I didn't get the syntax ;)09/11 15:51
FunctorSalad(from a cursory look)09/11 15:51
faxhm I still don't get it09/11 15:51
faxmy approach would be implement a core theory and then justify all your pattern matching and so on in terms of that09/11 15:52
faxso your logic is equivalent to the core09/11 15:52
FunctorSaladfax: and they already did the former for you09/11 15:52
faxbut clearly, we don't want to be equivalent the pi-sigma core09/11 15:52
jlairehmm?09/11 15:52
FunctorSaladwhy not? (real question)09/11 15:52
faxso that proofs are meaningful09/11 15:53
faxbecause it's got Type : Type, general recursion, can't implement all the data types we like09/11 15:53
FunctorSaladah didn't know it's incosistent09/11 15:53
FunctorSalad(it is with these properties, right?)09/11 15:54
faxwhat09/11 15:54
fax?09/11 15:54
FunctorSaladpisigma09/11 15:54
FunctorSaladif it has Type:Type and general recursion09/11 15:54
FunctorSaladunless it's too weak to derive the usual contradictions from that09/11 15:54
faxyes both of those are inconsisent individually09/11 15:54
faxif all they wanted was a computational model for reduction:  What's wrong with lambda calculus (+ symbols and such, perhaps)09/11 15:55
FunctorSaladwell you don't have to literally build on it, you could fork it09/11 15:55
faxso the types must be important -- but why?09/11 15:55
jlaireyou mean plain untyped lambda calculus?09/11 15:55
faxyes09/11 15:55
faxjust because something is pi-sigma typeable, well that tells us what?  The term wont get stuck in reduction -- well if you typecheck something before translating it into lambda calculus it wont get stuck either09/11 15:56
jlairethey want to study the dependent type system09/11 15:57
faxI am not stopping them :P09/11 15:57
faxI just question the motivation..09/11 15:57
faxperhaps one of the ideas is: If you give a semantics preserving translation of $language into pi-sigma then you know $language has subject-reduction and ____ and ____09/11 15:58
jlaireHaskell/ML are based on System F09/11 15:58
jlairenobody uses untyped lambda calculus really09/11 15:58
jlairetranslating complex type systems to a core language with no type system wouldn't be easy09/11 15:59
faxI'm not sure what you mean by that09/11 15:59
faxwhen you say "complex type systems", can we be concrete and use Agda2 as the example?09/11 16:00
jlaireanalyzing untyped lambda calculus doesn't help them understand dependent types09/11 16:00
faxor is that more than just a type system09/11 16:00
faxjlaire, oh I had in mind pi-sigma was an implementation thing09/11 16:00
faxso it's really a metatheory tool?09/11 16:00
jlairefrom what I understand, yes, a tool for studying the system09/11 16:02
faxthe system --- Agda2 ?09/11 16:02
jlaireyes09/11 16:02
FunctorSaladI still don't get what the point is if it's inconsistent09/11 16:02
faxso what can you learn about Agda2 from looking at pi-sigma?09/11 16:02
jlairethat sounds really weird, yes09/11 16:02
faxor pi-sigma and the map from Agda2 into it09/11 16:03
jlaireI haven't read the paper yet :P09/11 16:03
FunctorSaladfor *evaluation* I agree you might as well translate to untyped lambda calculus09/11 16:03
faxso how do you know all this?09/11 16:03
jlaireI thought you didn't understand the point of core languages in general09/11 16:03
faxFunctorSalad: although...... we need types to decide eta equality09/11 16:04
faxtype directed expansion09/11 16:04
FunctorSaladfax: one needs to decide eta equality during evaluation?09/11 16:04
faxif you want   f   to be convertible with   \x -> f x09/11 16:04
fax(which I do - so then I can prove Cont is a monad)09/11 16:05
fax(without introducing any other equality or setoids or anything)09/11 16:05
faxalso nice to have  x = () : Unit09/11 16:05
faxand so on.09/11 16:05
faxmaybe that's the reason for not using lambda calculus?09/11 16:06
faxalthough they only really talked about alpha-beta in the paper iirc09/11 16:06
FunctorSaladhmm so you mean you would feed a bare function to the evaluator in the first place?09/11 16:07
faxI'm not sure what you mean09/11 16:07
FunctorSalad"f" probably has some function type in your higher-level language09/11 16:07
faxyes, it must do: That's the only reason it's eta-expanded on conversion checking09/11 16:07
FunctorSaladI mean you only feed the evaluation system terms of a ground type, no?09/11 16:08
* FunctorSalad is confused :(09/11 16:08
faxme too09/11 16:08
FunctorSaladI thought we were thinking of using untyped lambda calculus just for evaluation, not logic09/11 16:09
faxyou have to do evaluation during typechecking though09/11 16:09
FunctorSaladhmm ok09/11 16:09
dolioCore languages come after type checking.09/11 16:14
dolioYou perform optimizations on them, and then turn them into machine code.09/11 16:14
FunctorSaladhmm I think GHC does typecheck the sugared Haskell first, but coar is still typed09/11 16:14
jlaireyes the core is typed09/11 16:15
dolioYes. PiSigma is typed, as well.09/11 16:15
FunctorSalad(because type inference is easier on sugared haskell, and for better errors)09/11 16:15
dolioTyping in the core language is useful as a sanity check for the optimizations.09/11 16:15
FunctorSaladyeah09/11 16:16
dolioThis is a new PiSigma paper?09/11 16:16
faxyes very new09/11 16:16
faxI think you can't erase proofs or indices when you translate into pisigma - and there seems to be no way pisigma can tell which is which so how can it do a decent job of optimization?09/11 16:17
dolioWell, as I recall, PiSigma has Type : Type, for example, and that's because they don't bother with making the language total, so there's no reason not to.09/11 16:19
dolioSo perhaps there's no situations where a computationally irrelevant proof would make things work that wouldn't otherwise.09/11 16:20
faxok so maybe you can erase proofs when you go from $language into pisigma by replacing them with 'undefined'09/11 16:20
faxseems dangerouasrt09/11 16:20
dolioI mean, the main proof I'd think you'd have to keep around is "this algorithm terminates," but PiSigma wouldn't care about that.09/11 16:20
faxwhere is the most recent OTT.agda?09/11 16:36
dolioDo you have a darcs checkout of Agda?09/11 16:37
faxah thanks09/11 16:38
faxwait where is it?09/11 16:42
dolioexamples/outdated.../OTT09/11 16:42
faxthat's a bit worrying :S09/11 16:43
dolioI don't know of anything newer than that.09/11 16:43
stevanhi09/11 16:49
dolioYo.09/11 16:49
stevani thought i'd share some stuff i've been doing as part of a course in models of computation i'm taking. most of the code contains more questions than answers, perhaps you guys can give me some comments. http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11977     http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11978     http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11979   http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11980   ...09/11 16:54
stevan...  thanks.09/11 16:55
dolioThere is a ℚ in Agda, although there aren't a lot of functions on it.09/11 16:58
stevanhmm09/11 17:00
dolioAh, fooling with parametic HOAS.09/11 17:01
Saizanstevan: for the future, you can "add revision" to pastes so it's everything on one page09/11 17:01
stevandolio: yeah, i couldn't get subst to work inside the big step semantics definition...09/11 17:02
faxmaybe I should implement OTT myself for learning09/11 17:02
faxhey Saizan how did it go with the unification stuff?09/11 17:02
doliofax: I'd wager that's easier than figuring out how to fix the existing one.09/11 17:02
Saizanfax: i just completed the optimist's lemma proof after changing the definition of Property09/11 17:03
faxdid you have to use any axioms (such as ext.)?09/11 17:03
Saizanno09/11 17:03
faxah that's good news09/11 17:03
Saizanit just made the previous definitions more complicated :)09/11 17:03
dolioI have an old interpreter for type-indexed lambda terms that I wrote before I figured out you could do 'data Foo : (n : Bar) -> T n -> Set', so I used a Sigma instead, and now I can't figure out how to remove the Sigma without breaking everything.09/11 17:03
faxstevan yo should assume there's a bijjection between N and N -> N and then show a contradiction using cantors diagonalization :P09/11 17:05
stevanyeah that would be cool, seems pretty hard tho :-)09/11 17:07
faxSaizan just noticed there's a mention in the OTT paper,  "McBride's correctness proof of unification is burdened throughout by the need to show explicitly that predicates respect the observational equality for substitions represented functionally"09/11 17:09
Saizanyeah, i can feel the burden :)09/11 17:10
Saizanmaybe i'd try converting it to OTT if we manage to get an encoding working09/11 17:11
Saizanstevan: about UTLC, ex1 should reduce to ex0, and ex2 doesn't work because ex0 doesn't represent a term with a free variable, the ƛ_ binds it09/11 17:13
Saizanand vice versa for (λ y → var y)09/11 17:13
Saizanbtw (λ y → var y) = var09/11 17:14
Saizanif you know monads subst is a join09/11 17:15
stevanthanks. hmm, cool. i'll have to play more with it. any idea why subst' doesn't work inside the big step semantics data definition?09/11 17:16
stevani'd also like to try the universe binding stuff by Dan Licata... perhaps it's simpler? anyone played with it?09/11 17:17
Saizanuhm, no, i'm not so strong on Coinduction09/11 17:19
stevancoinduction is only used for diverging terms (since this is untyped LC), (i took the defs from the mixing induction and coinduction paper)09/11 17:20
Saizanwell, subst takes only one explicit argument, so maybe you want subst\' but that doesn't seem to work either09/11 17:22
Saizanor maybe you want to index the data by Term instead of Term\' V09/11 17:23
Saizanthe PHOAS paper has to use a relational version of substition at some point, maybe it's the same problem here09/11 17:25
stevanhmm09/11 17:27
Saizanor maybe you just have to fix the type of variables during evaluation09/11 17:30
Saizanhere i've done SystemF by embedding it into agda http://code.haskell.org/~Saizan/SystemFpred.agda09/11 17:31
Saizanyou can't do exactly the same for UTLC, but the eval function has type ⟦_⟧ : ∀ {t} -> term {Set} {⌊_⌋p} t -> ⌊ t ⌋p09/11 17:32
Saizanso that variables have the type of what the terms are evaluated to09/11 17:32
stevanhmm, yeah. I'll have to try that out.09/11 17:35
FunctorSaladfax: I could get the outdated OTT to "compile" by adding absurd pattern matches for the definitions where it complains about nonexhaustiveness09/11 17:36
FunctorSaladbut there remain holes and pink stuff09/11 17:36
Saizanstevan: the ltamer source is in Coq but i found it quite helping even without knowing it, and examples/Untyped/Core.v defines a HOAS untyped lambda calculus09/11 17:38
stevanoh, good to know. thanks again! :-)09/11 17:39
Saizannp :)09/11 17:42
* FunctorSalad wonders if one could build an extensional system *on top* of agda, as a frontend09/11 19:05
FunctorSaladbasically, it would make use of setoids transparent09/11 19:05
FunctorSaladwhen you define a datatype, it generates the extensional equality for it (at least congruence rules with respect to all the constructors)09/11 19:06
copumpkin:O09/11 19:06
FunctorSaladcopumpkin: why?09/11 19:07
FunctorSalad:)09/11 19:07
copumpkinyou should call it the extensional extension for agda!09/11 19:07
FunctorSaladagdtensional edgar09/11 19:07
FunctorSaladbut seriously, it doesn't sound that hard at first thought09/11 19:08
faxFunctorSalad you read the OTT paper?09/11 19:08
FunctorSaladmaybe it could even be done without hacking agda, as a haskell program talking to agda09/11 19:08
FunctorSaladfax: still not :)09/11 19:08
faxit's not completely clear to me yet but maybe the shallow embed thing with OTT is one way to do what you're talking abou09/11 19:09
FunctorSaladthe .agda file didn't look very simple tbh ;)09/11 19:09
FunctorSaladI'm just talking about a "automatic setoid and coercion manager", basically09/11 19:10
FunctorSalad(I think)09/11 19:10
faxI mean the paper btw09/11 19:10
faxObservational Equality Now!09/11 19:10
FunctorSaladyes I understood you that way09/11 19:12
FunctorSalad(I mean, the setoids should be hidden from the user)09/11 19:13
FunctorSaladmaybe one could also keep track of a graph of coherent coercions09/11 19:14
FunctorSalad(by coherent I mean that all diagrams of coercions commute)09/11 19:14
dolioI don't think the shallow embedding would be very nice to use unless you had a front-end to translate to it.09/11 19:17
FunctorSaladthen if the user tries to compare a complex integer and a rational, it would autocoerce both to complex rational (dumb example ;))09/11 19:17
dolioUnless you enjoy defining all your inductive families by figuring out the W-type analogue.09/11 19:17
FunctorSaladdolio: but couldn't you front-end straight to agda?09/11 19:17
faxhehe09/11 19:17
faxwell you could probably compute the W type from a description09/11 19:18
fax(using Dybjers method)09/11 19:18
dolioYou'd want something like the pattern declarations in SHE.09/11 19:19
dolioEdgar's a good name, though.09/11 19:20
copumpkinFunctorSalad: can you automatically translate my pink corecursion to colorless constructor-based awesomeness? kthx09/11 19:20
FunctorSaladyes, extensional agda can do that.09/11 19:20
copumpkinyay09/11 19:20
copumpkinwe definitely need a @faq in here09/11 19:20
stevancan inductive families be "desugared" into W-types?09/11 19:21
FunctorSaladoh cool Agda.cabal has a library section already09/11 19:21
copumpkinagda is primarily a library I think09/11 19:21
FunctorSaladbut it has MANY modules09/11 19:22
dolioYeah, I think the emacs mode loads up the agda modules in ghci.09/11 19:22
FunctorSaladat least they're organized09/11 19:22
FunctorSaladoh nice09/11 19:22
copumpkinI vaguely remember that it had two modules called semiring, with different capitalization09/11 19:22
copumpkin(as I watched it compile)09/11 19:22
FunctorSaladis there some sort of protective wall around the kernel?09/11 19:22
FunctorSaladso I don't break it accidentally09/11 19:23
FunctorSalad(by calling  internal functions)09/11 19:23
fax"kernel?" :P09/11 19:23
faxthat's now how Agda is 'designed'ar09/11 19:23
copumpkinlol09/11 19:23
FunctorSalad:(09/11 19:23
FunctorSaladfax: do you know more?09/11 19:24
FunctorSalad(about the design)09/11 19:24
copumpkingotta put it in quotes to get an answer09/11 19:24
faxFunctorSalad: You probably wanna work from Agda Light09/11 19:24
FunctorSaladI guess I would mostly be interested in the "Syntax" hierarchy and don't mess with "TypeChecker"09/11 19:26
FunctorSaladto desugar extensional agda to agda proper09/11 19:27
FunctorSaladyay there is even haddock09/11 19:28
faxI get lost in this OTT paper around section 309/11 19:32
fax3.109/11 19:32
dolioWhich one?09/11 19:32
faxObservational Equality, Now!09/11 19:32
FunctorSaladoO (templateAgda ;))09/11 19:35
FunctorSaladthough haskell might be a better metalanguage09/11 19:36
faxI defined a universe ★ and interpretation into Set, another universe □ and interpretation into ★. Then a definition of equality of sets: ★ -> ★ -> □ and proved that if there are equal sets you can coerce values from one to the other.09/11 19:42
fax(following the paper)09/11 19:42
copumpkinooh, nice star09/11 19:43
faxso now there's value equality, Eq, eq, coe, coh and quotation -- it's not clear how any of those fit in with this09/11 19:44
dolioEq is equality of sets, eq is equality of values.09/11 19:54
doliocoe is use of Eq, which they denote "s [Q : S = T>" in their OTT syntax.09/11 19:55
doliocoh is a similar operation with eq.09/11 19:55
dolioWhich... I'm not seeing their syntax for.09/11 19:56
dolioIn other papers it looks like a double-bar version of coe. "s [[ q : (s : S) = (t : T)>>" or something.09/11 19:56
dolioOr, wait, no, I'm wrong. coh is equivalent to "refl" in the usual propositional equality.09/11 19:57
dolioRoughly, at least. It says that coercing s : S by a proof Q : S = T gives equal terms.09/11 19:58
FunctorSaladhmmm are agda functions between agda setoids as expressive as functional relations between setoids?09/11 20:00
copumpkinwhere is the agda implementation of OTT they mention in the paper?09/11 20:07
FunctorSaladhow do you type this in agda? ⇨09/11 20:10
FunctorSaladnote the vertical line on the left09/11 20:10
dolioPast it in a buffer, move the cursor over it, and type C-u C-x =09/11 20:12
FunctorSaladthanks but that tells me the unicode code, not how to enter it with the agda input method09/11 20:14
dolioIf it has an agda input escape, it will tell it to you.09/11 20:16
dolioIf it doesn't that means you'll have to specify one.09/11 20:16
dolioThe info says "to input: type "\r" with Agda"09/11 20:17
dolioWhich, \r lets you select from a big list of arrow symbols.09/11 20:17
dolioNumber 7 on line 1 is the one you want.09/11 20:17
FunctorSaladah, my info doesn't say that :) thanks09/11 20:18
dolio⇨➲➳➱➫09/11 20:18
FunctorSaladby the way do you have your category theory development up somewhere?09/11 20:19
dolio09/11 20:19
dolioYeah. It's at code.haskell.org/~dolio/09/11 20:19
dolioIn the agda-share stuff.09/11 20:19
dolioI've been neglecting it for a while, though. I got distracted by other stuff.09/11 20:20
FunctorSaladmaybe one could make setoid reasoning nicer by proving that the category of agda setoids and functions has all the nice categorical properties09/11 20:20
FunctorSaladthen using these09/11 20:20
FunctorSalad(but I don't want to write down all the CT axioms yet again ;))09/11 20:21
copumpkinso in basic agda we can't prove that functions are equal?09/11 20:22
dolioYou can prove that some are equal.09/11 20:22
dolioYou can't prove two functions are equal by proving that they agree on all elements, though.09/11 20:23
copumpkincause if we wanted to make a category-extras for agda I'd imagine a fair number of the properties would involve function equal09/11 20:23
copumpkinity09/11 20:23
dolioYou can prove that, for instance, f . g == \x -> f (g x), though.09/11 20:24
dolioBecause the former normalizes to the latter.09/11 20:24
copumpkinyeah09/11 20:24
FunctorSaladeven if you could, the plain agda category doesn't have colimits09/11 20:24
FunctorSaladat least not obviously09/11 20:24
FunctorSaladbecause coequalisers are essentially quotient types09/11 20:24
dolioYeah.09/11 20:25
FunctorSaladOTOH, AgdaSetoid easily has them09/11 20:25
FunctorSaladmaybe it's even a topos09/11 20:26
dolioSeems plausible. NuPRL has extensional equality and quotients, and it's based on one of the Martin-Loef type theories.09/11 20:28
dolioAnd I've seen people over at n-category cafe talking about toposes in connection with Martin-Loef type theory.09/11 20:28
dolioAlthough, I don't really understand what any of that means.09/11 20:28
dolioEvery time I go to read about toposes on their wiki, I have to start reading 10 different articles on prerequisites to understand what half the words in the topos article mean.09/11 20:29
FunctorSaladthey let you interpret constructive higher-order logic in them09/11 20:30
dolioI should probably get a book or something. :)09/11 20:30
FunctorSalad(the subobject classifier gives you the ability to talk about "subsets", internally)09/11 20:31
FunctorSaladoh I just know them from one course too09/11 20:31
FunctorSaladyou've probably heard that simply-typed LC can be interpreted in cartesian closed categories?09/11 20:31
FunctorSaladit's an extension of that correspondence09/11 20:32
dolioYeah, I have a hazy understanding of all that.09/11 20:32
FunctorSaladwhat's also nice is that you can more or less define the category of sets as a topos with this-and-that extra property09/11 20:34
FunctorSaladand it's a first-order theory, even09/11 20:34
faxI think I understand OTT /less/ after doing this09/11 20:34
FunctorSalad(IIRC)09/11 20:35
fax:(09/11 20:43
faxalso what's the point if Prop can't have disjunctions in it09/11 20:43
-!- RichardO_ is now known as RichardO09/11 20:45
dolioProp gets erased.09/11 20:45
Saizanthe idea was that the equality witnesses were in Prop with no computational content so they don't get stuck during reduction, afaiu09/11 20:45
faxoh09/11 20:46
faxWell I got this far and I'm kind of baffled and giving up I think,  http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11991 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=1199209/11 20:52
FunctorSaladhmm Agsy says "no constructors found" for record types?09/11 20:53
FunctorSaladerr wait this isn't a record type09/11 20:54
FunctorSalador it is, but not the one I thought ;)09/11 20:54
copumpkinyay, my bug was fixed09/11 20:55
* copumpkin updates agda09/11 20:55
dolioI had to update, too.09/11 20:56
dolioI did a pull on the library, and it started using some "constructor" thing for records.09/11 20:56
faxlines 54 to 56 are quite nice though, I guess I learned /something/09/11 20:56
dolioYeah, typing out all the non-trivial/off-dialgonal cases and stuff isn't much fun.09/11 20:58
faxwell the most annoying thing is that I don't get what to do next09/11 20:58
faxor what any of it means09/11 20:59
copumpkindid the probability in agda guy disappear?09/11 20:59
copumpkindoes anyone remember his nick?09/11 20:59
dolioYou need another type for value equality.09/11 20:59
faxoh so I should prove JMeq_eq for this universe09/11 21:00
dolio(_:_)==(_:_) : (S : star) -> (s : [S]) -> (T : star) -> (t : [T]) -> square, or something like that.09/11 21:01
dolioWhich is backwards again, due to types having to precede values that depend on them.09/11 21:01
FunctorSalad"Cannot instantiate the metavariable _6 to carrier a since it09/11 21:02
FunctorSaladcontains the variable a which _6 cannot depend on"09/11 21:02
FunctorSalad:-(09/11 21:02
copumpkinFunctorSalad: what's the code?09/11 21:02
copumpkinbah09/11 21:03
copumpkinI still get an internal error on Data.Nat.Properties09/11 21:03
FunctorSaladcopumpkin: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11998#a1199809/11 21:03
faxdolio alright I will keep going then09/11 21:04
FunctorSaladI'm just trying to define Setoid &&&09/11 21:04
Saizancopumpkin: make clean?:)09/11 21:05
copumpkin*sigh* :)09/11 21:05
FunctorSaladok I gave a sig to _$_ and now I have a different error09/11 21:06
doliofax: Then you get to write the proof that (S : s)==(T : coerce s Q), which is probably about as fun to write as coerce was. :)09/11 21:06
FunctorSaladoh lol agda is right...09/11 21:07
faxNone of this makes sense09/11 21:07
FunctorSaladI gave the sig for source tupling, not target tupling09/11 21:07
FunctorSalad(|||)09/11 21:07
faxwhat do any of these proofs mean09/11 21:07
dolioThey're equality proofs that are definitional but still (hopefully) substitutive.09/11 21:08
dolioNot definitional, that is.09/11 21:08
FunctorSaladit would be cool if the emacs mode had a command "solve this goal in a new toplevel definition"09/11 21:10
FunctorSaladso you can pattern match09/11 21:10
FunctorSaladand it would copy the type of the whole over as a sig09/11 21:10
faxhow are they definitional?09/11 21:12
FunctorSaladarghl and why does the equality for setoid `a' get printed as `(a09/11 21:12
dolioThey're not definitional.09/11 21:12
FunctorSalad`(a ≈ x) j'09/11 21:12
FunctorSaladinstead of  x ≈ j09/11 21:12
dolioI thought I saw something about printing infix while pulling recently.09/11 21:13
FunctorSaladit does print infix, but in a silly way09/11 21:14
FunctorSalad(and I'm using the head)09/11 21:14
dolioThe former looks like _~~_ a x j, naively translated into infix.09/11 21:14
FunctorSaladyeah09/11 21:14
FunctorSaladI did `open Setoid'09/11 21:14
FunctorSaladmaybe that's unexpected09/11 21:14
FunctorSaladok without the open it prints prefix09/11 21:14
copumpkinafter cleaning, still get an internal error on Data.Nat.Properties :(09/11 21:15
dolioYou should be able to write something like "open module M {a} = Setoid a" to hide the a.09/11 21:15
dolioI don't know if that's the right syntax.09/11 21:15
dolioYou might want to report that, actually. It's still happening with an Agda built today.09/11 21:23
dolioThe ~~ thing, that is.09/11 21:23
copumpkindolio: does Data.Nat.Properties work for you?09/11 21:24
FunctorSaladdolio: hmm Setoid doesn't take a param09/11 21:26
FunctorSalad(the module)09/11 21:27
dolioSetoid is the module generated by the record of the same name, which always takes a particular record of that type as a parameter.09/11 21:27
FunctorSaladah, right09/11 21:29
FunctorSaladhmm is setoid function composition in the library already?09/11 21:29
doliocopumpkin: Yes, it appears to have loaded after about 5 minutes.09/11 21:29
FunctorSaladoh no doesn't seem like it is09/11 21:30
copumpkinhmm, I wonder what's wrong with mine then09/11 21:31
FunctorSaladshould I darcs send such stuff to AgdaLib?09/11 21:32
dolioI don't know. With something that takes 5 minutes, it's probably close to blowing up, so differences in our machines might be relevant.09/11 21:32
copumpkinoh well it might have had to compile several dependencies09/11 21:33
copumpkinnormally the first time I load some modules from the std lib, it takes ages and ages09/11 21:33
dolioHold on, let me remove the .agdais and try again.09/11 21:34
copumpkinI think my problem was that I had an old version of agda-mode?09/11 21:35
copumpkinnot sure if that gets installed along with everything else09/11 21:35
copumpkinI've cleaned out my old agdas etc. and am compiling again09/11 21:35
* copumpkin drinks some warm cider as he waits09/11 21:36
dolioYep, still worked.09/11 21:39
copumpkinI probably just had some stale files lying around09/11 21:39
copumpkinGAH09/11 21:43
copumpkinhttp://code.haskell.org/Agda/src/full/Agda/TypeChecking/Substitute.hs09/11 21:46
copumpkinline 53, it still has the __IMPOSSIBLE__ line that crashed before09/11 21:46
copumpkinI guess the fix was to prevent one from reaching that point in the first place09/11 21:51
copumpkinbut somehow I still get there09/11 21:51
copumpkingonna wipe my local copy of the repo and get it again09/11 21:54
dolioYes, the point of the __IMPOSSIBLE__ is that it's actually supposed to be impossible.09/11 22:06
dolioThe bug is that it wasn't actually impossible, not that it shouldn't actually be impossible.09/11 22:07
copumpkinyeah09/11 22:07
FunctorSaladhmm do we really want to have products defined as a special case of Σ?09/11 22:10
FunctorSaladseems to break type inference09/11 22:10
copumpkinhow?09/11 22:10
copumpkinwith the const function for the second type?09/11 22:11
FunctorSaladI got lots of yellow stuff containing sigmas in things that seem obvious09/11 22:11
Saizani only had problems with \Sigma being a data instead of a record, so far09/11 22:11
copumpkinI think I know what was wrong09/11 22:12
copumpkinwith my agda09/11 22:12
FunctorSaladcopumpkin: yes it's defined with const now09/11 22:12
copumpkineven after cabal clean, it didn't clean agda-mode09/11 22:12
copumpkinoh, nope09/11 22:12
copumpkinit's still got the bug09/11 22:12
* copumpkin sighs09/11 22:12
copumpkindolio: sorry to bug, but do you think you could try http://hpaste.org/fastcgi/hpaste.fcgi/view?id=12004#a12004 on your agda?09/11 22:17
stevancopumpkin: i just updated everything and that code works for me. i also tried loading the whole data.nat.properties module, and that works as well.09/11 22:49
copumpkinand you're using the latest stdlib too?09/11 22:49
stevanyes09/11 22:49
copumpkinwell then, I'm stumped :)09/11 22:50
copumpkinoh, maybe I still have a broken .agdai file lying arond09/11 22:50
copumpkinyep, that was it :)09/11 22:51
copumpkinI guess the .agdai still had impossibilities floating around in them from my earlier agda09/11 22:51
stevan:-)09/11 22:52
copumpkinyay09/11 22:52
copumpkinnow I can stop rewriting proofs that I need that are already in the std lib09/11 22:53
FunctorSaladis there some shortcut to obtain the refl etc. of a setoid?09/11 22:54
copumpkinopen the module?09/11 22:54
FunctorSaladah the equivalence09/11 22:56
doliocopumpkin: Yes, that works.09/11 23:00
copumpkindolio: yeah, I found that my isue was stale and impossible .agdai files09/11 23:01
dolioAh.09/11 23:01
copumpkinthanks for checking09/11 23:01
dolioMy seconds of work all for nothing!09/11 23:01
copumpkinI'll dedicate my proof of 0==1 to you to make up for it09/11 23:02
Saizanhow romantic09/11 23:03
FunctorSaladah now I've reached the OOM-point too09/11 23:23
dolioDoing what?09/11 23:32
FunctorSaladdoing pullbacks for AgdaSetoid cat09/11 23:35
FunctorSalad(the universal property)09/11 23:36
FunctorSaladmaybe Σs are at fault? dunno09/11 23:36
--- Day changed Tue Nov 10 2009
copumpkinso I can't prove that Data.List.map f (toList v) == toList (Data.Vec.map f v) ?10/11 00:05
copumpkinI can only do it for specific lists, I guess10/11 00:06
Saizanv is?10/11 00:14
copumpkina vector10/11 00:14
Saizanit seems like you should be able to, by induction10/11 00:15
copumpkinyeah, I'm almost done with the proof10/11 00:15
stevanplease paste it when you are done, i'd like to see it :-).10/11 00:24
copumpkinoh, the list proof?10/11 00:25
stevanyea10/11 00:25
copumpkinnot even using it now, but here :) http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=4881#a488110/11 00:25
Saizani think that basically says toList is a natural transformation, right?10/11 00:26
copumpkinthat sounds about right10/11 00:26
stevani figured it would be trickier10/11 00:26
copumpkinyeah :)10/11 00:27
copumpkinexpressing it as composition might be harder?10/11 00:27
copumpkin / impossible?10/11 00:27
copumpkindunno10/11 00:27
Saizanprobably impossible, yeah10/11 00:27
copumpkinhow do I use sequence in http://www.cs.nott.ac.uk/~nad/listings/lib/Data.List.html#4009 ?10/11 00:37
copumpkinoh, I got it10/11 00:39
Saizansequence monad xs <- eww10/11 00:40
copumpkinyeah :)10/11 00:41
copumpkinbut at least we can specify multiple monads10/11 00:41
Saizanit'd be nice if you could get agda to splice in the source the arguments it inferred, i've some _ that i'm too lazy to write out but that would improve readability10/11 01:20
dolioYeah, Monadic should probably be exported instead.10/11 01:25
dolioSo you could "open Monadic M" and then write "sequence xs".10/11 01:25
copumpkinyeah10/11 01:27
dolioWow, Data.String has some serious stuff in it, apparently.10/11 01:49
dolioMan, Fin should have a decidable equality operator...10/11 02:01
copumpkinwe need an agda facebook group!10/11 05:10
dolioHave you done any work on rationals? I was thinking of trying to flesh it out and send a patch.10/11 05:19
copumpkinoh, I did a bit more but in NAD's email he also mentioned that someone had worked on rationals for some project with a professor and patches were going to get merged into the std lib in the near future10/11 05:20
copumpkinso I figured I'd wait and see10/11 05:20
dolioAh, cool.10/11 05:20
dolioAnyone know how to add to the input codes in .emacs instead of customizing variables?10/11 16:20
dolioI'd like to add a bunch of characters, and i"m not wild about clicking around in the emacs interface a hundred times.10/11 16:21
faxhi byorgey10/11 16:53
byorgeyhey fax10/11 17:07
faxdid  you make any progress with your universe? (on haskell-cafe)10/11 17:07
byorgeyno, no one has responded yet10/11 17:08
byorgeyI'm quite aware I can do what I want very easily in Agda =)10/11 17:08
faxWell I don't think that Mu can happily live inside U10/11 17:08
byorgeyyeah...10/11 17:09
byorgeyis there a different way I could approach the problem?10/11 17:09
faxyou might consider a universe with one variable, and then  enum :: U f -> [Mu f],   but this has its own problems too10/11 17:09
faxWhat is this for?10/11 17:10
byorgeygenerally this is for my combinatorial species library10/11 17:10
faxhm :S10/11 17:10
faxI don't know what that even is10/11 17:10
Saizan_hah, oleg responded10/11 17:10
byorgeyand I really need it to be in Haskell because the whole point is to have a Haskell library that can actually be used by other Haskell programs10/11 17:11
byorgeySaizan_: sweet, I was hoping he would =)10/11 17:11
faxI've not said anything to do with Agda10/11 17:11
byorgeyI know, but we're talking in the Agda channel =)10/11 17:13
* byorgey goes off to spend an hour grokking oleg's message10/11 17:14
byorgeydolio: I have something like this: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=12013#a1201310/11 17:16
byorgeyI cargo-culted it from somewhere else, but maybe it's useful =)10/11 17:16
faxwell tell me if you want to talk about it more at any point10/11 17:17
byorgeyok, thanks10/11 17:19
byorgeyfax: if you want to know about my combinatorial species library, see http://byorgey.wordpress.com/2009/07/24/introducing-math-combinatorics-species/ and following posts10/11 17:20
faxyeah it is interesting because I am studying generating-functionology but obviously I don't know this stuff yet10/11 17:21
faxPutting Mu in the universe is strange because that lets you make nested fixed points: But afaict there's now way to access these10/11 17:26
faxso you're getting like   mu X. 1 + (mu Y. ... < no way to talk about X or Y? >)10/11 17:26
faxso you defined a universe of species so that, well why? the typeclasses seem to worka no?10/11 17:39
Saizan_ah, he basically uses List as a "functor pointer", though there's a double definition for it..10/11 17:39
Saizan_it seems you could do without U and have enumShapes be a typeclass method10/11 17:42
faxI must be wrong about Mu - but I don't get see what Mu you /do/ want in there10/11 17:51
byorgeySaizan_: in this case, yes, you could, but then you just get a shallow embedding10/11 17:54
byorgeySaizan_: in my real use case I want to be able to inspect and transform the expressions themselves10/11 17:55
Saizan_byorgey: ah, k10/11 17:55
Saizan_i suspected so10/11 17:55
byorgeyfax: I'm not sure what you mean.10/11 17:56
faxwell the diagrams in your posts are very familiar and nice but there isn't one for Mu10/11 17:56
byorgeyyes, I haven't written about recursively defined species in my blog posts yet10/11 17:57
dolioWhat's wrong with nested fixed points?10/11 17:57
dolioRose trees are a nested fixed point.10/11 17:57
byorgeythere's nothing wrong with nested fixed points.  rather, I don't want there to be anything wrong with nested fixed points.10/11 17:58
doliomu T. mu L. 1 + T * L10/11 17:58
faxdoes the species Mu go by any other name? http://en.wikipedia.org/wiki/Combinatorial_species10/11 17:58
byorgeyindeed.10/11 17:58
byorgeyMu is not a species, it is a species operator.10/11 17:58
faxdolio: with the U posted on haskell-cafe, there is no way to reference 'T' or 'L'10/11 17:58
byorgeyfax: are you talking about my message or oleg's?10/11 17:59
faxbyorgey well there is multiplication addiiton differentation composition on that page.. any one that relates to the Mu you mean?10/11 17:59
faxyours10/11 17:59
byorgeyfax: the problem is that combinatorists are not particularly interested in building up a language of expressions to denote recursive species.10/11 18:00
byorgeyif they want to reference a recursive species they just say 'the species T such that T = 1 + X * T^2'10/11 18:01
faxso Mu doesn't have nice theory?10/11 18:01
byorgeyfax: it has a perfectly fine theory, I just don't know a good way to express it in Haskell.10/11 18:01
byorgeyI want to say  T = mu t. 1 + x* t^210/11 18:02
byorgeybut I need a way to reflect it at the type level as well, since the output type of a function to generate structures of a certain species depends on the species input.10/11 18:03
dolioType-level De Bruijn indices?10/11 18:03
dolioNot that that sounds nice.10/11 18:03
byorgeydolio: I've tried that.  It could possibly be made to work.10/11 18:04
byorgeybut it isn't very nice.10/11 18:04
dolioThinking back on functor versions, I guess the issue is that they tend to stick to a single fixed point operator.10/11 18:05
dolioSo you need one that adds a parameter.10/11 18:05
byorgeyyeah.  If only haskell had polymorphic kinds...10/11 18:06
byorgeyI guess what I REALLY want is to be able to write mixed Haskell + Agda code10/11 18:07
byorgeywith some sort of contracts/dynamic type stuff at the interface10/11 18:07
doliohttp://code.haskell.org/~dolio/agda-share/html/Regular.html10/11 18:08
dolioSomething like that.10/11 18:08
dolioWhich I translated from 'The Derivative of a Regular Type ...', I believe.10/11 18:08
byorgeyyes, exactly10/11 18:09
dolioActually, that's more the De Bruijn solution, I guess.10/11 18:09
byorgeyyeah, I wonder if you can do something similar in Agda using HOAS.10/11 18:14
faxwhy is it type indexed?10/11 18:19
fax(in the haskell)10/11 18:19
faxseems like if you don't index it then the problem goes away10/11 18:22
faxhad read through all the haskell code not sure why it is type indexed ...10/11 18:24
faxAll the equations like "T = 1 + X * T^2" have a solution?10/11 18:33
Saizan_fax: it's type indexed so e.g. the result type of enumShapes can depend on the argument10/11 18:37
Saizan_you'd have to use an existential otherwise10/11 18:37
byorgeyfax: re: type indexing, what Saizan_ said.  And no, some equations don't have solutions.  But I'm perfectly happy having those denote _|_.10/11 18:41
byorgeyheh, I just realized I made a silly mistake in enumShapes =)10/11 18:45
byorgeythat's ok, it's not the point10/11 18:45
faxseem like the typeclasses deal with the typing issues for things like enumShapes10/11 19:03
dolioSo, attempting to write a system of functors that let you use multiple fixed points, it's coming out a lot like De Bruijn indices...10/11 19:04
faxoh well I must just not get it10/11 19:08
Saizan_fax: the problem is needing both features, manipulating these species as terms and also writing functions with "dependent" types on them, the first is given by the constructors the second by the indexing.10/11 19:31
faxSaizan why not just do it all in an untyped way? (i.e. not-indexed)10/11 19:31
Saizan_which type do you give to enumShapes?10/11 19:32
faxif you want to generate a list [a] from a Species a you just do a dynamic check that the species has the right type.10/11 19:32
faxSomething like  Typeable a => Species -> [a]10/11 19:32
faxMaybe [a]10/11 19:32
Saizan_well, that's quite against my taste, but we'd have to see the larger use case to tell how well it'd fit10/11 19:34
faxSaizan if you look at the library it is using dynamic types all over: That is why I this indexed U thing sticks out10/11 19:35
faxas unusual10/11 19:35
faxthats funny how it always happens10/11 21:03
faxyou read about something then it comes up in a Zeilberger paper (species)10/11 21:04
--- Day changed Wed Nov 11 2009
Svrogis there an example somewhere of importing Int from haskell into agda?11/11 14:12
-!- seanmcl_ is now known as seanmcl11/11 16:58
--- Log closed Wed Nov 11 19:54:01 2009
--- Log opened Wed Nov 11 19:54:09 2009
-!- Irssi: #agda: Total of 19 nicks [0 ops, 0 halfops, 0 voices, 19 normal]11/11 19:54
-!- You're now known as Laney11/11 19:54
-!- Irssi: Join to #agda was synced in 106 secs11/11 19:55
-!- pumpkin is now known as copumpkin11/11 20:17
-!- ksf_ is now known as ksf11/11 20:49
sinelawcan Agda encode things like type class laws? for example for monoid, functor, etc...11/11 21:20
copumpkinsure11/11 21:20
copumpkinbut it doesn't have typeclasses themselves11/11 21:20
copumpkinyou can approximate them with records, but you don't get the automatic search for instances11/11 21:20
copumpkinwhich is both bad and good11/11 21:21
sinelaw"bood"11/11 21:21
copumpkinand some laws may be a little more painful than they should be11/11 21:21
copumpkin:)11/11 21:21
sinelawok11/11 21:21
faxwhat do you mean 'type class laws'11/11 21:21
sinelawfax, like associativity for monoid's operation11/11 21:21
copumpkinthe stuff that is relegated to documentation in haskell11/11 21:22
sinelawand left/right identity for 011/11 21:22
faxoh yes you can do that and prove then too sometimes11/11 21:22
--- Day changed Thu Nov 12 2009
-!- mbrock is now known as mikael12/11 00:52
FunctorSalad_copumpkin: is there anything good about not having a global registry, for *properties*?12/11 02:47
FunctorSalad_since for properties it doesn't matter which proof you find12/11 02:48
copumpkinnot sure :) I'd like it12/11 02:48
FunctorSalad_automation for great justice12/11 02:49
-!- copumpkin is now known as ToposTartare12/11 03:37
-!- ksf is now known as MonadRagout12/11 03:43
* Saizan_ wants a monad solver12/11 05:51
ToposTartare:o12/11 05:54
Saizan_i've to prove "(f . g) =<< m = f =<< fmap g m" and i'm feeling lazy :)12/11 06:06
ToposTartarewith an implicit input I guess?12/11 06:11
Saizan_implicit input?12/11 06:15
ToposTartareoh nevermind :)12/11 06:16
ToposTartaresomehow I read that as kleisli composition12/11 06:16
ToposTartarewhich obviously wouldn't work with the types12/11 06:17
ToposTartareso you're doing some CT in agda too?12/11 06:17
ToposTartareseems all you need is the definition of =<< and the fmap-fusion property12/11 06:20
ToposTartare==>  m >>= (f . g)  ==>  join (fmap (f . g) m)  ==>  join (fmap f (fmap g m))  ==>  fmap g m >>= f12/11 06:21
Saizan_i'm still writing down that proof of unification, but since substitions are kleisli arrows for the term monad i occasionally need such lemmas12/11 06:23
-!- ToposTartare is now known as copumpkin12/11 07:08
Svrogis there a way to write this so it doesn't trigger a termination checking failure?12/11 11:17
Svroghttp://hpaste.org/fastcgi/hpaste.fcgi/view?id=1207312/11 11:17
yakov hello12/11 12:28
Svroghi12/11 12:32
-!- opdolio is now known as dolio12/11 18:07
faxknow any good intro texts on species theory which are online?12/11 18:49
faxIn this part of the OTT paper (page 7)  coh : (S : ‘set’)(T : ‘set’)(Q : [[ ⌈Eq S T ⌉ ]] )(s : [[ S ]]) -> eq S s T (coe S T Q s)12/11 19:41
faxdoes that eq mean JMeq : (A : Set) -> A -> (B : Set) -> B -> Set, or is there a missing  [[ ⌈ ... ⌉ ]] around it?12/11 19:41
faxwe shold have an OTT study group12/11 19:55
copumpkin:)12/11 19:56
dolioWhat's JMeq?12/11 19:59
faxthe constructor is refl : JMeq A a A a12/11 20:02
dolioThe built-in equality?12/11 20:02
dolioThen no.12/11 20:02
faxoh sorry no12/11 20:02
faxIn my file it has a different definition12/11 20:03
dolioIt's the value equality that's being defined.12/11 20:03
faxJMeq : (A : ★) -> ⟦ A ⟧ -> (B : ★) -> ⟦ B ⟧ -> □12/11 20:03
faxJMeq ‘0’ _ ‘0’ _ = ‘⊤’12/11 20:03
faxJMeq ‘1’ _ ‘1’ _ = ‘⊤’12/11 20:03
faxetc12/11 20:03
dolioYes, that one, I think.12/11 20:03
faxso I have the type,  coh : (S T : ★) -> (Q : Prf (Eq S T)) -> (s : ⟦ S ⟧) -> Prf (JMeq S s T (coe S T Q s))12/11 20:03
fax(Prf P = [[ ⌈ ... ⌉ ]])12/11 20:04
dolioDoes it need the Prf?12/11 20:04
faxwell □ isn't a sort12/11 20:05
faxit's a type that is a sort in the object language12/11 20:05
dolioOh, right.12/11 20:06
faxso I'm supposing a typo/omission in the paper I guess12/11 20:07
dolioWait, isn't 'prop' an Agda datatype in the paper?12/11 20:08
faxyes I called mine □ instead of 'prop' though12/11 20:08
faxso instead of  data 'prop' where 'T' : 'prop'   I wrote  data □ where 'T' : □12/11 20:09
dolioOh, right, so depending on S s T ... that last part might be "-> '\top'", and '\top' isn't a type.12/11 20:10
faxyeah12/11 20:10
dolioYeah, I guess it's an omission.12/11 20:10
dolioKind of weird considering you'd think they'd machine checked the code in the paper.12/11 20:14
dolioI thought I had some papers on species, too, but I don't think I'll ever find them.12/11 20:19
faxthe thing is I am typing this stuff out and it checks but I don't really have a clue what it means12/11 21:46
fax(yet?)12/11 21:46
dolioDoes that paper give the definition of the natural numbers in the theory?12/11 21:51
faxyes (well let me double check)12/11 21:52
dolioYou could try proving that '(\i j k -> i + (j + k)) = (\i j k -> (i + j) + k)' when you're done.12/11 21:52
faxyet it is given here12/11 21:52
faxTr b |--> If b Then 1 Else 012/11 21:53
faxNat |--> W (b : 2), Tr b12/11 21:53
dolioYou can't prove the above in Agda, for instance.12/11 21:53
faxwell it's a bit hard to prove something like that12/11 21:53
faxI don't know how to even state it12/11 21:54
faxThere is a proof of Induction in here for example12/11 21:54
dolioeq (Nat -> Nat -> Nat -> Nat) (\i j k -> i + (j + k)) (Nat -> ...) (\i j ...)12/11 21:54
dolioOr something like that.12/11 21:55
dolioI guess it won't be Agda's function space you use.12/11 21:55
faxyes but that's what's confusing me12/11 21:55
faxwell hm12/11 21:56
faxin the .agda file they use a mixture of Agdas arrow and the OTT arrow (which is defined in terms of the OTT forall/Pi)12/11 21:56
faxbut the interpretation of Pi is  just the Agda Pi...12/11 21:57
faxso now we are back to square one12/11 21:57
dolioYes, well, the point of implementing it in Agda is that you can interpret it into Agda terms, thereby proving that OTT is strongly normalizing (assuming Agda is).12/11 21:58
faxWell I undesrtand that knowing an arrow came from the OTT universe tells you something about what that arrow can be12/11 22:00
faxthis is the same principle we might use to give a type theory impl. of free-theorems12/11 22:00
faxalso I don't see the quotation in either of the files12/11 22:19
dolioQuotation?12/11 22:19
faxsection 6. Type-Directed Quotation does the usual type directed fun12/11 22:20
faxbut again how this relates to anything else - I don't see12/11 22:20
dolioEvidently it encodes proof irrelevance.12/11 22:30
dolioSomehow.12/11 22:30
dolioWhich, I think I saw an "irr" in one of those OTT files.12/11 22:31
faxyeah he does prove irr,  so I guess later they are just adding irr into the definitional equality then12/11 22:32
fax(as well as eta expansion)12/11 22:32
dolioYeah.12/11 22:32
faxwhat about implementing OTT as a standalone thing, could we write programs and proofs in that?12/11 22:33
dolioWhat do you mean?12/11 22:33
faxrather than embedding in Agda12/11 22:33
dolioThat's what Epigram 2 is supposed to be.12/11 22:34
dolioAt least OTT is (part of) the core theory.12/11 22:34
faxI don't really have an intuition what it would be like to program in OTT12/11 22:34
faxand prove12/11 22:34
faxIt is not clear what exactly the definitional equality is, that allows you to prove things like extentionality12/11 22:35
dolioYou wouldn't use the definitional equality for proving most things. You'd use the eq equality.12/11 22:35
dolioBecause eq is substitutive.12/11 22:35
dolioThat's the problem with using setoids. You don't get "a ~= b -> P a -> P b".12/11 22:37
dolioBut, with the observational equality, you do.12/11 22:37
dolioAt least, I think that's the point.12/11 22:37
dolioLike, Saizan's unification proof. The predicates had to be encoded with an extra part that said they respected the extensional equality being used.12/11 22:39
dolioBecause only for the definitional equality (and the == type you can build on it) does that hold. However, in OTT, there's the observational equality that that also hold for.12/11 22:40
dolioAnd the observational equality is extensional, just like you'd want it.12/11 22:40
dolioBe back in a while.12/11 22:45
faxman this is ridiculous12/11 22:46
faxyou can't have ALL the good things12/11 22:46
faxalright it seems to be based on www.cs.nott.ac.uk/~txa/publ/lics99.pdf12/11 23:02
faxso an inductive recursive universe in agda (or similar) corresponds to 'category with family'12/11 23:20
faxthe definitional equality of OTT is the same as the type theory you implement it in, but more terms are provably equal *in agda* -- so you can add these as axioms to OTT?12/11 23:37
faxthat doesn't seem to fit together correctly because if you added them as axioms to OTT wouldn't that ruin canonical forms?12/11 23:38
--- Day changed Fri Nov 13 2009
faxacutally maybe it's not an omission there is a similar kind of thing earlier on13/11 00:38
dolioI don't know. Conceptually one would think of 'prop' as being an actual sort in the language, so perhaps they go back and forth, depending on what they're talking about at the time.13/11 00:45
faxyeah that sounds like it could be what's happening13/11 00:46
faxI'm not quite sure if I can get the correct reduction instide the agda model of OTT13/11 00:52
dolioI suspect you'll have to manually insert 'irr' in places, at the least.13/11 00:53
fax(because of the quotations stuff on page 10)13/11 00:53
faxlike.. I just want an OTT typechecker to try things in :p13/11 01:30
faxstarting agin http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11992#a1210513/11 01:38
-!- FunctorSalad is now known as hydromoron13/11 03:15
-!- hydromoron is now known as FunctorSalad13/11 03:28
-!- ksf is now known as ComonadDessert13/11 03:51
-!- ksf_ is now known as ksf13/11 12:48
faxwhats everyone doing with agda?13/11 17:25
Saizan_had not much time to hack lately, i still have to finish up the unification proof13/11 17:34
Saizan_did you complete OTT?13/11 17:34
faxno I restarted though13/11 17:35
faxthe biggest problem is that what I am writing does not mean anything to me13/11 17:35
Saizan_heh13/11 17:36
faxI think when they write out the type rules of OTT,  they are just giving them as axioms really13/11 17:44
faxbut then you actually prove that they hold for you OTT model inside agda13/11 17:44
faxalthough the biggest thing confusing me right now is where exactly the quotation comes into it13/11 17:46
faxseem to have written something that agda loops while trying to typecheck :/13/11 17:56
faxf : Set ; f = f13/11 17:57
faxp : f ; p = _13/11 17:57
Saizan_ouch13/11 18:50
dolioYes, don't put pink things in types unless you're sure they terminate.13/11 19:28
Saizan_i thought the typechecker wouldn't try to reduce terms it doesn't know they are strong normalizing13/11 19:31
dolioWell, I haven't done it in a while, but it used to just go for it.13/11 19:31
faxthere's a lot of {! !}13/11 19:37
faxin the ott files from Conor13/11 19:37
faxhttp://sneezy.cs.nott.ac.uk/darcs/JOTT/13/11 19:37
faxwhy?13/11 19:38
copumpkinholes he didn't have time to fill in?13/11 19:39
copumpkin"exercise left to reader"13/11 19:39
faxno I don't think so ...13/11 19:41
-!- whoppix_ is now known as whoppix13/11 20:47
--- Day changed Sat Nov 14 2009
Eduard_MunteanuHi.14/11 00:37
copumpkinhi14/11 00:38
copumpkinhmm,14/11 00:39
copumpkindata True : Set where   -- Here it would make sense to declare True to be a14/11 00:39
copumpkin  tt : True             -- Prop (the universe of propositions) rather than a14/11 00:39
copumpkin                        -- Set. See 'Introduction.Universes' for more14/11 00:39
copumpkin                        -- information.14/11 00:39
copumpkinthere's a universe of Propositions?14/11 00:39
tavelramso how many (other than me) were screening in #haskell and joined here?14/11 00:39
dolioJust you.14/11 00:40
Eduard_MunteanuAnd me.14/11 00:40
faxscreening??14/11 00:40
dolioWell, obviously. :)14/11 00:40
tavelramoh, off.14/11 00:40
tavelramodd14/11 00:40
tavelramEduard_Munteanu, but you werent screening :p14/11 00:40
faxWell I don't think Prop is implemented properly yet14/11 00:40
tavelramfax, just reading the channel silently.14/11 00:40
dolioAgda's Prop?14/11 00:40
copumpkinoh, but it exists?14/11 00:40
faxbut it is better for proofs to be in Prop14/11 00:40
Eduard_Munteanutavelram, I don't understand the meaning of "screening"... ?14/11 00:41
dolioIt isn't proof irrelevant, if that's what you mean.14/11 00:41
faxthat way you don't have to care about whether p and q are equal, they just are (if p, q : P with P : Prop)14/11 00:41
dolioThey even eliminated the --proof-irrelevance flag.14/11 00:41
faxdolio yeah that's what I mean about not implemented properly14/11 00:41
Eduard_Munteanutavelram, nvm, I see now.14/11 00:41
copumpkinI remember someone complaining about the lack of Prop in agda, so assumed it was actually absent :)14/11 00:41
tavelram:)14/11 00:41
faxhey what about inductives in Prop in OTT?14/11 00:41
dolioI don't know. But inductive props seem nice.14/11 00:42
tavelramI actually felt the need for agda the other day, when I got an assignment about block ciphers with size 96...14/11 00:42
faxyes they are very important especially Acc14/11 00:42
faxand Equality14/11 00:42
dolioEquality?14/11 00:43
fax=14/11 00:43
copumpkintavelram: you can do that in haskell too14/11 00:43
faxit's good in Prop. Since it only has on constructor you can eliminate into Set with it14/11 00:43
dolioSomething other than the one that all the OTT papers are about?14/11 00:43
Eduard_MunteanuI'm curious... are there any plans to merge/implement concepts from Agda back into Haskell? They seem to complement each other pretty well.14/11 00:43
fax(in theory... of course none of this works in Agda)14/11 00:43
tavelramcopumpkin, yeah of course :)14/11 00:43
faxdolio just data _=_ : ... -> Prop where ...14/11 00:44
copumpkinEduard_Munteanu: I don't think they'd really "fit" back into haskell14/11 00:44
faxEduard_Munteanu: yeah look up Conor McBrides 'She'14/11 00:44
dolio"where refl : x = x"?14/11 00:44
faxyes dolio14/11 00:44
Eduard_Munteanucopumpkin, I read some ml threads and it seemed feasible to make Haskell total. There were some proposals regarding dependent types.14/11 00:44
faxmaking haskell total would ruin it14/11 00:45
dolioThe entire point of OTT is to not use that one, because it's less useful than the observable equality.14/11 00:45
faxdolio oh really!14/11 00:45
faxI had not ppicked that up14/11 00:45
dolioI think so.14/11 00:45
Eduard_Munteanufax, will look it up.14/11 00:45
faxso you are given equality as an axiom?14/11 00:45
Eduard_Munteanufax, optionally total I meant!14/11 00:45
faxrather than as a type14/11 00:45
copumpkinEduard_Munteanu: half the fun of haskell is the ease of doing crazy things like infinity = fix S14/11 00:46
dolioIt's a built-in type of some sort.14/11 00:46
dolioJust like Pi is built-in.14/11 00:46
copumpkinEduard_Munteanu: having to deal with convincing the compiler that our corecursion is safe would be quite burdensome14/11 00:46
copumpkinEduard_Munteanu: and of course you have the issue of type inference14/11 00:46
Eduard_MunteanuYeah, but think about it, monads and purity are a nuisance as well for beginners. Separating data and codata adds more safety.14/11 00:47
faxdolio well that's a bit odd why can't I define = as data? If that works badly then isn't every inductive family I define going to have similar problems?14/11 00:47
dolioAnd the observable equality is defined for all the other types built in to the core language (0, 1, 2, Pi, Sigma, W), and all (co)inductive definitions are defined in terms of those core types.14/11 00:47
copumpkinEduard_Munteanu: but what about all our trivial one-liners for fibonacci numbers and primes?!?14/11 00:48
copumpkin:P14/11 00:48
dolioSo observable equality is automatically defined for every type you write.14/11 00:48
Eduard_Munteanucopumpkin, I wasn't proposing making Haskell strictly total. But it should enforce totality if instructed so :)14/11 00:48
faxdolio oh yeah of course :)14/11 00:48
Eduard_Munteanufax, that's her? http://strictlypositive.org/14/11 00:49
copumpkinit's a he :)14/11 00:49
dolioEvery inductive family, too, apparently. I've never been able to get through the literature on containers, though.14/11 00:49
Eduard_Munteanucopumpkin, < fax> Eduard_Munteanu: yeah look up Conor McBrides 'She'14/11 00:49
dolioThey start talking about coends and kan extensions right off the bat, and I get lost.14/11 00:49
copumpkinEduard_Munteanu: it's an awkwardly named preprocessor for haskell called SHE, for strathclyde haskell enhancement :P14/11 00:50
Eduard_Munteanucopumpkin, lol :))14/11 00:50
copumpkinhttp://personal.cis.strath.ac.uk/~conor/pub/she/14/11 00:50
Eduard_Munteanucopumpkin, thanks.14/11 00:50
copumpkinI expanded on one of his examples of usage in haskell, let me dig it up for you14/11 00:51
Saizan_how'd you prove (n m : ℕ) -> n ≡ m + n -> m ≡ 0 ? it seems trivial but i'm stumped if i try a simple induction14/11 01:56
Saizan_i guess i should use the fact that (+ n) is injective14/11 01:57
faxSaizan just subtract n from both sides14/11 01:58
faxn - n = 0, m + n - n = m14/11 01:58
Saizan_heh, yeah, the inverse :)14/11 01:59
Saizan_now, i should find an inverse for my real case14/11 01:59
faxtaht is, apply   a = b -> f a = f b,  with f x = x - n14/11 01:59
faxwell you can't have inverse in N14/11 01:59
faxbut you can do subtraction14/11 01:59
faxwhat objects and operations in the real situation?14/11 02:00
faxsupposing this can't apply14/11 02:00
Saizan_∀{m} (t : Term m) ps -> t ≡ ps ⊹ t -> ps ≡ []14/11 02:03
Saizan_where ps : List (Step m), and it's a context for the Term zipper14/11 02:03
Saizan_ps ⊹ t constructs a Term with t in the hole of the context14/11 02:03
faxoh god I have no clue14/11 02:03
faxcan you show the definitions?14/11 02:04
Saizan_oh, i didn't see the proof is given in the paper, it should be easier :)14/11 02:04
Saizan_http://hpaste.org/fastcgi/hpaste.fcgi/view?id=12128#a12128 <- these are the definitions14/11 02:05
faxSaizan in this case I would use a size measure14/11 02:06
faxsize : Term m -> N14/11 02:06
faxthen I think you can show that size (ps ⊹ t) = size t -> ps = [] by induction on ps14/11 02:07
faxmaybe the papers got a better proof of course14/11 02:07
faxthat's just my intuition on it14/11 02:07
Saizan_i was considering something like that too14/11 02:09
faxwell I guess when you look at it, really you're proving acylicity14/11 02:11
faxi.e. t <> F t (if F is some series of constructors ending in t)14/11 02:11
fax(and the size measure works for this case, but not if Term had the funny kind of induction  X : (A -> Term x) -> Term y14/11 02:13
faxthe other way to prove Acyclicity I know about is what they use in Contructions on Constructions with Below14/11 02:13
faxI never used that technique though14/11 02:14
* fax has spent about an hour (maybe more) trying to prove 2 <> 0 :(14/11 02:16
Saizan_if you've s fork t ≡ (xs ⊹ (s fork t)) fork y, how do you extract s ≡ (xs ⊹ (s fork t)), given that fork is a constructor?14/11 02:16
faxthat's injectivity14/11 02:17
faxyou can do that by making a function that behaves in this way:14/11 02:17
faxf (x fork _) = x14/11 02:17
Saizan_oh, sure14/11 02:17
faxwhat could it do for all the rest of the terms?  Well it doesn't really matter,  just have it return any value of the correct type14/11 02:17
faxf _ = y  -- completes the _local_ definition14/11 02:17
faxyou must define it in that scope so you actually have such a term, even though it's not used.14/11 02:18
faxThis is maybe a bit of a ugly hack at first: But don't worry because it's shorter than the 'nice' way :P14/11 02:18
fax(nice way is also in Constructions On Constructions but covered better in Eliminating Dependent Pattern Matching)14/11 02:19
dolioWow, this OTT stuff is tedious.14/11 02:35
faxhow do you mean?14/11 02:36
faxwith the off diagonal cases?14/11 02:36
dolioYeah.14/11 02:36
dolioI'm going through symmetry now.14/11 02:36
faxyeah it'd be cool having a thing (like Epigram editor I guess) that writes all the cases out so you can fill in the details14/11 02:37
dolioWell, you can get the agda mode to expand the cases for you with C-c C-c.14/11 02:38
dolioBut it's still tedious.14/11 02:38
faxoh cool I didn't know that14/11 02:38
copumpkinhow does that bit work?14/11 02:39
Saizan_i've reduced the think to "xs ++ left t ∷ [] ≡ []", now i've to do induction on xs to show that's impossible?:)14/11 02:39
copumpkinoh I see14/11 02:40
copumpkinvery neat14/11 02:40
faxyou could produce a function  f [] = 0 ; f _ = 1  and by induction on xs reduce to  1 = 014/11 02:42
faxmaybe even f [] = True ; f _ = False14/11 02:42
faxthat is more direct14/11 02:42
faxbut then again agda can discriminate the 1 = 0 version so not much difference14/11 02:43
fax(I say 'induction' but it's really just case analysis)14/11 02:43
Saizan_ah, true, i don't have to get to the end14/11 02:44
copumpkinaw the case splitting thing isn't smart enough to make a with thingy14/11 02:48
Saizan_yay, proved, except that now i've to rewrite everything for the right case..14/11 02:51
faxthe right case??14/11 02:51
Saizan_http://hpaste.org/fastcgi/hpaste.fcgi/view?id=12128#a1213214/11 02:51
Saizan_Step is left and right, like the two branches of fork14/11 02:52
Saizan_s/is/has/14/11 02:52
doliofax: So, in the Obseq Now paper, they say that they don't have to define coherence, because (essentially) it gets erased?14/11 02:56
dolioThat doesn't seem like it's going to work for me. :)14/11 02:56
faxdolio yeah he's saying that it, computationally, has no effect14/11 02:56
faxI don't know why that lets you just elide it though14/11 02:57
faxIt doesn't make very much sense, his use of Agda14/11 02:57
dolioYeah, I'm quite sure Agda won't let you get away with that.14/11 02:57
faxif he had a more standard presentation it would probably make more sense but I'm sure there's a lot of good stuff here14/11 02:57
dolioWell, I can't really figure out how coherence is supposed to be defined in Agda.14/11 04:12
dolioIt seems like it'd require operations on the value equality that haven't been defined.14/11 04:12
dolioFor instance, transitivity, perhaps.14/11 04:14
dolioWhich I'm not eager to define after my experience with symmetry.14/11 04:14
faxyeh :(14/11 04:14
faxit takes a lot of hard work14/11 04:14
faxwel not hard work but work14/11 04:14
dolioI started working on an interpreter that uses some fancier techniques in syntax representation than my old ones.14/11 04:16
dolioAnd I'm trying to implement the erasure pure type system stuff.14/11 04:17
dolioMaybe I can put observational equality in it, too.14/11 04:17
copumpkinoh no, peer got to him first14/11 04:32
guerrillaso i guess i'm kind of confused - how does vim syntax highlighting work for agda?14/11 21:08
faxI think that .vim file is genearted by the agda implementation14/11 21:10
guerrillayeah.. i see --vim, and that seems to take an agda file.. but i wonder why.14/11 21:11
guerrillaguess ill run it on the stdlib14/11 21:11
faxwhat do yuo mean?14/11 21:11
faxit's not possible/practical to syntax color agda using regex (or however vim  defines syntax coloring)14/11 21:11
guerrillai figured - especially because of mixfix14/11 21:11
guerrillathanks for confirming though14/11 21:12
guerrilla(just don't want to have to learn emacs and agda at the same time if you know what i mean ;) )14/11 21:12
guerrillai have the generated syntax files now, but they refer to syntax elements such as agdaInfixConstructor and so on. is it up to me to define those in a global agda syntax file is there one already avail. somewhere?14/11 21:29
guerrillagoogling gives nearly nothing when searching for the names of those elements14/11 21:29
faxin the emacs mode you can click on them and it takes yuo to the definition14/11 21:30
guerrillaah, no worries then14/11 21:31
--- Day changed Sun Nov 15 2009
doliofax: So, I skimmed that intersection types paper. Perhaps a "strongly normalizing term" is taken to mean that you can prove (in whatever metatheory they're using) that it has a normal form for any reduction strategy?15/11 02:11
faxI don't know about any metatheory15/11 02:12
dolioI mean, whatever mathematical framework they're using to analyze the lambda calculus.15/11 02:12
faxspecifically because some weak metatheory wont be able to show lots of terms terminate (even if they do)15/11 02:12
fax?15/11 02:12
dolioZF or whatever you want.15/11 02:12
dolioYeah, that is a concern.15/11 02:13
faxwhat is the objection to lambda terms normalziing iff they are intersection typed?15/11 02:30
faxbecause there are unprovable true statements?15/11 02:30
dolioI didn't read closely; is the contention that you can give any intersection type to every strongly normalizing term in the untyped lambda calculus? And that only such terms are so typeable?15/11 02:32
dolio"give an intersection ..."15/11 02:33
dolioBecause if that's the statement, then it sounds like solving the halting problem.15/11 02:33
dolioAssuming you can decide whether a term is intersection typeable.15/11 02:34
faxwhy is it solving the halting problem, if the type is interpreted as a proof that this term is SN?15/11 02:34
faxno you cannot decide if a term is typeable, only if a term is well typed (given the term and the type)15/11 02:34
dolioYes. Decide whether a term has an intersection type. If yes, then the program it represents halts. If no, then it doesn't.15/11 02:34
dolioOh, right. Well, I still don't like it.15/11 02:37
faxwhy? :)15/11 02:37
faxdolio: suppose I invent a type ssystem:15/11 02:38
faxterm : type15/11 02:38
faxtype ::= (term * type) list15/11 02:38
faxwhere the first component is a beta reduction of the term15/11 02:39
faxso if a term is well typed, you have written down every possible reduction sequence for it15/11 02:39
faxsurely that system has the same property as the intersection one?15/11 02:39
fax(SN iff typeable)15/11 02:39
faxMy guess was the intersection type system is just like this, except much more compach15/11 02:39
faxcompact*15/11 02:40
dolioBecause any language where programs are provably terminating should lack some terms from the untyped lambda calculus that terminate, but do not provably (in whatever theory is equivalent in strength to the type system) terminate.15/11 02:43
faxwhy?15/11 02:44
faxif a term is strongly normalizing every reduction has a finite path furthermore there is only a finite number of reductions at each stage -- and so it is typable in my type system15/11 02:45
fax(finite path --> that ends in the normal form)15/11 02:45
dolioBecause otherwise, presumably, every reduction strategy for your language is well-typed in your language, so it proves its own completeness.15/11 02:47
faxI don't understand15/11 02:47
dolioAnd it's probably also as strong as peano arithmetic.15/11 02:47
faxthere is no curry-howard interpretation for these systems15/11 02:47
Saizandoes it also type terms that get stuck?15/11 02:51
dolioHow does "type ::= (term * type) list" work? Which terms have the empty list as types?15/11 02:51
faxnormal forms15/11 02:51
dolioLet me try rephrasing.15/11 03:02
dolioI was under the impression that there were terms in the untyped lambda calculus such that you couldn't prove in, say, ZF, that they terminate.15/11 03:05
faxsuppose I have a lambda term that means   if (reimann hypothesis) omega else id,    this term is not strongly normalizing15/11 03:06
dolioBut, if we can represent intersection typing of lambda terms in ZF, then a proof that 'tm' has intersection type 'ty' would be a proof that 'tm' is normalizing, according to the paper.15/11 03:07
faxI wonder if you could split the omgea into two non-diverging parts that might meet again, if only the $extemely_difficult_to_prove_statement is true15/11 03:07
faxI'm not very sure about it, but in my mind, given that a term is strongly normalizing then every reduciton sequence is finite - and so can be written down15/11 03:08
faxthat 'writing it down' should constitute a proof15/11 03:08
dolioWell, that term is certainly not strongly normalizing.15/11 03:15
dolioI thought there was more to it than that, though.15/11 03:15
dolioThe usual example that's invoked is that one cannot type the normalizer in the strongly normalizing language.15/11 03:17
dolioEven though the normalizer is obviously terminating, because the types ensure strong normalization.15/11 03:17
faxwell the evaluator is SN, it's only when you put a term into it that it can possibly loop15/11 03:21
Saizanyou can even give a type to Y but not to "Y (\x -> x)", so giving a type to the normalizer wouldn't mean much here, maybe?15/11 03:21
faxif you hooked an evaluator up with an enumerator you'd certainly get a diverging term15/11 03:21
fax(an enumerator lists every lambda term)15/11 03:21
dolioThe normalizer doesn't just take untyped lambda terms. It takes terms annotated with the types in the language in some way.15/11 03:26
dolioSaizan: Yeah, maybe what I'm overlooking is that the types don't have properties where it's possible to determine from f being well-typed and x being well-typed whether 'f x' is well-typed.15/11 03:51
dolioAs would seem to be the case for types being "list all possible reduction sequences for a term".15/11 03:51
dolioAlthough that doesn't really look like the case for the intersection types in the paper.15/11 03:55
kmchello gentlemen and ladies15/11 05:21
kmcwhere is \all defined in the Agda standard library?15/11 05:22
kmcor is it built in?15/11 05:22
dolioIt's built-in notation.15/11 05:30
dolio"\all n" is short for "(n : _)".15/11 05:30
dolioAnd so on.15/11 05:30
kmcmeaning "argument n of any type"?15/11 05:31
dolioNo, where the type can be inferred.15/11 05:31
dolioYou can actually write "\all (n : T)" as well, in which case it just looks nice.15/11 05:32
dolio"\all {n}" is the same as "{n : _}", of course.15/11 05:32
dolioAnd you can have a list of variables, too.15/11 05:33
dolioSo "\all {m n} o p q {r}" is short for "{m : _} {n : _} (o : _) (p : _) (q : _) {r : _}"15/11 05:34
kmcah, i remember now that System F types have \all.  in agda that'd be roughly the case where it infers Set for the type, yes?15/11 05:35
dolioYes, although it doesn't have to be Set.15/11 05:35
dolioLike, with vectors, you might do "\all {n A} -> Vec A n"15/11 05:36
dolioAnd it can figure out that n is a natural and A is a Set, because Vec requires that.15/11 05:36
kmccool15/11 05:37
kmcthanks15/11 05:37
kmcdo i have to do anything special to get the standard library? i did "cabal install agda" and my "open import Data.Nat" fails, and it's only searching the current directory15/11 05:43
kmci don't see Data/Nat.[l]agda anywhere in my cabal install path15/11 05:43
doliohttp://wiki.portal.chalmers.se/agda/agda.php?n=Libraries.StandardLibrary15/11 05:46
kmcso i should just download it and add it to the search path somehow?15/11 05:51
kmcah i see the README explains it15/11 05:51
kmcthanks again15/11 05:55
dolioNo problem.15/11 05:55
kmcwhat's a good symbol that's like \-> but free for user use?15/11 08:06
fax-->15/11 08:07
dolio\=>15/11 08:09
dolioThere are a whole lot if you type \r, actually.15/11 08:09
kmcah very nice15/11 08:10
faxhttp://en.wikipedia.org/wiki/Symbolic_combinatorics15/11 08:47
faxwhat's the difference/relation between this and species?15/11 08:48
dolioThere's a link at the bottom to species. :)15/11 08:49
dolioOh, so, I think I may have figured out the source of my confusion.15/11 08:49
faxwell there is a like yes :p  but that doesn't answer my question15/11 08:50
faxlink*15/11 08:50
dolioA function defined in the lambda calculus having an intersection type doesn't necessarily identify it as "total".15/11 08:50
faxtotal meaning terminates on all 'inputs' (when it has inputs)15/11 08:51
dolioYes.15/11 08:51
faxI suppose (\u -> u u) could be an example of that, it is SN, and for example if you apply it with id you get id, but if you self apply it it diverges15/11 08:52
dolioYeah, good one.15/11 08:52
dolioAlthough, the intersection typing rules in that paper give types for application based on types for functions and potential arguments.15/11 08:53
dolioSo one would think that that rule would have to rule out applying (\u -> u u) to itself.15/11 08:54
faxthere's also a note by Henk on this stuff but I couldn't follow it15/11 08:54
faxdolio yeah that sounds very plausible15/11 08:55
dolioBut, it may be that despite the fact that (\u -> u u) has an intersection type, there's no way to systematically interpret such types as identifying total functions in some semantics.15/11 08:56
faxwell I think that's what Henks note was about (maybe)15/11 08:56
dolioSo you're not led to a paradox where you have a language where you can identify all total functions, and rule out all non-total functions.15/11 08:57
dolioBut I don't know. It's still rather hazy.15/11 08:58
faxNote that species with the same generating function might not be isomorphic, but isomorphic species do always have the same generating function ????15/11 11:10
-!- ksf_ is now known as ksf15/11 16:23
Saizani wish there was a way to get an inductive version of "foo x y .. \== r" for any particular foo15/11 18:55
faxwhat does that mean?15/11 18:56
Saizanever tried twelf?15/11 18:57
faxonly tutorials15/11 18:57
Saizanwell, in twelf you declare functions by making a inductive family with inputs and outputs as indexes, and each clause is a constructor15/11 18:57
Saizani'd like to generate such an inductive family automatically from a function definition, in agda15/11 18:58
faxand what do you use the inductive for?15/11 18:59
faxI mean, if you had it15/11 18:59
Saizansince while writing proofs of the characteristic properties of some function i end up doing something isomorphic to pattern matching against such an inductive15/11 19:00
Saizanthough i think actually having the inductive would be nicer15/11 19:00
faxoh I see!15/11 19:00
faxCoq has this feature actually15/11 19:00
Saizanreally? how does it look?15/11 19:01
faxit's derives an induction scheme based on a function,   Functional Scheme <name> := Induction for <function> Sort <sort>.15/11 19:01
faxhttp://www.lix.polytechnique.fr/coq/distrib/current/refman/Reference-Manual013.html#FunScheme-examples15/11 19:02
Saizanthx15/11 19:03
-!- fax is now known as facsimile15/11 20:43
kmcsuppose i have "data Foo (a : A) (b : B) : C -> D -> Set where ..."15/11 23:55
kmchow do the parameters A, B differ from C, D?  is it just that i can use the variables a15/11 23:56
kmcand b dependently? is it still different if i don't?15/11 23:56
edwinbthe main difference is that a and b don't change across a whole Foo structure, but C and D might15/11 23:57
--- Day changed Mon Nov 16 2009
kmcmeaning i can instantiate those parts differently for each constructor?16/11 00:01
kmcso they're like the type variables of a GADT in Haskell, then?16/11 00:03
kmcso why would i put types ("indices"?) to the left of the colon?16/11 00:03
edwinbparameters need to be the same for each constructor, but indices don't, yes16/11 00:04
kmcso the parameters are to the left of the colon and have to be the same for every ctor?16/11 00:05
edwinbto be honest, I'm not certain what the distinction is in Agda16/11 00:05
kmcah16/11 00:05
edwinbin other systems, if you're also generating an elimination rule, it affects the type of the elimination rule16/11 00:05
edwinbsince it reflects the fact that parameters don't change16/11 00:05
edwinbI don't really use Agda, I just pay close attention to what people do with it ;)16/11 00:05
kmccool16/11 00:10
kmci'm an Agda beginner16/11 00:10
kmcaimlessly stating trivial things and attempting to prove them16/11 00:10
edwinbthat sounds like a good way to start...16/11 00:11
dolioParameters vs. indices tends to affect how large your datatype is, as well.16/11 02:16
dolio"data Foo (A : Set) : Set where foo : A -> Foo A" is valid, while "data Foo : Set -> Set where foo : {A : Set} -> A -> Foo A" is not, despite the fact that you might think they're the same.16/11 02:17
kmcdolio, is that "large" in the sense of sets vs. proper classes?16/11 05:49
dolioLarge as in which universe it lives in.16/11 05:49
dolioSet vs. Set1, etc.16/11 05:49
kmcok16/11 05:49
kmcwhy aren't those two the same?16/11 05:50
dolioThe second one stores a Set in the constructor, which forces the type into Set1.16/11 05:59
-!- fax is now known as facsimile16/11 09:30
facsimilehi EnglishGent16/11 12:25
EnglishGenthi facsimile :)16/11 12:33
facsimilehttp://www.e-pig.org/darcs/Pig09/src/Epitome.pdf16/11 15:54
Saizanhas there been any thought about incremental typechecking? i.e. not recheck the whole file if i just changed the bottom lines would be nice16/11 17:40
Saizanotherwise i need to create new modules just to keep it fast16/11 17:42
FunctorSaladdoes that work in agda?16/11 18:04
* FunctorSalad was sad when his pullback-of-setoid-functions OOMed16/11 18:05
FunctorSalad;)16/11 18:05
Saizannot afaik :)16/11 18:12
EnglishGenthi Saizan :)16/11 18:14
Saizanhi16/11 18:14
EnglishGenthow's things? :)16/11 18:20
Saizani'm trying to understand why some expression doesn't reduce further :)16/11 18:22
EnglishGenthi dolio :)16/11 18:41
EnglishGentwell I have to confess I havent really looked at agda in much detail yet - it's on my "must study" list16/11 18:42
EnglishGentbut I'm still getting to grips with Haskell16/11 18:42
EnglishGentI really do like the idea of having a more expressive type system than Haskell's though - at times it feels like a bit of a straight-jacket16/11 18:43
facsimilemore types means a straighter jacket16/11 18:46
guerrillawhich means awesome :)16/11 18:48
guerrillaso far, i'm loving it.16/11 18:48
guerrillahope it catches on.16/11 18:49
Saizanif you can express more structure in your types, some requirements can become easier to fulfill16/11 18:49
facsimilewhat have you done with it guerrilla?16/11 18:50
guerrillanot much yet, i'm still going through the Dependantly Typed Programming in Agda16/11 18:51
guerrilla(trying it all out)16/11 18:51
EnglishGentyes - but a more expressive type system too - you can say things you simply cant say otherwise16/11 18:51
guerrillamy end goal is to represent and manipulate extended attribute grammars16/11 18:52
facsimilecool project16/11 18:52
* EnglishGent has looked at Dependent type systems before - Cayenne, Dependent-ML, and other bits & pieces16/11 18:52
guerrillaand construct pushdown automata/transducers from them16/11 18:52
EnglishGentI even wrote an implementation of Cayenne in Java once :D16/11 18:52
guerrillafacsimile: part of a larger project for automated translation of instruction sets16/11 18:52
facsimileEnglishGent: I think I came across that at one point16/11 18:53
guerrillafacsimile: btw, extended "extended attribute grammars" to have types so that i can imply inequalities. theoretically anyway, now trying to use Agda to implement some of it16/11 18:53
guerrillaone of the reasons i _love_ the mixfix stuff16/11 18:53
guerrillacan't stand haskells `blah` syntax16/11 18:54
EnglishGenthello Saizan16/11 18:56
EnglishGenthas anyone here looked at polytypic programming btw? (I have no idea if Agda supports that - but it would be nice if it did)16/11 18:57
facsimileEnglishGent: You can do this in agda16/11 18:57
EnglishGentcool!16/11 18:58
* guerrilla googles polytypic16/11 18:58
EnglishGentsee that's part of what I meant about more powerful types systems actually feel like _less_ of a straight-jacket to me16/11 18:58
facsimileyou can do it in lisp too16/11 18:58
facsimileor java16/11 18:59
EnglishGentit's the fact I cant say all sorts of things I want to say in basic H-M - and then I have to jump through hoops to do it16/11 18:59
guerrillaoh, "generics", eh?16/11 18:59
EnglishGentum.. I'd describe it more as a way of extending 'deriving'16/11 18:59
EnglishGentso it works for your own stuff & not just a fixed list of built in examples16/11 18:59
EnglishGenthttp://www.cse.chalmers.se/~patrikj/poly/polyp/16/11 19:01
facsimilehttp://www.cs.nott.ac.uk/~pwm/16/11 19:01
guerrillai wonder why the vim syntax file generator doesn't catch [] and :: as constructors.. bug?16/11 19:13
guerrillasometimes it doesn't, sometimes it does.. how odd...16/11 19:14
FunctorSaladI like dependent types too obviously, but I'm not so sure whether treating proofs and values the same is the way to go really?16/11 19:46
FunctorSaladthe proof objects just get in the way16/11 19:46
FunctorSaladis there some theoretical obstacle to proof irrelevance? I think someone hinted at it16/11 19:47
Saizan_proof irrelevance doesn't work for constructive or, basically16/11 19:50
facsimilereally??16/11 19:50
Saizan_is it surprising? assuming that inj\_1 and inj\_2 are the same thing looks quite weird to me16/11 19:51
facsimileI thought it was fine as long as you don't write any functions into T : Set16/11 19:52
Saizan_maybe so16/11 19:52
Saizan_the proof objects are quite nice to recurse over btw, though a bit tedious to construct16/11 19:55
facsimileI mean you are basicalyl making a setoid that equates everything, and it in that case I think you can show it's respectful going p -> q (p, q : Prop), and p -> t (t : Set), if p has zero or one constructor16/11 19:56
Saizan_what's the use of constructive or in Prop then, though?16/11 19:58
facsimilejust stuff in prop is useful in general, like you might prove an equality with it: And that has meaning on its own16/11 19:59
FunctorSaladAIUI none really, you might as well use classical logic for proofs that don't affect the computation16/11 19:59
FunctorSaladbut what's wrong with classical logic if I just want to prove some *property*?16/11 19:59
FunctorSalad(classical is still a lot simpler)16/11 20:00
Saizan_i don't think it's intrinsically wrong, it's just a subset afterall16/11 20:01
facsimileFunctorSalad: There are some arguments against classical logic ...16/11 20:02
facsimileor did you mean in the technical sense?16/11 20:02
FunctorSaladI'm not opposed to classical on philosophical grounds if you mean that16/11 20:03
FunctorSaladI meant it pragmatically16/11 20:03
FunctorSaladit's a simplifying abstraction of intuitionistic, I think16/11 20:03
facsimileI don't really know about that, but aren't most proof assistants (like the big ones that have been around for a while) are mostly classical16/11 20:03
FunctorSaladjust one definition of finiteness, yay :D16/11 20:03
EnglishGentjust mentioned this elsewhere - but given the topic. it may be of interest to people: http://us.metamath.org/16/11 20:10
EnglishGenta proof verifier16/11 20:10
EnglishGentsupports classical & intuitionistic logics16/11 20:11
EnglishGentand already has several thousand theorems encoded in it :)16/11 20:11
facsimileEnglish I use this 'metamath' to show people how horrid set theory looks :D16/11 20:11
EnglishGentlol! set theory is sort of important though! *almost* everything ultimately becomes ZFC :)16/11 20:12
facsimilewhat do you mean?16/11 20:13
EnglishGent(btw - why dont schools teach children what proofs are about? I remember the maths classes I had pre-uni - and we almost never *proved* anything, just solved things -- not the same at all)16/11 20:14
EnglishGentthat it might be horrible - but you cant escape it :)16/11 20:14
FunctorSaladEnglishGent: are you sure children have the capability?16/11 20:16
facsimilethey should not teach math in school16/11 20:16
FunctorSalado_o16/11 20:17
EnglishGentthey dont! they teach *computation* -- 'follow these rules, without understanding why'16/11 20:17
EnglishGentand yes FunctorSalad - seriously, I'm convinced you could explain it to children16/11 20:17
EnglishGentafter all - if you can learn to write programs - you've already started working with formal systems16/11 20:18
byorgeyEnglishGent: most schools in the US teach proofs (via Euclid) in about the 8th grade16/11 20:22
byorgeyit's a horrible failure since most students end up hating "proofs", but I'm convinced it could be done well16/11 20:23
facsimilebyorgey you are from the 1800s? :p16/11 20:25
facsimilewell in the UK they don't do this sort of thing16/11 20:25
facsimile(any more)16/11 20:25
byorgeyno, but the middle school math curriculum in the US is.16/11 20:25
FunctorSaladhmm geometry is a horrible introduction to the axiomatic method IMHO16/11 20:32
FunctorSalad(you're not sure what you're allowed to use as "obvious")16/11 20:33
EnglishGentI agree16/11 20:35
EnglishGentthat's a problem I've found with lots of exam questions in maths as well 'prove X' - 'prove X *assuming what?*'16/11 20:36
EnglishGentotherwise I can just declare X 'obviously true'16/11 20:36
EnglishGenta horrible number of these have correct answers of 'the proof you were supposed to memorise as being the right answer'16/11 20:36
EnglishGentwhich - sort of misses the point I feel :|16/11 20:37
Saizan_that's a case for automatic proof checkers in education16/11 20:37
EnglishGentI agree Saizan_ - I do think we should introduce such tools16/11 20:37
facsimileexposing people to formal proof at a young age will probably destory any ability they have to learn real mathematics16/11 20:37
EnglishGentbut I suspect it will be a long uphill struggle - my school maths courses didnt like people using calculators16/11 20:38
Saizan_facsimile: can you elaborate on real mathematics?16/11 20:39
EnglishGentfacsimile - if you want to teach them 'informal' math do some investigations in class 'here is the sequence of square numbers, here is the sequence of triangular numbers - can we find a rule for how many triangular numbers come between two consecutive squares?'16/11 20:39
EnglishGent(thank you Douglas Hoffstadter for that example) :)16/11 20:39
* EnglishGent would also like to know what facsimile means, but is guessing they mean proofs which arent in fact fully formal (the overwhelming majority of proofs)16/11 20:41
guerrillai don't see why they don't teach propositional logic in grade school16/11 20:50
guerrillaeasy enough as arithmetic16/11 20:50
ttt--hi, what sort of things can you do with agda?16/11 20:51
ttt--i finished the tutorial16/11 20:51
ttt--whats the most fun to code in it without knowing a lot about logic?16/11 20:52
EnglishGentguerrilla - I'd agree - and then move on from there to predicate calculus16/11 20:53
EnglishGentit's appaling that they are happy to write equations without saying if they are identities or mere equations - becuase they dont say if any of the variables are universally or existentially quantified16/11 20:54
EnglishGentyou should at least explain that (rather fundamental!) difference16/11 20:55
facsimileEnglishGent I don't know what the difference is :P16/11 20:55
facsimileoh right16/11 20:55
guerrillaEnglishGent: i was including prec.calc, but yeah :)16/11 20:57
guerrillattt--: pick something from Haskell and reimp in Agda?16/11 20:57
Saizan_ever got an "*** Exception: Prelude.init: empty list" in the *ghci* buffer, after C-c C-l ?16/11 20:59
ttt--hmm, ok16/11 21:00
guerrillattt--: what kinda stuff are you looking for?16/11 21:04
ttt--i like code that reasons about code16/11 21:06
ttt--things like djinn, could that be done in agda?16/11 21:07
facsimilettt-- yes16/11 21:07
guerrillawhat's djinn?16/11 21:07
ttt--it's a tool for haskell that generates a function from a given type. like f : A -> B -> A  gives f a _ = a16/11 21:08
ttt--but i dont know the theory behind it16/11 21:09
guerrillaah interesting16/11 21:10
guerrillawhy would you want that? program refinement?16/11 21:10
ttt--just for fun, i suppose16/11 21:10
facsimileit's useful in theorem proving16/11 21:10
guerrillainteresting, just found the LtU announcement16/11 21:11
facsimile(not djinn,  but the general idea)16/11 21:11
guerrillaright16/11 21:11
guerrillattt--: how about a SAT solver in Agda? ;)16/11 21:12
ttt--i dont know anything about that16/11 21:17
ttt--except that it is NP complete so probably hard :)16/11 21:18
guerrillaok... start simpler then, turn arbitrary formulas into conjunctive normal form?16/11 21:19
guerrillai'm not sure that a problem being NP-complete implies it's difficult to code a solution for :P16/11 21:19
guerrillait just means it may take a "while" for the program to terminate given a big enough input16/11 21:19
guerrilla;)16/11 21:19
facsimileguerrilla the higher the complexity of a function, the more elaborate the implementation (usually) will be16/11 21:20
guerrillai suppose, but certainly not always16/11 21:22
guerrillai.e. bruteforce (of whatever)16/11 21:22
facsimileguerrilla I mean in agda or similar (where you justify the termination)16/11 21:23
guerrillaoh right16/11 21:25
guerrillastill, not always right? i mean with a SAT solver it seems you could do it the bruteforce-way and provide a termination proof fairly easy, no? am i just naive?16/11 21:27
guerrillahehe16/11 21:27
facsimilethe best way to find out... :p16/11 21:27
dolioThe Ackermann function isn't very difficult to write in Agda.16/11 21:28
EnglishGenthi dolio :)16/11 21:28
dolioHi.16/11 21:28
facsimileAckermann is like the most basic possible formula that isn't primitive though16/11 21:28
dolioYes, but it has a very high computational complexity, doesn't it?16/11 21:29
facsimileyeah16/11 21:29
dolioOn the other hand, I slacked off and never figured out a well-founded ordering for my fibsLessThan function.16/11 21:33
facsimilefibsLessThan lists the fibs below n?16/11 21:34
dolioProduces a list of them, yes.16/11 21:34
facsimilewell if you have isFib you just filter the list 1..n which is eacy16/11 21:34
facsimileeasy*16/11 21:34
dolioWell, that's patently cheating. :)16/11 21:35
dolioAlso, how do you write isFib?16/11 21:37
facsimilethat's easy,  isFib n = within n (fibsLessThan (n+1))16/11 21:37
dolioI suspect the termination checker won't like that mutual definition.16/11 21:38
-!- Saizan_ is now known as Saizan16/11 22:28
Saizan"danger_do_not_open_until.eps" <- in the Agda repo16/11 22:32
FunctorSaladI thought Ackermann was primitive in higher-order logic like Agda?16/11 22:36
facsimileI meant primitive recursive16/11 22:36
FunctorSaladyes16/11 22:37
-!- English_Gent is now known as EnglishGent^afk16/11 23:15
--- Day changed Tue Nov 17 2009
solidsnackhi17/11 01:08
solidsnackHow does Agda's block-recognizer handle double width chars?17/11 01:08
dolio"block-recognizer"?17/11 01:13
solidsnackThe lexer/parser component that tells us we are in an indented block.17/11 01:13
dolioIs there anything indentation-based in Agda?17/11 01:14
dolioOh, other than modules.17/11 01:15
dolioAnd records. Which don't have to worry about double-width characters, presumably.17/11 01:15
solidsnackI guess I just assumed there was.17/11 01:16
dolioThere are modules and records.17/11 01:17
dolioBut those have python-like block structure.17/11 01:17
dolioI don't think there are many situations where you'd have to account for indentation level after a non-space character.17/11 01:18
solidsnackDoes AGDA not have `where` ?17/11 01:19
dolioIt does.17/11 01:19
dolioWho puts where after a bunch of other characters on a line, though?17/11 01:20
solidsnackFair enough.17/11 01:20
solidsnackWhat about `do`?17/11 01:20
dolioNo do.17/11 01:21
Saizanwe don't even have a case .. of17/11 01:21
solidsnackWow.17/11 01:21
solidsnackWell, that takes care of a lot of the problems, then.17/11 01:21
solidsnackI thought AGDA might have a custom `wcwidth` that it ships with; I am writing bindings have found errors in my native `wcwidth`..17/11 01:22
solidsnacks/have found/and have found/17/11 01:23
dolioLet's see about where...17/11 01:24
dolioI guess it does have some kind of indentation checking for where.17/11 01:25
dolioHandles extra-wide characters as ordinary monospace, though.17/11 01:26
solidsnackyuck :(17/11 01:26
dolio⟶ counts as one character.17/11 01:26
solidsnackThanks for checking in to that.17/11 01:26
solidsnackI must step away from my keyboard for a bit.17/11 01:27
--- Log closed Tue Nov 17 09:28:08 2009
--- Log opened Tue Nov 17 09:28:14 2009
-!- Irssi: #agda: Total of 16 nicks [0 ops, 0 halfops, 0 voices, 16 normal]17/11 09:28
-!- Irssi: Join to #agda was synced in 91 secs17/11 09:29
-!- EnglishGent^afk is now known as EnglishGent17/11 10:18
guerrillaso, how does writing decimal numbers in agda work exactly? does 1 expand to "suc zero" somehow?17/11 11:49
guerrillai assume 0-9 are just identifiers like any others, no?17/11 11:52
dolioIt only works when you declare some datatype BUILTIN NATURAL.17/11 11:55
guerrillai see17/11 11:55
guerrillayou couldn't do it with some clever pattern matching somehow?17/11 11:55
dolioThen it decimal numbers behave as elements of that type, and on the backend, it gets implemented by a Haskell Integer, I believe.17/11 11:55
guerrillaright17/11 11:56
dolioYou could build decimal strings, but they'll never look like ordinary numerals.17/11 11:56
guerrillaright17/11 11:57
guerrillanot a huge limitation :)17/11 11:58
guerrillajust curious17/11 11:58
guerrillathink Agda will ever be independent of Haskell?17/11 11:59
dolioMaybe, but it'd probably still be good to have, say, a GMP-backed built-in natural.17/11 12:00
dolioWhich is what the current situation accomplishes.17/11 12:00
guerrillayeah of course :) i would never want native Agda Nat's that'd be silly17/11 12:01
guerrillaGMP is great17/11 12:01
dolioWell, peano numbers are nice for proving, but you can never do anything big with them.17/11 12:02
guerrillayeah, exactly17/11 12:02
dolioAnd I doubt digit strings are much better.17/11 12:02
FunctorSaladmuch better, but still not good enough? :)17/11 12:03
FunctorSaladassuming you mean performance17/11 12:03
dolioYeah.17/11 12:03
dolioIt's probably worse for proving in a lot of cases. :)17/11 12:04
chrisdoneidentity : (A : Set) -> A -> A17/11 21:15
chrisdoneidentity A x = x17/11 21:15
chrisdonewhat does the `A' mean in the second line?17/11 21:15
chrisdonewhat is the arity of this function?17/11 21:17
chrisdoneoh, nevermind. the explanation was on the next page17/11 21:19
chrisdonecan I write agda code and use it from haskell or vise versa?17/11 22:18
* EnglishGent has no idea - but would also like to know that!17/11 22:22
EnglishGenthi chrisdone :)17/11 22:22
chrisdonehi =)17/11 22:22
chrisdoneI'm reading the for-haskell-programmers-tutorial17/11 22:22
chrisdonejust wondering if I could, say, write a list sorting algorithm in agda that I know is correct and then use it from haskell17/11 22:23
chrisdoneoh, yeah. at the end it says that you can import Haskell functions17/11 22:24
EnglishGentcool :)17/11 22:25
chrisdoneapply : (A : Set)(B : A -> Set) ->17/11 22:27
chrisdone        ((x : A) -> B x) -> (a : A) -> B a17/11 22:27
chrisdoneapply A B f a = f a17/11 22:27
chrisdonedo you know what this `B x' notation is?17/11 22:27
chrisdoneoh I think I know17/11 22:28
chrisdoneB is a type function17/11 22:28
chrisdoneso it takes x, which is of type A, and ``returns'' Set17/11 22:29
chrisdone(as far as I can interpret)17/11 22:29
EnglishGentI dont really know any agda yet chrisdone - I'm interested in it - and I've looked at dependently typed languages before17/11 22:34
EnglishGentbut right now I'm busy climbing the Haskell learning curve17/11 22:35
chrisdoneEnglishGent: you teach me adga and .. I can give you motivational support for haskell17/11 22:40
EnglishGentI'd *love* to chrisdone - but I'd need to learn it myself properly first.. kinda hard to teach stuff you dont really know :|17/11 22:48
Saizanchrisdone: your interpretation of B is correct17/11 22:53
SaizanSet is the type of types17/11 22:53
Saizan(monomorphic types, actually)17/11 22:53
chrisdonehm, ok17/11 22:54
chrisdonethanks =)17/11 22:54
EnglishGenthi Saizan :)17/11 22:54
Saizanhi17/11 22:55
EnglishGenthello solidsnack17/11 22:56
solidsnackEnglishGent: How do you do.17/11 22:56
chrisdoneis there an agda bot?17/11 23:02
copumpkinnope, but I'd like to see one :)17/11 23:02
copumpkinespecially since agda is already a library17/11 23:02
copumpkinbut it'd be fairly complicated probably :)17/11 23:03
kosmikuswell, it only counts if agdabot is written in Agda :)17/11 23:03
kosmikusand passes the productivity checker17/11 23:03
copumpkinlol17/11 23:03
copumpkinbut agda's already a haskell lib17/11 23:03
kosmikustrue17/11 23:04
facsimilewhat should the bot do?17/11 23:04
kosmikusit'd probably not even be that hard17/11 23:04
kosmikusbut there are less useful one-liners to eval than in Haskell17/11 23:05
kosmikusoften you want to define datatypes as well17/11 23:05
copumpkinthe bot would probably be quite complex17/11 23:05
copumpkinbut having an efficient search mechanism of the standard library would be excellent17/11 23:05
copumpkina hoogle for agda would be very nice :)17/11 23:06
facsimileI think searching libraries like that is a difficult AI problem17/11 23:06
facsimilesince if you are searching for x + x = 2*x but the only thing in the library is 2*x = x + x, you want to get that answer17/11 23:06
chrisdoneoh dear what have I started :P17/11 23:06
copumpkinit would be difficult, but it could just deal with name substitutions for now17/11 23:07
copumpkinit doesn't need to automatically search symmetrically and so on17/11 23:07
* Saizan wonders if it'd be easier to hack hoogle or start from scratch17/11 23:07
chrisdoneidentity3 : (A : Set) -> A -> A17/11 23:11
chrisdoneidentity3 = \(A : Set)(x : A) -> x17/11 23:11
chrisdonein the example above the (x : A) isn't necessary is it? it could just be `x'17/11 23:11
kosmikusI wonder if there's something like Hoogle for Coq theorems17/11 23:11
facsimilekosmikus well there's various ways to search but actually I give up on them and just grep until I learn the libraries17/11 23:12
kosmikusfacsimile: :)17/11 23:16
kosmikuschrisdone: yes (but why don't you just try it?)17/11 23:17
chrisdoneI haven't set it up yet17/11 23:18
chrisdoneI'll set it up and try it... I just don't want to misinterpret the results as can be the case when learning by science17/11 23:19
chrisdoneoff to bed night17/11 23:21
--- Day changed Wed Nov 18 2009
-!- ksf is now known as notkmc18/11 08:44
-!- notkmc is now known as ksf18/11 08:48
guerrillaso is there a "planet agda" like there is for haskell? or something similar to the "haskell sequence" for agda?18/11 10:46
EnglishGent"haskell sequence" ?18/11 11:28
guerrillaEnglishGent: just a weekly for haskell : http://sequence.complete.org/18/11 12:30
guerrillawhat peopel are up to, interesting blog posts, new packages, etc18/11 12:30
EnglishGentty guerrilla :)18/11 12:43
EnglishGent(sorry - was afk having lunch) :)18/11 12:43
guerrillanp18/11 12:44
-!- EnglishGent is now known as EnglishGent^afk18/11 15:49
-!- EnglishGent^afk is now known as EnglishGent^semi18/11 19:03
-!- chrisdon` is now known as chrisdone18/11 19:22
chrisdonehyello!18/11 19:30
luquiWhat do people usually use to interface with agda?  emacs?18/11 20:58
copumpkinyeah18/11 20:58
copumpkinthe interactive mode is unsupported now18/11 20:58
copumpkinso it's pretty much the only way to do it18/11 20:58
luqui'm getting an error:  Cannot open load file: haskell-indent18/11 20:59
luquimind I know next to nothing of emacs.18/11 20:59
copumpkinhmm, did you set up agda-mode?18/11 20:59
luquii agda-mode setup'd18/11 20:59
copumpkinweird that it's looking for haskell stuff18/11 21:00
copumpkinyou opened a .agda file?18/11 21:00
luquiyeah18/11 21:00
copumpkinhmm18/11 21:00
copumpkinnot sure, not an emacs guy myself either. I just use it for agda18/11 21:01
luquik i'll hunt a bit18/11 21:01
luquihad to install http://projects.haskell.org/haskellmode-emacs/18/11 21:05
luquiHm.  There is not good syntax highlighting...18/11 21:07
luquiit's mostly black.  comments are red.18/11 21:07
kosmikusluqui: wait until you typecheck :)18/11 21:07
copumpkinC-c C-l18/11 21:07
copumpkin(that being an L, not an I)18/11 21:08
luquiyay!18/11 21:09
copumpkin:)18/11 21:10
copumpkinstick holes in your code using a question mark18/11 21:10
copumpkin(then load)18/11 21:10
luquiHell yes!  That's the sort of thing I was about to ask about.18/11 21:11
copumpkin:)18/11 21:11
luquihmm... shows me the expected type, but it doesn't show me about my environment18/11 21:11
copumpkinC-c C-,18/11 21:11
luquibeautiful.18/11 21:12
copumpkin:)18/11 21:12
copumpkinsadly it ignores where bindings18/11 21:12
copumpkinbut I put in a ticket about that18/11 21:12
copumpkinso with any luck that will change soon18/11 21:12
luquibut it pays attention to lets?18/11 21:12
copumpkinthere's no such thing as let, for some reason18/11 21:12
luquiso developments aren't tactic-based.  it's more of an epigram style?18/11 21:12
luquioh.  huh.18/11 21:12
copumpkinyeah, no tactics18/11 21:12
copumpkinand strange deviations from haskell-like syntax for no obvious reason (to me at least)18/11 21:13
copumpkinlike you can't pattern match in a lambda parameter, and you can't put type annotations on any expression18/11 21:13
luquiI give language designers a lot of syntactical leeway... acknowledging that they have spent time according to Wadler's law on it18/11 21:13
copumpkinyeah :)18/11 21:13
luquiI think no pattern matching in lambdas is because pattern matching needs to occur in a rigid context?18/11 21:14
copumpkinmaybe :) I'm still pretty new to all this, so my objections may not be particularly learnéd :P18/11 21:14
luquiyeah.  i've built a couple dependent typecheckers.  there are a lot of stupid little details that get in the way of what you want it to look like.18/11 21:15
luquibecause of termination, and the undecidability of higher order unification18/11 21:15
luquiOh yeah, so i have this ? box and i have filled it in... what now?18/11 21:16
luquiwow, C-c C-r... good guess.  I wonder what it stands for.18/11 21:18
copumpkinnot sure how console emacs works, but in my graphical emacs I right click18/11 21:18
copumpkinand it gives me context-sensitive options with their key bindings18/11 21:18
luquioh cool18/11 21:19
copumpkinI'll take a look for C-c C-r18/11 21:19
luquirefine18/11 21:19
copumpkinah yeah18/11 21:19
copumpkinalso, do you know about the mixfix in agda?18/11 21:20
luquiokay i might very soon be an agda convert18/11 21:20
luquisuck my coq18/11 21:20
copumpkinlol18/11 21:20
luquithis is getting much closer to the picture of what an ideal IDE is18/11 21:20
copumpkinit can also split cases for you in simple pattern matches18/11 21:20
luquii mean, it's still a pencil sketch, but it's sweet18/11 21:20
luqui:-)18/11 21:21
copumpkinmore complicated pattern matches with "with" are too hard for it though18/11 21:21
copumpkinunsurprisingly, I guess :)18/11 21:21
luquiyeah, i'm not so keen on agda's crazy custom syntax18/11 21:21
luquithat's what turned me away from it when i first looked at it18/11 21:21
luquii like the auto hole-filler too18/11 21:22
* copumpkin restrains from making another coq joke18/11 21:23
luquiyeah i saw that one too :-P18/11 21:23
FunctorSalad:D18/11 21:26
luquican I get rid of a hole?18/11 21:26
copumpkinif you select the entire thing and press backspace it'll disappear18/11 21:27
copumpkinor there's a "give" option too18/11 21:27
luquiwhich fills it in, yeah...18/11 21:27
luquibut it wasn't happy with me filling it in with nothing.  understandably.18/11 21:27
copumpkinyeah18/11 21:27
copumpkinI'd like to be able to select an arbitrary expression and get its type and context18/11 21:28
luquiyeah that would be nice18/11 21:28
luquiand evaluate it to normal form18/11 21:28
luquiand all that other good stuff18/11 21:28
copumpkinyeah18/11 21:29
luquimaybe an easy way would be to be able to open a hole around an arbitrary expression18/11 21:29
copumpkinyeah, that might be nice18/11 21:29
luquisomeday, when i have the tuits...18/11 21:30
luquidoesn't help that i'm no elisp hacker18/11 21:30
FunctorSaladthere *is* eval-to-normal-form18/11 21:30
copumpkinbut you need to type the expression in18/11 21:30
FunctorSaladare you using the gtk emacs?18/11 21:30
copumpkinI can't just select it18/11 21:30
luquiyep, gtk18/11 21:30
FunctorSalad(right click on hole then to see the commands)18/11 21:31
luquiright, we are talking about not needing a hole to do that stuff18/11 21:31
FunctorSaladhmm about the rigid context... that doesn't explain why we don't have case statements with explicit types :(18/11 21:31
FunctorSaladah18/11 21:31
luquiis there a way to give concise untyped defs.  Like, foo x y = bar y x18/11 21:34
luquior do all defs need types?18/11 21:35
copumpkinI think you can only do it if you don't have any arguments on the left18/11 21:35
copumpkinnot sure though18/11 21:35
copumpkinI've been able to define constant values without types18/11 21:35
copumpkinlike x = 5 :: 6 :: [] at the top level18/11 21:35
luquihmm, wop = \x y -> pow y x18/11 21:36
luquiseems like it doesn't like it, but the "error message" is rather incomprehensible18/11 21:36
copumpkinis that a real lambda?18/11 21:36
FunctorSalad:o18/11 21:36
copumpkinnot sure agda likes \ as lambda18/11 21:37
FunctorSaladit does18/11 21:37
copumpkinoh ok :)18/11 21:37
luquioh, how do i type a real lambda?18/11 21:37
FunctorSaladλ18/11 21:37
copumpkin\lambda18/11 21:37
FunctorSalad\lambda ?18/11 21:37
luquithanks18/11 21:37
luqui:-P18/11 21:37
copumpkinyou get all the fancy unicode characters with sequences after \18/11 21:37
luquiah cool18/11 21:37
copumpkinyou can type \<tab> to see what's available18/11 21:37
copumpkin\r is the function arrow for example, or \bn is the N for natural numbers18/11 21:38
luquiman that is a really stupid looking lambda.  :-)18/11 21:38
FunctorSalad⊚_⊚18/11 21:38
copumpkinlol18/11 21:38
FunctorSalad:)18/11 21:38
copumpkin\neg_\neg18/11 21:38
copumpkin(¬_¬)18/11 21:38
luquioh nice that def did work18/11 21:39
luquii just needed to use it18/11 21:39
luquipresumably to tie down the universe constraints or something18/11 21:39
copumpkindid it turn yellow or something before?18/11 21:39
luquiyeah18/11 21:39
copumpkinah that isn't exactly an error18/11 21:39
luquiwhat does it mean?18/11 21:39
copumpkinjust means that it doesn't really know what its type is18/11 21:39
copumpkinit often means it wasn't able to infer the value of an implicit variable or something18/11 21:40
luquihm18/11 21:40
copumpkinbut the thing that appeared down at the bottom wasn't an error18/11 21:40
luquiyeah it was some numbers and colons18/11 21:40
copumpkinit's a very unhelpful message that tells you what it wants for the undefined metavariable18/11 21:41
FunctorSaladapropos implicits, we need coq's `@' :o18/11 21:41
copumpkinsomething lke _277 : _25318/11 21:41
copumpkintelling you that the unnamed, invisible variable _277 needs to be of type _253 ;)18/11 21:41
copumpkinreally unhelpful, basically :P18/11 21:41
FunctorSalad\a b c -> f {a} {b} {c} is a bit evil18/11 21:41
luquiunimpliciting parameters?18/11 21:43
FunctorSaladyes18/11 21:43
luquiwhy is that evil?18/11 21:43
FunctorSalada lot to type :)18/11 21:44
luquiAgda win on time to first success18/11 21:48
luqui_+_ = prim id (\x p m -> Succ (p m))18/11 21:48
copumpkinwhat did you do?18/11 21:48
copumpkinooh18/11 21:48
copumpkinnext up, a prettier diagonal!18/11 21:50
copumpkin;)18/11 21:50
luquiI think it's funny that you can omit type signatures if there are no arguments18/11 21:53
luquiit's the opposite of haskell, because of monomorphism we have to include type signatures only on those cases18/11 21:53
copumpkinyeah18/11 21:54
copumpkinoh one thing that's worth mentioning is dot patterns18/11 21:56
copumpkinbut now that I try, I can't think of a good way to describe them18/11 21:56
luquiwith example?18/11 21:57
copumpkinif one pattern is determined by another pattern you're matching, one of them should be dotted, lest you give yourself too much freedom18/11 21:57
copumpkinso the standard library has a ∈ for vectors and it's actually a data type18/11 21:57
copumpkinit has two constructors, here and there, with the former saying that the sought element is at the head of the vector and there saying it's somewhere in the tail18/11 21:58
copumpkinso say you had moo a (x :: xs) pf, and pf is a proof that the first parameter is in the second (using ∈)18/11 21:59
copumpkinthat pattern would be fine as written, but say you wanted to deal with here and there separately18/11 21:59
copumpkinmoo .x (x :: xs) here is what you would have to write18/11 21:59
* edwinb goes through all his character encodings to find out which one makes ?s look like real symbols18/11 21:59
copumpkinbecause the fact that you specified here means that 'a' and 'x' must be the same18/11 21:59
copumpkinthat wasn't very clear :P18/11 22:00
copumpkinhmm18/11 22:00
luquii think i follow18/11 22:00
copumpkinso it would complain if you wrote moo a (x :: xs) here18/11 22:01
luquiyeah ok18/11 22:01
luquiwhat about moo _ (x :: xs)18/11 22:01
edwinbI would perhaps explain it by saying it's a pattern that must have a particular value, but you're not allowed to match on.18/11 22:01
copumpkinthat'd be fine18/11 22:01
edwinbI don't know if that helps though18/11 22:02
copumpkinhttp://www.cs.nott.ac.uk/~nad/listings/lib/Data.Vec.html#615 is the here of which I speak by the way18/11 22:02
luquidoes agda have decent support for compilation18/11 22:03
luquii know it didn't a year or two ago18/11 22:03
luquilike... could i write programs in it?18/11 22:03
copumpkinI think there's two different compilers provided with it18/11 22:03
edwinbthey still do it by translation to Haskell don't they?18/11 22:03
copumpkinit has a decent way to lift haskell types and functions into it, and I think you can write decent programs in it, but I'm not sure how good the generated code is18/11 22:04
copumpkinbut yeah, I think it's via haskell18/11 22:04
edwinbI'd be curious to know. I don't suppose anyone has tried writing any benchmarks or anything though.18/11 22:04
copumpkinI remember coming across a paper by some japanese people for an agda compiler, but the performance didn't look so good if I remember correctly18/11 22:05
edwinbmmm18/11 22:05
copumpkinhttp://unit.aist.go.jp/cvs/tr-data/PS06-011.pdf is what I was thinking of18/11 22:05
edwinbIdris is beating Java in my latest benchmarks... maybe one day I'll get around to bolting the back end onto Agda18/11 22:05
copumpkinalonzo is the other compiler I think18/11 22:05
luquii'm working on a VM that ought to be good at running the type of program you see in proof developments18/11 22:05
copumpkinooh18/11 22:05
luquii wonder if that would be easy to hook up18/11 22:05
edwinbnone of the Agda compilers do anything about erasure of irrelevant arguments or proof terms, as far as I can tell18/11 22:06
edwinband that seems to be quite important in my experience18/11 22:06
edwinbit's not particularly tricky either...18/11 22:07
copumpkinI'd imagine18/11 22:07
luquifrom a typical Nat data, I've defined this:18/11 22:08
luquiprim : {p : Nat -> Set} -> p Zero -> ({y : Nat} -> p y -> p (Succ y)) -> (x : Nat) -> p x18/11 22:09
luquiprim z s Zero = z18/11 22:09
luquiprim z s (Succ a) = s {a} (prim z s a)18/11 22:09
luquibut it is "yellowing" at me18/11 22:09
luquiany idea how to shut it up?18/11 22:09
copumpkinwhich part is yellow?18/11 22:10
copumpkindo you have universe polymorphism turned on?18/11 22:10
luquithe rightmost s in the last line18/11 22:10
copumpkinI guess it wouldn't affect this18/11 22:10
luquihow does one turn that on anyway?18/11 22:10
copumpkin{-# OPTIONS --universe-polymorphism #-}18/11 22:11
copumpkinit might want you to pass the {Nat} to the s there18/11 22:11
copumpkin(s {a}) maybe?18/11 22:11
luquihuh... that's a type error18/11 22:12
copumpkinoh hmm18/11 22:12
luquiit's something about the implicits though18/11 22:13
luquiit works just fine if y:Nat isn't implicit18/11 22:13
luqui(with appropriate modifications)18/11 22:13
luquii.e. {a} -> a   ... that {a} isn't really necessary anyway18/11 22:14
copumpkinprim z s (Succ a) = s {a} (prim z (λ {y} → s {y}) a)18/11 22:14
copumpkinugly though :/18/11 22:14
copumpkinnot sure why it can't infer that18/11 22:14
luquioh.  i was doing \y -> s {y}18/11 22:15
luquilambdas can have implicits too...18/11 22:15
copumpkinyeah18/11 22:15
luquiweird18/11 22:15
luquimaybe it is trying to fill in s's implicit right there18/11 22:16
copumpkinit seems strange that it can't figure that out, but I don't really know how it all works18/11 22:16
luquiwhereas we want it to pass it on18/11 22:16
copumpkinyeah18/11 22:16
luquii think exactly this sort of situation is why i don't like implicits18/11 22:16
copumpkinI tend to avoid them unless it's likely that it'll be able to infer them18/11 22:17
luquiyeah.18/11 22:17
copumpkinwhich often means I make something explicit that I don't really want explicit, but ah well :)18/11 22:17
luquiwell the thing is, that implicit is inferrable in all my use cases18/11 22:17
luquijust not in the definition18/11 22:17
luquibut yeah, that is the cleanest Nat development i've ever done18/11 22:18
luquiagda++18/11 22:18
copumpkinyou can get away without the implicit on the first s btw18/11 22:18
luquiyeah i noticed that18/11 22:18
copumpkinprim {p} z s (Succ a) = s (prim {p} z s a)18/11 22:19
copumpkinthat also works18/11 22:19
luquiah that is more sensible to me for some reason18/11 22:19
luquii think it's because i know that eliminators are hard to infer18/11 22:19
copumpkinwhat's an eliminator? :)18/11 22:19
luquithe P : Nat -> Set argument18/11 22:20
copumpkinoh18/11 22:20
* copumpkin still has much to learn!18/11 22:23
luquihow do i eval an expression?18/11 22:24
copumpkinC-c C-n18/11 22:24
luquilike one would do at the ghci prompt, perhaps18/11 22:24
luquinice18/11 22:24
copumpkinif we built a subst/cong/sym grammar along with a basic definition of _+_ and _*_ for Nat, and enumerated that grammar, I wonder how long it would be before we discovered that they form a semiring18/11 22:30
copumpkinwould we discover it at all? are subst/cong/sym even sufficient?18/11 22:31
luquiI *really* like that you can use functions which have holes in them18/11 22:39
luquiallows me to reason like, *if* i had this lemma, then could I prove it?18/11 22:39
copumpkinyeah :) at one point I had 19 holes in that diagonal module :P18/11 22:39
copumpkinyeah :)18/11 22:39
copumpkin ∀ {A B} → ∀ (a : A) → (xs : Colist⁺ A) → (f : A → Colist⁺ B) → a ∈ xs → (y : B) → y ∈ f a → y ∈ diagMap f xs18/11 22:40
copumpkinfor that ^18/11 22:40
luquiouch18/11 22:41
copumpkinthat second forall is unnecessary I guess18/11 22:41
copumpkinbut diagMap is concatMap using diagonal instead18/11 22:41
copumpkinonly have 13 holes now ;)18/11 22:41
luquihaha18/11 22:42
luquisomeday this kind of stuff will be easy18/11 22:42
luquii think both the software and our brains need to improve for that to happen18/11 22:42
copumpkinif we can get more people to notice and get interested18/11 22:42
copumpkinyeah :)18/11 22:42
copumpkinI found haskell eye-opening but agda really felt like a brain workout18/11 22:43
copumpkin(and still does)18/11 22:43
luquiwell haskell was designed after there was a pretty good understanding of what functional programming is like18/11 22:46
luquiagda is still on the cutting edge in some sense18/11 22:46
edwinbyes, we haven't really got the hang of programming with dependent types yet...18/11 22:46
copumpkinyep :)18/11 22:46
edwinbmore people doing it weill help ;)18/11 22:46
luquiI don't suppose agda supports sections18/11 22:47
copumpkindon't think so18/11 22:47
copumpkinit's also frustrating when a mixfix operator needs an implicit parameter18/11 22:47
luquihoo... this is hard18/11 22:53
luquitrying to prove addition is commutative18/11 22:53
luquiso familiar with tactics, never got comfortable with writing proof terms18/11 22:53
FunctorSaladluqui: but modules18/11 22:54
FunctorSalad(nested)18/11 22:54
luquihuh?18/11 22:54
FunctorSalad(instead of sections)18/11 22:54
FunctorSaladyou can just start a submodule inside your module18/11 22:54
luquioh no.  (+ x)  kind of section18/11 22:54
FunctorSaladah :)18/11 22:55
copumpkinluqui: yeah, commutativity took me forever in haskell, even with a lot of help from Saizan :P18/11 23:03
FunctorSalad*googled for idris* edwinb : ah, you're the developer of ivor?18/11 23:03
FunctorSaladembedding in haskell seems like the way to go for automatizing theorem proving, to me18/11 23:04
FunctorSalad(I mean, like you did in ivor)18/11 23:04
* copumpkin wants http://hpaste.org/fastcgi/hpaste.fcgi/view?id=9423#a9423 in agda next18/11 23:07
copumpkinI imagine having a more complete rational in the standard library would help a lot :)18/11 23:07
edwinbFunctorSalad: I might be ;)18/11 23:11
edwinbi think it will help18/11 23:11
edwinbI'd quite like to have some kind of plugin mechanism for adding decision procedures18/11 23:12
edwinbbut I don't see why they can't ultimately be implemented in Agda/Epigram/Idris/whatever itself18/11 23:12
copumpkinivor looked interesting but I couldn't really figure out how to get started with it18/11 23:12
edwinbI can't say I blame you ;)18/11 23:12
FunctorSaladedwinb: you mean plugin directly into the kernel?18/11 23:12
edwinbI should write documentation sometimes18/11 23:12
FunctorSalad(the conversion I mean)18/11 23:13
edwinbFunctorSalad: I mean plugin tactics which construct proof terms18/11 23:13
copumpkinbut last time I tried I hadn't really tried any proofs of anything18/11 23:13
copumpkinso I may have an easier time this time around :)18/11 23:13
FunctorSaladedwinb: ah. isn't that possible with the current interface already?18/11 23:13
FunctorSalad(I admit I just looked at it briefly too)18/11 23:13
edwinbyes, but you have to recompile the thing18/11 23:13
edwinbso not really much use for, say, a programmer who wants a domain specific tactic for the library they've just made18/11 23:13
FunctorSaladthe thing = your haskell program using Ivor, right?18/11 23:14
edwinbyes18/11 23:14
edwinbdepends what you're using it for I suppose18/11 23:14
FunctorSaladsure they can be implemented in Agda/Epigram/Idris, but I'm a lot better at Haskell programming and you don't really need dependent types for metaprogramming ;)18/11 23:14
edwinbI mainly made it because I wanted something to implement languages on top of, so I'd like to be able to add plugins to those languages18/11 23:14
copumpkincould agda be implemented on top of ivor?18/11 23:15
edwinbI don't see why not18/11 23:15
edwinbexcept that they have a perfectly good kernel already ;)18/11 23:15
FunctorSalad(and Haskell is more mature, of course)18/11 23:15
edwinband I'd trust theirs rather than mine because I've seen my code18/11 23:15
copumpkinthe kind that lets you stick Set (suc n) into Set n? :P18/11 23:15
edwinbyeah, well, Ivor cheats too...18/11 23:15
FunctorSaladoh18/11 23:16
FunctorSaladI was thinking of using it for math18/11 23:16
edwinbin the interests of getting things done, I might have cut a corner or two...18/11 23:16
edwinbyou could use it for maths, but I'd need to fix a couple of small things if you wanted complete faith in your proofs18/11 23:16
edwinbsame goes for agda at the moment18/11 23:17
FunctorSaladwhat's Ivor's position about equality? :)18/11 23:18
-!- EnglishGent^semi is now known as EnglishGent^afk18/11 23:18
FunctorSaladI'd like to try extensional type theory, undecidable or not18/11 23:18
edwinbIvor is the same as Agda on that one18/11 23:19
FunctorSaladthe other option would be to build the extensional layer on top of the intensional one18/11 23:20
FunctorSaladwhere automation would be very useful...18/11 23:20
luquiIs it possible to do developments based on Mu?18/11 23:46
luquior will I always run into the strictly positive restriction18/11 23:46
copumpkinhmm18/11 23:56
--- Day changed Thu Nov 19 2009
luquiDo you know if anyone has done stuff with computable reals in agda?19/11 00:05
copumpkindon't think so19/11 00:15
copumpkinI was going to port roconnor's code to it19/11 00:16
copumpkinbut I got lazy19/11 00:16
copumpkindoes anyone have any ideas on how to improve the metas display?19/11 01:55
copumpkinknowing that my goal is ({x : .A} (y' : Colist⁺ .B) → _314 a f z zs y pfy y') doesn't do me much good19/11 01:55
ccasinyes, it is very frustrating19/11 02:01
ccasinbut I haven't observed any general ways in which it could be better19/11 02:02
ccasinhave you?19/11 02:02
copumpkinI don't even understand those constraints some of the time :)19/11 02:02
copumpkinso nope, I don't have any ideas :/19/11 02:02
ccasinoften it is "obvious" to me how the variable could resolve, but usually I'm implicitly assuming the injectivity of some function19/11 02:04
ccasinof course, those particular solutions are reasonable ones - maybe agda could somehow display "obvious" possible instantiations based on the context19/11 02:08
ccasinI mean to say, as you point out, specifying the precise constraints is hard, but it might be easy to show some particular and likely-to-be-useful solutions satisfying those constraints19/11 02:09
ccasinor maybe I'm blowing smoke and actually it would be easy and useful to show the constraints19/11 02:10
copumpkin:)19/11 02:10
Saizanit should at least say where _314 comes from19/11 02:12
copumpkinit does elsewhere19/11 02:12
Saizanin an understandable way?19/11 02:13
copumpkinnot really19/11 02:13
ccasinSaizan: how would one show it in an understandable way?19/11 02:17
ccasinAlready it identifies the line number and type in the list of unsolved metas19/11 02:18
copumpkinwhnf (stripeDiagonal [ ♭ zs ]) != (whnf (map [_] (fromColist⁺ zs)) | (whnf (fromColist⁺ zs) | ♭ zs))19/11 02:19
copumpkinin an error19/11 02:19
Saizanif it is e.g. the type of some expression say so, or if it's an implicit argument to some function call, a bit like the holes19/11 02:19
copumpkinwhat do the | mean?19/11 02:19
* Saizan wants to know too19/11 02:20
-!- copumpkin is now known as ivanmorphism19/11 03:14
-!- ivanmorphism is now known as copumpkin19/11 03:16
Saizan_anyone using darcs agda has noticed that the .Foo.agda files are not longer written, and you don't get the source highlighted just by opening a previously checked file?19/11 04:06
dolioluqui: You can turn off the positivity checker, but other than that, there's no way to write Mu as regular data.19/11 04:49
dolioBecause there's no way to parameterize by something and say "this needs to be strictly positive in its first argument."19/11 04:50
luquidolio, what about a family of strictly positive functors19/11 04:50
dolioUnless you construct a datatype of strictly positive types.19/11 04:50
luquidefined by some other means19/11 04:50
dolioEr, yeah.19/11 04:50
luquibut that is probably not that easy19/11 04:50
dolioIt isn't really that hard.19/11 04:51
luquia algebraic type with sums, products, and codomains?19/11 04:51
luquiis that enough?19/11 04:51
dolioYou probably want the constant functor, too.19/11 04:52
dolioAnd maybe 0 and 1, although you can do that with constant.19/11 04:52
luquicool.  might be fun to play with someday.19/11 04:53
luquihow do you use universe polymorphism?19/11 04:58
copumpkindo you have the latest standard library? there's an easy module Level in there19/11 04:59
copumpkinotherwise, you can make levels yourself without too much work19/11 04:59
luquicopumpkin, cool19/11 04:59
luquiSo, is the raw definition that you can have Set L, where L is any data?19/11 04:59
copumpkinhttp://www.cs.nott.ac.uk/~nad/listings/lib/Level.html#17419/11 04:59
copumpkinI think it'll check that you've done that BUILTIN pragma stuff on what you're using for your level type19/11 05:00
copumpkinI wonder how it would enjoy having codata Level19/11 05:01
luquioh, so it's basically nat19/11 05:01
copumpkinyeah19/11 05:01
dolioIt'll probably tell you that levels aren't codata.19/11 05:01
dolioJust like it does with naturals.19/11 05:02
Saizan_noone, eh?19/11 05:02
luquiI sure haven't19/11 05:02
copumpkinSaizan_: I forgot the old behavior I guess :P19/11 05:03
copumpkinbut yeah, that's true19/11 05:03
Saizan_well, it was quite nice for browsing the standard library without needing that much ram :)19/11 05:04
luquiI am trying to just import U from Level19/11 05:06
luquiopen import Level using (_U_)    (where U is the \un) says it doesn't export it19/11 05:06
luquioh it's some kind of bracket-u19/11 05:07
luqui\lub19/11 05:08
luquii'm not enjoying this unicode thing very much19/11 05:08
Saizan_C-u C-x = over a symbol, to get a description and the binding19/11 05:10
luquithat's helpful19/11 05:11
luquiWait, are you sure?  That doesn't seem to be working19/11 05:13
Saizan_"C-u C-x =" works hre19/11 05:23
luquioh, equals.19/11 05:37
luquimy eyes scanned right past that19/11 05:37
luqui:-P19/11 05:37
luquishouldn't an expression of type Set l fit in the type Set (suc l) as well?19/11 06:44
luquido I need to cast it?19/11 06:44
dolioYou mean A : Set 1 ==> A : Set 2?19/11 06:55
luquidolio, yeah19/11 06:55
dolioNo, that doesn't happen yet.19/11 06:55
luquiis... there any way to allow it to19/11 06:55
dolioIt needs lifting operations that haven't been implemented yet.19/11 06:55
luquihm19/11 06:55
luquiwell.. that's lame19/11 06:55
dolioYou could of course implement it with a datatype.19/11 06:56
luquiyeah i just had that idea19/11 06:57
luquiOkay, so, not impossible19/11 06:57
luquiwait... how?19/11 06:58
luquiI tried19/11 06:58
luquidata Cast (l m : Level) (a : Set l) : Set m where19/11 06:58
luqui  MkCast : a -> Cast l m a19/11 06:58
luquiah right, : Set (l lub m)19/11 06:59
luquiOh boy, internal error!19/11 07:01
copumpkin<borat>nice!</borat>19/11 07:01
dolioThe thing about the real operation is you want it to permute through type constructors.19/11 07:04
dolioSo up (F A) = F (up A), assuming F is universe polymorphic.19/11 07:04
dolioAnd up (A -> B) = up A -> up B19/11 07:04
luquiOkay, here's the context where I ran into this.  Maybe there is a better way.19/11 07:08
luquiI am playing with the partiality stuff, and I am trying to implement a general fix19/11 07:09
luquiI would like it to work on the family of types19/11 07:09
luquiD a -> D a,  (D a -> D a) -> (D a -> D a), ...19/11 07:09
luquier, sorry, (D a -> D b) -> (D a -> D b)19/11 07:10
luquihmm.. I wonder if I just answered my own question...19/11 07:10
dolioWell, I thought I was being novel trying to do contextual erasure typing with sigma types, but it looks like one of the authors of the EPTS paper did a thesis that includes inductive types.19/11 07:37
ski_"contextual erasure typing with sigma types" ?19/11 08:07
dolioThere's a paper on "Erasure Pure Type Systems", which has annotations on lambdas, pis and applications, distinguishing erasable from non-erasable things.19/11 08:15
dolioSo, like, you might have "/\A : Set -> \x : A -> x" for polymorphic identity.19/11 08:16
dolioIndicating that A can be erased.19/11 08:16
dolioThis is instead of having erasability tied to type.19/11 08:17
dolioSo, I'm fiddling with an interpreter that implements that (among other things).19/11 08:17
FunctorSalad*naive* isn't erasability linked to having just a single element?19/11 08:17
dolioAnd I also want to have sigma types. But there's no reason you can't use a similar system to erase parts of those, too.19/11 08:18
FunctorSaladthose where the second component is a proof?19/11 08:18
dolioProof irrelevance is (sort of).19/11 08:18
dolioActually, I realized last night that you could erase either component.19/11 08:18
dolioSo far I'd been planning on erasing only the first, since that's analogous to the lambda situation.19/11 08:19
FunctorSaladnot sure what sort of sums you have in mind19/11 08:19
dolioAnyhow, you can erase more than irrelevant proofs.19/11 08:20
FunctorSaladhmm not(x) has just a single element extensionally right?19/11 08:20
FunctorSalad(or none)19/11 08:20
FunctorSaladfor any x19/11 08:20
dolioPresumably you'd erase types when compiling a language (unless you have some kind of type case), for instance.19/11 08:20
FunctorSaladso classical or should have 0/1 element (not(not(P) && NOT(Q)))19/11 08:20
dolioWhich is why /\A : Set -> \x : A -> x makes sense.19/11 08:20
dolioA is only ever used in the types of things, which has no computational use.19/11 08:21
FunctorSaladhmm yes19/11 08:21
dolioSo you can erase that down to \x -> x in some suitable calculus, because that's the only part you need to compute at runtime.19/11 08:21
FunctorSaladuntyped lc?19/11 08:21
FunctorSaladbut I don't see the relation to prove erasure19/11 08:21
dolioWell, in the paper they erase to a curry-style but still typed calculus.19/11 08:22
FunctorSaladsorry I jumped in without cxt :)19/11 08:22
dolioIt has no relation to proof erasure, yet, although I have an idea for that, too.19/11 08:22
FunctorSaladclearly constructive OR of two provable props has two elements19/11 08:23
FunctorSaladhence my thinking about not(not(P) && not(Q))19/11 08:23
dolioThe point of the EPTS stuff is that whether or not you can erase something depends on how you use it, rather than what type it has.19/11 08:23
FunctorSaladyeah, I mean the approaches could be complementary19/11 08:24
FunctorSaladif there's just zero or one elements, you can delete it definitely19/11 08:24
FunctorSaladso some dependencies are also dropped19/11 08:24
dolioBut, on the other hand, if you ensure that the way you use Props is always computationally irrelevant, you could presumably correctly annotate your program such that the proofs get erased.19/11 08:25
FunctorSaladyou mean with Prop like in coq?19/11 08:25
dolioYes, but there erasure is tied to Prop.19/11 08:25
FunctorSalad(is double negation a monad? :D)19/11 08:25
FunctorSaladI think it is19/11 08:25
dolioYes.19/11 08:26
dolioIt's Cont \bot19/11 08:26
FunctorSalad*nod*19/11 08:26
FunctorSaladwas just thinking of quarantining the noncomputational stuff in a monad19/11 08:26
FunctorSaladand this monad seems to be double negation already :)19/11 08:26
dolioAnyhow, I was thinking perhaps if I add an OTT-like equality, then the coercion operator can be typed such that you can write, for instance: /\eq : A == B -> \x : A -> coerce eq x19/11 08:27
dolioThen that could be erased to \x -> x.19/11 08:27
dolioBut, I don't know if that works yet.19/11 08:27
FunctorSaladwait, are we talking about erasure when compiling programs?19/11 08:28
FunctorSalad(or some sort of proof irrelevance in the conversion)19/11 08:28
opdolioWhere did I leave off?19/11 08:31
FunctorSalad<dolio> But, I don't know if that works yet.19/11 08:32
FunctorSalad<FunctorSalad> wait, are we talking about erasure when compiling programs?19/11 08:32
FunctorSalad<FunctorSalad> (or some sort of proof irrelevance in the conversion)19/11 08:32
opdolioYes.19/11 08:33
opdolioYou type check, then erase to get your program.19/11 08:33
opdolioWhich is more efficient than running a program with all the non-erased stuff.19/11 08:33
opdolioAnyhow, the two forms of Pi, might be written "pi" and "forall".19/11 08:33
opdolioSo that identity would have type: forall A : Set. A -> A19/11 08:33
opdolioSo I thought that erasing the first component of a sigma might give something worth being called exists.19/11 08:33
opdolioSince, it really gets forgotten as far as computation is concerned.19/11 08:33
FunctorSaladpi being for types depending on values?19/11 08:33
FunctorSaladthat sounds a lot like coq's "exists"19/11 08:34
opdolioThat, or computationally relevant abstraction.19/11 08:34
FunctorSalad(you can only destruct it to prove a Prop)19/11 08:34
FunctorSaladso the goal is to do something like in coq but without having a  magic sort?19/11 08:35
FunctorSalad(Prop)19/11 08:35
opdolioBut, there's also the use of sigma types with a prop as the second component, where you get subsets, essentially.19/11 08:35
FunctorSaladsuch a type should just compile to the same repr as the first type, no?19/11 08:35
opdolioBut having two erasable things doesn't really fit into the scheme very well, because the original setup just annotated the binder.19/11 08:35
FunctorSalad(the first component)19/11 08:36
opdolioRight.19/11 08:36
opdolio(p, q) gets erased to p (or q for exists).19/11 08:36
FunctorSaladI don't know much about erasure so maybe we're talking past each other :)19/11 08:36
FunctorSaladyes19/11 08:36
FunctorSaladit doesn't sound hard at first glance19/11 08:36
FunctorSaladis it computable? (to erase all the propositional stuff)19/11 08:37
FunctorSalad(FSVO 'propositional', of course...)19/11 08:37
opdolioErasing with the annotations is pretty easy. I don't know how easy it is to take an un-annotated language and figure out what the right annotations are.19/11 08:38
opdolioBut I'm not interested in the latter at the moment.19/11 08:38
FunctorSaladdo you annotate everything or just a few strategic things?19/11 08:39
opdolioPi, lambda and application in the original paper, which is just about everything, I guess.19/11 08:39
opdolioAnyhow, the idea is that if you handle erasing by types, you end up having to write duplicate code.19/11 08:40
opdolioIf T : Prop means that values of T get erased, then you might have to write a T' : Set for computational Ts, and the T : Prop for non-computational Ts.19/11 08:41
FunctorSaladhmm yes19/11 08:41
opdolioWhereas in an EPTS, whether or not values of T get erased depends on how you use them.19/11 08:41
opdolioSame with 'dependent' programming in Haskell.19/11 08:42
opdolioTypes get erased, so you end up writing type-level stuff, and value-level stuff, and linking the two.19/11 08:42
FunctorSaladhow has it caught your interest? for agda?19/11 08:43
opdolio(And Omega and ATS)19/11 08:44
opdolioI'm interested in fooling with fancy type systems.19/11 08:44
opdolioI'm writing an interpreter.19/11 08:44
-!- opdolio is now known as dolio19/11 08:44
dolioI'm not sure I'd know how to add it to agda.19/11 08:44
luquiwhat is the Agda way for the coq syntax  { x : A | p x }19/11 08:55
luquii.e., x : A such that p x holds19/11 08:56
FunctorSaladΣ A p19/11 08:57
FunctorSalad(IIRC in Data.Product)19/11 08:57
luquiah, thanks19/11 08:57
ski_dolio : that sounds related to some thoughts i've had19/11 09:05
ski_i was thinking on how to separate the proof irrelevance / erased parts from quantifiers19/11 09:06
ski_so instead of `forall x : A. ..x..' one would say something like `Forgotten (x : A) -> ..x..'19/11 09:08
ski_`Forgotten Foo' having a single inhabitant iff `Foo' has any inhabitant (and is empty otherwise)19/11 09:09
ski_(`Forgotten' would probably be a monad)19/11 09:09
dolioYeah. I've seen systems like that, too.19/11 09:09
dolioPeople proposing bases for NuPRL's quotient types and stuff.19/11 09:09
FunctorSaladbut defining Forgotten is not possible currently, right?19/11 09:09
ski_it would be a primitive19/11 09:09
FunctorSaladquotient types++19/11 09:09
ski_i'm not sure it's the same as a quotient type, at least not operationally19/11 09:10
ski_the operational idea i have of quotient types is that representants are computed and passed around19/11 09:10
ski_but here we want to avoid computing any representant19/11 09:11
FunctorSaladhmm if it contains no information, then the "rep" function would have to make up some element of A out of thin air19/11 09:11
FunctorSalad(rep : quotient -> original space)19/11 09:11
ski_why would there be a `rep' function, here ?19/11 09:11
FunctorSaladI mean if Forgotten was a quotient, and we had choice, we'd need such a thing :)19/11 09:12
ski_there is `Forgotten A -> Forgotten (Forgotten A)', though19/11 09:12
ski_(the monadic `join')19/11 09:12
FunctorSaladother direction?19/11 09:13
FunctorSalad(that's fmap return :))19/11 09:13
ski_er, right19/11 09:13
FunctorSaladthat sounds a lot like the double negation monad I mentioned19/11 09:14
ski_in `Forgotten (n : Natural) -> Forgotten (P n)' `P' could do induction on `n'19/11 09:14
FunctorSalad(you can't get any computation out of a negation proof, right?)19/11 09:14
ski_yes, i was thinking double negation would possibly be one way to implement this19/11 09:14
luquiForgotten & rep  witness the axiom of choice19/11 11:10
guerrillaany recommendations for a book on lambda calculus? maybe something constructive?19/11 13:25
facsimileLectures on the Curry-Howard Isomorphism is my favourite book on lambda calculus ever19/11 13:26
guerrillalooks good from the TOC19/11 13:27
guerrillaany prerequisite background it favors?19/11 13:28
facsimileno19/11 13:28
guerrillagreat19/11 13:28
guerrillabit expensive it seems.. hmmf, will have to do some bargain hunti19/11 13:30
guerrillan19/11 13:30
facsimileI think the online version is equivalent to the book19/11 13:34
FunctorSaladhmm if you have (A, ~), could you give the quotient A/~ the eliminator that every function on A respecting ~ descends to A/~ ?19/11 13:34
FunctorSalad(to avoid `rep'?)19/11 13:34
FunctorSalador can you somehow recover rep from that19/11 13:34
facsimileFunctorSalad sounds plausible and a good idea but what the terms?19/11 13:35
facsimiledescends?19/11 13:35
FunctorSaladI mean given f : A -> B respecting ~, there's an f' : A/~ -> B such that f = f' ∘ quotientMap19/11 13:36
FunctorSaladuh it 'descends' because the total space is hovering over the quotient or something ;)19/11 13:36
FunctorSalador because A/~ is drawn below A in the diagram usually ;)19/11 13:37
facsimilewhat's that to do with eliminator19/11 13:44
facsimilebtw doesn't that requring taking the inverse of an injective function19/11 13:44
facsimile?19/11 13:44
FunctorSaladI call it 'eliminator' because it defines how to define functions out of A/~19/11 13:45
facsimileoh right19/11 13:45
facsimileactually19/11 13:46
facsimileif yuo let  f' = f o representative19/11 13:46
facsimilerepresentative : A/~ -> A19/11 13:46
facsimiledo you think could be shown respectful?19/11 13:47
FunctorSaladI'm not sure what injective functions you're thinking of19/11 13:47
FunctorSaladhmm I thought we were avoiding `representative'19/11 13:47
facsimileI feel like representative o quotientMap is id (well not id, but respectfully id)19/11 13:47
FunctorSaladit's the projection to "normal forms"19/11 13:48
FunctorSalad(so in particular `rep' would give you a decision procedure for equivalence)19/11 13:48
FunctorSaladif equality is decidable on A19/11 13:48
facsimilewhat about  f : (a : A) -> B a?19/11 13:49
FunctorSaladwhere B=?19/11 13:50
facsimileB : A -> Set19/11 13:52
facsimilethere's no way to define dependent functions with setoids?19/11 13:52
FunctorSaladwell you need that forall a, Setoid (B a)19/11 13:53
FunctorSaladthough that's not enough if you need heterogenous equality on the codomain19/11 13:54
-!- copumpkin is now known as pumpkin19/11 17:39
-!- pumpkin is now known as copumpkin19/11 17:42
luquiWhat is the "abstract" keyword?19/11 17:46
copumpkinI think it means people can't look inside it19/11 17:47
luquiso like private?19/11 17:47
copumpkinhaven't actually played with it much, but as far as I understand it means that all you get is the type of the term, and you can't look inside at its definition19/11 17:48
luquiah, an opaque definition19/11 17:49
facsimilehttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.VisibilityAndEvaluation19/11 17:50
facsimilebest I could find ..19/11 17:50
dolioThings declared inside an abstract block don't unfold when you're trying to prove things about them.19/11 17:55
dolioprivate is how you prevent something from being exported from a module.19/11 17:56
luquik, that's straightforward enough19/11 17:59
luquiprivate = don't export anything ; abstract = export name but not definition19/11 17:59
dolioYeah, basically.19/11 17:59
luquiand the scope of the exceptions is the... innermost enclosing module?19/11 18:00
luquii.e. same module can see privates and abstracts' definitions ?19/11 18:00
dolioOnly stuff in the same abstract block can see the definitions in question.19/11 18:01
luquioh19/11 18:01
luquiso is it possible to have a function f which is not abstract, whose termination check depends on g which is abstract19/11 18:02
luquithat might not even make sense19/11 18:02
luquisurely abstract definitions should be able to use private ones19/11 18:03
luquiah, it looks like privates have innermost module scope19/11 18:10
copumpkinluqui: I think it's mostly because nobody's gotten around to it yet19/11 18:42
copumpkin(the lack of universe polymorphism in some modules in the standard library and not others)19/11 18:42
luquiok, good :-)19/11 18:43
facsimilebuggy universe polymorphism better than nothing?19/11 18:43
luquioh it's buggy?19/11 18:43
facsimilewait let me scratch that19/11 18:43
facsimilebuggy universe polymorphism better than type-in-type?19/11 18:43
luquiyes!19/11 18:43
luquiwhat is buggy about it?19/11 18:43
facsimileluqui I couldn't be sure, since they've fixed so many.. how could there any bugs left? :P19/11 18:43
luquilol19/11 18:44
Saizana few cases were only a matter of the agda-mode not reporting there were unresolved constraints, it seems19/11 18:48
dolioIt's tragic that they weren't able to implement universe polymorphism perfectly in a single darcs check-in.19/11 18:51
copumpkinproof of what fasta was saying earlier!19/11 18:51
copumpkinPL research is bullcrap19/11 18:51
facsimiledolio: I know you'er making fun of it but I think it matters19/11 19:01
facsimilekinda the whole reason one might care about mechanical proof19/11 19:01
EnglishGenthello :)19/11 19:03
facsimilehi19/11 19:03
facsimilecopumpkin learn anything from what fasta was saying? Or just spent that time trying to make some express thenmselves in a less arrogant way?19/11 19:06
copumpkinfacsimile: well, considering all he was doing was complaining about lack of innovation, without giving any convincing arguments for it, not really19/11 19:07
copumpkindo you have thoughts on the matter?19/11 19:07
EnglishGentinnovation of what?19/11 19:07
copumpkinin PL research19/11 19:07
EnglishGent(serious question)19/11 19:07
facsimileyes but you'll all hate me and make fun of me even more if I voice them19/11 19:07
EnglishGentI wont - I'd like to hear them (serious)19/11 19:07
copumpkinI don't think I've ever made fun of you :o19/11 19:07
* EnglishGent thinks there's a serious lack of innovation in *industry* -- but that's different19/11 19:08
FunctorSaladbuggy universe poly is proof that PL research is bull?19/11 19:08
copumpkinand considering I'm a newcomer to the whole field, I'm not terribly opinionated :) I just get frustrated to see someone say stuff like that when they don't seem to know much19/11 19:08
FunctorSalad*confused*19/11 19:08
facsimilewhy do you think fasta doesn't "know much"19/11 19:09
copumpkinjust an impression I got from watching him/her in #haskell19/11 19:09
copumpkincan't point at anything in particular19/11 19:09
copumpkinis that another of your aliases? :P19/11 19:09
facsimilehe's probably got massive amounts more experience than all of us, but he's not just learning about beginner stuff like I am - so he doesn't have that same nthusiasm that makes him seem like a genius19/11 19:09
facsimileIt's impossible to gauge what someone knows, the best approach is try to not to patronize and piss people off that do know what they're talking about19/11 19:11
copumpkineither way, regardless of his qualifications, he didn't appear able to support his painfully broad statement19/11 19:11
facsimile(because when you learn some stuff and everyone thinks you don't, it's dire)19/11 19:11
EnglishGentwhat did he claim? (curious)19/11 19:11
copumpkinI mean, he was dismissing an entire field of study19/11 19:11
copumpkinhe said that PL research didn't give much bang for the buck and that nothing of interest had come out of it in the past few years19/11 19:12
luquiyes, far too much focus on authority vs. argumentation in this discussion...19/11 19:12
facsimileluqui: but that's what the discussion is about ?19/11 19:12
copumpkinand was generally being caustic19/11 19:12
luquiwell i came in late, but it seems like you guys are arguing about whether pl research is giving bang for the buck...19/11 19:12
EnglishGenthi luqui :)19/11 19:12
copumpkinas I said before, I don't really have an opinion on the matter (being a newbie myself)19/11 19:13
copumpkinhe was just overly caustic and I don't think broad statements like that are of any use19/11 19:13
luquihi, uwoerwierweojr19/11 19:13
luquithere are many statements, fewer proofs :-)19/11 19:13
copumpkinfacsimile: do you know him in person or something? I didn't think you spent time in #haskell anymore19/11 19:14
facsimileluqui even proofs don't contain enough proofs:   "hence |x-a| <= ...."  without the proof that you have to subtract ... from both sides19/11 19:14
facsimilecopumpkin: you mentioned it in a way that seemed to apply to me so I checked the logs19/11 19:15
copumpkinah19/11 19:15
facsimilelike my ridiculous verbiage was proof of something he said or whatever :P19/11 19:15
luquianywho, physics research in the late 19th centure wasn't giving much bang for the buck19/11 19:15
copumpkinso do you (dis)agree with him? or you just wanted to set me straight with regards to his authority?19/11 19:15
luquiwith the parallelism crunch happening now, i feel like there might be a double slit experiment around the corner19/11 19:16
facsimilecopumpkin; I don't even know what he's on about, all I think matters is trying to have respect for peoples opinions regardless of relative intelligence or how arrogant they sound19/11 19:16
copumpkinfacsimile: well that's where this all stemmed from really :) did you see how the discussion started?19/11 19:17
copumpkinit seemed like a disrespectful position for him to have19/11 19:17
luquioh... nevermind.  you guys are having an emotional discussion.19/11 19:17
copumpkinyep :)19/11 19:17
luquisometimes i wonder if i have asperger's  (not really)19/11 19:18
facsimileluqui: not really sure what you're getting at other than "oh god please stop arguing!!!"19/11 19:18
facsimileluqui: and I don't think it does well to devalue terms like 'emotional' as if being rational is so important19/11 19:19
luquii think it was my mind wandering as i unintentionally entered an uncomfortable discussion19/11 19:19
copumpkinomg edwardk19/11 19:19
* edwardk hides.19/11 19:20
copumpkinin search of universe polymorphism!19/11 19:20
edwardkuniverse polymorphism makes me happy =)19/11 19:20
dolioGet him!19/11 19:20
edwardkack!19/11 19:20
* edwardk hides.19/11 19:20
* edwardk tries very hard to become existentially quantified without a proof of his own existence so you can't extract him from the channel.19/11 19:20
facsimilelol19/11 19:21
* edwardk discards the witness.19/11 19:21
copumpkinfacsimile: anyway, you read the logs, it started with his broad/offensive statement, I took issue with it and said "you're kidding, right?", and then he got unpleasant and started sarcastically asking me to provide examples of great innovation. I explained that I was unable to (which didn't imply that there were no such examples) and he just got nastier, so I wasn't particularly impressed19/11 19:21
luquiis Relation.Nullary.Decidable the typical way quotients are modeled in agda?19/11 19:21
luquier, .True19/11 19:21
dolioSomething like that.19/11 19:22
edwardkcopumpkin: "he"?19/11 19:22
copumpkinedwardk: a semi-argument/name-calling in #haskell earlier, with fasta19/11 19:22
edwardkah19/11 19:22
* edwardk is sure there is a 'BLAST' pun that could be made at this point, but isn't sure there are any bioinformatics folks here to appreciate it19/11 19:23
facsimileluqui I don't think so, are quotiens and setoids the same thing?19/11 19:24
luqui... i didn't think so.  but i never really grokked setoids19/11 19:24
dolioTrue is used in the libraries when proofs of the underlying proposition aren't provably unique.19/11 19:24
edwardkfacsimile: approximately, think of a quotient type as just not being able to be viewed at any detail below the relation19/11 19:25
luquiso what does True do?19/11 19:25
dolioPiping them through Bool gives the desired proof properties, and avoids having to use setoids, I guess.19/11 19:25
dolioThe example I'm familiar with is with the rational numbers...19/11 19:26
luquiyeah that's what i'm staring at now19/11 19:26
facsimilelink to the code?19/11 19:26
luquihttp://www.cs.nott.ac.uk/~nad/listings/lib-0.2/Data.Rational.html19/11 19:27
facsimileI've never seen this True thing19/11 19:27
facsimilethanks19/11 19:27
facsimileoh that19/11 19:27
facsimileI wish it was called so19/11 19:27
luqui"so"?19/11 19:27
copumpkinhttp://www.cs.nott.ac.uk/~nad/listings/lib/Data.Rational.html#180 has more comments19/11 19:27
dolioThe coprimality proof is a function, so you can't prove that a given rational number has a unique representation.19/11 19:27
dolioOr something like that.19/11 19:27
edwardkfacsimile: i.e. if i have a setoid over integers that includes an equivalence relation for even or odd, then i can use the setoid to check if an integer i have is even or odd. i can then prove things about other functions/relations preserving the setoid, etc. if i have a quotient over the integers for even or odd, then i have values that are either even or odd, but i can't even try to use any other property of the integers i have t19/11 19:28
edwardkthe values i have are the equivalence classes, not the individual members of the equivalence class19/11 19:28
facsimileedwardk: in that case there's got to be some special mechanism to actually do stuff with quotients?19/11 19:28
edwardkbasically, setoids are more tractable ;)19/11 19:29
dolioBut with the True proof, any rational number has representation "record { numerator = n ; denominator = d ; coprime = _ ; ... }"19/11 19:29
luquioh interesting19/11 19:29
edwardkquotient types usually mean you need some way to either extract a canonical member of each equivalence class, or you need to use the machinery to prove that your proof doesn't care about which exemplar of the equivalence class it uses19/11 19:30
dolioWhere _ is trivial, because True (true) = \top, or whatever.19/11 19:30
luquiit kind of surprises me that that's possible... for some reason19/11 19:30
edwardkat one point in time i really wanted a notion of quotient types in a toy type system of mine, so i spent a lot of time playing with them19/11 19:30
dolioIf there were a proof irrelevant Prop universe, you could probably use that instead.19/11 19:31
luquiyeah.  but general constructive quotient types are equivalent to the axiom of choice, no?19/11 19:31
chrisdonecopumpkin: I don't think dwelling on the point of someone's experience is a good idea. neither, I think, is giving people special treatment based on their profile, rather than the content of what they say. I just wouldn't bother inventing things to say to uninteresting statements19/11 19:31
edwardklikely19/11 19:31
facsimileluqui well I was reading this paper (Venanzio) about setoids and choich..19/11 19:33
luquiwhat is this syntax:  (n ÷ zero) {≢0 = ()}19/11 19:33
copumpkinchrisdone: I do think that if you're going to demean an entire field of study, you'd damn well better know that field well, and be able to support your claims19/11 19:33
luquiOOP research is for losers!19/11 19:33
edwardkluqui: the language i was using it in was using subset typing ala dana xu's ESC/Haskell stuff, so i wasn't all that concerned with total correctness, merely partial correctness, so i could cheat a lot19/11 19:33
facsimileluqui :(19/11 19:34
dolio{f = expr} lets you apply to named implicit arguments.19/11 19:34
* edwardk is a loser. ;)19/11 19:34
dolioOh, wait, that's a match.19/11 19:34
luqui... i don't follow19/11 19:34
dolioIf you have "foo : {x y z : T} -> ..."19/11 19:35
chrisdonecopumpkin: why?19/11 19:35
luquii am happily demeaning fields of study without knowing what i'm talking about.  for some reason you guys don't take me seriously though :-)19/11 19:35
edwardkluqui: my toy language uses a lot of OOP techniques for inheriting module signatures19/11 19:35
dolioThen "foo {z = pat} ..." will match pat against the argument z.19/11 19:35
dolioWithout having to match against the implicit x and y as well.19/11 19:35
luquioh ok, that's simple enough19/11 19:36
dolioI'm actually not sure if it works the other way around.19/11 19:36
dolioIt may not.19/11 19:36
luquiand the () is the empty pattern, saying that /=0 is empty19/11 19:36
chrisdonecopumpkin: (I'm just probing, I think answering that question might be fruitful, or maybe not at all)19/11 19:36
dolioYes.19/11 19:36
copumpkinchrisdone: why what part? :)19/11 19:37
chrisdonecopumpkin: "I do think that if you're going to demean an entire field of study, you'd damn well better know that field well, and be able to support your claims" -- why?19/11 19:37
edwardker, back to my original inquiry, when did universe polymorphism get smuggled into the compiler?19/11 19:37
luquiedwardk, yeah, there is something to do that (OOP & module signatures)19/11 19:37
dolioFew months back?19/11 19:37
edwardkdoh19/11 19:37
edwardki ignore you guys for a year or so and all of a sudden the reason i walked away is implemented without fanfare ;)19/11 19:38
facsimileedwardk: it's for category theory?19/11 19:38
dolioSeptember, it seems.19/11 19:38
edwardkfacsimile: yeah. i had to use set-in-set to implement the category of small categories19/11 19:38
copumpkinchrisdone: from an emotional point of view, because many people have dedicated many years of their lives to it and you're saying they've wasted that time, and while you may be right, I think you need to have a good case for such a heavy statement19/11 19:39
edwardkdolio: nice.19/11 19:39
edwardknow i have to resist the draw of another 6 month distraction ;)19/11 19:39
dolioI don't know. I never got past representing products before I ran out of memory. :)19/11 19:40
copumpkinchrisdone: and a good case for such a statement means a survey of the entire field to show that indeed nothing of interest/use has come out of it19/11 19:40
edwardkdolio: heh.19/11 19:40
luquicopumpkin, maybe you can think to yourself "he's probably overgeneralizing" and let it go?19/11 19:41
copumpkinluqui: I'm being asked to back up my position so that's what I'm doing :) I didn't even bring it up19/11 19:41
chrisdoneluqui: we're just exploring the way the contention played out itself19/11 19:41
facsimilecopumpkin you want to get into PL reserach?19/11 19:41
copumpkinfacsimile: not really :)19/11 19:41
luquiah ok19/11 19:41
edwardkdolio: went for the whole universal morphism representation?19/11 19:41
facsimilecopumpkin you did bring it up!19/11 19:41
copumpkinfacsimile: true :)19/11 19:42
copumpkinbut only jokingly19/11 19:42
edwardki went and started to encode pullbacks and things got messy19/11 19:42
dolioedwardk: Yeah, I think so. I think I got half way through a proof of associativity, and started getting stack overflows.19/11 19:42
dolioAlthough I figured out a change that made that stop. But I never started up again.19/11 19:43
edwardkmine was mostly that any time i had to use set-in-set i felt dirty19/11 19:43
dolioWell, I never actually implemented anything that needed that.19/11 19:44
dolioAlthough, I was putting everything in Set anyway.19/11 19:44
chrisdonecopumpkin: ok, you want to avoid emotional distress?19/11 19:44
edwardkcoz i was never sure if hurkens' didn't lurk in my proofs19/11 19:44
copumpkinchrisdone: in general, yes19/11 19:44
facsimileedwardk: yeah19/11 19:44
facsimileAnd the matter of, when do add the feature is there chance this will even be possible to port across19/11 19:45
edwardkyeah19/11 19:45
luquiso if one so needed, could one use a more advanced ordinal than Nat for Level?  would that ever be needed?19/11 19:45
dolioIs the code.haskell.org web server down for everyone else?19/11 19:45
copumpkinyeah19/11 19:45
chrisdonecopumpkin: I think that between someone with no evidence tells someone that they've wasted five years, and someone presenting evidence to them that indicates they've wasted a load of time, the latter is emotionally distressing, and the former is not. don't you think?19/11 19:46
facsimileluqui not sure about needed but people (Palmgren) have studied stuff like that, it's all way to confusing for me to make any sense of though19/11 19:46
chrisdonecopumpkin: (assuming only backed up statements are worth anything)19/11 19:46
copumpkinchrisdone: it's more distressing, but justifiably so19/11 19:47
chrisdonecopumpkin: is the former even distressing?19/11 19:47
copumpkinchrisdone: not for the same reasons, but yes19/11 19:47
edwardkbah: i make unbacked statements all the time. like this one!19/11 19:47
copumpkin:)19/11 19:47
chrisdonecopumpkin: but if it is unbacked up, it can't be worth anything and will be disregarded, right?19/11 19:48
facsimilehaha19/11 19:48
copumpkinchrisdone: it's definitely worth something19/11 19:48
edwardkchrisdone: the question is can you back that up? otherwise we have to discard... oh my head hurts19/11 19:48
copumpkinchrisdone: you start wondering about the person's motivations when they say something with no evidence19/11 19:48
chrisdonecopumpkin: yes19/11 19:48
edwardkcopumpkin: but they get away with it in politics all the time and in the interest of fair and balanced coverage...19/11 19:49
copumpkinand the fact that they chose to say something potentially hurtful with no evidence is in itself distressing19/11 19:49
copumpkindamn right19/11 19:49
luquiedwardk, lol19/11 19:49
chrisdonecopumpkin: what I was trying to conclude is that, whether a statement is backed up or not, people are going to get hurt if they take it seriously19/11 19:50
copumpkinyep19/11 19:51
chrisdonecopumpkin: but if a lunatic or a clown made the statements, I have doubts about whether that would be taken seriously19/11 19:51
chrisdonecopumpkin: and I think of everyone on IRC like clowns :D19/11 19:51
copumpkinI do too, some of the time19/11 19:51
chrisdonelunatic clowns19/11 19:51
copumpkinbut not everyone does, and fasta isn't ridiculous enough to be in the clown bin for me19/11 19:51
luquiperhaps we should ridicule him more then?19/11 19:52
Saizanmmh type theory + sociology19/11 19:52
copumpkin:)19/11 19:52
edwardkso what was the particular name calling exchange about?19/11 19:52
edwardkyeah, wait until Glenn Beck attacks your type system.19/11 19:52
Saizanoh, god, who do we use as jon stewart then?19/11 19:53
chrisdonecopumpkin:  welllll I just think people make statements all the time to hurt people, with varying motivations (intentional or unintentional), and it seems the best (and hardest) thing to do is to let it pass. anyway, I'll drop the topic19/11 19:54
chrisdonecopumpkin: I've been reading Zhuangzi so I'm all reflective recently :p19/11 19:54
edwardkI nominate Cale.19/11 19:54
edwardkWith copumpkin playing the role of steven colbert.19/11 19:54
copumpkinchrisdone: I am not personally offended by what he said, but I tend to feel the need to point out to people that they may be offending other people19/11 19:54
luquichrisdone, the world model I use is that people almost never mean to hurt others, and if I am offended by a statement, I am probably misinterpreting its intention19/11 19:55
facsimilechrisdone, (looks cool ty)19/11 19:55
chrisdoneyeah19/11 19:55
chrisdone(to all three)19/11 19:56
luquia scatter reply19/11 19:57
chrisdoneindeed19/11 19:57
luquii would love to see a graph of IRC conversations19/11 19:57
chrisdoneluqui: have you seen those IRC graphs showing which people talk to which the most?19/11 19:58
luquieven between two people they fork and merge ...19/11 19:58
chrisdonehttp://www.jibble.org/piespy/19/11 19:58
luquichrisdone, no...19/11 19:58
edwardkluqui: you are a far nicer person that i will ever be, or at least play one on IRC ;)19/11 19:58
chrisdoneluqui: I think there is even one for #haskell knocking about somewhere19/11 19:58
edwardkluqui: its tricky to graph irc conversations because of undirected comments