Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
( ( balance
|
||||
= a x b y c zd
|
||||
. !arg
|
||||
: ( B
|
||||
. ( ( R
|
||||
. ((R.?a,?x,?b),?y,?c)
|
||||
| (?a,?x,(R.?b,?y,?c))
|
||||
)
|
||||
, ?zd
|
||||
)
|
||||
| ( ?a
|
||||
, ?x
|
||||
, ( R
|
||||
. ((R.?b,?y,?c),?zd)
|
||||
| (?b,?y,(R.?c,?zd))
|
||||
)
|
||||
)
|
||||
)
|
||||
& (R.(B.!a,!x,!b),!y,(B.!c,!zd))
|
||||
| !arg
|
||||
)
|
||||
& ( ins
|
||||
= C X tree a m z
|
||||
. !arg:(?X.?tree)
|
||||
& !tree:(?C.?a,?m,?z)
|
||||
& ( !X:<!m
|
||||
& balance$(!C.ins$(!X.!a),!m,!z)
|
||||
| !X:>!m
|
||||
& balance$(!C.!a,!m,ins$(!X.!z))
|
||||
| !tree
|
||||
)
|
||||
| (R.,!X,)
|
||||
)
|
||||
& ( insert
|
||||
= X tree
|
||||
. !arg:(?X.?tree)
|
||||
& ins$(!X.!tree):(?.?X)
|
||||
& (B.!X)
|
||||
)
|
||||
& ( insertMany
|
||||
= L R tree
|
||||
. !arg:(%?L_%?R.?tree)
|
||||
& insertMany$(!L.!tree):?tree
|
||||
& insertMany$(!R.!tree)
|
||||
| insert$!arg
|
||||
)
|
||||
);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
( ( it allows for terse code which is easy to read
|
||||
, and can represent the algorithm directly
|
||||
.
|
||||
)
|
||||
: ?values
|
||||
& insertMany$(!values.):?tree
|
||||
& lst$tree
|
||||
& done
|
||||
);
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
(tree=
|
||||
B
|
||||
. ( B
|
||||
. (R.(B.,,),algorithm,(B.,allows,))
|
||||
, and
|
||||
, (B.,can,)
|
||||
)
|
||||
, code
|
||||
, ( R
|
||||
. ( B
|
||||
. (B.(R.,directly,),easy,)
|
||||
, for
|
||||
, (B.(R.,is,),it,)
|
||||
)
|
||||
, read
|
||||
, ( B
|
||||
. (B.,represent,)
|
||||
, terse
|
||||
, (R.(B.,the,),to,(B.,which,))
|
||||
)
|
||||
)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue