     (whatif--simplify 'x '((x . 42)))
     (list 'value 42))))
 
-(ert-deftest simplify--if ()
+(ert-deftest simplify--if-by-condition ()
+  "We should discard then THEN or the ELSE case
+if we can evaluate the condition."
   (should
    (equal
     (whatif--simplify '(if x y z) nil)



(defun whatif--simplify (form bindings)
  "Simplify FORM in the context of BINDINGS using partial application.

         (list 'value (alist-get form bindings))
       (list 'unknown form)))
    (`(if ,cond ,then ,else)
     (setq then (whatif--simplify then bindings))
     (setq else (whatif--simplify else bindings))
     ;; If we can evaluate the if condition, then simplify to just the
     ;; THEN or the ELSE.
     (pcase (whatif--simplify cond bindings)
       (`(value ,value)
        (if value then
          else))
       ;; Return if with simplified arms.
       (`(unknown ,_)
        (list 'unknown
              `(if ,cond ,(cl-second then) ,(cl-second else))))))
    ;; Remove pointless values in progn, e.g.
    ;; (progn nil (foo) (bar)) -> (progn (foo) (bar))
    (`(progn . ,exprs)
