|
35 | 35 | (and (identifier? #'proc) |
36 | 36 | (or (free-label-identifier=? #'proc #'procedure) |
37 | 37 | (free-label-identifier=? #'proc #'kernel) |
38 | | - (free-label-identifier=? #'proc #'grammar) |
39 | | - (free-label-identifier=? #'proc #'grammar*))) |
| 38 | + (free-label-identifier=? #'proc #'grammar))) |
40 | 39 | (let ([out-type (identifier->type #'out stx)] |
41 | 40 | [arg-types (map (curryr identifier->type stx) (syntax->list #'(type ...)))]) |
42 | 41 | (when (free-label-identifier=? #'proc #'kernel) |
|
202 | 201 | ; Typechecks the verify or synthesis query statement. |
203 | 202 | (define (typecheck-query stx) |
204 | 203 | (syntax-case stx () |
| 204 | + [(query #:forall [decl ...] #:bitwidth bw #:grammar-depth depth #:ensure form) |
| 205 | + (parameterize ([current-env (env)]) |
| 206 | + (with-syntax ([(typed-decl ...) (map typecheck-query-declaration (syntax->list #'(decl ...)))] |
| 207 | + [typed-form (typecheck #'form)] |
| 208 | + [typed-bw (typecheck #'bw)] |
| 209 | + [typed-depth (typecheck #'depth)]) |
| 210 | + (check-no-conversion (type-ref #'typed-bw) int #'typed-bw stx) |
| 211 | + (check-no-conversion (type-ref #'typed-depth) int #'typed-depth stx) |
| 212 | + (type-set (syntax/loc stx (query #:forall [typed-decl ...] |
| 213 | + #:bitwidth typed-bw |
| 214 | + #:grammar-depth typed-depth |
| 215 | + #:ensure typed-form)) |
| 216 | + void)))] |
205 | 217 | [(query #:forall [decl ...] #:bitwidth bw #:ensure form) |
206 | 218 | (parameterize ([current-env (env)]) |
207 | 219 | (with-syntax ([(typed-decl ...) (map typecheck-query-declaration (syntax->list #'(decl ...)))] |
208 | 220 | [typed-form (typecheck #'form)] |
209 | 221 | [typed-bw (typecheck #'bw)]) |
210 | 222 | (check-no-conversion (type-ref #'typed-bw) int #'typed-bw stx) |
211 | | - (type-set (syntax/loc stx (query #:forall [typed-decl ...] #:bitwidth typed-bw #:ensure typed-form)) void)))] |
| 223 | + (type-set (syntax/loc stx (query #:forall [typed-decl ...] |
| 224 | + #:bitwidth typed-bw |
| 225 | + #:ensure typed-form)) |
| 226 | + void)))] |
212 | 227 | [(query #:forall [decl ...] #:ensure form) |
213 | 228 | (parameterize ([current-env (env)]) |
214 | 229 | (with-syntax ([(typed-decl ...) (map typecheck-query-declaration (syntax->list #'(decl ...)))] |
|
435 | 450 | (dict-set! procs #'choose typecheck-choose) |
436 | 451 | (dict-set! procs #'?? typecheck-??) |
437 | 452 | (dict-set! procs #'grammar typecheck-grammar) |
438 | | - (dict-set! procs #'grammar* typecheck-grammar) |
439 | 453 |
|
440 | 454 | (dict-set! procs #'procedure typecheck-procedure) |
441 | 455 | (dict-set! procs #'kernel typecheck-procedure) |
|
0 commit comments