On Tue, Oct 4, 2011 at 4:52 AM, Bo Jacoby <[email protected]> wrote:
> Verbs for deduction and induction are defined like this.
>
>    a     =. *`%`:3"2
>    b     =. ,: (%:@* -.)
>    c     =. (,: , 1:) % +/@]
>    deduc =. a@b@c f.
>    T     =. -@(+ #)
>    induc =. (T@}: , }.)@(T~ deduc T) f.

This looks fun.

I do have some cosmetic suggestions.

First, I prefer =: over =. for definitions that I am going to use,
because =. definitions in a script I load from file vanish before I
can use them.

Second, I would probably use / instead of `:3 -- I know that J will
convert gerund/ to gerund`:3 but / is still more concise (and, for me,
saves a round trip to the vocabulary page -- but that might not be the
case for someone else).

Also, it's interesting (and educational) to try to put names to each
of the intermediate results that arise in this kind of computation.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to