Björn Helgason wrote:
> A good start but much more is needed
(snip)
Kip Murray replies:
You could precede my comments with the following from the Dictionary
http://www.jsoftware.com/help/dictionary/dictf.htm -- this is first class exposition!
F. Trains
An isolated sequence, such as (+ */) , which the “normal” parsing rules do not resolve to a
single part of speech is called a train, and may be further resolved as described below.
A train of two or three verbs produces a verb and (by repeated resolution), a verb train of any
length also produces a verb. For example, the trains +-*% and +-*%^ are equivalent to +(-*%) and
+-(*%^). The production is defined by the following diagrams:
HOOK FORK CAPPED FORK
g g g g g g
/ \ / \ / \ / \ | |
y h x h f h f h h h
| | | | / \ / \ | / \
y y y y x y x y y x y
For example, 5(+*-)3 is (5+3)*(5-3). If f is a cap ([:) the capped branch simplifies the forks
to g h y and g x h y . The train N g h (a noun followed by two verbs) is equivalent to N"_ g h .
2009/5/1 Kip Murray <[email protected]>
(snip)
Although a motivation for APL and J is to have a precise language for
mathematics, almost nothing in J is exactly like its mathematical
counterpart. This is one justification for J's grammatical names noun,
verb, adverb, conjunction for its objects.
As an example, although I said in the Language S thread
([: ^. ^) is a tacit verb equivalent to the mathematical composition (ln o
exp)
that assertion ignored the ambivalence of the verb ^ -- only in monadic
usage does ^ correspond to the exponential function of mathematics, and the
train ([: ^. ^) permits
x ([: ^. ^) y <--> ^. (x ^ y)
as well as
([: ^. ^) y <--> ^. (^ y)
the latter corresponding to (ln o exp) y = ln(exp y) in mathematics.
This is a good thing. In the concept of verb J embraces two mathematical
concepts, function (monadic use) and operation (dyadic use), and J
economically presents concepts of composition in addition to the
mathematical (f o g) y = f(g y) .
TACIT DEFINITION OF VERBS DEFINES VERBS IN TERMS OF OTHER VERBS. This
occurs in mathematics where you see h = f + g , h = f g, h = f o g, etc.,
but tacit definition is not much used in math beyond differentiation
formulas like (f + g)' = f' + g', (f g)' = f' g + f g', (f o g)' = (f' o g)
g' ; and you are more than likely to see the last expressed as f(g(x))' =
f'(g(x)) g'(x) . Likewise, you are more likely to see (x^n)' = n x^(n-1)
than (id^n)' = n id^(n-1) . That is, math is more likely to use informal
definitions with x's than tacit definitions without x's.
Above, id is the identity function defined by
for every real number t, id(t) = t
In terms of id you can define many other functions, for example f = (1 +
id)/(1 - id) which means
for every real number t except 1, f(t) = (1 + id(t))/(1 - id(t)) = (1 +
t)/(1 - t) .
In J, the tacit definition of f would be expressed
f =: (1 + ]) % (1 - ])
where in monadic use ] is in fact an identity verb: x ] y is y , and ] y
is y .
You may object that I have violated my definition, "TACIT DEFINITION OF
VERBS DEFINES VERBS IN TERMS OF OTHER VERBS" because there is a number, 1,
in my definition of f . In fact, until recently, you would have had to use
f =: (1"_ + ]) % (1"_ - ]) or f =: (1: + ]) % (1: - ])
where both 1"_ and 1: are constant verbs which return only the value 1.
Now the form
Noun Verb Verb (for examples 1 + ] and 1 - ]) is given special dispensation
in tacit definitions. It is understood to mean Noun"_ Verb Verb.
That is my beginner's introduction to tacit definition of verbs.
Kip Murray
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm