functions: Implement tbf-tabulate using tbf-tabulate*.

This commit is contained in:
Sergiu Ivanov 2020-07-12 00:20:15 +02:00
parent e11f20431f
commit 1adaf63ec1

View file

@ -342,12 +342,7 @@
'((0 0 0 0) (0 1 1 0) (1 0 1 0) (1 1 1 1))))) '((0 0 0 0) (0 1 1 0) (1 0 1 0) (1 1 1 1)))))
;;; Tabulates a TBF. ;;; Tabulates a TBF.
(define (tbf-tabulate tbf) (define tbf-tabulate (compose tbf-tabulate* list))
(define ins (apply
cartesian-product
(make-list (vector-length (tbf-w tbf)) '(0 1))))
(for/list ([in ins])
(append in (list (apply-tbf tbf (list->vector in))))))
(module+ test (module+ test
(test-case "tbf-tabulate" (test-case "tbf-tabulate"