Merge branch 'master' of ssh://git.journeyman.cc:4022/simon/dengine

This commit is contained in:
Simon Brooke 2025-08-16 12:09:53 +01:00
commit 4d3f8eb8b8

View file

@ -32,10 +32,17 @@
(defn make-node (defn make-node
"Make a node. TODO: these wrapper functions will probably disappear once "Make a node. TODO: these wrapper functions will probably disappear once
I'm more comfortable with the architecture." I'm more comfortable with the architecture."
([feature ^Boolean colour ^String fragment] ([feature-id ^Boolean colour ^String fragment]
(make-node feature colour fragment nil)) (make-node feature-id colour fragment nil))
([feature ^Boolean colour ^String fragment children ] ([feature-id ^Boolean colour ^String fragment children ]
(NodeImpl. feature colour fragment children))) (if (and (find-feature-for @!kb feature-id)
(every? #(satisfies? Node %) children))
(NodeImpl. feature-id colour fragment children)
(throw (ex-info "Unexpected item passed as child node"
{:feature-id feature-id
:colour colour
:fragment fragment
:children children})))))
;; Here's the algorithm as published in A Graphical Inference Mechanism, ;; Here's the algorithm as published in A Graphical Inference Mechanism,
;; but it's not real Interlisp code, and I remember there being at least ;; but it's not real Interlisp code, and I remember there being at least