> On Sun, Apr 14, 2013 at 10:41 AM, km <[email protected]> wrote:
>> It would be nice if there were a simple way to transform your T into U :
>>
>>     U =: 2 2 $ +/ ; |: ; |. ; -/ . *

So far no solution is transforming T into U and perhaps emulating U is what
was meant, as in
Raul's solution T(4 :'<y`:0 x'"_ 0&).  In any case, here there are fixed
tacit solutions
for both interpretations and a n-way extension to the one-way simple agenda
(@.) case.

   ( T =: 2 2 $ +/`|:`|.`(-/ .*) ) NB. A table of atomized verbs
┌───────┬───────────────┐
│┌─┬───┐│|:             │
││/│┌─┐││               │
││ ││+│││               │
││ │└─┘││               │
│└─┴───┘│               │
├───────┼───────────────┤
│|.     │┌─┬───────────┐│
│       ││.│┌───────┬─┐││
│       ││ ││┌─┬───┐│*│││
│       ││ │││/│┌─┐││ │││
│       ││ │││ ││-│││ │││
│       ││ │││ │└─┘││ │││
│       ││ ││└─┴───┘│ │││
│       ││ │└───────┴─┘││
│       │└─┴───────────┘│
└───────┴───────────────┘

It is helpful to see what follows in the context of
http://www.jsoftware.com/pipermail/programming/2013-March/031883.html.
However, no extensions
are requiered; only willingness to use a little bit of black magic...

   9!:14 ''
