mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Fixed candidate checking
This commit is contained in:
parent
aae8dc0ccd
commit
667782cab3
1 changed files with 15 additions and 14 deletions
|
@ -421,24 +421,25 @@
|
||||||
;; TODO:
|
;; TODO:
|
||||||
;; Find candidates for beta expansion
|
;; Find candidates for beta expansion
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (id)
|
(lambda (db-entry)
|
||||||
|
;(trace:error `(check for lambda candidate
|
||||||
(cond
|
(cond
|
||||||
((number? id)
|
((number? (car db-entry))
|
||||||
;; TODO: this is just exploratory code, can be more efficient
|
;; TODO: this is just exploratory code, can be more efficient
|
||||||
(let ((app-count 0)
|
(let ((id (car db-entry))
|
||||||
|
(fnc (cdr db-entry))
|
||||||
|
(app-count 0)
|
||||||
(app-arg-count 0)
|
(app-arg-count 0)
|
||||||
(reassigned-count 0))
|
(reassigned-count 0))
|
||||||
(with-fnc! id (lambda (fnc)
|
(for-each
|
||||||
(for-each
|
(lambda (sym)
|
||||||
(lambda (sym)
|
(with-var! sym (lambda (var)
|
||||||
(with-var! sym (lambda (var)
|
(set! app-count (+ app-count (adbv:app-fnc-count var)))
|
||||||
(set! app-count (+ app-count (adbv:app-fnc-count var)))
|
(set! app-arg-count (+ app-arg-count (adbv:app-arg-count var)))
|
||||||
(set! app-arg-count (+ app-arg-count (adbv:app-arg-count var)))
|
(set! reassigned-count (+ reassigned-count (if (adbv:reassigned? var) 1 0)))
|
||||||
(set! reassigned-count (+ reassigned-count (if (adbv:reassigned? var) 1 0)))
|
))
|
||||||
))
|
)
|
||||||
)
|
(adbf:assigned-to-var fnc))
|
||||||
(adbf:assigned-to-var fnc))
|
|
||||||
))
|
|
||||||
(trace:error `(candidate ,id ,app-count ,app-arg-count ,reassigned-count))
|
(trace:error `(candidate ,id ,app-count ,app-arg-count ,reassigned-count))
|
||||||
))))
|
))))
|
||||||
(hash-table->alist *adb*))
|
(hash-table->alist *adb*))
|
||||||
|
|
Loading…
Add table
Reference in a new issue