From dfb0eae02c1144cec03c0e721faf44e4bcfb91c2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 21 Mar 2015 17:31:17 -0400 Subject: [PATCH] Fix patch-feedback calculation mistake, to match fixes in redex and coq --- prospect/mux.rkt | 6 ++++-- prospect/patch.rkt | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/prospect/mux.rkt b/prospect/mux.rkt index 4601906..6d12c45 100644 --- a/prospect/mux.rkt +++ b/prospect/mux.rkt @@ -61,8 +61,10 @@ (for/list [(pid affected-pids)] (cond [(equal? pid label) (define feedback - (patch (biased-intersection new-routing-table (patch-added delta)) - (biased-intersection old-routing-table (patch-removed delta)))) + (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)))) (cons label feedback)] [else (cons pid (view-patch delta-aggregate (mux-interests-of m pid)))])) diff --git a/prospect/patch.rkt b/prospect/patch.rkt index 8f1202c..0507256 100644 --- a/prospect/patch.rkt +++ b/prospect/patch.rkt @@ -28,6 +28,7 @@ compute-patch biased-intersection view-patch + patch-union patch-project patch-project/set patch-project/set/single @@ -205,6 +206,10 @@ (patch (biased-intersection (patch-added p) interests) (biased-intersection (patch-removed p) interests))) +(define (patch-union p1 p2) + (patch (matcher-union (patch-added p1) (patch-added p2)) + (matcher-union (patch-removed p1) (patch-removed p2)))) + (define (patch-project p spec) (match-define (patch in out) p) (patch (matcher-project in spec) (matcher-project out spec)))