 ;; for now, we can just require that these be unconditional.
 ;; If we add unions, etc later, worry about details.
 ;; TODO: constraint is not the same as set-vars ?  ???
-
-;(def no-effect ::no-effect)
 
 (declare make-logging-factored-state-set)
 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Implicit Set Protocol ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defprotocol ImplicitStateSet
  (empty?    [s] "Is this set empty")
;  (singleton-val [s v] "Return single possible value for far, or nil if not singleton")
  (singleton [s] "Return the singleton element making up this set, or nil if cardinality != 1.")
  (some-element [s] "Return an arbitrary element of this set, or throw if empty. ")
  (explicit-set [s] "Return an explicit outcome set. ")
  (constrain [ss constraint] "Apply a constraint."))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Factored Implicit Sets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;

         (meta (first lfss))))))

(defn vars-known? [ss vars]
  (every? #(singleton (state/get-var ss %)) vars))

(defn get-known-var [ss var] (util/make-safe (singleton (state/get-var ss var))))

(defn ss-str [ss] "LFSS" (print-str (dissoc (state/as-map ss) :const)))
(defmethod print-method LoggingFactoredStateSet [ss o] (print-method (ss-str ss) o))




