     (whatif--simplify '(if (if t x a) y z) '((y . 42) (z . 41)))
     (list 'unknown '(if x 42 41)))))
 
+(ert-deftest simplify--if-without-else ()
+  (should
+   (equal
+    (whatif--simplify '(if t y) nil)
+    (list 'unknown 'y)))
+  (should
+   (equal
+    (whatif--simplify '(if nil y) nil)
+    (list 'value nil))))
+
 (ert-deftest simplify--progn ()
   (should
    (equal

     (if (assoc form bindings)
         (list 'value (alist-get form bindings))
       (list 'unknown form)))
    (`(if ,cond ,then ,else)
     (setq cond (whatif--simplify cond bindings))
     (setq then (whatif--simplify then bindings))


(defun whatif--simplify (form bindings)
  "Simplify FORM in the context of BINDINGS using partial application.
Loops are not executed and side-effecting functions are not run.

Returns a list ('value VALUE) if we could simplify the entire
FORM to an expression, or a list ('unknown NEW-FORM) if some
parts of FORM could not be simplified."
  (pcase form
    ;; nil and t evaluate to themselves.
    (`nil (list 'value nil))