j602/2008-03-03/16:45

   o=. @:

   evoke=. ,^:(0:`(<'`:')) NB. Verbalizing ( `: )
   an=. <@:((,'0') ,&< ])  NB. Atomizing a noun

   Apply=. evoke&6 o ([ , an) NB. A counterpart of ( apply=. 128!:2 )

   ( et=. &(< o Apply f."0 _) ) NB. A fixed tacit counterpart of ( (4
:'<y`:0 x'"_ 0&) )
&(<@:(,^:(0:``:)&6@:([ , <@:((,'0') ,&< ])))"0 _)

   T et i.2 2
┌───┬───┐
│2 4│0 2│
│   │1 3│
├───┼───┤
│2 3│_2 │
│0 1│   │
└───┴───┘

Regarding writing an adverb to transform (T) into (2 2 $ +/ ; |: ; |. ; -/
. *)... Writing an
adverb?  Please, let us write a verb instead! :)

   link=. evoke&6 o ([ , (;`'') , ]) NB. Linking a couple of boxed verbs
   box=. < o evoke&6"0

   ( tf=. evoke&6 o ((an o $) ; ($ `'') ; (< o link&< / o , o box)) f. )
,^:(0:``:)&6@:(<@:((,'0') ,&< ])@:$ ; (,<,'$') ; <@:(,^:(0:``:)&6@:([ ,
(,<,';') , ]))&</@:,@:(<@:(,^:(0:``:))&6"0))

   u=. 2 2 $ +/ ; |: ; |. ; -/ . *

   (tf T) `'' -: u f.`'' NB. (tf T) is (2 2 $ +/ ; |: ; |. ; -/ . *)
1

   (tf T) i.2 2
┌───┬───┐
│2 4│0 2│
│   │1 3│
├───┼───┤
│2 3│_2 │
│0 1│   │
└───┴───┘

In my opinion, the straightforward use of table and hyper-tables of verbs
is for a n-way
selection of a verb, as in Tracy's 2-way Poker example:

   ( t2wa=. evoke&6 o (<@:] { [) f. ) NB. A fixed tacit n-way version of a
simple agenda
,^:(0:``:)&6@:(<@:] { [)

   (T t2wa 0 1) i.2 2
0 2
1 3

It also works for tables and hyper-tables of boxed verbs:

   ( B=. box T ) NB. The table of boxed verbs corresponding to T
┌──┬─────┐
│+/│|:   │
├──┼─────┤
│|.│-/ .*│
└──┴─────┘

   (B t2wa 1 0) i.2 2
2 3
0 1

 ( C=. 4 3 2 $ ,B )
┌──┬─────┐
│+/│|:   │
├──┼─────┤
│|.│-/ .*│
├──┼─────┤
│+/│|:   │
└──┴─────┘
┌──┬─────┐
│|.│-/ .*│
├──┼─────┤
│+/│|:   │
├──┼─────┤
│|.│-/ .*│
└──┴─────┘
┌──┬─────┐
│+/│|:   │
├──┼─────┤
│|.│-/ .*│
├──┼─────┤
│+/│|:   │
└──┴─────┘
┌──┬─────┐
│|.│-/ .*│
├──┼─────┤
│+/│|:   │
├──┼─────┤
│|.│-/ .*│
└──┴─────┘

   C t2wa (2 1 0)
|.
┌──┐
│|.│
└──┘

I will leave to others to show explicit versions of tf and t2wa.



On Mon, Apr 15, 2013 at 4:34 PM, Linda Alvord <[email protected]>wrote:

> Thanks.  Linda
>
> -----Original Message-----
> From: [email protected] [mailto:
> [email protected]] On Behalf Of Raul Miller
> Sent: Monday, April 15, 2013 11:03 AM
> To: Programming forum
> Subject: Re: [Jprogramming] Table of Verbs
>
>    A=:>:i.2 2
>    F=: 2 2$ '+/';'|:';'|.';'-/ .*'
>    ([:$"."1)(>"0 F)(,"1)2 2 1$'A'
> 2 2 2 2
>    ([:$".)"1(>"0 F)(,"1)2 2 1$'A'
> 2 0
> 2 2
>
> 2 2
> 0 0
>
> So it's about the relevance of those parenthesis.
>
>
>    9!:3]6
>
>    $@"."1
> ($@".)"1
>    ([:$"."1)
> [: $ ("."1)
>    ([:$".)"1
> ([: $ ".)"1
>
> You need $ to be modified by "1
>
> Does this make sense?
>
> Thanks,
>
> --
> Raul
>
>    9!:3]5
>
> On Mon, Apr 15, 2013 at 9:58 AM, Linda Alvord <[email protected]>
> wrote:
> >  Maybe this is a clearer explanation of my question.
> >
> >    A=:>:i.2 2
> >    f=: 2 2$ '+/';'|:';'|.';'-/ .*'
> >    "."1 (>"0 f)(,"1)2 2 1$'A'
> >  4 6
> >  0 0
> >
> >  1 3
> >  2 4
> >
> >
> >  3 4
> >  1 2
> >
> > _2 0
> >  0 0
> >    <"2 "."1 (>"0 f)(,"1)2 2 1$'A'
> > ┌───┬────┐
> > │4 6│1 3 │
> > │0 0│2 4 │
> > ├───┼────┤
> > │3 4│_2 0│
> > │1 2│ 0 0│
> > └───┴────┘
> >
> >    ($@"."1)(>"0 f)(,"1)2 2 1$'A'
> > 2 0
> > 2 2
> >
> > 2 2
> > 0 0
> >
> >    NB.($"."1)(>"0 f)(,"1)2 2 1$'A' is a domain error
> >
> >    ([:$"."1)(>"0 f)(,"1)2 2 1$'A'
> > 2 2 2 2
> >
> >      Why, if  u@v y ↔ u v y  , are the two final results different?
> >
> > Linda
> >
> >
> >
> > -----Original Message-----
> > From: [email protected] [mailto:programming-
> > [email protected]] On Behalf Of Linda Alvord
> > Sent: Monday, April 15, 2013 4:39 AM
> > To: [email protected]
> > Subject: Re: [Jprogramming] Table of Verbs
> >
> >    (>"0 f)(,"1)2 2 1$'A'
> > +/   A
> > |:   A
> >
> > |.   A
> > -/ .*A
> >
> >
> >    (>"0 f)(,"1)2 2 1$'A'
> > +/   A
> > |:   A
> >
> > |.   A
> > -/ .*A
> >
> > If   u@v y ↔ u v y  shouldn't these two agree?
> >
> >
> >    ($@"."1)(>"0 <mailto:$@>  f)(,"1)2 2 1$'A'
> > 2 0
> > 2 2
> >
> > 2 2
> > 0 0
> >    n
> >
> >    ($"."1)(>"0 f)(,"1)2 2 1$'A'
> > |domain error
> > |       ($"."1)(>"0 f)(,"1)2 2 1$'A'
> >
> >
> > This is also different.
> >
> >   ([:$"."1)(>"0 f)(,"1)2 2 1$'A'
> > 2 2 2 2
> >
> > The padding covers up the fact that:
> >
> > $+/A
> > 2
> >    $|:A
> > 2 2
> >    $|.A
> > 2 2
> >    $-/ .*A
> > The final result is empty.  I can understand that dealing with the
> > different shapes is a problem.  I'm bothered by the different results.
> >
> > Linda
> >
> > -----Original Message-----
> > From: [email protected] [mailto:programming-
> > [email protected]] On Behalf Of Linda Alvord
> > Sent: Monday, April 15, 2013 3:38 AM
> > To: [email protected]
> > Subject: Re: [Jprogramming] Table of Verbs
> >
> >
> >  A=:i.2 2
> >    <"2 "."1 (>"0 f)(,"1)2 2 1$'A'
> > ----T----┐
> > │2 4│0 2 │
> > │0 0│1 3 │
> > +---+----+
> > │2 3│_2 0│
> > │0 1│ 0 0│
> > L---+-----
> >
> >    <"2 "."1 (>"0 f)(,"1)2 2 1$'B'
> > --------T-----┐
> > │9 12 15│0 3 6│
> > │0  0  0│1 4 7│
> > │0  0  0│2 5 8│
> > +-------+-----+
> > │6 7 8  │0 0 0│
> > │3 4 5  │0 0 0│
> > │0 1 2  │0 0 0│
> > L-------+------
> >
> >
> > This is getting closer to the answer.  Linda
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Linda
> > Alvord
> > Sent: Sunday, April 14, 2013 12:15 PM
> > To: [email protected]
> > Subject: Re: [Jprogramming] Table of Verbs
> >
> > You just need to exclude the extra zeros somehow.
> >
> >   A=:>:i.2 2
> >    f=: 2 2$ '+/';'|:';'|.';'-/ .*'
> >    "."1 (>"0 f)(,"1)2 2 1$'A'
> >  4 6
> >  0 0
> >
> >  1 3
> >  2 4
> >
> >
> >  3 4
> >  1 2
> >
> > _2 0
> >  0 0
> >
> > Linda
> >
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Raul
> > Miller
> > Sent: Sunday, April 14, 2013 11:45 AM
> > To: Programming forum
> > Subject: Re: [Jprogramming] Table of Verbs
> >
> > Paper and pencil is a powerful tool of thought. I have yet to see an
> > adequate replacement in any computing environment.
> >
> > --
> > Raul
> >
> > On Sun, Apr 14, 2013 at 10:41 AM, km <[email protected]> wrote:
> >> It would be nice if there were a simple way to transform your T into U :
> >>
> >>     U =: 2 2 $ +/ ; |: ; |. ; -/ . *
> >>     U i. 2 2
> >>  +---+---+
> >>  |2 4|0 2|
> >>  |   |1 3|
> >>  +---+---+
> >>  |2 3|_2 |
> >>  |0 1|   |
> >>  +---+---+
> >>     U i. 3 3
> >>  +-------+-----+
> >>  |9 12 15|0 3 6|
> >>  |       |1 4 7|
> >>  |       |2 5 8|
> >>  +-------+-----+
> >>  |6 7 8  |0    |
> >>  |3 4 5  |     |
> >>  |0 1 2  |     |
> >>  +-------+-----+
> >>     U
> >>  2 2 $ +/ ; |: ; |. ; -/ .*
> >>
> >> P.S. I probably should have said "One of Ken's handwritten notes for
> > Linda".
> >>
> >> --Kip
> >>
> >> Sent from my iPad
> >>
> >>
> >> On Apr 14, 2013, at 9:40 AM, Dan Bron <[email protected]> wrote:
> >>
> >>> I wasn't wanting any behavior; I was just answering your question.
> >>> Is
> > there something else you wanted, having read Ken's paper (i.e. some
> > other question than how to make a table of verbs in J)?
> >>>
> >>> -Dan
> >>>
> >>> Please excuse typos; composed on a handheld device.
> >>>
> >>> On Apr 14, 2013, at 9:00 AM, km <[email protected]> wrote:
> >>>
> >>>> Is this the behavior you want?
> >>>>
> >>>>  T =: 2 2 $ +/`|:`|.`(-/ .*)
> >>>>   T i. 2 2
> >>>> 2
> >>>>   T i. 3 3
> >>>> 2
> >>>>   T
> >>>> +-------+---------------+
> >>>> |+-+---+||:             |
> >>>> ||/|+-+||               |
> >>>> || ||+|||               |
> >>>> || |+-+||               |
> >>>> |+-+---+|               |
> >>>> +-------+---------------+
> >>>> ||.     |+-+-----------+|
> >>>> |       ||.|+-------+-+||
> >>>> |       || ||+-+---+|*|||
> >>>> |       || |||/|+-+|| |||
> >>>> |       || ||| ||-||| |||
> >>>> |       || ||| |+-+|| |||
> >>>> |       || ||+-+---+| |||
> >>>> |       || |+-------+-+||
> >>>> |       |+-+-----------+|
> >>>> +-------+---------------+
> >>>>
> >>>> --Kip
> >>>>
> >>>> Sent from my iPad
> >>>>
> >>>>
> >>>> On Apr 14, 2013, at 8:36 AM, Dan Bron <[email protected]> wrote:
> >>>>
> >>>>> 2 2 $ +/`|:`|.`(-/ .*)
> >>>>>
> >>>>> Please excuse typos; composed on a handheld device.
> >>>>>
> >>>>> On Apr 14, 2013, at 8:24 AM, km <[email protected]> wrote:
> >>>>>
> >>>>>> One of Ken's notes shows a "table of verbs".  A two by two
> >>>>>> example in J might be
> >>>>>>
> >>>>>> +/   |:
> >>>>>>
> >>>>>> |.   -/.*
> >>>>>>
> >>>>>> How would you implement such a table in J?
> >>>>>>
> >>>>>> --Kip Murray
> >>>>>>
> >>>>>> Sent from my iPad
> >>>>>>
> >>>>>>
> >>>>>> On Apr 13, 2013, at 11:53 PM, "Linda Alvord"
> >>>>>> <[email protected]>
> > wrote:
> >>>>>>
> >>>>>>> Here are some copies of notes that Ken made over the years.
> >>>>>>>
> >>>>>>>
> >>>>>>> http://www.jsoftware.com/jwiki/KenIversonNotes-LindaAlvord
> >>>>>>>
> >>>>>>> Linda
> >>>>>> -----------------------------------------------------------------
> >>>>>> -
> >>>>>> ---- 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
> >>> --------------------------------------------------------------------
> >>> -
> >>> - 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
> >
> > ----------------------------------------------------------------------
> > 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
> > ----------------------------------------------------------------------
> > 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to