Dan, On the one hand, I understand your points, one can easily,
cheat=. (`'') ("_) u=. [: - % v=. [ -@] % (u -: v) 1 2 3 1 (u cheat -: v cheat) 1 2 3 0 Here the verbs do not break down “during _derivation_”; they just compute different results ignoring, the values of, the arguments. Nevertheless, I also agree that when posing puzzles it could be advisable to “discriminate between tautologies which break during _application_ and those which break during _derivation_.” On the other hand, in my mind two verbs, that are meant to be functions, are equal if (and only if) they have the same domain and they yield the same result for every value of their common domain (even when considering the practical issues inherent in this approach). For example, I am careful about interchanging (!) and ((*/ @: >: @: i. "0); granted, I also should be very careful about interchanging (^. @: *:) and (2 * ^.). Also, although one can cheat during the derivation, assuming that I am using the term in the same sense that you are, sometimes is difficult to disentangle it from the application. For example, as described in the bonus puzzle, inv ^:_1 u f. [: - % u f. inv ([: - %)^:_1 u f. b. _1 NB. even if... [: % - v f. [ -@] % v f. inv NB. and ([ -@] %)^:_1 v f. b. _1 NB. even if... |domain error | v f.b._1 |[-14] So, apparently, the actual derivation of (u f. inv) and (v f. inv) is only triggered during the application, (u f. inv) 1 2 3 _1 _0.5 _0.333333 (v f. inv) 1 2 3 |domain error | (v f.inv)1 2 3 |[-3] Besides, the inverse of a function (verb), when exists, seems to me an intrinsically associated to the function. In other words, (inv) is not cheating (or at least not too much) and neither is (&.) from my point of view. _______________________________________________________________ On Sat, Dec 8, 2012 at 5:27 PM, Dan Bron <j...@bron.us> wrote: > Pepe wrote: >> You are allowed to show "sneaky" cases where the >> domain of a verb involving (Ca f p g) is reduced > > For future identity puzzles, I think we should explicitly discriminate > between tautologies which break during _application_ and those which break > during _derivation_. If I claim f and g are identical verbs, it is much > more interesting to find cases where (f y) vs (g y) or (x f y) vs (x g y) > differ than to find cases where I can distinguish (or get the interpreter to > distinguish) f from g. > > Such puzzles are analogous to invalidating the claim that 32 and 16b20 are > identical. I'd expect that to be impossible based on their values, but > trivial based on their forms (i.e. if you give me access to '32' and > '16b20'). If you showed me a way to do it based on their values alone, I > would be wowed (and report it as a bug to Roger)! > > In short, if I claim the verbs f and g are identical, but =/ f`g doesn't > hold, it won't be too hard to find a way to get the interpreter to tell you > that. Of course, interesting new ways to get the interpreter to tell you > that are always welcome! > > I wrote: >> does "favoring" require that the interpreter generate code >> involving @ (instead of [: ) of arbitrary complexity? > > Pepe wrote: >> Yes... > > Ok, I checked out your original solution. I like the approach; it follows > the lines of thought I was going to pursue next if you were unsatisfied with > my formulation. I was particularly pleased that the approach you outlined > produced @s (and @:s) irrespective of whether the input was phrased as f@:g > or ([: f g) . > > -Dan > > PS: I haven't thought about the bonus puzzle yet. If I get some time > tomorrow, I'll do that, and maybe check out 13 : in early J versions, too. > > > Please excuse typos; composed on a handheld device. > > On Dec 8, 2012, at 11:30 AM, Jose Mario Quintana > <jose.mario.quint...@gmail.com> wrote: > >> Dan, >> >>> Let me put it a different way: must I find a combination of f g x y such >>> that ( (Ca f p g) y ) -: ( ([: f g) y ) or ( x (Ca f p g) y ) -: ( x >>> ([: f g) y ) does not result in a 1? Or am I allowed sneakier tactics? An >>> example of the kind of sneaky tactic I'm considering is given in the >>> postscript (after some spaces to hide the spoilers). >> >> You are allowed to show "sneaky" cases where the domain of a verb >> involving (Ca f p g) is reduced because its execution breaks down >> reporting a domain error whereas the corresponding verb involving (Ca >> f p g) produces a result, when both are given the same arguments. >> Thus, replacing literally ([: f g), within a sentence, by (Ca f p g) >> does not work in these cases because the new version fails to produce >> a result. >> >>> whether "favoring" requires that the interpreter generate code involving @ >>> (instead of [: ) of arbitrary complexity >> >> Yes, and your question is related to the bonus puzzle. >> >>> PS: I noticed your original "(This is a tricky puzzle thought)", and felt >>> it was hinting at something, but haven't grasped what. >> >> You already passed that hurdle by not following the red herring (13 :). >> >>> >>> **SPOILERS BELOW HERE** >> >> >> >> >> >> >> >> >> >>> +/&.([: #: +:) 1 2 3 >>> 6 >>> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm