Fix semantics bug
This commit is contained in:
parent
d5ce38162b
commit
c92beaa5bf
|
@ -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))
|
|
@ -64,7 +64,8 @@
|
||||||
(patch-union
|
(patch-union
|
||||||
(patch (biased-intersection new-routing-table (patch-added delta))
|
(patch (biased-intersection new-routing-table (patch-added delta))
|
||||||
(biased-intersection old-routing-table (patch-removed 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)]
|
(cons label feedback)]
|
||||||
[else
|
[else
|
||||||
(cons pid (view-patch delta-aggregate (mux-interests-of m pid)))]))
|
(cons pid (view-patch delta-aggregate (mux-interests-of m pid)))]))
|
||||||
|
|
Loading…
Reference in New Issue