diff --git a/csp/csp.rkt b/csp/csp.rkt index f7ced556..1b6bcb80 100644 --- a/csp/csp.rkt +++ b/csp/csp.rkt @@ -329,3 +329,8 @@ (define/contract (alldiff= x y) (any/c any/c . -> . boolean?) (not (= x y))) + +(define/contract (state-count csp) + ($csp? . -> . exact-nonnegative-integer?) + (for/product ([var (in-list ($csp-vars csp))]) + (length ($var-vals var)))) \ No newline at end of file