diff --git a/src/sicp_logic/evaluator.clj b/src/sicp_logic/evaluator.clj index b081b10..06a815a 100644 --- a/src/sicp_logic/evaluator.clj +++ b/src/sicp_logic/evaluator.clj @@ -19,9 +19,11 @@ (disjoin db (rest disjuncts) input-frames)))) (defn negate [db operands input-frames] - (filter + (mapcat (fn [frame] - (empty? (qeval db (first operands) [frame]))) + (if (empty? (qeval db (first operands) [frame])) + [frame] + [])) input-frames)) (defn execute [exp]