Rather than searching for a problem for this answer, I confirmed some
comprehension of the ordinal fraction idea. Maybe I'll return to learn
addition and subtraction since the algebra of logic is intriguing. "2
of 3 witnesses thought the suspect might have had reddish hair" will
``always'' be a problem.
On 12/22/2017 09:49 AM, chat-requ...@forums.jsoftware.com wrote:
Date: Fri, 22 Dec 2017 09:49:13 -0500
From: Raul Miller<rauldmil...@gmail.com>
To: Chat forum<c...@jsoftware.com>
Subject: Re: [Jchat] ordinal fractions
Message-ID:
<cad2jou9jve6tc1py-nzccdeklqhlmr802-8hffeheazp-h_...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Sure:
'data indices'=. 'abcdeq';__ 0 1 1 1 0
We see that b and q have a as their parent:
data {~ indices {~ data i.'bq'
aa
And, we see that c d and e have b as their parent:
data {~ indices {~ data i.'cde'
bbb
And when we look at the diagram, we see the same thing:
c
/
b - d
/ \
a e
\
q
So, for example:
insert_under=:dyad define
'old_data old_indices'=. y
'new_data new_parents'=. x
data=.old_data,~.new_data -. old_data
data;old_indices,old_data i. ($new_data)$new_parents
)
Example use:
('jkl';'d') insert_under 'abcdeq';__ 0 1 1 1 0
That said, beware that like most tree implementations, this is a
solution searching for a problem.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm