Anybody got an easy way to design adverbs? 
Author Message
 Anybody got an easy way to design adverbs?

I am hoping to find an easier method for writings adverbs than what
I have now, which is to stare at the parse table until inspiration
strikes.  Example:

I have an array, and a function that finds the starts of sections
in the array.  I want an adverb that will apply its verb to each
section and raze the results back into an array like the original.
After much pencil-gnawing I came up with:


(find start points, use them to cut the array, apply x. to each
section and box the result, and then finally raze the boxes)

It sure would have been nice to let the interpreter generate
this from an explicit equivalent, but I couldn't get it to.  Is
there a way?

Or, does anyone have a systematic way of generating such adverbs?

Henry Rich

P. S. I say that there is no way to write my example adverb without
  using ~ .  Anybody want to fade that?

hhr



Sun, 11 Oct 1998 03:00:00 GMT  
 Anybody got an easy way to design adverbs?


Quote:

>I am hoping to find an easier method for writings adverbs than what
>I have now, which is to stare at the parse table until inspiration
>strikes.  Example:

>I have an array, and a function that finds the starts of sections
>in the array.  I want an adverb that will apply its verb to each
>section and raze the results back into an array like the original.
>After much pencil-gnawing I came up with:


>(find start points, use them to cut the array, apply x. to each
>section and box the result, and then finally raze the boxes)

>It sure would have been nice to let the interpreter generate
>this from an explicit equivalent, but I couldn't get it to.  Is
>there a way?

>Or, does anyone have a systematic way of generating such adverbs?

>Henry Rich

>P. S. I say that there is no way to write my example adverb without
>  using ~ .  Anybody want to fade that?

>hhr

 I have a couple solutions to Henry's question of designing adverbs.
I'll include a some text in each case to try to show how I arrived
at it.  Hopefully there will be some techniques in the following
ramblings which might help others in developing tacit definitions of
adverbs and conjunctions...

 Firstly, I found an explicit definition of the adverb which allows
the interpreter to generate a tacit form:


   foreachsection

 Note that this doesn't use ~, but we certainly could rephrase the
train in the above definition to be a hook using it:



 I'd also be tempted to solve this by creating a conjunction instead:

   eachcut

   |. eachcut (=&' ') ' reverse these words'
esrever eseht sdrow

 These all work and, given enough time referring to the section on
trains in the Dictionary, you can work through them and see why.
(It's probably a worthwhile exercise too...)

 Sometimes I find it helpful when defining an adverb to define
the *resulting* verb, using a placeholder for the argument verb,
and then to remove or change the placeholder to get the tacit
definition of the adverb.  I find it works in many cases.

 Some simple examples of this are:
   1/ Create an adverb which applies the argument
      verb, and then encloses the result.  The
      resulting verb of  foo thisadverb   is:

      In this case we can remove foo in order to
      leave us with an adverb:

   2/ A fork which returns the argument list linked
      to its sum is:
          ] ; +/
      If we want to make an adverb with +/ as an
      argument, we see if we can replace +/ to
      achieve this:
          ] ; ]:
      Doesn't quite do the trick, because the
      ]: adverb takes the ; as its argument.
      This works better when it's the left tine
      of the fork which is replaced with an
      adverb, because  x (A V V)  is  (x A) V V.
      In this case it's easy to reverse the order
      of the verbs:
          +/ ;~ ]
      We then replace  +/  with  ]:  and the
      result is the adverb we were looking for:
          besideit=. ]: ;~ ]
          (+/ % #) besideit  2 4 7 8  NB. average
       +-------+----+
       |2 4 7 8|5.25|
       +-------+----+

   ============================================================

 The way I'd approach this particular problem is to build up the
pieces, and create an eachcut conjunction such that:
   foo eachcut findcuts
is the same as the
   foo foreachsection
defined above.

 The first piece is an adverb which cuts an array based on its
argument verb.  If the argument verb were findcuts, the resulting
verb would be

   findcuts <;.1 ]

 It's easy to make this into an adverb, with findcuts as the argument
