fixes
svn: r17265 original commit: 791ec557876881eaeafc29a43b339b7a7d632d84
This commit is contained in:
parent
4741518170
commit
21f9c0ec16
|
@ -2,7 +2,6 @@
|
|||
#lang typed-scheme
|
||||
|
||||
(: f ((U Number #f) (cons Any Any) -> Number))
|
||||
|
||||
(define (f x y)
|
||||
(cond
|
||||
[(and (number? x) (number? (car y))) (+ x (car y))]
|
||||
|
@ -11,6 +10,5 @@
|
|||
[else 0]))
|
||||
|
||||
(: bool-to-0-or-1 (Boolean -> Number))
|
||||
|
||||
(define (bool-to-0-or-1 b)
|
||||
(if b 1 0))
|
|
@ -126,7 +126,7 @@
|
|||
;; polymorphic function types should be subtypes of the function top
|
||||
[(-poly (a) (a . -> . a)) top-func]
|
||||
|
||||
[(cl->* (-Number . -> . -String) (-Boolean . -> . -String)) ((Un -Number -Boolean) . -> . -String)]
|
||||
[(cl->* (-Number . -> . -String) (-Boolean . -> . -String)) ((Un -Boolean -Number) . -> . -String)]
|
||||
))
|
||||
|
||||
(define-go
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
[#:fold-rhs (*NotTypeFilter (type-rec-id t) (map pathelem-rec-id p) v)])
|
||||
|
||||
;; implication
|
||||
(df ImpFilter ([a (listof Filter/c)] [c (listof Filter/c)])
|
||||
(df ImpFilter ([a (non-empty-listof Filter/c)] [c (non-empty-listof Filter/c)])
|
||||
[#:frees (combine-frees (map free-vars* (append a c)))
|
||||
(combine-frees (map free-idxs* (append a c)))])
|
||||
|
||||
|
@ -70,8 +70,8 @@
|
|||
[#:fold-rhs (*LNotTypeFilter (type-rec-id t) (map pathelem-rec-id p) idx)])
|
||||
|
||||
;; implication
|
||||
(df LImpFilter ([a (listof LatentFilter/c)] [c (listof LatentFilter/c)])
|
||||
#;[#:frees (combine-frees (map free-vars* (append a c)))
|
||||
(df LImpFilter ([a (non-empty-listof LatentFilter/c)] [c (non-empty-listof LatentFilter/c)])
|
||||
[#:frees (combine-frees (map free-vars* (append a c)))
|
||||
(combine-frees (map free-idxs* (append a c)))])
|
||||
|
||||
|
||||
|
|
|
@ -146,11 +146,12 @@
|
|||
[((FilterSet: f1+ f1-) (T-FS:) (FilterSet: f3+ f3-)) (mk (combine null (append f1- f3-)))]
|
||||
;; and
|
||||
[((FilterSet: f1+ f1-) (FilterSet: f2+ f2-) (F-FS:))
|
||||
(mk (combine (append f1+ f2+)
|
||||
#;null
|
||||
(append (for/list ([f f1-])
|
||||
(mk (combine (append f1+ f2+)
|
||||
(append (for/list ([f f1-]
|
||||
#:when (not (null? f2+)))
|
||||
(make-ImpFilter f2+ (list f)))
|
||||
(for/list ([f f2-])
|
||||
(for/list ([f f2-]
|
||||
#:when (not (null? f1+)))
|
||||
(make-ImpFilter f1+ (list f))))))]
|
||||
[(f f* f*) (mk f*)]
|
||||
[(_ _ _)
|
||||
|
|
|
@ -261,7 +261,6 @@
|
|||
(define true-filter (-FS (list) (list (make-Bot))))
|
||||
(define false-filter (-FS (list (make-Bot)) (list)))
|
||||
|
||||
|
||||
(define (opt-fn args opt-args result)
|
||||
(apply cl->* (for/list ([i (in-range (add1 (length opt-args)))])
|
||||
(make-Function (list (make-arr* (append args (take opt-args i)) result))))))
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
(fp")")]
|
||||
[(LNotTypeFilter: type path idx) (fp "(! ~a @ ~a ~a)" type path idx)]
|
||||
[(LTypeFilter: type path idx) (fp "(~a @ ~a ~a)" type path idx)]
|
||||
[(LBot:) (fp "LBot")]))
|
||||
[(LBot:) (fp "LBot")]
|
||||
[(LImpFilter: a c) (fp "(LImpFilter ~a ~a)" a c)]))
|
||||
|
||||
(define (print-filter c port write?)
|
||||
(define (fp . args) (apply fprintf port args))
|
||||
|
@ -57,7 +58,8 @@
|
|||
[(NoFilter:) (fp "-")]
|
||||
[(NotTypeFilter: type path id) (fp "(! ~a @ ~a ~a)" type path (syntax-e id))]
|
||||
[(TypeFilter: type path id) (fp "(~a @ ~a ~a)" type path (syntax-e id))]
|
||||
[(Bot:) (fp "Bot")]))
|
||||
[(Bot:) (fp "Bot")]
|
||||
[(ImpFilter: a c) (fp "(ImpFilter ~a ~a)" a c)]))
|
||||
|
||||
(define (print-pathelem c port write?)
|
||||
(define (fp . args) (apply fprintf port args))
|
||||
|
|
|
@ -145,7 +145,7 @@ at least theoretically.
|
|||
;; - 1 printers have to be defined at the same time as the structs
|
||||
;; - 2 we want to support things printing corectly even when the custom printer is off
|
||||
|
||||
(define-for-syntax printing? #f)
|
||||
(define-for-syntax printing? #t)
|
||||
|
||||
(define-syntax-rule (defprinter t ...)
|
||||
(begin
|
||||
|
|
Loading…
Reference in New Issue
Block a user