(and (compound-tag? object)
(eq? 'conjoin (compound-tag-operator object))))
+(define (tag-is-complement? object)
+ (and (compound-tag? object)
+ (eq? 'complement (compound-tag-operator object))))
+
(add-boot-init!
(lambda ()
'conjoin
predicates))
+(define (complement predicate)
+ (make-predicate (lambda (object)
+ (not (predicate object)))
+ 'complement
+ (list predicate)))
+
(define (make-predicate datum-test operator operands)
(if (every predicate? operands)
(dispatch-tag->predicate
(make-joinish-memoizer dispatch-tag-is-top?))
(define-compound-operator 'conjoin
- (make-joinish-memoizer dispatch-tag-is-bottom?))))
\ No newline at end of file
+ (make-joinish-memoizer dispatch-tag-is-bottom?))
+
+ (define-compound-operator 'complement
+ (let ((table (make-key-weak-eqv-hash-table)))
+ (lambda (datum-test operator tags)
+ (hash-table-intern! table
+ (car tags)
+ (lambda ()
+ (make-compound-tag datum-test operator tags))))))
+
+ ))
\ No newline at end of file