             "V2 must be a valid variable reference")
     (cond
       ;if RHS is +-infinity, then the guard will never flip truth value
-      (or (= rhs Infinity) (= rhs -Infinity)) (if (guard-satisfied? rel v10 v20 c)
+      (or (= rhs Infinity) (= rhs -Infinity)) (if sat
                                                 [-Infinity Infinity]
                                                 [Infinity Infinity])
       ; if t is bounded from above by a number less than time-unit, return an interval which will become empty during intersection

                              (range 0 trans-count))]))
                    (map #(extrapolate % (:now @scene)) (vals (:objects @scene)))
                    (range 0 ct))
               (map (fn [{x :x y :y w :w h :h :as ha}]
                      [:div
                       [:div {:style {:width           (str (* scale w) "px") :height (str (* scale h) "px") :borderRadius (str (* scale w) "px")
                                      :backgroundColor "brown"
                                      :position        "absolute" :left (str (* scale x) "px") :bottom (str (* scale y) "px")}}
                        (str (:id ha))]])
                    (map #(extrapolate % (:now @scene)) (vals (:objects @scene))))
               [:button {:onClick #(swap! scene (fn [s] (assoc s :playing (not (:playing s)))))} (if (:playing @scene) "PAUSE" "PLAY")]
               [:span {:style {:backgroundColor "lightgrey"}} "Pause on state change?"
                [:input {:type     "checkbox"
                         :checked  (:pause-on-play @scene)

              ; >= : t >= rhs --> guard becomes true once t exceeds or equals rhs
              :geq [(.max js/Math rhs min-t) Infinity]
              ;  > : t  > rhs --> guard becomes true once t exceeds rhs
              :gt [(.max js/Math (+ rhs (/ time-unit 16)) min-t) Infinity]))))

(defn transition-interval [has ha transition]
  ;(println "Transition" (:id ha) (:x ha) (:target transition) (:guard transition))
  (let [intervals (map #(simple-interval has ha %) (:guard transition))
        interval (intersect-all intervals)]
    ;(println "interval:" intervals "->" interval)
    ; TODO: handle cases where transition is also guarded on states
    {:interval   interval
     :id         (:id ha)
