File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-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 get-starting-expr )
1919
2020;;;;;;;;;;;;;;;;;;;;;;;;;;;; Taylor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2121
195195
196196;;;;;;;;;;;;;;;;;;;;;;;;;;;; Public API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
197197
198+ (define (get-starting-expr altn)
199+ (match (alt-prevs altn)
200+ [(list) (alt-expr altn)]
201+ [(list prev) (get-starting-expr prev)]))
202+
198203(define (generate-candidates batch brfs spec-batch reducer)
199204 ; Starting alternatives
200205 (define start-altns
218223 (run-rr start-altns batch)
219224 '() ))
220225
221- (remove-duplicates (append evaluations rewritten approximations) #:key alt-expr))
226+ (remove-duplicates (append evaluations rewritten approximations)
227+ #:key (λ (altn) (cons (alt-expr altn) (get-starting-expr altn)))))
You can’t perform that action at this time.
0 commit comments