# SICP Solutions

### Section - The Elements of Programming

#### Normal Order Evaluation

Here we fully expand and then reduce, thus expanding it we get:

Now if is a special form, and scheme interpreter will first check for the predicate and evaluate the expression based on the result of predicate.

Note that here (p) is not expanded again because as per the description of if, the interpreter will first check the predicate and then depending on it evaluates the expression.

Clearly the result of predicate is true. Thus it will output: $0$.

#### Applicative Order Evaluation

Evaluate the arguments and then apply. Now evaluating (p) will go into a infinite loop of recursive calls. Thus the program will never terminate by itself.