File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1919 [x]
2020 (and (symbol? x) (= \% (first (name x)))))
2121
22+ (defn- vars [constraint]
23+ (if (list? constraint)
24+ (filter st/vartest? (rest constraint))
25+ (st/vars constraint)))
26+
2227(defn mark-unbound
2328 " Convert a head to use fresh vars for any vars that are unbound.
2429 Scans the vars in the body to identify which vars are unbound."
3742 " Body must be a sequence of constraints" )
3843 (assert (and (sequential? head) (or (empty? head) (every? sequential? head)))
3944 " Head must be a sequence of constraints" )
45+ (assert (every? (complement fresh-var?) (mapcat vars body))
46+ " Fresh vars are not allowed in a body" )
4047 (st/new-rule (mark-unbound head body) body name)))
4148
4249(s/defn named-rule :- Rule
You can’t perform that action at this time.
0 commit comments