OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-ure commits / 425c33b

Move obsolete function to wher its used.
No one else uses this function. Yes, URE is dead. But I won't leave it entirely stranded. Just move the dead code to here. If for no other reason than historical preservation.
425c33b4245a1e0ff7a573f9fbba15d7d0dc6476
by Linas Vepštas <linasvepstas@gmail.com> · 2025-09-20T04:12:28.000Z

Changed files (1) +39 -0

opencog/scm/opencog/ure/ure-utils.scm +39 -0
……@@ -670,6 +670,45 @@
670670 (cog-set-atomspace! current-as)
671671 rules))
672672
673(define-public (cog-map-chase-link link-type endpoint-type proc anchor)
674"
675 cog-map-chase-link -- Invoke proc on atom connected through type.
676
677 Similar to cog-chase-link, but invokes 'proc' on the wanted atom.
678 Starting at the atom 'anchor', chase its incoming links of
679 'link-type', and call procedure 'proc' on all of the atoms of
680 type 'endpoint-type' in those links. For example, if 'anchor' is the
681 node 'GivenNode \"a\"', and the atomspace contains
682
683 SomeLink
684 GivenNode \"a\"
685 WantedNode \"p\"
686
687 SomeLink
688 GivenNode \"a\"
689 WantedNode \"q\"
690
691 then 'proc' will be called twice, with each of the WantedNodes's
692 as the argument. These wanted nodes were found by following the
693 link type 'SomeLink, starting at the anchor GivenNode \"a\".
694
695 It is presumed that 'anchor' points to some atom (typically a node),
696 and that it has many links in its incoming set. So, loop over all of
697 the links of 'link-type' in this set. They presumably link to all
698 sorts of things. Find all of the things that are of 'endpoint-type'.
699 Apply proc to each of these.
700"
701 (define (get-endpoint w)
702 (map proc (cog-outgoing-by-type w endpoint-type))
703 )
704
705 ; We assume that anchor is a single atom, or empty list...
706 (if (null? anchor)
707 '()
708 (map get-endpoint (cog-incoming-by-type anchor link-type))
709 )
710)
711
673712(define-public (ure-weighted-rules rbs)
674713"
675714 List all weighted rules of rbs, as follow