What follows is my interpretation of the issue. Some of it is already well known, some of it is speculation but I hope at least a part of it is insightful.
Given a _well_formed_ atomic representation, it should (may) be easy to translate to linear. The bug, from what I can see, has two related causes. First, tie, I don't think was ever meant to work with nouns and second, the atomic representation of an object itself is a noun as opposed to being a special type of object. I will elaborate: Tie works similarly to link (;). In link the right argument is boxed only if it is open. This is what lets you chain links together as in 0;1;2;3 and get a level 1 boxed list. An analogous thing happens in tie, but instead of boxing, tie chains together atomic representations (AR's). So it will only take the AR of the right argument if it is not already a list of AR's so as to avoid AR's of AR's. Now the problem is that a list of AR's is just a noun so how does tie decide if it needs to take the AR of the right argument or simply pre-pend the left argument to the list of AR's? It essentially just checks if the right argument is a noun. If it is it assumes it is a properly formed list or AR's. This can be observed in the examples below. +`1 |domain error | +`1 Because tie assumes 1 is an AR and tries to join the AR of + with 1, i.e. (<'+') , 1 +`(<1) ┌─┬─┐ │+│1│ └─┴─┘ This is ok because (<'+') , <1 is not a domain error. However it is meaningless as a gerund because <1 is not the AR of any object. The following small object causes a lot of confusion: `(<(,'0');_1) `_1 To see why this is happening (<(,'0');_1) ┌──────┐ │┌─┬──┐│ ││0│_1││ │└─┴──┘│ └──────┘ A=. _1 5!:1 <'A' ┌──────┐ │┌─┬──┐│ ││0│_1││ │└─┴──┘│ └──────┘ Well, the right argument of the gerund is the AR of _1 so the session is "correctly" printing the LR of `(<(,'0');_1) as `_1 because it assumes (and rightly so) that gerunds have AR's as arguments and it forms the object represented by the AR and outputs its LR for each part of the train. But we know this is different from typing in `_1 directly and hence the LR in this case is misleading. Again, because tie assumes a noun argument is an AR when in this case it is not. Lets examine this a little further. A=. `(<(,'0');_1) B=. `_1 A `_1 B `_1 The heart of the issue we care about is this. The LR's are the same but the objects are far from it. The confusion is compounded further by the AR verb (5!:5). AA=. (5!:1 <'A') AB=. (5!:1 <'B') AA ┌────────────────────┐ │┌─┬────────────────┐│ ││4│┌─┬────────────┐││ ││ ││`│┌─┬────────┐│││ ││ ││ ││0│┌──────┐││││ ││ ││ ││ ││┌─┬──┐│││││ ││ ││ ││ │││0│_1││││││ ││ ││ ││ ││└─┴──┘│││││ ││ ││ ││ │└──────┘││││ ││ ││ │└─┴────────┘│││ ││ │└─┴────────────┘││ │└─┴────────────────┘│ └────────────────────┘ AB ┌──────────────┐ │┌─┬──────────┐│ ││4│┌─┬──────┐││ ││ ││`│┌─┬──┐│││ ││ ││ ││0│_1││││ ││ ││ │└─┴──┘│││ ││ │└─┴──────┘││ │└─┴──────────┘│ └──────────────┘ 5!:5 takes the AR of each object in the hook (of form ` N) so the AR of the noun part in A which was already an AR is taken again. This makes AB look like the well formed object... but it is a lie. + AA 5!:0 ┌─┬──────┐ │+│┌─┬──┐│ │ ││0│_1││ │ │└─┴──┘│ └─┴──────┘ AB 5!:0 |domain error | +AB 5!:0 because as mentioned above: +`1 |domain error | +`1 AB's AR is a mis-representation of the actual object. So what can we do about this? My head is spinning too much to think clearly about it now. But it seems that as long as gerunds use AR and AR is simply a noun then the interpreter will not be able to handle all cases and you the programmer must be careful about how you form your gerunds and interpret the LR of gerunds. For something more concrete, I speculate a solution might be to change the LR verb to not take the LR of arguments to tie but instead take the LR of the AR of them; something I plan to test soon. Of course I don't know what else this will break AND it doesn't solve the fundamental problem of the interpreter not being able to distinguish AR's from regular nouns. On Tue, Feb 21, 2012 at 4:26 PM, Jose Mario Quintana <josemarioquint...@2bestsystems.com> wrote: > **SPOILERS BELOW** (I wonder if this is still necessary...) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type (^:_1) b. _1 NB. The base of your solution > type > (_5&}.) (0: :. type) b. _1 NB. The base of mine > type > > The same idea but I was unnecessarily afraid of using (^:_1) when the inverse > is not available (but J seems knows better). > > > > type ((^:_1) b. (`(<_1;~":0)) (`:6)) NB. Your adverb at work... Well done! > type > type (((0: :.) b. (`(<(,'0');_1))) (_5&}.`) (`:6)) NB. I could have written > mine manually this way but... > type > > type (((0: :.)(`((<'b.')`(an _1))) (`:6)) ((_5&}.) av)) NB. I generated > mine this way instead, > type > > where (an) is a verb that atomizes a noun and (av) is an adverb that > adverbalizes a verb (if you know what I mean). > > > > I was hoping that someone could have worked out the linear representation > from the atomic representation which is readily available after applying > (`'') first. The atomic representation has, by design, all the necessary > information and your challenge might be solved this way (if I understand it > correctly). What I find frustrating is the linear representation bug that > manages somehow to lose information in even simple cases as your piece, > > > > (`(<_1;~":0)) > `_1 > > This makes developing and communicating tacit verbs much harder that it > should be. A good tool would be a verb (lra) that takes the atomic > representation of a tacit adverb (or any noun, verb, adverb or conjunction if > you like) and produces a proper linear representation. This might be a > really hard challenge because that bug has proven to be very resistant. > > > > > > > > > > > > > > > > > > > ________________________________________ > From: programming-boun...@jsoftware.com [programming-boun...@jsoftware.com] > on behalf of Dan Bron [j...@bron.us] > Sent: Tuesday, February 21, 2012 8:10 AM > To: 'Programming forum' > Subject: Re: [Jprogramming] tacit adverb > > Ok, given the clarifications in the message from Pepe with that subject, > here's a whack at it: > > **SPOILERS BELOW** > > > > > > > > > > > > > > > > > > > > lrv =: (^:_1) b. (`(<_1;~":0)) (`:6) > > > > boxopen f. lrv > <^:(L. = 0:) > > (<^:(L. = 0:)) lrv > <^:(L. = 0:) > > list lrv > list > > list f. lrv > 3 : 0 > w=. {.wcsize'' > w list y > : > if. 0=#y do. i.0 0 return. end. > if. 2>#$y=. >y do. > d=. (' ',LF) {~ LF e. y=. toJ ": y > y=. [;._2 y, d #~ d ~: {: y > end. > y=. y-. ' '{.~ c=. {:$ y=. (": y),.' ' > (- 1>. <. x % c) ;\ <"1 y > ) > > The basic insight here is that we want an adverb not dissimilar to b. : one > that accepts a verb argument and (with a little convincing) produces a > linear rep. > > That was the easy part. What I struggled with is I (mistakenly!) thought > the challenge was asking for behavior similar to this: > > flrv =: (^:_1) b. (`(<_1;~":0)) (5!:5@< :: ]`) (`:6) > > type flrv > {&(<;._1 '|invalid name|not > defined|noun|adverb|conjunction|verb|unknown')@(2&+)@(4!:0)&boxopen > > But, implicitly or explicitly, deprecrating 5!:5 (which is unsatisfying). > That is, some elegant mechanism to force a name to be stacked by value, > which in concert with the original lrv would admit flrv =: > adverbToStackNameByValue lrv (among many other uses!). > > So: NEW CHALLENGE. > > Write a tacit adverb which takes a verb argument, which if anonymous it > produces untouched, and if named (proverb) produces its definition. The > adverb may not rely on : (explicit conjunction) or 5!:n (but maybe other > foreign are OK). Note, of course, that f. is not a candidate for this tool, > as we just want to "peel off" one layer of naming, if present, not all > layers.) > > I've got no spoilers for this one. > > -Dan > > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of Dan Bron > Sent: Monday, February 20, 2012 8:03 PM > To: 'Programming forum' > Subject: Re: [Jprogramming] tacit adverb > > Oh, and would it be valuable if the domain were extended to nouns, in > particular literal vectors or boxed strings which represent J names, > potentially pro-adverbs or pro-conjunctions? > > -Dan > > -----Original Message----- > From: Dan Bron [mailto:j...@bron.us] > Sent: Monday, February 20, 2012 8:01 PM > To: 'Programming forum' > Subject: RE: [Jprogramming] tacit adverb > > I just saw this message and I haven't looked at the rest of the thread yet, > because I'm afraid of spoilers, so I don't know if there are clarifications, > amplifications, or alterations to the challenge. > > But there's a pretty simple solution, depending on the domain of the adverb. > So: what is the domain of the adverb? In particular, can I always expect a > proverb whose referent is a tacit verb? Can the argument be anonymous? Can > it be (or contain) explicit? > > Re: >> bonus points for a fixed version > > Is this for a fixed version of the adverb, or if the adverb produces the > fixed version of its argument? If the latter, is there some reason to > suspect that flrv =: f. lrv would not suffice ? > > -Dan > > > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of Jose Mario Quintana > Sent: Monday, February 20, 2012 2:56 PM > To: Programming forum > Subject: Re: [Jprogramming] tacit adverb > > Now, a challenge/puzzle: write a tacit adverb (lrv) that produces the linear > representation of its input verb (bonus points for a fixed version), for > example, > > type lrv > type > type f. lrv > {&(<;._1 '|invalid name|not > defined|noun|adverb|conjunction|verb|unknown')@(2&+)@(4!:0)&(<^:(L. = 0:)) > > SPOILER ALERT: A Solution is presented below... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Another challenge is to evade the linear representation persistent bug to > show the adverb: > > lrv=. (".(0 : 0) -. LF)`:6 > (<(<,'4'),<(<(<,'4'),<(<(<,'4'),<(<(<,'4'),<<;._1 ' 0: > :.'),<(<,'4'),<(<,'`'),<( > <,'0'),<(<'b.'),<(,'0');_1),<(<,'4'),<(<'`:'),<(,'0');6),<(<,'4'),<(<(<,'4') > ,<(< > (<,'4'),<(<(<,'4'),<(<(<,'4'),<(<(<,'4'),<(<,'"'),<(,'0');_),<(<,'4'),<(<(<' > @:') > ,<(<,'<'),<(<,'3'),<(<<;._1 ' 0 > 0'),(<(<,'&'),<;:',<'),<,']'),<'@:'),<(<,'4'),<( > <,'`'),<(<,'0'),<<(,'0');_),<(<,'4'),<(<'`:'),<(,'0');6),<(<,'4'),<(<(<,'&') > ,<(< > (,'0');_5),<'}.'),<,'`'),<(<,'4'),<(<'`:'),<(,'0');6) > ) > > lrv > (((0: :.)(`(b.`_1)))(`:6))(((((("_)(<@:((,'0') ,&< > ])@:))(`_))(`:6))(_5&}.`))(`:6)) > > type lrv > type > type f. lrv > {&(<;._1 '|invalid name|not > defined|noun|adverb|conjunction|verb|unknown')@(2&+)@(4!:0)&(<^:(L. = 0:)) > > Oh yes, I cheated! I used b. _1 to get the linear representation of the > adverse of the adverse of the input verb. The code of the adverb can be > shorter; most of it is related to (_5&}.) dropping 5 trailing characters > (':. 0:') but it illustrates how to tacitly transform a verb into its > corresponding adverb. A direct, non-cheating, version is possible but quite > more difficult (as far as I can see). > > > > > > ________________________________________ > From: programming-boun...@jsoftware.com [programming-boun...@jsoftware.com] > on behalf of Dan Bron [j...@bron.us] > Sent: Monday, February 20, 2012 11:02 AM > To: 'Programming forum' > Subject: Re: [Jprogramming] tacit adverb > >> A=: 1 : '0&(;@:u) :: empty' > > Can be expressed tacitly as B=: 0&(;@:) (:: empty) . In general, tacit > adverbs are trains of adverbial clauses, so if you want to add another, you > only need to wrap it in parens and tack it on the end. > > Though your phrasing 0&(;@:) is very appealing; it seems to "beg for an > argument" more than the vanilla formulation of (0&) (;@:) . > > -Dan > > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of David Ward Lambert > Sent: Monday, February 20, 2012 10:50 AM > To: programming > Subject: [Jprogramming] tacit adverb > > I had > > A=: 0&(;@:) > u A y > > My u raises an error if y is bad, in which case EMPTY is a reasonable > result. I'd prefer not checking y in each u. What is the tacit > > A=: 1 : '0&(;@:u) :: empty' > > ? Thanks, Dave. > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > [BEST LLC] > > Bayesian Efficient Strategic Trading LLC > > The information in this communication and any attachment is confidential and > intended solely for the attention and use of the named addressee(s). Any > views or opinions presented are solely those of the author and do not > necessarily represent those of BEAM Bayesian Efficient Asset Management, LLC > (BEAM), Bayesian Efficient Strategic Trading, LLC (BEST) and/or their > affiliates unless otherwise specifically stated. All information and > opinions expressed herein are subject to change without notice. This > communication is not to be construed as an offer to sell or the solicitation > of an offer to buy any security. Any reliance one may place on the accuracy > or validity of this information is at their own risk. Past performance is > not necessarily indicative of the future results of an investment. If you > are not the intended recipient, or a person responsible for delivering this > to the intended recipient, you are not authorized to and must not disclose, > copy, distribute, or retain this > message or any part of it. If you are not the intended recipient, please > permanently delete all copies of this communication and any attachments from > your computer system, destroy any hard copies, and immediately notify the > sender or BEAM/BEST at either i...@2bestsystems.com, i...@beamstrategy.com > or (201) 792-1002. No waiver of confidentiality or privilege is made by > mistransmission. > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > [BEST LLC] > > Bayesian Efficient Strategic Trading LLC > > The information in this communication and any attachment is confidential and > intended solely for the attention and use of the named addressee(s). Any > views or opinions presented are solely those of the author and do not > necessarily represent those of BEAM Bayesian Efficient Asset Management, LLC > (BEAM), Bayesian Efficient Strategic Trading, LLC (BEST) and/or their > affiliates unless otherwise specifically stated. All information and opinions > expressed herein are subject to change without notice. This communication is > not to be construed as an offer to sell or the solicitation of an offer to > buy any security. Any reliance one may place on the accuracy or validity of > this information is at their own risk. Past performance is not necessarily > indicative of the future results of an investment. If you are not the > intended recipient, or a person responsible for delivering this to the > intended recipient, you are not authorized to and must not disclose, copy, > distribute, or retain this > message or any part of it. If you are not the intended recipient, please > permanently delete all copies of this communication and any attachments from > your computer system, destroy any hard copies, and immediately notify the > sender or BEAM/BEST at either i...@2bestsystems.com, i...@beamstrategy.com or > (201) 792-1002. No waiver of confidentiality or privilege is made by > mistransmission. > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm