82 | | == Translation of ''!ItemSelects'' Constraints == |
83 | | TODO: review |
84 | | The [https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt KConfig specification] defines select statements as follows: |
85 | | > reverse dependencies: "select" <symbol> !["if" <expr>] |
86 | | > While normal dependencies reduce the upper limit of a symbol (see |
87 | | > below), reverse dependencies can be used to force a lower limit of |
88 | | > another symbol. The value of the current menu symbol is used as the |
89 | | > minimal value <symbol> can be set to. If <symbol> is selected multiple |
90 | | > times, the limit is set to the largest selection. |
91 | | > Reverse dependencies can only be used with boolean or tristate |
92 | | > symbols. |
93 | | 1. Translation of Boolean !ItemSelect statements: |
| 82 | == Translation of ''ItemSelects'' Constraints == |
| 83 | The ItemSelects statement specifies the minimum possible selection for a variable, if the specified condition is true. The constraint is evaluated in "integer logic", with "or" being "max", "and" being "min" and "not" being "2-". |
| 84 | |
96 | | ItemSelects BOOLEAN_VAR OTHER_VAR CONDITION |
97 | | }}} |
98 | | * In Boolean formula: |
99 | | {{{ |
100 | | (BOOLEAN_VAR and CONDITION) implies OTHER_VAR |
101 | | }}} |
102 | | * In DIMACS: |
103 | | {{{ |
104 | | Not(BOOLEAN_VAR) or Not(CONDITION) or OTHER_VAR |
105 | | }}} |
106 | | 2. Translation of Tristate !ItemSelect statements: |
107 | | * In RSF: |
108 | | {{{ |
109 | | ItemSelects TRISTATE_VAR OTHER_VAR CONDITION |
110 | | }}} |
111 | | * In Boolean formula: |
112 | | {{{ |
113 | | (TRISTATE_VAR and CONDITION) implies OTHER_VAR |
114 | | (TRISTATE_VAR_MODULE and CONDITION) implies OTHER_VAR_MODULE |
115 | | }}} |
116 | | * In DIMACS: |
117 | | {{{ |
118 | | Not(TRISTATE_VAR) or Not(CONDITION) or OTHER_VAR |
119 | | Not(TRISTATE_VAR_MODULE) or Not(CONDITION) or OTHER_VAR_MODULE |
120 | | }}} |
| 87 | ItemSelects Variable OtherVariable Condition |
| 88 | }}} |
| 89 | |
| 90 | === Variable is Boolean === |
| 91 | * In Boolean formula: |
| 92 | {{{ |
| 93 | (Variable and Condition) implies OtherVariable |
| 94 | }}} |
| 95 | * In DIMACS: |
| 96 | {{{ |
| 97 | Not(Variable) or Not(Condition) or OtherVariable |
| 98 | }}} |
| 99 | |
| 100 | If the Condition is true and Variable is true (i.e. 'y'), then OtherVariable must be true (i.e. 'y'). If OtherVariable is a tristate, 'y' means "permanently selected". |
| 101 | |
| 102 | === Variable is Tristate === |
| 103 | * In Boolean formula: |
| 104 | {{{ |
| 105 | (Variable and Condition) implies OtherVariable |
| 106 | (Variable_MODULE and Condition) implies (OtherVariable or OtherVariable_MODULE) |
| 107 | }}} |
| 108 | * In DIMACS: |
| 109 | {{{ |
| 110 | Not(Variable) or Not(Condition) or OtherVariable |
| 111 | Not(Variable_MODULE) or Not(Condition) or (OtherVariable or OtherVariable_MODULE) |
| 112 | }}} |
| 113 | |
| 114 | If the Condition is true and Variable is true (i.e. 'y'), then OtherVariable must be true (i.e. 'y'). |
| 115 | |
| 116 | If the Condition is true and Variable is selected as module (i.e. 'm'), then OtherVariable must be selected as module ('m') or permanently selected ('y'). Thus, if OtherVariable boolean, it can only be permanently selected; the " or OtherVariable_MODULE" part is omitted in this case. |