File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 165165
166166;; Converts a patch to full alt with valid history
167167(define (reconstruct! alts)
168- ;; extracts the base expressions of a patch as a batchref
169- (define (get-starting-expr altn)
170- (match (alt-prevs altn)
171- [(list) (alt-expr altn)]
172- [(list prev) (get-starting-expr prev)]))
173-
174168 ;; takes a patch and converts it to a full alt
175169 (define (reconstruct-alt altn loc0 orig)
176170 (let loop ([altn altn])
Original file line number Diff line number Diff line change 1515 "rival.rkt "
1616 "taylor.rkt " )
1717
18- (provide generate-candidates)
18+ (provide generate-candidates
19+ get-starting-expr)
1920
2021;;;;;;;;;;;;;;;;;;;;;;;;;;;; Taylor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2122
197198
198199;;;;;;;;;;;;;;;;;;;;;;;;;;;; Public API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
199200
201+ (define (get-starting-expr altn)
202+ (match (alt-prevs altn)
203+ [(list) (alt-expr altn)]
204+ [(list prev) (get-starting-expr prev)]))
205+
200206(define (generate-candidates batch brfs spec-batch reducer)
201207 ; Starting alternatives
202208 (define start-altns
220226 (run-rr start-altns batch)
221227 '() ))
222228
223- (remove-duplicates (append evaluations rewritten approximations) #:key alt-expr))
229+ (remove-duplicates (append evaluations rewritten approximations)
230+ #:key (λ (altn) (cons (alt-expr altn) (get-starting-expr altn)))))
You can’t perform that action at this time.
0 commit comments