Logic Equation Definition

Declaration Sentences

LOGIC EQUATION is a reserved word to specify a logic proposition, name must be provided by the user, it must follow the rules of any constraint name.

The generic sintaxis is: LOGIC EQUATION name

Examples: Some examples could be like the following ones:

LOGIC EQUATION ATMOST1, ATMOST2, ATMOST3, IMP0, IMP1, IMP2;

 

Definition Sentence

Logic propositions are used to pose relationships between the Boolean (Binary) variables handling the disjunctive terms. Logic Propositions must be declared and defined in the GAMS Section. The definition of a LOGIC EQUATION is similar to any other equation in the GAMS model (see Chapter 8. Equations in the GAMS Users Guide), with the difference that is must include only the following operators:


Operator Symbol Operation
-> Implication
<-> equivalence
not negation
and logical and
or logical or
xor exclusive or

Examples: Some definition sentences could be like the following ones:

ATMOST1.. Y('1') xor Y('2');
ATMOST2.. Y('4') xor Y('5');
ATMOST3.. Y('6') xor Y('7');
IMP0.. Y('1') -> Y('3') or Y('4') or Y('5');
IMP1.. Y('2') -> Y('3') or Y('4') or Y('5');
IMP2.. Y('3') -> Y('8')