Every pearl begins with a grain of sand. Still, perhaps, I should try to be
more than grit.
That said... I took a look at what you're doing here. And my first attempt
went something like this:
load '/users/rauldmiller/j64-804-user/temp/111.ijs'
hg
|value error: hg
...er...
Anyways, after I changed all the =. to =: I took another look:
* (< , ((<'/')"_)) hg
*/
So, ok, you've got a mechanism here for generating verbs, so let's make
sure I understand the basic grammar:
slash=: (< , ((<'/')"_)) hg
* slash
*/
And, looking at the left argument to hg:
(< , ((<'/')"_))
< , (<'/')"_
We've got a verb. So, let's try a few experiments with that verb:
(< , ((<'/')"_)) ''
┌┬─┐
││/│
└┴─┘
(< , ((<'/')"_)) '*'
┌─┬─┐
│*│/│
└─┴─┘
Hmm...
But this turns out to be a false trail - playing with another verb from
your test cases suggests that the verb argument to hg is not being used for
what it does but for its structure (you mention the atomic representation).
In other words, you seem to have developed a system which introspects a
representation of the verb and uses that to drive the behavior of the
adverb in creating new verbs.
And maybe I could have given up here, but reading over what you wrote
again, I decided to run another test. I can get the atomic representation
using 5!:1:
* 1 :'5!:1 <''u'''
┌─┐
│*│
└─┘
And, you are using `:6 as the basis of hg. And, so I think I should expect
that the verb argument to hg takes an atomic representation as an argument
and produces a gerund train representation of a verb as a result and that
hg will be dealing with converting to atomic representation in the first
place and then back to a verb at the end
Testing this idea:
((< , ((<'/')"_)) * 1 :'5!:1 <''u''')`:6
*/
So, ok, I think I see what you are doing here.
Testing further, I define:
steroids=: 1 :0
u illegal
)
illegal=: 2 :0
representation=. 5!:1 <'v'
(u representation)`:6
)
And, using my illegal steroids in your tests, in the place of hg:
assert 1 4 9 -: 1 2 3 ((<'*:') ; ] ) steroids
assert 6 -: * (< , ((<'/')"_)) steroids 1
2 3
assert 0 1 3 -: (*:`(+/\)) (0&{ , (<'-') , 1&{)@:(('';1)&{::) steroids 1
2 3
So... hg takes a verb which transforms a gerund to another gerund and
converts that to an adverb.
I am now tempted to document how it works, but this response has already
gotten long, and perhaps someone else would be interested in tackling that
issue?
Still... looking at what you wrote, most of you a* names are adverbs, but
ar and aw are not. Looking at those two: ar gives the atomic representation
for a name, and is documented as extracting an atomic representation, and
its definition extracts from a boxed nest.
And, looking closer, you are using ar to extract atomic representations of
some of your intermediate adverbs (but it does not seem to appear in the
final result - it's scaffolding but not a part of the product).
So, I think what you are doing here is taking advantage of gerund formation
to get at what I illegally name u and v and then working from there. But
I'd need to spend some time studying and thinking before I could come up
with better names, descriptions or comments for a1, a2, a3, a4, a5 and a6.
Thanks,
--
Raul
On Sat, Mar 19, 2016 at 1:23 PM, Jose Mario Quintana <
[email protected]> wrote:
> Many thanks for your kind words Dan. As in mathematics the person that
> puts the last piece in place and starts the engine gets most of the
> credit. Yet, other people contributed, particularly you, including (at
> least indirectly)... Raul! Do not get me wrong though; I am very proud of
> the "holy grail." :) I am re posting the fixed version here using another
> pro-adverb (hg) because I use the Adv name often for another purpose:
>
> o=. @:
> e=. &.>
> ar=. 5!:1@:<
>
> (a0=. `'') (a1=. (@:[) ((<'&')`) (`:6)) (a2=. (`(<(":0);_)) (`:6))
> av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6)
> NB. Adverbing a monadic verb (adv)
> assert 1 4 9 -: 1 2 3 *: av
>
> aw=. < o ((0;1;0)&{::) NB. Fetching the atomic representation
> a3=. (@: (aw f.)) ('av'f.)
> a4=. "_
> a5=. `:6
> a6=. ((( ar'a4') ; ] ; ( ar'a3')"_) ('av'f.)) (`:6)
>
> hg=. `((ar'a6')`(ar'a5')) (`:6)
> assert 1 4 9 -: 1 2 3 ((<'*:') ; ] ) hg
> assert 6 -: * (< , ((<'/')"_)) hg 1 2 3
> assert 0 1 3 -: (*:`(+/\)) (0&{ , (<'-') , 1&{)@:(('';1)&{::) hg 1 2 3
>
> erase'a0 a1 a2 a3 a4 a5 a6 ar av aw'
>
> Feel free to rename, modify, explain, etc. as you please. You might also
> like to make the script suitable for loading with the verb load. (I am
> allergic to run scripts within an unfaithful explicit environment because
> one can get confused sometimes.) I wrote the "holy grail" in a hurry and I
> would not be surprised if some bugs arise but so far, so good.
>
> You might like to know that recently I found, half buried in the archives,
> my original Turing machine post [0]. There is also a recent version in the
> Rosetta code site.
>
> [0] Jforum: A Tacit Implementation of a Turing Machine
> http://www.jsoftware.com/pipermail/general/1999-December/002736.html
>
>
>
>
> On Thu, Mar 17, 2016 at 11:22 PM, Dan Bron <[email protected]> wrote:
>
> > Pepe wrote:
> > > Let us add another twist, courtesy of David Lambert, to the Exercise 1:
> >
> >
> > All these puzzles are interesting, but ever since you posted the “holy
> > grail”, the “write a tacit adverb to do X” challenges have been reduced
> (in
> > principle) to “write a tacit verb to do X”, and given you sent me, in
> > something like 2002, a complete implementation of a Turing Machine as a
> > tacit verb, the exercises seem … superfluous.
> >
> > In other words, it can all be done, because you have done all of it. In a
> > very literal sense.
> >
> > The upside, however, is I have never read one of your posts and not
> > learned something not only new, but intriguing. If I were given to envy,
> I
> > might have experienced that, as well. Good thing the only sentiment I
> feel
> > for my fellow man is admiration ;)
> >
> > That said, if Thomas comes through with an interpreter which
> re-introduces
> > (some of) the F Trains table, new challenges (in terms of brevity and
> > algebraic reduction) will open up to us. If I were given to
> > competitiveness, I might perceive that as a kind of perverse motivation.
> >
> > I’m already dusting off my running shoes.
> >
> > -Dan
> >
> > * In general, I have been, historically, lax about backups.
> >
> > In general, I am not bothered, because death is inevitable and
> possessions
> > are but albatrosses about our necks, but a few losses have made me regret
> > this specific foible.
> >
> > All the lost treasures which I was given by the luminaries of J, early in
> > my career, before I was in a position to truly appreciate them, including
> > your Turing Machine, personal correspondence from Ken, private guidance
> by
> > Henry Rich, a utilities file presented to me by Kirk Iverson, etc, number
> > among these regrets.
> >
> > Ah well, youth is not known for its gratitude, is it?
> >
> >
> >
> > ----------------------------------------------------------------------
> > 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