3

In programming language J, is a train of verbs always associative? If it is, Are there any proofs?

kaleidic
  • 3,070
  • 1
  • 21
  • 22
ahala
  • 4,683
  • 5
  • 27
  • 36

2 Answers2

5

No, a train of verbs is not associative and this follows the definitions. For example, a fork is

(f g h) y = (f y) g (h y)

but

(f (g h)) y = y f ((g h) y) = y f (y g (h y))

which can also be written as y f y g h y. And

((f g) h) y = y (f g) (h y) = y f (g (h y))

which can also be written as y f g h y.

Those three are completely different things.

Eelvex
  • 8,975
  • 26
  • 42
1

Train in J is right associative, and the minimum group is a fork. Only when it cannot make a fork, it makes a hook. So

vvvvv = (vv(vvv)), 

And

vvvv= (v(vvv)).
LCJ
  • 22,196
  • 67
  • 260
  • 418
learnJ
  • 11
  • 1