verb, by replacing the instance of findcuts with an adverb which simply
returns its verb argument as the result.  The resulting train (A0 V1 V2)
is an adverb which applies the argument verb to the A0 adverb, and
evaluates the rest as a fork, ie:

   cuts=.  ]: <;.1 ]

             findcuts cuts y             NB.  example use
             findcuts (]: <;.1 ]) y      NB.  definition of 'cuts'
             ((findcuts ]:) <;.1 ]) y    NB.  resolve V (A V V)
             (findcuts <;.1 ]) y         NB.  f]:   is   f
             (findcuts y) <;.1 y         NB.  resolve (V V V) y

   =&' ' cuts ' these are the words'
+------+----+----+------+
| these| are| the| words|
+------+----+----+------+

 The second piece is an adverb which applies its argument verb
to each item of the resulting verb's argument, and then razes
them.  Given an argument verb foo, the resulting verb is:

 If foo is removed from this sentence, the expression in the
parentheses (&.>) is an adverb, and the resulting sentence is
V0 C1 A2.  This is an adverb, and when it is applied to a verb,
that verb is the argument to A2, resulting in a verb, which
reduces the expression down to a simple verb-conjunction-verb.
So, the second adverb is:

             process eachcut y             NB.  example use



   |. eachcut  <;.1 ' these are some words'
eseht era emos sdrow

 A look at the trains shows the next step in the following:
   A0 C1 A2      conj       (x A0) C1 (y A2)

 Using this we can combine the above two adverbs into a
conjunction with:


       process eachsection findcuts y          NB.  example use



       (process eachcut) ((findcuts y) <;.1 y) NB.  defn of 'cuts'


   |. eachsection (=&' ') ' a list of words'
a tsil fo sdrow

           ======================================================

 Now let's try to create the    process eachsection findcuts  conjunction
another way.  For this exercise, we'll make the following definitions:
   findcuts=. =&' '
   process=. |.

 Firstly, we know the resulting verb is

so let's start by turning this verb into an adverb by stripping out
the findcuts verb.  In this case, we replace findcuts with the ]:
adverb, and the resulting expression defines the adverb we want:


   findcuts s1 ' rev these words'
ver eseht sdrow

 Now, convert this adverb to be a conjunction with the findcuts
argument to be on the right (and ignore the argument on the left):


   ] s2 findcuts ' rev these words'
ver eseht sdrow

 We now have a conjunction which uses the right argument verb to
select the cuts, but still has  process  hard-coded in it.  We
now change this to take the process verb as its left argument.
We can't directly replace the reference to process with [. because,

want, the train in parentheses becomes C0 C1 V2 which, according to
the Dictionary, resolves to  (x C0 y) C1 V2, which isn't what we
want.  We'd like a conjunction which takes the argument verbs and
applies them to the above conjunctions and verb as follows:
   (x C0 y) (x C1 y) V

 So, let's use J to find out how to write this bit.  I'll use
placeholders for the conjunctions and verbs I will be using:



 We can examine the Dictionary to see how this works, but for now
let's just use it, substituting in our conjunctions and verbs from
above:



neglecting up to now.  We can add this because:
     x (V0 C1 C2) y    is   V0 C1 (x C2 y)
which means that the verb arguments to this conjunction will go to
the phrase we've developed above.

 The resulting conjunction is:


  |. eachsection (=&' ') ' reverse these words'
esrever eseht sdrow

   eachsection

 Does this definition look familiar?  When I first discussed creating
a conjunction to do this I let J do the hard work:



 So in real life if I were defining this I would use:


or

   cuts=.  ]: <;.1 ]


--



Thu, 15 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. VW: getting a graphics handle (easy question?)

3. Anybody here design a simple logo ?

4. can anybody help me design this example?

5. ANYBODY NEED ASIC DESIGN SERVICES

6. ANYBODY NEED USB/PCI DESIGN SERVICES

7. Anybody need USB/PCI design services

8. ASIC DESIGN Services/Manpower/Consultancy Available - Anybody keen ?

9. ANYBODY NEED ASIC DESIGN SERVICES

10. Anybody need ASIC design services

11. Anybody need ASIC design services

12. Anybody need USB/PCI design services

 

 
Powered by phpBB® Forum Software