# Description

The if node selects a value or path based on the value of its first child-node. The mode of operation is dependent on how many child-nodes the if node has. In all cases it is the value of the first (leftmost) node that controls the evaluation.

child-node count | returns |

1 | 0 or 1 |

2 | 0 or value_{2} |

3 | value_{2} or value_{3} |

4 | value_{2} or value_{3} or value_{4} |

# Constraints

# Calculus

## General

The first (leftmost) child-node is evaluated and compared to the child-node's weight^{1)} to give a meta result. This meta result then determines how the if node will act. (see below)

value_{1} | meta result |

`>` = weight_{1} | true |

`<` weight_{1} AND `>` -weight_{1} | undetermined |

`<` = -weight_{1} | false |

ERROR | ERROR |

## 1 child-node

value_{1} | meta result | returns |

`>` = weight_{1} | true | 1 |

`<` weight_{1} AND `>` -weight_{1} | undetermined | 0 |

`<` = -weight_{1} | false | 0 |

ERROR | ERROR | ERROR |

## 2 child-nodes

value_{1} | meta result | returns |

`>` = weight_{1} | true | value_{2} |

`<` weight_{1} AND `>` -weight_{1} | undetermined | 0 |

`<` = -weight_{1} | false | 0 |

ERROR | ERROR | ERROR |

## 3 child-nodes

value_{1} | meta result | returns |

`>` = weight_{1} | true | value_{2} |

`<` weight_{1} AND `>` -weight_{1} | undetermined | value_{3} |

`<` = -weight_{1} | false | value_{3} |

ERROR | ERROR | ERROR |

## 4 child-nodes

value_{1} | meta result | returns |

`>` = weight_{1} | true | value_{2} |

`<` weight_{1} AND `>` -weight_{1} | undetermined | value_{3} |

`<` = -weight_{1} | false | value_{4} |

ERROR | ERROR | ERROR |