Skip to content

Commit

Permalink
remove redundant pools
Browse files Browse the repository at this point in the history
there is no need to separate an asp and ImplicationLink rule-set as there
are no multiple rule-sets.
  • Loading branch information
amebel committed Apr 14, 2016
1 parent 3a2f0c2 commit c2ca4bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion opencog/openpsi/action-selector.scm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

; TODO: Add checks to ensure the eval-term argument is actually evaluatable
(let* ((z-name (string-append
(psi-prefix-str) " action-rule-selector-" name))
(psi-prefix-str) " action-selector-" name))
(selector-dpn (cog-node 'DefinedPredicateNode z-name)))
(if (null? selector-dpn)
(begin
Expand Down
22 changes: 4 additions & 18 deletions opencog/openpsi/active-schema-pool.scm
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,9 @@
; --------------------------------------------------------------
(define-public (psi-asp)
"
Create the active-schema-pool as a URE rulebase and return the node
representing it.
Returns the ConceptNode that represents the active-schema-pool.
"
(let ((asp (ConceptNode (string-append (psi-prefix-str) "asp"))))

(ure-define-rbs asp 1)

; Load all default actions because they should always run. If they
; aren't always.
(if (null? (ure-rbs-rules asp))
(map (lambda (x) (MemberLink x asp)) (psi-get-action-rules-default)))

asp
)
(ConceptNode (string-append (psi-prefix-str) "asp"))
)

; --------------------------------------------------------------
Expand Down Expand Up @@ -134,9 +123,7 @@
action
(ConceptNode (string-append (psi-prefix-str) "action")))

(MemberLink
(implication)
(ConceptNode (string-append (psi-prefix-str) "rule")))
(MemberLink (implication) (psi-asp))

(implication)
)
Expand All @@ -150,8 +137,7 @@
(if (member x (psi-get-all-actions)) #t #f))

(define (psi-get-all-rules) ; get all openpsi rules
(cog-chase-link 'MemberLink 'ImplicationLink
(ConceptNode (string-append (psi-prefix-str) "rule"))))
(cog-chase-link 'MemberLink 'ImplicationLink (psi-asp)))

(define (psi-get-context rule) ; get the context of an openpsi-rule
(define (get-c&a x) ; get context and action list from ImplicationLink
Expand Down

0 comments on commit c2ca4bb

Please sign in to comment.