     :lt (assoc g 0 :geq)))
 
 (defn make-state [id flows & edges]
-  (let [edge-guards (map :guard (filter #(:required (:label %)) edges))]
+  (let [edges (flatten [edges])
+        edge-guards (map :guard (filter #(:required (:label %)) edges))]
     ; invariant is a disjunction of negated guards
+    (println "es" edges "eguards" edge-guards)
     {:id id :flows flows :edges edges :invariant (map #(map invert-guard %) edge-guards)}))
 
 (defn valid-for-inputs [_transition _inputs]


(defn extrapolate [ha now]
  (let [req (:next-required-transition ha)
        _ (assert (or (nil? req) (<= now (first (:interval req)))) "Extrapolating beyond next transition of HA")
        s (:state ha)
        flows (:flows (get ha s))
        delta (- now (:entry-time ha))


(defcard ha-data
         (fn [scene _owner]
           (let [a (get-in @scene [:objects :a])
                 b (get-in @scene [:objects :b])
                 desc (fn [ha]
                        [[:div "Required transitions:" (str (required-transitions ha))]
                         [:div "Next required transition:" (str (:next-required-transition ha))]
                         [:div "Optional transitions:" (str (optional-transitions ha))]
                         [:div "Intervals:" (str (:optional-transitions ha))]])]
             (sab/html [:div
                        (concat
                          (desc a)
                          (desc b))])))
         scene-a)

#_(defcard sample-time
           "What are the current values of the variables of object a?"
