Function nodes can be evaluated when determining which inputs are used. However,
for general function nodes the output value is considered to be unknown if any
of the inputs is considered to be unknown. For some built-in nodes we can do
better than that.
This patch improves the behavior for the following cases, previously the output
was always unknown:
* Float Math:
* `0.0 * x = 0.0`
* `x * 0.0 = 0.0`
* Integer Math:
* `0 * x = 0`
* `x * 0 = 0`
* Boolean Math:
* `false AND x = false`
* `x AND false = false`
* `true OR x = true`
* `x OR true = true`
* `false NAND x = true`
* `x NAND false = true`
* `true NOR x = false`
* `x NOR true = false`
* `false IMPLY x = true`
* `x IMPLY true = true`
* `false NIMPLY x = false`
* `x NIMPLY true = false`
This helps the inferencing code to be smarter on some cases.
This partially solves #139319. Although in the provided file even more complex
reasoning is necessary to fully support it. For integers it would need to keep
track of the current possible values e.g. `{0, 1}` so that when the integer is
compared to 2, it can be determined that this will always be false. This kind of
inferencing is a bit out of reach for the time being, it's not impossible
though.
Pull Request: https://projects.blender.org/blender/blender/pulls/139331