Thanks, Raul.

>> 2. If baa is not a verb, how can I determine its type?
>>     -short of actually assigning it to a local name: baa=. (...) and
>> calling 4!:0<'baa' ?
>
> What's wrong with that?

What indeed? -- for the overwhelming majority of cases. If it turns
into an impossibly large noun, then just too bad.

I was trying to get right away from physically constructing (baa) each
time. My original approach had me doing just that, covering each verb
I found, running the tooled-up expression with test data and looking
to see if each (baa) was called monadically or dyadically, and with
what argument(s). If the algorithm runs to completion in reasonable
time, it's cast-iron.

But, trained as an algebraist, I wondered if a useful subset of J
syntax (without copulas, and confined to verb trains) could be reduced
to a formal axiomatic system and handled by substitution rules: like a
semigroup presentation.

At the time I guessed not - and your answer to my question 3
reinforces that view: that J is "implementation defined" (like every
other programming language I know, with the possible exception of
Prolog) and therefore not (in the general case) amenable to algebraic
manipulation...
   http://www.jsoftware.com/jwiki/Guides/Language%20FAQ/J%20BNF
more-or-less says as much.

Well, I thought it was all worth a second glance.

I'll go back and take a hard look at Ambrus's tte.ijs to see how he
salts his x's and y's around. It may be he simply guesses.

On Fri, Jul 20, 2012 at 6:39 PM, Raul Miller <[email protected]> wrote:
> On Fri, Jul 20, 2012 at 12:05 AM, Ian Clark <[email protected]> wrote:
>> For all my exposure to J, I can't answer the following simple(?)
>> questions. Can someone help please?
>>
>> Take the fully parenthesized representation of a given tacit verb: foo
>> (viz 5!:6 <'foo')
>> --note: "verb", not "sentence" (which might be a noun).
>> Take what's inside any pair of balanced parens: (...). Give it a name:
>> baa, so we can formally replace (...) with (baa) .
>>
>> 1. Is baa always a verb?
>>      Answer: no, because I can make phrases like: (-~) appear.
>>     BUT are there only a small number of special cases I can detect
>> and allow for, like (-~)?
>
> -~ is a verb
>
>> 2. If baa is not a verb, how can I determine its type?
>>     -short of actually assigning it to a local name: baa=. (...) and
>> calling 4!:0<'baa' ?
>
> What's wrong with that?
>
>> 3. Is there an easy way to tell if baa gets called monadically or
>> dyadically, and if it gets the y-argument of foo -- and the x-arg too?
>
> Not in the general case.  Consider:
>
>    example=: +/@:(#.inv)
>
> Here, we can use the monadic or the dyadic definitions of #.inv,
> depending the context where example is used.
>
> That said, some contexts will provide adequate restrictions.  For
> example, we only care about the monadic definition of the left
> argument for @ or for the right argument of & (assuming it's a verb).
>
> --
> Raul
> ----------------------------------------------------------------------
> 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