diff options
| author | Jakob L. Kreuze | 2023-04-21 20:19:06 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2023-04-21 20:19:06 -0400 |
| commit | d11dfff39d005f7cd41868bf3e4ae4875db9204e (patch) | |
| tree | 2b8fb6be8ea11992f73d6120c1fc9a6212e9b64e | |
| parent | d19e3175406e0ea21cb1bbc6448e7e5446de1f58 (diff) | |
Fix compilation of 04-rule-free-variables.rego
| -rw-r--r-- | compiler/passes/compile-constraints.scm | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/compiler/passes/compile-constraints.scm b/compiler/passes/compile-constraints.scm index 80de0fc..81c8d01 100644 --- a/compiler/passes/compile-constraints.scm +++ b/compiler/passes/compile-constraints.scm @@ -68,19 +68,19 @@ (is-local-assignment? (first xs))) (let ((assignments (take-while is-local-assignment? xs)) (body (drop-while is-local-assignment? xs))) - (make <lean-intro-locals> - #:identifiers - (map (match-lambda - ((($ <reference> (($ <variable-ref> "assign"))) left right) - `(,left ,right))) - assignments) - #:body - (make <lean-conjunction> #:clauses body))) + `(,(make <lean-intro-locals> + #:identifiers + (map (match-lambda + ((($ <reference> (($ <variable-ref> "assign"))) left right) + `(,left ,right))) + assignments) + #:body + (make <lean-conjunction> #:clauses body)))) xs)) (define (process-all form) - (map process-local-extent - (collapse-extents (partition-on form is-local-assignment?)))) + (fold-right append '() (map process-local-extent + (collapse-extents (partition-on form is-local-assignment?))))) (define (compile-constraints policy) (policy-map @@ -101,7 +101,7 @@ #:left left #:right right))) ((xs ...) - (if (any is-local-assignment? form) - (process-all form) - form)) + (if (any is-local-assignment? xs) + (process-all xs) + xs)) (anything-else anything-else))))) |