# MATH show mechanisms for branching
[hear] (intro if);

[hear] (= 28 / if (< 3 0) 24 28);

[hear] (= 27 / if (> 2 4) 29 27);

[hear] (= 29 / if (= 3 1) 20 29);

[hear] (= 21 / if (= 0 0) 21 26);

[hear] (= 29 / if (> 5 3) 29 23);

[hear] (= 26 / if (> 1 0) 26 22);

[hear] (= 21 / if (= 3 3) 21 27);

[hear] (= 23 / if (> 4 4) 25 23);

[hear] (define max /
         ? x /
         ? y /
         if (> (x) (y)) (x) (y));

[hear] (define min /
         ? x /
         ? y /
         if (< (x) (y)) (x) (y));

[hear] (= 0 / max 0 0);

[hear] (= 0 / min 0 0);

[hear] (= 1 / max 0 1);

[hear] (= 0 / min 0 1);

[hear] (= 2 / max 0 2);

[hear] (= 0 / min 0 2);

[hear] (= 1 / max 1 0);

[hear] (= 0 / min 1 0);

[hear] (= 1 / max 1 1);

[hear] (= 1 / min 1 1);

[hear] (= 2 / max 1 2);

[hear] (= 1 / min 1 2);

[hear] (= 2 / max 2 0);

[hear] (= 0 / min 2 0);

[hear] (= 2 / max 2 1);

[hear] (= 1 / min 2 1);

[hear] (= 2 / max 2 2);

[hear] (= 2 / min 2 2);

       # need to be careful about whether 'if' is eager or lazy
       # here we suggest that it is lazy
[hear] (define factorial /
         ? n /
         if (< (n) 1) 1 /
         * (n) /
         factorial /
         - (n) 1);

[hear] (= 1 / factorial 1);

[hear] (= 2 / factorial 2);

[hear] (= 6 / factorial 3);

[hear] (= 24 / factorial 4);

[hear] (= 120 / factorial 5);