The last spoiler to the challenge below (
http://www.jsoftware.com/pipermail/programming/2007-December/009267.html )
follows after several blank lines.

0.  Extreme: "The cases where u f. is not equivalent to u, of practical
interest or otherwise, are rare and are bugs.  These have been fixed for the
next J6.01 beta."  That is, find at least one Proverb (and a NOUN) such that
'Proverb NOUN' and 'Proverb f. NOUN' still do not produce the same result.
Bonus puzzle: Find different (not trivial variations) counterexamples.











































































On a fresh Windows J session copy and paste to a new ijs window the
following text,

9!:14''

u=. (0 -: ".@(,~ , 2 # {:)) ::1:
u   'u'''
u f.'u'''

Then type ctrl-a crtl-e. I get,

   9!:14''
j602/beta/2008-02-22/22:30
   
   u=. (0 -: ".@(,~ , 2 # {:)) ::1:
   u   'u'''
0
   u f.'u'''
1

(After that, you can type ctrl-w, with the focus still on the ijs window,
for a sudden ending.)

The explanation in a nutshell is that this behavior does not imply that fix
needs to be fixed; the verb u is not a function in the mathematical sense
because side effects are induced, in this case, by ::.  Other variations and
an account, that I often enjoy to tell, follow.

Many years ago two of my children were playing a game that they just had
made up.  The aim was to force the opponent to give a wrong answer to a
'simple' YES or NO question.  After long exchange that only young children
can endure the game abruptly ended when the youngest of them posed the
following question to her brother: Is your next answer going to be NO?  The
same tricky question can be posed to any oracle to demonstrate that, in math
jargon, she can either be consistent or complete (but not both).  J can be
thought as an oracle when questions can be posed as logical expressions, for
example,

   1 = 2
0
   0 -: 1 + ^o.1 * j.1
1

The question is: How can we pose the tricky question to J?  The question is
a brain twister because it is indirectly self-referencing; but, it can be
posed in J as,

u'u'''

where u=. 0 -: ".@(,~ , 2 # {:) since,

   (,~ , 2 # {:)'u'''
u'u'''

Understandably, J refuses to answer it,

   u'u'''
|stack error: u
|       u'u'''

The oracle could argue that some seemingly YES or NO questions are really
UNDECIDABLE.  Accordingly, the next logical question to pose to her is: Is
your next answer going to be NO or UNDECIDABLE?  The J counterpart is the
already mentioned (in this context :: really means uncomputable given the
resources at hand),

   u=. (0 -: ".@(,~ , 2 # {:)) ::1:
   u   'u'''
0
   u f.'u'''
1

Since indirect self-referencing is closely related to Quines, solutions
found in http://www.jsoftware.com/jwiki/Puzzles/Quine can be used as
templates for other variants, for example,

   v=. (0 = ".@({&a. , ' ' , ":)) ::1:
   v    118
0
   v f. 118
1

or

   w=. (0 -: {&a. 128!:2 ]) ::1:
   w    119
1
   w f. 119
0

The last example has to be submitted directly from the ijx window; otherwise
I get,

   w=. (0 -: {&a. 128!:2 ]) ::1:
   w    119
1
   w f. 119
1
 
(Do not ask me why.) 

Other solutions based on verbs vulnerable to side effects are possible
including the ridiculous,

   r=. ?
   r    0
0.971379
   r f. 0
0.0466292

Further, in principle, any verb is vulnerable to sickening side effects due
to a mischievous virus or bug.  Admittedly, the puzzle followed by a
'clarification' was deceiving.  




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

Reply via email to