**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

Reply via email to