More adverb questions 
Author Message
 More adverb questions

Since the question of adverb creation has come up, let me solicit some
help
in understanding the general process. I apologize if my examples seem
artificial--they illustrate my conceptual problems, which are based on
real problems.

1.  Can / be modeled in J?

2.  How does one write the following adverb, A?
    a.  For an atomic verb (a monadic verb having rank 0 or a dyadic verb
        having rank 0 0), if either of the atoms the verb
        is presented with is 1, the result is 10, otherwise
        the result is the normal result of the verb.
    b.  For non-atomic verbs, the result is the number of atoms
        in the normal result of the verb.

    Example:
        +A i.3 -> 0 10 2
        (1 + i.3) +A i.3 -> 10 10 5
        (<\)A i.3 -> 3

        a =. i. 2 3
        b =. i. 2 3 4
        a $A b is */$(a$b) or 1440 because $ has dyadic rank _ 1

Basically, I am trying to understand the following concepts in J adverb
creation:
1.    How does one modify the operand(s) to the verb ("preprocess the
      operands). So far as I know this must be done tacitly, since x.
      for an adverb is presumably the verb it is modifying. Can any
      adverb be written tacitly  with respect to the verb operands?
2.    How does one modify the normal result of the verb ("postprocess the
      results of the verb").
3.    How does one distinguish in the adverb whether the verb is being
used
      monadically or dyadically?

Any help on understanding these concepts would be appreciated.

hf



Tue, 10 Mar 1998 03:00:00 GMT  
 More adverb questions
Harry Felder:
:  1.  Can / be modeled in J?

yes.  I'm not going to do it in this post, however.

:  2.  How does one write the following adverb, A?
:      a.  For an atomic verb (a monadic verb having rank 0 or a dyadic verb
:          having rank 0 0), if either of the atoms the verb
:          is presented with is 1, the result is 10, otherwise
:          the result is the normal result of the verb.
:      b.  For non-atomic verbs, the result is the number of atoms
:          in the normal result of the verb.

Why would you want to?  This sounds incredibly arbitrary.  [In real
life, if presented with a problem like this, it's probably time to
review the overall goals of your project.]  Nevertheless, it is
possible.  I'd could write something like this:

A = 0 : 1
$. =. $. -. (0 = x. mr) # 3             NB. 0
$. =. $. -. (0 0 -: x. dr) # 5          NB. 1
v1 =. x. ex1a                           NB. 2
v1 =. x. ex1b                           NB. 3
v2 =. x. ex2a                           NB. 4
v2 =. x. ex2b                           NB. 5
   v1 : v2                              NB. 6
)





mr =: ' {. x. hasrank' : 1      NB. monadic rank of verb
dr =: ' }. x. hasrank' : 1      NB. dyadic rank of verb

hasrank =: 0 : 1        NB. rank of verb
t =. - " x.

Quote:
> 2{ 5!:2 <'t'

)

CAUTION:

[1] I'm used to J release 1 version 7.  Release 2 has some superficial
incompatabilities that I think would prevent the above from working
there.

[2] I've not tested this -- the machine I'm posting from doesn't have
J on it at the moment.

:  Basically, I am trying to understand the following concepts in J adverb
:  creation:
:  1.  How does one modify the operand(s) to the verb ("preprocess the
:        operands). So far as I know this must be done tacitly, since
:        x.  for an adverb is presumably the verb it is modifying. Can
:        any adverb be written tacitly with respect to the verb
:        operands?

In general, use & for this.

:  2.  How does one modify the normal result of the verb ("postprocess
:        the results of the verb").


:  3.  How does one distinguish in the adverb whether the verb is being
:        used monadically or dyadically?

In general, define both the monadic and dyadic case and join them
together with :

--
Raul



Thu, 12 Mar 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. J adverb question

2. J ammend adverb }

3. Need help with adverb

4. Defining adverbs tacitly

5. adverb definition via : in J 3.2

6. User-defined adverbs?

7. Trains of conjunctions and/or adverbs

8. Prefix adverb in J

9. tacit adverb problem [J]

10. A handy explicit adverb in J

11. Can I design a bivalent adverb without using : ?

12. Anybody got an easy way to design adverbs?

 

 
Powered by phpBB® Forum Software