]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of http://factorcode.org/git/factor into tangle
authorAlex Chapman <chapman.alex@gmail.com>
Tue, 1 Apr 2008 01:09:33 +0000 (12:09 +1100)
committerAlex Chapman <chapman.alex@gmail.com>
Tue, 1 Apr 2008 01:09:33 +0000 (12:09 +1100)
Conflicts:

extra/semantic-db/semantic-db-tests.factor

1  2 
extra/semantic-db/hierarchy/hierarchy.factor

diff --cc extra/semantic-db/hierarchy/hierarchy.factor
index 69c7baba9ffd973e312e7bc155c8568f50c5fed7,69c7baba9ffd973e312e7bc155c8568f50c5fed7..0000000000000000000000000000000000000000
deleted file mode 100755,100755
+++ /dev/null
@@@ -1,45 -1,45 +1,0 @@@
--! Copyright (C) 2008 Alex Chapman
--! See http://factorcode.org/license.txt for BSD license.
--USING: accessors db.tuples hashtables kernel
--semantic-db semantic-db.relations sequences sequences.deep ;
--IN: semantic-db.hierarchy
--
--TUPLE: tree id children ;
--C: <tree> tree
--
--: has-parent-relation ( -- relation-id )
--    "has parent" relation-id ;
--
--: parent-child* ( parent child -- arc-id )
--    has-parent-relation spin create-arc* ;
--
--: parent-child ( parent child -- )
--    parent-child* drop ;
--
--: un-parent-child ( parent child -- )
--    has-parent-relation spin <arc> select-tuples [ id>> delete-arc ] each ;
--
--: child-arcs ( node-id -- child-arcs )
--    has-parent-relation f rot <arc> select-tuples ;
--
--: children ( node-id -- children )
--    child-arcs [ subject>> ] map ;
--
--: parent-arcs ( node-id -- parent-arcs )
--    has-parent-relation swap f <arc> select-tuples ;
--
--: parents ( node-id -- parents )
--     parent-arcs [ object>> ] map ;
--
--: get-node-hierarchy ( node-id -- tree )
--    dup children [ get-node-hierarchy ] map <tree> ;
--
--: (get-root-nodes) ( node-id -- root-nodes/node-id )
--    dup parents dup empty? [
--        drop
--    ] [
--        nip [ (get-root-nodes) ] map
--    ] if ;
--
--: get-root-nodes ( node-id -- root-nodes )
--    (get-root-nodes) flatten prune ;