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)))))
;;; Tabulates a TBF.
(define (tbf-tabulate tbf)
(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))))))
(define tbf-tabulate (compose tbf-tabulate* list))
(module+ test
(test-case "tbf-tabulate"