With Apply's shortcuts on, choose the exclusive-or call that returns at once.
Textbook Apply stops only at a pair of terminals. With operator shortcuts on, a call also stops when one operand is a controlling value of the operator: a constant that decides the result whatever the other operand is. 0 controls and, since f & 0 is 0, and 1 controls or. A call that meets neither case recurses.
f & 0
Take k = (p | q) & r under the order p q r, and the operator nand, the negation of and.
k = (p | q) & r
p q r
k nand 0 is 1 whatever k is, so 0 is a controlling value of nand. With shortcuts on, the call on k and 0 returns 1 at once: 1 call. With them off, Apply recurses down to pairs of terminals: 7 calls.
k nand 0
k
k nand 1 is ~k, which still depends on k. So 1 decides nothing alone, and the call on k and 1 recurses even with shortcuts on: 7 calls.
k nand 1
~k
So nand has one controlling value, 0, and only a call with that operand returns at once.
Apply runs with operator shortcuts on, and f is not a terminal.
f
Which call of Apply for exclusive-or (xor) returns at once?
xor
app(f, 0)
app(f, 1)
app(f, f)
None of them: each recurses.
Choose one of the four options. app(f, g) is the call of Apply on the operands f and g.
app(f, g)
g
One call.
For each option, write what f xor that operand is, as the example does for nand: a call returns at once only when its operand alone fixes the result.
f xor
In Explore the example, play the call with g = 0 and read the number of calls in the last caption; change g and play again to test another option.
g = 0
Kata 3.2 of Binary Decision Diagrams with CUDD on formal.org. The site checks the answer when you press Check answer; sign in to keep your progress.