networks: Export and test boolean-power-n.

This commit is contained in:
Sergiu Ivanov 2020-03-20 16:38:32 +01:00
parent 34fbc516e2
commit 36c26d2a1f
2 changed files with 2 additions and 0 deletions

View file

@ -215,6 +215,7 @@
'((#f #f #f) (#f #t #f) (#t #f #f) (#t #t #t)))
(check-equal? (tabulate/boolean (lambda (x y) (and x y)))
'((#f #f #f) (#f #t #f) (#t #f #f) (#t #t #t)))
(check-equal? (boolean-power-n 2) '((#f #f) (#f #t) (#t #f) (#t #t)))
(let ([negation (table->function '((#t #f) (#f #t)))]
[negation/list (table->function/list '((#t #f) (#f #t)))])
(check-true (negation #f)) (check-false (negation #t))

View file

@ -61,6 +61,7 @@
[tabulate/boolean (-> procedure-fixed-arity? (listof (listof boolean?)))]
[table->function (-> (listof (*list/c any/c any/c)) procedure?)]
[table->function/list (-> (listof (*list/c any/c any/c)) procedure?)]
[boolean-power-n (-> number? (listof (listof boolean?)))]
[enumerate-boolean-tables (-> number? (stream/c (listof (*list/c any/c any/c))))]
[enumerate-boolean-functions (-> number? (stream/c procedure?))]
[enumerate-boolean-functions/list (-> number? (stream/c procedure?))])