-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Milestone
Description
The recursive call in the last line of
(defn recursive-validate
"validates each step in order, returning an array of boolean values corresponding to the rules, in order"
[exps rules steps]
(cond
;if one expression and 0 rules are left, all expressions and rules validated
(and (= 1 (count exps)) (empty? rules)) '()
;if only one list is empty, something is wrong
(or (>= 1 (count exps)) (empty? rules)) (throw (js/Error. "Mismatched expression and rules lists' lengths"))
(and (= (first steps) "⇒") (check-match (nth exps 0) (nth exps 1) (nth rules 0) (nth rules 1)))
(cons true (recursive-validate (rest exps) (rest (rest rules)) (rest steps)))
(and (= (first steps) "≡")
(true? (check-match-recursive (nth exps 0) (nth exps 1) (nth rules 0) (nth rules 1))))
(cons true (recursive-validate (rest exps) (rest (rest rules)) (rest steps)))
;if check-match-recursive didn't return true, end the computation
:else (cons false (recursive-validate (rest exps) (rest (rest rules))))))
from unification.cljs doesn't have enough arguments. Not clear if this is a bug or not, but someone should look into that.