Fix semantics bug

This commit is contained in:
Tony Garnock-Jones 2015-04-03 21:42:32 -04:00
parent d5ce38162b
commit c92beaa5bf
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,27 @@
#lang prospect
;; Analogous to nc-incremental-swap-int-and-claim.rkt in the Redex model.
;; Demonstrates (hopefully) correct processing of feedback at interest switches.
(require rackunit)
(spawn (lambda (e u)
(if (< (length u) 3)
(transition
(append u (list e))
(if (null? u)
(patch-seq (assert 'a) (unsub 'a))
'()))
(begin0 #f (check-equal? u (list #f #f #f)))))
'()
(sub 'a))
(spawn (lambda (e u)
(if (< (length u) 3)
(transition
(append u (list e))
(if (null? u)
(patch-seq (retract 'b) (sub 'b))
'()))
(begin0 #f (check-equal? u (list #f #f #f)))))
'()
(assert 'b))

View File

@ -64,7 +64,8 @@
(patch-union
(patch (biased-intersection new-routing-table (patch-added delta))
(biased-intersection old-routing-table (patch-removed delta)))
(view-patch delta-aggregate (mux-interests-of m pid))))
(patch (biased-intersection (patch-added delta-aggregate) new-interests)
(biased-intersection (patch-removed delta-aggregate) old-interests))))
(cons label feedback)]
[else
(cons pid (view-patch delta-aggregate (mux-interests-of m pid)))]))