+++ title = "Abstract the nested if-statements into a list" author = "Yann Herklotz" tags = [] categories = [] backlinks = ["2e1c3"] forwardlinks = ["2e1c5", "2e1c3b"] zettelid = "2e1c3a" +++ The main problem with the nested if-statements is that they are ordered, meaning that one can not simply order them and end up with the same behaviour. This depends on the fact of if two predicates are satisfiable or not, which affects on if they can be switched or not. This can be solved with a similar solution to the full SAT solution ([\#2e1c5]), whereby the if-statements are collapsed into a list of conditionals, out of which only one can be active at a time. This means that their order does not matter, and that they can then be sorted. [\#2e1c5]: /zettel/2e1c5