00:06:06 Riastradh: if behaviour of "define" at top level is still defined like in CL, i.e. analogously to "setf" and "intern", then I don't see the relation to "letrec*". 00:06:53 Thus you need better example to demonstrate why current letrec* is not broken. 00:10:23 jao [~jao@21.Red-79-153-49.dynamicIP.rima-tde.net] has joined #scheme 00:10:26 -!- jao [~jao@21.Red-79-153-49.dynamicIP.rima-tde.net] has quit [Changing host] 00:10:27 jao [~jao@pdpc/supporter/professional/jao] has joined #scheme 00:11:02 Riastradh: My understanding is that internal definition is letrec*, specifically not letrec. 00:13:31 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 00:15:18 alexei [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has joined #scheme 00:15:21 jcowan: BTW, this indicates that top level behaviour may need further elaboration. 00:15:51 Top level behavior is intentionally only partly defined. 00:15:55 -!- amgarchIn9 [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has quit [Quit: Konversation terminated!] 00:17:07 Erm. 00:17:38 How are you going to deal with libraries/modules then?? 00:18:29 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 272 seconds] 00:18:56 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error: Connection reset by peer] 00:19:55 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 00:24:24 What do you mean exactly? 00:31:09 -!- alexei [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has quit [Ping timeout: 272 seconds] 00:31:54 It is unclear how you're going to describe behaviour of definitions within one module. 00:32:22 Is it going to be top level, another top level, or something completely different? 00:35:06 How it is going to interact with top level is another interesting question. 00:35:27 I see that some people decide to drop REPL completely in favour of clear semantics. 00:38:53 Anyway, we'll see... 00:39:14 Modules have nothing to do with the REPL; their rules are spelled out. They don't allow redefinition, but they do require syntax definition to precede use. 00:39:54 In fact, though, essentially all existing REPLs use the same rules, which is why we spelled out what we did. 00:40:15 (The only exception among the 40-odd Schemes I use for testing is SCM.) 00:48:04 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 00:57:49 -!- tiksa [~tiksa@gateway/tor-sasl/tiksa] has quit [Ping timeout: 240 seconds] 00:58:42 tiksa [~tiksa@gateway/tor-sasl/tiksa] has joined #scheme 01:03:07 what is the difference between data abstraction and OOP? 01:04:57 Data abstraction is an element of OOP. 01:05:47 so all OOP incorporates data abstraction, but not all data abstraction is OOP? 01:06:09 It depends on whether you count behaviours (i.e. how objects respond to messages) data. 01:08:11 zacts: OOP is not a very well defined term and encompasses a couple orthogonal ideas. 01:08:28 I'd say that those ideas are non-orthogonal. 01:08:52 Some people argue that programming in CLOS is OOP. 01:09:29 how about SICP's definition of data abstraction and OOP.. 01:09:31 CLOS doesn't offer encapsulation, right ? All "slots" are public ? 01:11:22 Python and ECMAScript don't offer it either. :) 01:11:56 If so, then perhaps it could be said that OOP encompasses polymorphism, and encapsulation, which are two orthogonal concepts from what I see. 01:14:02 This opens a tricky question whether procedural language with polymorphic procesures and ADTs is OOP or not. 01:14:12 E.g. Ada as of 1983. 01:15:54 I would say no, particularly since OOP was one of the touted features of Ada 95. 01:16:03 Some people use 'object-based' for that case. 01:17:00 Then "polymorphism and encapsulation" don't define OOP. 01:17:11 i would argue that any system that enforces complete encapsulation is unneccesarily restricting freedom 01:17:30 I didn't mean to say that any language that supports those two supports OOP. 01:17:59 see e.g. Ruby which is mostly encapsulated but also provides set_instance_variable and get_instance_variable, as well as leaving classes "open" for later modification 01:18:08 Rather, the term OOP has in practice been used to refer to certain techniques for polymorphism, and certain techniques for encapsulation. 01:18:25 (Personally, I'd define OOP as a style of writing code in a way that is to some degree reminiscent of objectstudioactors sending messages to each other, that is Smalltalk.) 01:19:01 "OOP" as a term is really rather meaningless 01:19:38 All terms are really rather meaningless, but somehow conversation goes on. 01:19:39 i'd say Scheme with define-record-type or equivalent is object-oriented, but an experienced Java programmer would probably disagree strongly 01:19:43 heh, heh 01:22:49 Record types give encapsulation only, but no polymorphism. From what I see so far, all languages that have been called to support OOP have at minimum supported polymorphism through either a class/instance system, or protytypes; and optionally strong encapsulation (scope management, arguably more cleanly achieved through static scoping, hence the exclusion of it from CLOS, ECMAScript, and similar?) 01:38:33 It is still unclear. 01:38:53 If you accept ECMAScript as OOP, 01:38:55 what about Lua? 01:39:29 OOP is a pattern, not a language. Some languages support that pattern well, some require kludges to support it. 01:39:49 You can do OOP in pure C, for otherwise, the C->C++ translator would have been impossible. 01:39:51 Yes, I have mentioned it above. 01:40:23 It is quite possible to write in functional style in C++. 01:40:28 Though the code looks quite horrible that way. 01:43:29 dmr000 [~dmr@c-50-152-149-59.hsd1.ca.comcast.net] has joined #scheme 01:43:52 testing 01:44:07 -!- dmr000 [~dmr@c-50-152-149-59.hsd1.ca.comcast.net] has left #scheme 01:54:45 alexei [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has joined #scheme 01:56:02 oxum [~oxum@122.164.105.247] has joined #scheme 02:06:23 -!- alexei [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has quit [Ping timeout: 260 seconds] 02:09:15 -!- jao [~jao@pdpc/supporter/professional/jao] has quit [Ping timeout: 252 seconds] 02:19:12 duggiefresh [~duggiefre@c-66-30-11-90.hsd1.ma.comcast.net] has joined #scheme 02:22:51 -!- tcsc [~tcsc@c-76-127-240-20.hsd1.ct.comcast.net] has quit [Quit: computer sleeping] 02:22:59 -!- stepnem [~stepnem@internet2.cznet.cz] has quit [Ping timeout: 272 seconds] 02:26:20 jcowan, in the R5RS internal definitions are LETREC. I don't know about the R6RS or R7RS. 02:34:19 Riastradh: In other words, you believe it's an error to depend on the order in which the initialization expressions of internal defines are evaluated? 02:37:17 In the R5RS, it is. 02:39:46 *jcowan* nods. 02:40:12 I suppose the reason that letrec* (which is a special case of letrec) was introduced was primarily because users *were* depending on that property. 02:40:40 IIUC, it is valid to implement letrec and letrec* the same way. 02:41:00 No. 02:41:14 LETREC evaluates all right-hand sides before any assignments happen. 02:41:21 LETREC* interleaves assignments with right-hand sides. 02:43:05 alexei [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has joined #scheme 02:44:41 Riastradh: That is a possible interpretation of the R6RS/R7RS language "each variable is assigned in left-to-right order to the result of evaluating the corresponding ", but it doesn't actually say that assignment and evaluation are interleaved. 02:44:58 AFAICR that R6RS was going to forbid "define" except at top level. 02:45:08 No, ASau. 02:45:24 Maybe. 02:45:34 It may have forbidden non-DEFINE at the top level of a library, but I don't remember. Certainly it didn't get rid of internal definitions. 02:45:48 jcowan, (letrec* ((x 0) (y x)) y) is supposed to yield 0; if it doesn't, your LETREC* is broken. 02:46:05 Random expressions at top level are transformed into defines of otherwise unknown variables. 02:46:21 And yes, internal definitions are still available in R6RS and R7RS. 02:46:26 And (letrec ((x (f)) (y (g))) ...) is supposed to call F and G with continuations that assign all variables, not a subset of them. 02:47:14 The latter is clear from the R[567]RS language, but the former is not. 02:47:23 Time for another bombing run. 02:47:50 Then the specification of LETREC* in the R[67]RS is broken, because that was the whole point of the exercise of LETREC* in the first place. 02:48:32 The question is what "interleaving means" and how exactly top level expressions are transformed. 02:48:44 No. 02:49:14 The expansion is: (letrec* ((x E) (y F)) G) => (let ((x ) (y )) (set! x E) (set! y F) (let () G)) 02:49:21 What should (define (f x) y) (f 0) yield? 02:49:49 Error, because y is not defined. 02:50:21 And (define (f x) y)? 02:50:59 Error, because y is not defined (but if you're entering it interactively, the implementation will usually defer reporting the error until you try to use it). 02:51:25 Of course, if you put it together with (define y 1), then it's OK. 02:52:04 Thus, top level differs from let/letrec. 02:52:10 Correct. 02:52:26 That's why they introduced LETREC* (and perhaps changed the semantics of internal definitions) in the R6RS and R7RS. 02:53:50 ...although I'm not sure why you said `thus' there. 02:54:19 tcsc [~tcsc@c-76-127-240-20.hsd1.ct.comcast.net] has joined #scheme 02:54:20 The definition of internal defines was definitely switched to letrec* in R6/R7. 02:54:22 -!- tcsc [~tcsc@c-76-127-240-20.hsd1.ct.comcast.net] has quit [Remote host closed the connection] 02:54:57 " jcowan, in the R5RS internal definitions are LETREC." 02:54:57 -!- dkordic [~danilo@109-93-122-193.dynamic.isp.telekom.rs] has quit [Quit: Ex-Chat] 02:55:07 jcowan, there is no ambiguity in the text. `Each variable is assigned in left-to-right order to the result of evaluating the corresponding ', meaning you go through each variable (x, y, ...), say x, and set it to the value of its right-hand side, and then go on to the next variable. 02:55:36 ASau, yes? That statement is true. 02:55:47 Yes, I see that that is one possible meaning. But it could also mean that the evaluations are done first in L2R order followed by the assignments. 02:55:55 (also in L2R order) 02:56:04 I think I understand what was all the fuss about top level in R6 process. 02:56:29 Or what might be, because I'm not going to read all those flames again. 02:56:33 jcowan, no. There's no point in doing the assignments in left-to-right order after all the evaluations. 02:56:55 So there's no reason to say `the variables are assigned in left-to-right order' unless they are interleaved with the assignments. 02:56:59 evaluations 02:57:05 Fair enough. 02:57:19 But even granted that, the definition of how letrec* behaves is not inconsistent with the contract of letrec. 02:57:22 And I am sure that (set! x E) (set! y F) was the intended semantics. 02:57:24 No. 02:57:27 It is absolutely inconsistent. 02:57:55 In (letrec ((x (f)) (y (g))) ...), both the continuation passed to F and the continuation passed to G assign both X and Y. 02:58:09 In (letrec* ((x (f)) (y (g))) ...), the continuation passed to F assigns X and Y, but the continuation passed to G assigns only Y, not X. 02:58:48 How can those be distinguished operationally? 02:58:49 tcsc [~tcsc@c-76-127-240-20.hsd1.ct.comcast.net] has joined #scheme 02:59:38 These are readily distinguishable and if you want an example you may write a note of inquiry with an enclosed prestamped envelope and an obligatory pun to Albatross Petrofsky, at al at petrofsky dot org, Earth, Sol, Milky Way, and he will be glad to return one by post as fast as the Pony Express can deliver it. 02:59:43 Ah, I think I see; it has to do with the R6/R7 restriction that the continuation not be invoked more than once. 03:00:05 which is not (at least not explicitly) present in R5 03:00:49 Subject to that constraint they may not be distinguishable. I'm not sure. 03:01:01 I would still ask the Petroff. 03:01:11 Historically, Chicken at least implemented letrec as letrec* until relatively recently. 03:01:37 And fixing that broke at least one piece of code, I am told, though just how I do not know. 03:01:39 Yes. So does MIT Scheme. It's buggy. 03:02:26 Because as written there is nothing to prevent the unspecified values to which the letrec variables are bound from being (by way of an oracle) the values which the expressions will return on evaluation. 03:03:22 so it may just happen that (letrec ((x 0) (y x)) y) returns 0 anyway. 03:03:46 In the R6RS, actually, no, the implementation is required to report an error in that case. 03:03:51 True. 03:04:35 weie [~weie@softbank221078042071.bbtec.net] has joined #scheme 03:06:18 BTW, all my Schemes report either 0 or an error having to do with the fact that they don't have letrec*. So that's good. 03:10:15 -!- davexunit [~user@fsf/member/davexunit] has quit [Quit: Later] 03:11:50 Larceny does not, but it's probable that its REPL is running in R5RS mode, I don't really know. 03:13:03 That doesn't sound like a very strict R5RS mode! 03:13:35 -!- alexei [~amgarchin@p4FD62C3B.dip0.t-ipconnect.de] has quit [Ping timeout: 260 seconds] 03:13:58 Sorry, I dropped a stitch there. 03:14:00 -!- tcsc [~tcsc@c-76-127-240-20.hsd1.ct.comcast.net] has quit [Quit: bye!] 03:14:17 I also investigated (letrec ((x 0) (y x)) y). 03:14:34 The R6RS implementations other than Larceny complain, as do MIT and Scheme48/scsh. 03:15:09 The rest either return 0 or some random value. 03:15:20 typically #f or their regular unspecified-value value. 03:17:39 Specifically, Racket, Gauche, Guile, Kawa, SISC, SCM, Larceny, NexJ, JScheme, KSi, RScheme, XLisp, Rep, Schemik, Elk, LLava, SXM, FemtoLisp, Dfsch, Inlab, Foment, Owl Lisp, and Chibi all return 0. 03:41:38 -!- zzach [~zzach@dslb-092-072-007-143.pools.arcor-ip.net] has quit [Ping timeout: 265 seconds] 03:42:08 zzach [~zzach@dslb-084-063-146-118.pools.arcor-ip.net] has joined #scheme 03:45:28 kilimanjaro_ [~kilimanja@thalassa.feralhosting.com] has joined #scheme 03:48:20 Okay, I checked the internal-definition version too. Only SigScheme and Scheme48/scsh actually have a problem with it; Gambit, Scheme 9, and SXM use the R5RS definition (returning an unspecified value). The rest assume letrec* semantics. 03:51:19 So Scheme48/scsh is unique: it supports letrec* but uses letrec semantics for internal defines. 03:52:56 -!- kilimanjaro_ [~kilimanja@thalassa.feralhosting.com] has quit [Ping timeout: 272 seconds] 03:54:33 -!- jcowan [~John@earth.ccil.org] has quit [Remote host closed the connection] 03:55:02 jcowan [~John@earth.ccil.org] has joined #scheme 03:55:35 Scsh supports LETREC*? 03:56:04 I'm not surprised to learn that Scheme48 1.9 or whatever the current version does, but scsh hasn't been updated since before the R6RS, as far as I know. 03:56:13 (One of its joke version number titles *was* `R6RS'.) 03:59:53 No, scsh 0.7 runs on top of Scheme48 1.9 at long last. 04:00:47 Hm, OK. 04:02:13 Technically it is not yet 0.7; I grabbed it from git. 04:05:38 But given how freaking ancient 0.6.7 is, I decided not to worry about that. Not that I don't have older Schemes. 04:05:56 UMB dates from 2004. 04:08:05 SXM from 2003, and XLisp from 2002. Oaklisp is even older, but I can't build it on my spiffy new 64-bit Linux any more. 04:08:30 kilimanjaro_ [~kilimanja@thalassa.feralhosting.com] has joined #scheme 04:08:36 (There appears to me no way to force gcc to build in -m32 mode short of patching the Makefile) 04:08:59 -!- jcowan [~John@earth.ccil.org] has quit [Remote host closed the connection] 04:09:29 jcowan [~John@earth.ccil.org] has joined #scheme 04:17:38 hillgreen012 [6a787f0f@gateway/web/freenode/ip.106.120.127.15] has joined #scheme 04:28:41 -!- kobain [~sambio@unaffiliated/kobain] has quit [] 04:54:10 -!- hillgreen012 [6a787f0f@gateway/web/freenode/ip.106.120.127.15] has quit [] 04:55:45 preflex_ [~preflex@unaffiliated/mauke/bot/preflex] has joined #scheme 04:56:48 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping timeout: 246 seconds] 04:57:09 -!- preflex_ is now known as preflex 05:02:26 Giomancer [~gio@107.201.206.230] has joined #scheme 05:04:30 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 272 seconds] 05:10:12 -!- Feng__ [~quassel@218.28.84.60] has quit [Ping timeout: 252 seconds] 05:12:27 hillgreen_ [6a787f0f@gateway/web/freenode/ip.106.120.127.15] has joined #scheme 05:20:29 CADD [~CADD@12.227.104.109] has joined #scheme 05:22:02 andavi [~user@98-125-72-82.dyn.centurytel.net] has joined #scheme 05:22:24 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 05:23:08 -!- andavi [~user@98-125-72-82.dyn.centurytel.net] has left #scheme 05:25:06 jrapdx [~jra@c-50-137-169-114.hsd1.or.comcast.net] has joined #scheme 05:26:02 hillgreen [~hillgreen@106.120.127.15] has joined #scheme 05:30:09 -!- duggiefresh [~duggiefre@c-66-30-11-90.hsd1.ma.comcast.net] has quit [Remote host closed the connection] 05:31:11 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 05:36:01 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 245 seconds] 05:38:12 strobegen [~Adium@188.168.72.236] has joined #scheme 05:39:48 hillgreen1 [~Thunderbi@106.120.127.15] has joined #scheme 05:41:11 -!- hillgreen_ [6a787f0f@gateway/web/freenode/ip.106.120.127.15] has quit [] 05:43:42 -!- hillgreen1 [~Thunderbi@106.120.127.15] has quit [Quit: hillgreen1] 05:46:43 teleScope [~cong@183.219.71.33] has joined #scheme 05:50:47 -!- juanfra [~juanfra@unaffiliated/juanfra] has quit [Ping timeout: 260 seconds] 05:50:59 -!- joneshf-laptop [~joneshf@086.112-30-64.ftth.swbr.surewest.net] has quit [Ping timeout: 272 seconds] 05:52:46 hello 05:53:36 hello, every schemer. 05:56:38 juanfra [~juanfra@unaffiliated/juanfra] has joined #scheme 05:57:30 -!- francis_wolke [~user@c-98-207-155-161.hsd1.ca.comcast.net] has quit [Ping timeout: 252 seconds] 05:58:19 -!- hillgreen [~hillgreen@106.120.127.15] has quit [Quit: Leaving] 05:59:10 hillgreen [~hillgreen@106.120.127.15] has joined #scheme 06:00:29 -!- hillgreen [~hillgreen@106.120.127.15] has quit [Client Quit] 06:01:29 *offby1* waves 06:02:22 joneshf-laptop [~joneshf@086.112-30-64.ftth.swbr.surewest.net] has joined #scheme 06:04:30 *jcowan* waves back 06:04:42 Well, not *every* Schemer, just a few of them 06:06:26 Are you excluding those present who are not Schemers? Non-Schemers can be worthwhile conversationalists too. 06:08:32 hillgreen1 [~gxd@106.120.127.15] has joined #scheme 06:08:59 Oh, (s?)he left and came back. 06:09:08 =-O 06:09:27 06:04 * jcowan waves back 06:09:28 06:04 < jcowan> Well, not *every* Schemer, just a few of them 06:09:28 06:06 < Riastradh> Are you excluding those present who are not Schemers? 06:09:28 Riastradh: No, I was pointing out that every Schemer is not reachable here: there are a great many Schemers who are not. 06:09:32 Non-Schemers can be worthwhile conversationalists too. 06:09:55 jcowan, I was asking about hillgreen1's greeting to every Schemer, but not every non-Schemer (present). 06:10:27 Oh, I thought you were talking to me. 06:15:12 *jcowan* notes the following in the source of SRFI 1: 06:15:13 06:15:47 xue [~nebula@112.65.62.186] has joined #scheme 06:22:41 wow, good find. 06:23:19 Now, the question is, did you start by looking for SRFI 1, or did you start by...? 06:23:38 Hi all, this is a new man of scheme. could you recommend some resource on continuation to me? 06:31:25 Riastradh: The former. But I did google the phrase to see if SRFI 1 would be found, and it isn't, even when I add "scheme". 06:31:56 I was actually looking at the source to find out what anchors it has, one of the things browsers don't let you easily do. 06:32:01 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 06:35:50 -!- deadghost [~deadghost@pool-173-55-80-153.lsanca.fios.verizon.net] has quit [Ping timeout: 245 seconds] 06:36:15 hillgreen1: are you new to lisps in general? 06:37:03 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 260 seconds] 06:40:26 and, have you tried the wikipedia page? http://en.wikipedia.org/wiki/Continuation 06:40:29 not so new. for about 2 month I have worked with lisp. 06:42:29 Thank you. wiki came first. 06:43:48 'the little schemer' also describes the use of continuations as escape constructs, to instantaneously 'return' from a computation 06:44:47 which is perhaps the main use you'd give them on their own. barring that, I imagine they're mostly used to build other control mechanisms, like exception handling, coroutines, etc 06:45:04 (an example of coroutines is in the wikipedia article) 06:47:48 thank you. I have found something interesting about. google - ed "call-with-current-continuation" and "call-with-current-continuation-for-c-programmers". 06:50:49 isBEKaml [~user@unaffiliated/isbekaml] has joined #scheme 07:00:10 zan-xhipe [~user@105-237-92-15.access.mtnbusiness.co.za] has joined #scheme 07:14:06 -!- hillgreen1 [~gxd@106.120.127.15] has quit [Quit: Leaving.] 07:15:53 nebula [~nebula@112.65.62.186] has joined #scheme 07:19:43 -!- isBEKaml [~user@unaffiliated/isbekaml] has left #scheme 07:19:46 -!- xue [~nebula@112.65.62.186] has quit [Ping timeout: 245 seconds] 07:21:51 gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has joined #scheme 07:27:15 -!- ASau [~user@p5083D4AE.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 07:30:02 -!- gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has quit [Remote host closed the connection] 07:31:26 ASau [~user@p5083D4AE.dip0.t-ipconnect.de] has joined #scheme 07:32:45 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 07:32:48 -!- teleScope [~cong@183.219.71.33] has quit [Quit: Konversation terminated!] 07:42:18 palach [~palach@89-178-12-173.broadband.corbina.ru] has joined #scheme 08:06:16 gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has joined #scheme 08:12:14 -!- gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has quit [Remote host closed the connection] 08:12:36 gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has joined #scheme 08:15:33 -!- nisstyre [~yours@oftn/member/Nisstyre] has quit [Quit: Leaving] 08:52:26 -!- oleo [~oleo@xdsl-78-35-135-188.netcologne.de] has quit [Ping timeout: 264 seconds] 08:53:07 oleo [~oleo@xdsl-87-79-252-137.netcologne.de] has joined #scheme 09:02:21 -!- palach [~palach@89-178-12-173.broadband.corbina.ru] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 09:13:18 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 252 seconds] 09:15:07 -!- yacks [~py@103.6.159.103] has quit [Read error: Operation timed out] 09:17:27 przl [~przlrkt@p5DCA3116.dip0.t-ipconnect.de] has joined #scheme 09:32:23 -!- gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has quit [Ping timeout: 272 seconds] 09:34:30 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 09:41:54 -!- przl [~przlrkt@p5DCA3116.dip0.t-ipconnect.de] has quit [Ping timeout: 272 seconds] 09:52:16 yacks [~py@103.6.159.103] has joined #scheme 09:52:49 przl [~przlrkt@p5DCA3116.dip0.t-ipconnect.de] has joined #scheme 10:04:53 -!- przl [~przlrkt@p5DCA3116.dip0.t-ipconnect.de] has quit [Quit: leaving] 10:13:18 gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has joined #scheme 10:23:36 hiroakip [~hiroaki@77-20-51-63-dynip.superkabel.de] has joined #scheme 10:35:05 -!- hiroakip [~hiroaki@77-20-51-63-dynip.superkabel.de] has quit [Ping timeout: 272 seconds] 10:42:50 wingo [~wingo@cha74-2-88-160-190-192.fbx.proxad.net] has joined #scheme 10:52:55 -!- yacks [~py@103.6.159.103] has quit [Ping timeout: 246 seconds] 11:01:51 -!- MichaelRaskin [~MichaelRa@195.91.224.161] has quit [Ping timeout: 245 seconds] 11:04:08 stepnem [~stepnem@internet2.cznet.cz] has joined #scheme 11:12:08 MichaelRaskin [~MichaelRa@195.91.224.161] has joined #scheme 11:13:32 -!- nebula [~nebula@112.65.62.186] has quit [Quit: Konversation terminated!] 11:16:54 -!- dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has quit [Ping timeout: 246 seconds] 11:20:02 -!- jrapdx [~jra@c-50-137-169-114.hsd1.or.comcast.net] has quit [Ping timeout: 264 seconds] 11:22:51 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 272 seconds] 11:29:33 xue [~nebula@112.65.62.186] has joined #scheme 11:31:29 -!- xue [~nebula@112.65.62.186] has quit [Client Quit] 11:40:59 -!- william-cushing [4cda7ae2@gateway/web/freenode/ip.76.218.122.226] has quit [Quit: Page closed] 11:41:53 -!- turbofail [~user@107-215-216-65.lightspeed.sntcca.sbcglobal.net] has quit [Read error: Connection reset by peer] 11:45:17 alexei [~amgarchin@p4FD60932.dip0.t-ipconnect.de] has joined #scheme 11:57:10 Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 12:18:30 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 12:23:19 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 260 seconds] 12:23:35 -!- Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/] 12:30:19 Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 12:36:41 round-robin [~bubo@91.224.149.58] has joined #scheme 12:36:54 -!- Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/] 12:39:42 add^_ [~user@m176-70-211-242.cust.tele2.se] has joined #scheme 12:56:30 dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has joined #scheme 12:59:48 cajetanus [~cajetanus@public-gprs516886.centertel.pl] has joined #scheme 13:03:04 -!- cajetanus [~cajetanus@public-gprs516886.centertel.pl] has left #scheme 13:19:17 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 13:20:54 yacks [~py@103.6.159.103] has joined #scheme 13:23:57 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 246 seconds] 13:38:28 -!- aranhoide [~smuxi@10.Red-83-59-6.dynamicIP.rima-tde.net] has quit [Ping timeout: 246 seconds] 13:44:32 Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 13:46:50 -!- vraid is now known as Fauxord 13:48:12 -!- add^_ [~user@m176-70-211-242.cust.tele2.se] has quit [Remote host closed the connection] 13:50:54 lazyden [~lazyden@58.185.121.38] has joined #scheme 13:51:08 -!- lazyden [~lazyden@58.185.121.38] has quit [Client Quit] 13:53:16 -!- Fauxord is now known as vraid 14:08:42 Sgeo [~quassel@ool-ad034ea6.dyn.optonline.net] has joined #scheme 14:11:23 add^_ [~user@m176-70-211-242.cust.tele2.se] has joined #scheme 14:11:35 -!- Sgeo_ [~quassel@ool-ad034ea6.dyn.optonline.net] has quit [Ping timeout: 260 seconds] 14:13:59 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 14:18:33 -!- hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has quit [Ping timeout: 246 seconds] 14:23:56 edw [~edw@cpe-69-204-234-195.nyc.res.rr.com] has joined #scheme 14:27:42 hiyosi [~skip_it@247.94.30.125.dy.iij4u.or.jp] has joined #scheme 14:32:22 -!- gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has quit [Ping timeout: 246 seconds] 14:48:03 civodul [~user@gateway/tor-sasl/civodul] has joined #scheme 14:53:07 -!- Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/] 14:57:55 gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has joined #scheme 15:02:42 defanor [~defanor@ppp91-77-174-87.pppoe.mtu-net.ru] has joined #scheme 15:05:36 -!- defanor_ [~defanor@ppp91-77-172-91.pppoe.mtu-net.ru] has quit [Ping timeout: 245 seconds] 15:10:33 davexunit [~user@fsf/member/davexunit] has joined #scheme 15:21:33 -!- alexei [~amgarchin@p4FD60932.dip0.t-ipconnect.de] has quit [Ping timeout: 246 seconds] 15:25:15 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 15:43:27 -!- zan-xhipe [~user@105-237-92-15.access.mtnbusiness.co.za] has quit [Ping timeout: 258 seconds] 15:47:37 -!- wingo [~wingo@cha74-2-88-160-190-192.fbx.proxad.net] has quit [Ping timeout: 246 seconds] 15:48:09 hellome [~lua@192.73.239.25] has joined #scheme 16:22:12 C6248 [~Ni50M50@84.233.246.170] has joined #scheme 16:22:35 -!- C6248 [~Ni50M50@84.233.246.170] has left #scheme 16:25:05 pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has joined #scheme 16:46:47 synacktic [~jordyd@unaffiliated/jordyd] has joined #scheme 17:00:52 alexshendi [~alexshend@ip-109-42-0-247.web.vodafone.de] has joined #scheme 17:02:29 -!- tenq is now known as tenq|away 17:04:42 aranhoide [~smuxi@10.Red-83-59-6.dynamicIP.rima-tde.net] has joined #scheme 17:04:54 Riastradh: searching for an add-on library for list utilities is natural, and nothing to be ashamed of! 17:06:54 Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 17:10:15 -!- aranhoide [~smuxi@10.Red-83-59-6.dynamicIP.rima-tde.net] has quit [Ping timeout: 260 seconds] 17:15:32 -!- yacks [~py@103.6.159.103] has quit [Quit: Leaving] 17:15:35 hiroakip [~hiroaki@77-20-51-63-dynip.superkabel.de] has joined #scheme 17:16:59 wingo [~wingo@cha74-2-88-160-190-192.fbx.proxad.net] has joined #scheme 17:25:17 -!- vraid [50d8e34d@gateway/web/freenode/ip.80.216.227.77] has quit [Ping timeout: 250 seconds] 17:36:58 duggiefresh [~duggiefre@66.30.11.90] has joined #scheme 17:45:13 -!- duggiefresh [~duggiefre@66.30.11.90] has quit [Remote host closed the connection] 17:49:33 Suuuure, offby1. Next you'll be saying that searching for al Qaida terrorist material is part of valid scholarly research. You just watch yourself! Actually, we'll watch you for you at only the low cost of your taxes. 17:51:17 Someone in #emacs just discovered it :) 17:51:28 oh, he's here too 17:51:32 *offby1* glares at TaylanUB 17:52:36 Remember, we're watching your terrorist hobbies AND your porn habits so we can discredit you among your nonalcoholic terrorist friends if you become a threat to our power. I mean, if you are about to kill innocent people. 17:53:00 only my hairdresser knows for sure 17:53:53 *TaylanUB* waves at offby1 17:54:55 *offby1* bares his teeth and growls 18:01:48 friends, if any, that should be. 18:21:43 -!- hiroakip [~hiroaki@77-20-51-63-dynip.superkabel.de] has quit [Ping timeout: 260 seconds] 18:22:42 -!- Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/] 18:23:21 duggiefresh [~duggiefre@c-66-30-11-90.hsd1.ma.comcast.net] has joined #scheme 18:25:11 -!- duggiefresh [~duggiefre@c-66-30-11-90.hsd1.ma.comcast.net] has quit [Remote host closed the connection] 18:26:40 -!- cdidd [~cdidd@95-27-62-159.broadband.corbina.ru] has quit [Ping timeout: 245 seconds] 18:48:20 -!- alexshendi [~alexshend@ip-109-42-0-247.web.vodafone.de] has quit [Read error: Connection reset by peer] 18:53:49 hiroakip [~hiroaki@77-20-51-63-dynip.superkabel.de] has joined #scheme 18:57:40 alexshendi [~alexshend@ip-109-42-0-247.web.vodafone.de] has joined #scheme 18:58:34 -!- oxum [~oxum@122.164.105.247] has quit [Quit: ...] 19:03:55 cdidd [~cdidd@128-69-9-112.broadband.corbina.ru] has joined #scheme 19:14:30 jrapdx [~jra@c-50-137-169-114.hsd1.or.comcast.net] has joined #scheme 19:21:10 alexei [~amgarchin@p4FD60932.dip0.t-ipconnect.de] has joined #scheme 19:21:21 -!- pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has quit [Quit: Leaving.] 19:39:19 nisstyre [~yours@oftn/member/Nisstyre] has joined #scheme 19:39:51 -!- gravicappa [~gravicapp@ppp91-77-183-179.pppoe.mtu-net.ru] has quit [Ping timeout: 246 seconds] 20:02:25 Shlohmo [~shlmrahim@g231204042.adsl.alicedsl.de] has joined #scheme 20:13:23 -!- peterhil [~peterhil@dsl-hkibrasgw3-58c156-108.dhcp.inet.fi] has quit [Read error: Connection reset by peer] 20:14:45 peterhil [~peterhil@dsl-hkibrasgw3-58c156-108.dhcp.inet.fi] has joined #scheme 20:19:26 -!- wingo [~wingo@cha74-2-88-160-190-192.fbx.proxad.net] has quit [Ping timeout: 264 seconds] 20:28:10 Sgeo_ [~quassel@ool-ad034ea6.dyn.optonline.net] has joined #scheme 20:30:36 -!- Sgeo [~quassel@ool-ad034ea6.dyn.optonline.net] has quit [Ping timeout: 246 seconds] 20:34:45 -!- hiroakip [~hiroaki@77-20-51-63-dynip.superkabel.de] has quit [Ping timeout: 252 seconds] 20:35:50 -!- alexshendi [~alexshend@ip-109-42-0-247.web.vodafone.de] has quit [Quit: Leaving] 20:41:34 aranhoide [~smuxi@10.Red-83-59-6.dynamicIP.rima-tde.net] has joined #scheme 20:42:57 HectorAE [~Panhuman@74-134-105-19.dhcp.insightbb.com] has joined #scheme 20:47:25 So. Given three values a, b, c and a binary operator <=> which returns lt, eq, or gt, how do I verify that the operator is transitive with respect to a, b, and c? 20:47:53 Short of a nine-way cond. 20:48:21 R(a,b) = R(b,c) 20:48:27 ? 20:49:00 Transitivity must involve at least three calls to <=> 20:49:35 R(a,b) = R(b,c) \/ R(a,c) = R(c,b) \/ R(b,a) = R(a,c) 20:50:21 Or do you mean this: R(a,b) = R(b,c) = R(a,c)? 20:51:22 The second at least is insufficient 20:51:52 Add two other cases. 20:52:09 (I think it should've been obvious.) 20:54:03 -!- cosmez [~cosmez@200.92.100.68] has quit [Remote host closed the connection] 20:55:01 I think that if you think of your function as indicator for relation, then you should get the picture better. 20:56:40 You want aRb and bRc implies aRc, no? Does <=> return an element of the set {lt, eq, gt}, or does it return true/false to mean {lt for one relation, eq for another, gt for a third}? 20:57:10 Riastradh: the former 20:57:36 Ah, OK. 20:57:55 That it has three-element range makes it not an indicator, but it changes little. 20:58:15 -!- add^_ [~user@m176-70-211-242.cust.tele2.se] has quit [Remote host closed the connection] 20:59:00 In any case if aRb is lt and bRc is eq, then aRc should be lt 20:59:21 So it is not enough to be transitive for each possible predicate separately. 21:00:19 I am thinking that the nine-way cond, even if not the most efficient, will be the clearest and easiest to check. 21:00:28 I think that's better to tabulate and do table lookup. 21:01:32 pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has joined #scheme 21:01:34 yacks [~py@103.6.159.103] has joined #scheme 21:02:28 (define (<= x y) (not (eq? (<=> x y) 'GT))) (or (and (<= a b) (<= b c)) (not (<= a c))) 21:02:36 pnkfelix1 [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has joined #scheme 21:02:58 -!- aranhoide [~smuxi@10.Red-83-59-6.dynamicIP.rima-tde.net] has quit [Ping timeout: 246 seconds] 21:05:57 -!- pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has quit [Ping timeout: 246 seconds] 21:07:06 Riastradh: yes, that reduces it to indicator function of linear order (if original function is total). 21:07:52 You only need to check that R(x1,x2) = R(x2,x3) = R(x1,x3) holds for any of 6 cases. 21:09:13 Seven cases, I think 21:09:25 Which is seventh? 21:09:42 aRb has one of 3 values and so does bRc, that makes nine. 21:09:56 However, a < b and b > c does not allow any conclusion, and likewise for a > b and a < c. 21:10:01 That eliminates two cases. 21:10:02 No, it has only two values. 21:10:15 aRb can be <, =, or > 21:10:17 Three values. 21:10:25 (R is not a relation) 21:10:27 Reduce it to order. 21:10:55 R(a,b) = 1 for (a<=>b) <> "gt". 21:11:27 Thus R is indicator function for linear order on dom (<=>). 21:11:54 Now you need to put your 3 points in linear order. 21:11:57 6 cases. 21:12:26 If R(x1,x2) = R(x2,x3) = R(x1,x3), then they are in linear order R. 21:13:00 1) a < b and b < c; 2) a < b and a = c; 3) a = b and b < c; 4) a = b and a = c; 5) a = b and b > c; 6) a > b and b = c; 7) a > b and b > c 21:14:01 transitivity holds iff 1) a < c; 2) a < c; 3) a < c; 4) a = c; 5; a > c; 6) a > c; 7) a > c. 21:14:17 What are you trying to accomplish here? Are you writing automatic tests? 21:14:25 Your seventh case is the same as the first one. 21:15:13 Riastradh: In essence, yes. I have a procedure which wraps a comparison function such that when it is called, this test (along with reflexivity and weak asymmetry) will be checked. 21:16:07 ASau: In what sense the same? 21:16:57 If you compare values rather than go through prepositional logic, it is the same. 21:17:39 Make it easy to vet the test case by eyeball by converting it to a binary order, and check the reverse relation too -- that is, (lambda (a b) case (<=> a b) ((LT) 'GT) ((EQ) 'EQ) ((GT) 'LT))). 21:18:08 jcowan: See above, if your function does infer linear order, you only need to test that your points are in linear order indeed. 21:18:26 What Riastradh says. 21:19:25 Once you reduce it to linear order indicator, you just check that R(x1,x2)=R(x2,x3)=R(x1,x3). 21:19:59 This includes cases when R(x1,x2) = 0, that is x1>x2, and R(x1,x2)=1, that is x1<=x2. 21:22:17 I think that assumes that <=> is already weakly asymmetric 21:22:29 What do you mean? 21:22:41 -!- Shlohmo [~shlmrahim@g231204042.adsl.alicedsl.de] has quit [Quit: Leaving] 21:22:47 that is, that if a < b, then b > a 21:23:21 I assume that it is antisymmetric for "gt" and "lt" cases and symmetric for "eq". 21:23:28 Otherwise it makes little sense. 21:23:59 There is a separate set of tests for those assumptions, but imo it is better not to introduce dependencies between tests. 21:24:25 I don't understand it. 21:25:21 Then, back to my question: What are you trying to accomplish? What is the problem you are trying to solve? 21:25:22 Let's simplify it and define it in saner way: 21:25:27 By checking all seven cases, the test will fail for transitivity even if the relationship is weakly asymmetric (i.e. antisymmetric for lt and gt, symmetric for eq) 21:25:28 r(x,y) = sign(x-y). 21:25:57 Thus, r=1 for x>y, r=0 for x=y, r=-1 for x Okay. That is in fact the realization of <=> 21:26:29 aranhoide [~smuxi@10.Red-83-59-6.dynamicIP.rima-tde.net] has joined #scheme 21:27:10 It is quite easy to see that when you have such a function, 21:27:24 If you're trying to write an automatic test for the desired properties of <=> that maximizes debuggability, check for the symmetry and reflexivity properties you want first, and then check for the transitivity properties. 21:27:27 you can easily reconstruct linear order on your objects. 21:27:40 If that's not what you're trying to do, step back and explain what you're trying to do. 21:27:41 -!- alexei [~amgarchin@p4FD60932.dip0.t-ipconnect.de] has quit [Ping timeout: 272 seconds] 21:28:06 Riastradh: I am trying to do so, but I dislike saying that certain tests must pass before other tests can even be attempted. 21:28:12 Why? 21:28:15 Who cares? 21:28:16 (not (and (r a b) (r b c) (not (r a c)))) ? 21:28:23 It sounds like you're just making life difficult for yourself. 21:28:26 I don't see any sense in this. 21:28:58 Alright, build the test for reflexivity and symmetry properties into this test. 21:29:31 Ah, I just saw something: r(r(a, b) + r(b, c)) = r(a, c) is sufficient. 21:29:49 That's too clever by half; I can't eyeball that and be confident it's correct. 21:29:59 s/r/sign/1 21:30:52 I don't see what is not clear in my explanation above. 21:30:52 oh sorry I thought r returned a boolean 21:31:08 aranhoide: welcome to Fortran. :) 21:31:58 Wait but if you have more than one test you also need a meta-test that tests that those tests are transitive. 21:32:00 jcowan: let's step back for a while. 21:32:34 jcowan: do you agree that if your function is anti-symmetric and reflexive it infers pre-order? 21:33:51 I mean, on those three points. 21:34:08 No, that's too strong. 21:34:09 Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 21:34:26 Ah, alright. 21:34:52 Pre-order and linear order are the same thing on three points. 21:35:27 jcowan: is that statement clear? 21:36:42 So, if you want to check transitivity, you want to establish that your function infers pre-order. 21:37:29 Since on three points it is the same as linear order, you need to check that your three points are indeed in linear order wrt to your function. 21:37:29 alexei [~amgarchin@p4FD60932.dip0.t-ipconnect.de] has joined #scheme 21:37:52 The only difference is that your function is a bit too detailed. 21:38:05 x<=y iff r(x,y) <> +1. 21:38:07 so, r returns -1 if ab? 21:38:08 Or -1. 21:38:12 -!- oleo [~oleo@xdsl-87-79-252-137.netcologne.de] has quit [Ping timeout: 272 seconds] 21:38:27 Whatever you wish. 21:40:12 I mean, jcowan's definition is adding the results of r, which don't make much sense if r returns lt, eq, or gt 21:40:18 *doesn't 21:40:27 lt, eq, and gt are in fact -1, 0, and 1 21:40:38 ah, ok 21:40:57 However, my closed formula will not work if a < b and b > c (or the opposite), because their sum is 0, whereas this does not mean that a = c. Pity. 21:41:39 I still don't understand why you don't want to check for equality of three calls. 21:41:46 Don't be clever, don't be intricate. Say it simply and clearly, and don't worry about depending on symmetry for the transitivity test case unless you have a really good reason for that. 21:41:52 And six obvious cases. 21:42:07 I think the seven case version *is* simple and clear, if a tad longer than a six-case version. 21:43:22 (define (check-<=>-transitivity <=> a b) (and (check-<=-transitivity (linearize <=>) a b) (check-<=>-transitivity (linearize (complement <=>)) b a))) 21:43:51 (define (check-<=-transitivity <= a b c) (or (and (<= a b) (<= b c)) (not (<= a c))) 21:44:04 (define ((linearize <=>) a b) (not (eq? 'GT (<=> a b)))) 21:44:30 (define ((complement <=>) a b) (case (<=> a b) ((GT) 'LT) ((EQ) 'EQ) ((LT) 'LT))) 21:44:46 (There were some typos in the first line. Finding them is left as an exercise for the reader in eyeball-vetting this test.) 21:45:04 Here's my code: http://paste.lisp.org/+309O 21:45:04 jcowan: with your approach there should be 8 cases. 21:45:20 vraid [50d8e34d@gateway/web/freenode/ip.80.216.227.77] has joined #scheme 21:45:40 It is easy to see why it is so geometrically. 21:45:57 Geometry is magic. 21:46:00 ignore the :z 21:46:01 I'm not going to read all that, jcowan. Too many alternating ones and zeros to match up. 21:46:22 You fix position of two points on line and place another one around them. 21:46:40 If these two points coincide, third one is either to the left, coincide, or to the right. 21:46:42 -!- weie [~weie@softbank221078042071.bbtec.net] has quit [Ping timeout: 265 seconds] 21:46:57 Quite so, that is three of my seven cases. 21:47:11 If these two points don't coincide, third one is left, coincide with left, in the middle, coincides with right, to the right. 21:47:23 3+5=8. 21:47:30 Thus, you have forgotten one case somehow. 21:48:51 And it isn't obvious how to find it in your code which one was forgotten. 21:50:30 Riastradh: what surprises me is why one cannot tabulate those cases and just call MEMBER. 21:50:42 -!- pnkfelix1 [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has quit [Quit: Leaving.] 21:51:23 Cromulent|2 [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 21:54:47 that would be most straightforward. with a table of 9 rows (3 relations to consider * 3 possible results) I wouldn't get any more clever 21:55:26 -!- Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has quit [Ping timeout: 264 seconds] 21:56:09 ASau: My two uncheckable cases "a < b and b > c" and "a > b and b < c", they are indeterminate between c being in the middle and not being in the middle. 21:56:47 You're making this painfully complicated, jcowan. 21:56:49 aranhoide: That is what I am doing, except that the two cases noted above aren't strong enough. 21:56:49 I give up. 21:57:03 Evidently one person's complication is another's simplicity. 21:57:31 I don't know. 21:57:52 It is not obvious why your test is correct. 21:58:05 Consider that ac. 21:58:26 Transitivity is easy to state for a binary relation: R is transitive iff aRb and bRc implies aRc. 21:59:05 ASau: Just so. In that test and the other one just like it, we can conclude nothing about a and c. That is why the 9 cases aranhoide speaks of reduce to 7. 21:59:12 In fact, that is the very definition of transitivity. 21:59:20 Riastradh: Indeed 21:59:21 a # b && b # c => a # c 21:59:23 If your test doesn't mention that definition, it's already hopeless. 21:59:29 if you can't conclude anything about a and c then <=> is transitive by default 21:59:35 at least on those values 21:59:57 aranhoide: No, only in those two cases "a < b & b > c" and "a > b & b < c" we can conclude nothing. 21:59:57 I don't see that definition anywhere in the code for your test. 22:00:11 Perhaps 'transitivity' is an ill-chosen term 22:00:15 !? 22:00:21 ??? 22:00:23 Then I have no idea what you're trying to accomplish, and I'm not sure you do either. 22:00:28 What are you testing then??? 22:01:19 -!- TaylanUB [tub@p4FD92AB1.dip0.t-ipconnect.de] has quit [Disconnected by services] 22:01:49 TaylanUB [tub@p4FD92F5D.dip0.t-ipconnect.de] has joined #scheme 22:02:10 Well, SRFI 67 speaks of transitivity in this connection, but I find their code for this purpose unintelligible. 22:02:27 I'm sure that the most straightforward test that just checks all 3! cases by directly encoding transitivity definition is trivial and obvious. 22:03:18 ASau: How does your method verify that if a < b and b = c, then a < c, as is obviously the case? 22:03:54 If a Yes. 22:04:06 If b=c then b<=c, isn't it? 22:04:17 Yes. 22:04:36 jcowan: what are you trying to prove? 22:05:12 That given certain relations that obey the trichotomy law hold between a and b and between b and c, then the correct relation holds between a and c. 22:05:24 That is not classical transitivity, but it is related to it. 22:05:33 ASau` [~user@p54AFFA8A.dip0.t-ipconnect.de] has joined #scheme 22:05:51 Classical transitivity does not validate assertions such as "a < b and b = c implies a < c", because two different relations are involved. 22:06:03 jcowan: define "correct relation" 22:06:23 See my exhaustive list of seven cases above 22:06:44 There are really nine cases (three relations, two different applications) but from two cases we can conclude nothing. 22:06:50 those which mix < and > 22:06:58 -!- Cromulent|2 [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/] 22:07:16 Cromulent [~Cromulent@cpc1-reig5-2-0-cust251.6-3.cable.virginm.net] has joined #scheme 22:07:46 Use <= and >=, not . 22:07:51 jcowan: can you write them out in infix notation somewhere? 22:08:55 -!- ASau [~user@p5083D4AE.dip0.t-ipconnect.de] has quit [Ping timeout: 260 seconds] 22:08:56 oh wait you meant something other than the lisp code 22:08:57 *ASau`* sighs. 22:09:03 That's Calculus 101. 22:09:08 Once you establish that "<=" satisfies the following conditions: 22:09:33 1. (Reflexivity) a<=a. 22:09:35 1) a < b & b < c -> a < c; 2) a < b & b = c -> a < c; 3) a = b & b < c -> a < c; 4) a = b & b = c -> a = c; 5) a = b & b > c -> a -c; 6) a > b & b = c -> a > c; 7) a > b & b > c -> a > c. 22:09:38 2. (Antisymmetry) a<=b & b<=a => a=b. 22:10:27 Then your a It is non-reflective and strictly antisymmetric: !(a nisstyre: The remaining cases a < b & b > c and a > b & b < c don't imply anything. 22:11:59 ok 22:12:05 so why are they there? 22:12:08 All you need to establish transitivity on three points is to check 3! cases that x1<=x2 & x2<=x3 => x1<=x3. 22:12:26 nisstyre: they aren't, they are the comments 22:12:33 3! = 6. 22:12:38 This method encodes transitivity definition explicitly. 22:12:45 Thus it is obvious what is tested. 22:13:35 *ASau`* sighs. 22:13:55 -!- dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has quit [Ping timeout: 272 seconds] 22:14:00 jcowan: x1<=x2 & x2<=x3 => x1<=x3. That's all what you need to consider. 22:14:27 If it works, then your cases like a a that should be obvious by the definition of <= 22:15:03 less than OR equal to 22:15:17 In that case we can rewrite <= as /> 22:15:29 (fortunately, NaNs are out of the case here) 22:15:41 -!- ASau` is now known as ASau 22:16:14 -!- HectorAE [~Panhuman@74-134-105-19.dhcp.insightbb.com] has left #scheme 22:18:11 I don't see why they are relevant. 22:18:35 You can do the same on IEEE FPNs, if you wish. 22:18:45 NaNs disobey many laws: NaN = NaN is false, for example. 22:18:57 and so is NaN < Nan and NaN > NaN 22:19:03 Your only problem will be that your order will have no relation to natural order on real numbers. 22:19:05 (Which are fractional in case of IEEE FPNs.) 22:20:14 -!- round-robin [~bubo@91.224.149.58] has quit [Quit: leaving] 22:20:47 That's for = defined the natural way. 22:20:55 dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has joined #scheme 22:21:04 pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has joined #scheme 22:21:04 Is it any surprise that you'll find tests for these properties fail when applied to NaN? 22:21:11 It isn't total order. 22:21:24 It doesn't surprise me, no. It apparently does surprise some people. 22:21:28 -!- mrowe_away is now known as mrowe 22:21:38 It doesn't satisfy antisymmetry condition above, if you want it. 22:22:26 ASau: is the object to prove that it has some ordering? 22:22:28 Hm,. 22:22:52 Well... No. 22:22:58 It is just not a linear order. 22:23:27 Well... This terminology varies from book to book a little. 22:23:54 nisstyre: yes. 22:23:57 At least that's obvious to me, I have no idea whether jcowan understands it. 22:24:23 ASau: that's what I assumed too but he didn't say he was trying to show some kind of ordering 22:24:26 It's obvious to me that where NaNs are involved, we don't have a total order. 22:24:27 I think that Riastradh understands it the same way. 22:25:17 No. 22:25:20 You are wrong. 22:25:47 Here's how I understand what's going on. 22:26:11 There's some SRFI that inroduces the concept of order 22:26:38 so that it could be used in something like (binary) search trees for instance. 22:27:05 But that SRFI introduces order as three-state comparator function. 22:27:22 riastrandh: (define (check-<=-transitivity <= a b c) (or (and (<= a b) (<= b c)) (not (<= a c))) 22:27:27 I think you have it wrong, ASau. SRFIs only contribute to chaos, not to order! 22:27:38 I think the 'not there belongs in the first check, not the second 22:27:57 Now you want to write a test that checks whether some random function of comparator type (DxD->{-1,0,+1}) 22:28:01 (or (not (<= a b) (<= b c)) (<= a c)) 22:28:02 -!- dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has quit [Ping timeout: 246 seconds] 22:28:06 oops 22:28:13 aranhoide, you're probably right. Notice how easy it was to spot that mistake in my code? Compare the string of ones and zeros and EQ?s and ANDs and ASSERTs in jcowan's paste. 22:28:19 establishes that this function does infer order. 22:28:51 Riastradh: this is set-theoretical order, you know, it doesn't entail that it leads to physical order. 22:28:56 If you don't like the ones and zeros, I could rewrite the (eqv? x 0) as (=? x) and similarly for the other two. 22:29:07 (or (not (and (<= a b) (<= b c))) (<= a c)), or, to flatten it out a bit, (or (not (<= a b)) (not (<= b c)) (<= a c)) 22:29:07 dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has joined #scheme 22:29:41 It would be better if you rewrite it to encode transitivity definition directly. 22:29:42 -!- pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has quit [Ping timeout: 252 seconds] 22:30:09 riastradh: I feel your solution is a compression of ASau's proposal, I'm trying to figure out how your cases expand to the 6! ones ASau says need to be considered 22:30:32 I said about 3!=6 cases. 22:30:55 (define (implies P Q) (or (not P) Q)) (define (transitive?:<= <= a b c) (implies (and (<= a b) (<= b c)) (<= a c))), if you want to avoid demorganizing your brain. 22:30:58 Not about 6!=720 of them. 22:31:15 We've exchanged about 6! messages on the subject already, it seems. 22:32:36 aranhoide: you need to consider all 3! cases due to ex falso rule. 22:33:21 You know, the complementing crap in my code earlier is silly. 22:34:02 If you have three points and you want to check transitivity for all six permutations of those points, just do that: (and (transitive?:<= <= a b c) (transitive?:<= <= a c b) ...) 22:34:29 I'd rather write all permutations down and loop over them. 22:34:32 ASau: yes, sorry, I meant 3!=6 22:34:39 Write a program to generate permutations, then. 22:34:56 It needs tests. :D 22:34:59 MORE TESTS! 22:35:04 write it in haskell 22:35:11 then get quickcheck to generate the tests for you 22:35:54 The alternative is to use indicator function for <= and compare its values. 22:36:12 This way you need only three cases. 22:37:24 But some people don't get geometric arguments here. 22:38:29 Riastradh: yes, factoring out |implies| is much better 22:38:48 kobain [~sambio@unaffiliated/kobain] has joined #scheme 22:40:01 -!- strobegen [~Adium@188.168.72.236] has quit [Quit: Leaving.] 22:43:09 Riastradh: Okay, that last strategy convinces me. 22:44:25 If you understand that you're checking that you infer _linear_ order, then you can write simply: 22:44:51 (define (transitive? <= a b c) (equal? (<= a b) (<= b c) (<= a c))) 22:45:33 And check twice less cases. 22:46:21 Or with "implies". 22:46:28 which would be more correct. 22:47:54 Riastradh: when you say your complementing approach was silly, you meant it was wrong, or just that it's not the nicest way to put it? 22:48:10 (define (transitive? <= a b c) (implies (equal? (<= a b) (<= b c)) (equal? (<= a b) (<= a c)))) 22:49:17 No point, aranhoide. Needlessly complex. 22:50:41 After all, what you're really interested in is not the predicate P(<=>, a, b, c) for all (a, b, c) in the permutations of (a_0, b_0, c_0) for particular a_0, b_0, c_0 in \R or whatever. You're interested P(<=, a, b, c) for all a, b, c, in \R, which covers those permutations already. 22:51:42 -!- kobain [~sambio@unaffiliated/kobain] has quit [Remote host closed the connection] 22:52:02 kobain [~sambio@unaffiliated/kobain] has joined #scheme 22:59:02 -!- dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has quit [Ping timeout: 240 seconds] 22:59:22 but your original code doesn't consider all permutations; it only makes two checks: (and (transitive? <= a b c) (transitive? => a b c)) (with our definition of transitive?, not the one ASau just proposed) 23:00:21 it doesn't bother itself with '(a c b) at all, AFAICT 23:00:25 Actually, this check can be simplified even more. :D 23:01:21 Probably. 23:01:33 -!- tiksa [~tiksa@gateway/tor-sasl/tiksa] has quit [Remote host closed the connection] 23:02:33 (s/=>/>=/) 23:05:11 I think that all you need to test is this: 23:05:27 a<=b & b<=c & c<=a => a=b=c. 23:05:51 And this is enough. 23:06:02 (a<=b)=(b<=c)=(c<=a) => a=b=c. 23:06:05 This one. 23:06:24 Since you can walk the graph the other way around. 23:11:39 tiksa [~tiksa@gateway/tor-sasl/tiksa] has joined #scheme 23:15:37 -!- stepnem [~stepnem@internet2.cznet.cz] has quit [Ping timeout: 246 seconds] 23:16:57 so I wonder whether it's really equivalent, or even correct. if (r a b) returns -1 and (r b c) returns 0 and (r a c) returns 0 this function passes your test but doesn't satisfy jcowan's expectation that (a < b = c) implies a < c 23:17:21 The latter is definitly correct. 23:17:24 (talking to Riastradh here) 23:18:00 (I mean, I was not commenting on your latest formulation; I'm chewing on that one now :)) 23:18:24 ("your latest formulation" being ASau's latest formulation) 23:18:24 Ah that. 23:18:31 Yes, that is correct too. 23:18:51 If (r a b) returns -1 or 0, <= is true. 23:19:21 T & T => T is definitly true. 23:20:08 Alternatively, 23:21:06 given <= with reflexivity and symmetry conditions you can easily restore the original function. 23:21:41 pnkfelix [~Adium@bas75-2-88-170-201-21.fbx.proxad.net] has joined #scheme 23:21:56 You just define (a=b) := (a<=b & b<=a). 23:22:34 you mean antisymmetry, right? 23:22:46 Weak asymmetry 23:23:00 aranhoide: It is combined symmetry-antisymmetry. 23:23:23 aranhoide, if (r a b) returns -1, then (<= a b) returns #t. If (r b c) returns 0, then (<= b c) returns #t. If (r a c) returns 0 then (<= a c) returns #t. Hence the condition is satisfied. What's the problem? 23:23:54 aranhoide: anyway, by carefully considering cases you can prove that = is equivalence relation. 23:24:03 That *is* the problem: it is satisfied when it should not be satisfied. 23:24:12 or rather, it is satisfied but I am not. 23:25:02 aranhoide: and it breaks set into equivalence classes that are strictly ordered by (a ASau: ok, by symmetry you meant the condition that (a=b) := (a<=b & b<=a) (while antisymmetry only entails that (a<=b & b<=a) implies a=b, not necessarily the other way around) 23:30:25 Symmetry condition is aRb => bRa. 23:30:38 which is not true for <= 23:30:51 Antisymmetry is (aRb xor bRa xor a=b). 23:31:27 That's what you have for strict order, <. 23:31:42 For non-strict order that is usuall called just "order", you have 23:31:57 aRb & bRa => a=b. 23:32:42 -!- davexunit [~user@fsf/member/davexunit] has quit [Read error: No route to host] 23:32:52 oh, ok. I was derailed by terminology on wikipedia http://en.wikipedia.org/wiki/Antisymmetric_relation 23:32:54 If you carefully consider this plus reflexivity/non-reflexivity 23:33:26 you can find it out that you can convert between < and <=. 23:33:35 where they define antisymmetry as what I said above. now I get what you mean 23:33:38 Different books use slightly different definitions. 23:33:58 If you insist on this definition, I can rewrite all the above. 23:34:09 oh no, I don't insist at all :) 23:34:25 Or you can do it yourself. 23:34:42 It's just a matter of paper. 23:34:57 I was just pointing out why I didn't understand you before. I'm not attached to any terminology 23:35:00 davexunit [~user@fsf/member/davexunit] has joined #scheme 23:35:25 Anyway, by carefully writing down definitions of order and indicator function 23:35:58 you can establish relation between original comparator function D^2 -> {-1, 0, +1} 23:36:36 and order defined by a<=b := (c(a,b) /= +1). 23:37:10 a And so on. 23:38:02 And here's how you can get my latest formulation: 23:38:26 yes, and I think it matches jcowan's expectations too 23:38:34 draw a graph with points a, b, c with arrows pointing from a to b when a<=b. 23:39:04 Transitivity means that if this graph is a cycle, then a=b=c. 23:39:12 -!- jcowan [~John@earth.ccil.org] has quit [Remote host closed the connection] 23:39:30 jcowan [~John@earth.ccil.org] has joined #scheme 23:40:27 If it isn't cycle, then you can easily find it out how three points ordered linearly. 23:41:28 Thus all you need to check is: 23:41:42 that's very elegant! 23:41:53 SOrry, missed it. What was it? 23:41:54 you see. 23:42:24 draw a graph with points a, b, c with arrows pointing from a to b when a<=b. 23:42:27 Transitivity means that if this graph is a cycle, then a=b=c. 23:42:30 If it isn't cycle, then you can easily find it out how three points ordered linearly. 23:42:34 Thus all you need to check is: 23:43:02 1. Whether graph isn't a cycle. Then the relation is transitive. 23:43:30 2. If it is cycle then all your points are equal. Then the relation is transitive. 23:43:54 3. All other cases mean that your relation is non-transitive. 23:44:38 Alternative formulation for strict order. 23:45:36 Draw arrows pointing from a to b when a Anyway, when you walk your graph in both directions you can see how many steps you go down arrows. 23:47:24 For transitive relation the set of allowed counts is fixed. 23:48:20 oxum [~oxum@122.164.105.247] has joined #scheme 23:48:26 in point 2. did you mean "if it is a cycle then CHECK THAT all your points are equal" ? 23:48:39 Yes. 23:51:24 Hm. 23:51:32 Alright, the formulation with strict order is a bit trickier. 23:51:42 You should track an account. 23:51:58 If you walk against arrow, you add -1. 23:52:01 If you walk along arrow, you add +1. 23:52:09 If you walk along non-arrow, you add 0. 23:52:31 After full circle the graph is transitive iff your account is -1, 0, or +1. 23:53:26 In terms of original comparator function: 23:53:48 http://paste.lisp.org/display/140320 23:53:51 c(a,b)+c(b,c)+c(c,a) belongs to {-1, 0, +1}. 23:55:21 Right. 23:55:41 Since c is discrete, then you can write it as: 23:55:46 jao [~jao@21.Red-79-153-49.dynamicIP.rima-tde.net] has joined #scheme 23:55:50 -!- jao [~jao@21.Red-79-153-49.dynamicIP.rima-tde.net] has quit [Changing host] 23:55:50 jao [~jao@pdpc/supporter/professional/jao] has joined #scheme 23:55:57 |c(a,b)+c(b,c)+c(c,a)|<=1. 23:56:17 that would be an implementation of your proposal (modulo a bad paren in the definition of =) 23:56:33 But the proof is trickier 23:56:41 especially for people who are not accustomed to energy considerations. 23:58:21 You can consider comparator function as transfer energy between two states, 23:59:11 transitivity in this case means that this is real energy, that is state function, rather than work, that is process function.